Posts

Showing posts from August, 2017

Stripe Webhooks subscription with Salesforce Endpoint - Apex class and Apex Test Class

Image
Steps in making this integration possible: Problem: A new field('Stripe Transaction status') in Salesforce contact object that should show the Stripe transaction 'status' attribute of events such as "charge.succeeeded/charge.refunded/charge.failed/charge.pending/charge.refunded" based on the contact email address. 1) In Salesforce, create a new field under the contact object(via the contacts page layouts). 2) Now, code your salesforce apex class to implemenet the Endpoint. Find the code below: note: the code below parses the json data pass from Stripe webhooks as of date :Aug 14th, 2017. ------------------------------------------------------------------------------ /**  * Hint:  *  - Site name : https://<<force.comurl>/<your custom string url>  *  - Relative endpoint : https://<<force.comurl>/<your custom string url>/ services/apexrest / StripeEndpointService  */ @RestResource(urlMapping='/StripeEndpointServi...