Stripe Integration with Salesforce [2023]

Stripe Integraton with Salesforce

So firstly what is a stripe? Stripe is the most commonly used payment gateway. Stripe is widely used by e-commerce, subscription-based services, and by many small as well as large-scale businesses to manage their payments and subscriptions. With the help of Rest API Stripe makes it easy for us to manage our payments.

While I was integrating Salesforce to Stripe I faced many challenges, with the help of this article I would like to share my learning and the steps for Salesforce to Stripe integration using input from a LWC component. I have also attached the link to my GIT for reference to the code.

Some key use cases of Stripe:

  1. Manage customers.
  2. Manage their payment methods and also save the primary payment source.
  3. Initiate transactions from Salesforce.

Key Challenge:

Despite detailed documentation provided by Stripe, integration with Stripe using Apex was challenging while passing the nested object structure in url encoded format.

How we usually pass nested object structure in JSON.

  Stripe Integration with Salesforce

How Stripe accepts nested objects(check the link to git for complete code)

  Stripe Integration with Salesforce

Steps to integrate Stripe with Salesforce.

Firstly you would need the secret key from your stripe account. To get the secret key go to Developers->API key-> check on the reveal key to get it.

  Stripe Integration with Salesforce
  1. Once you have the key you can store it in your environment(I used a custom metadata to store it)
  2. Creating a screen for the inputs required for the integration, which will be calling the Helper for creating the customer, and payment method and initiating the payments. I have shared the code which uses a Stripe helper to create the request and call Stripe API for customers, payment methods, and then initiate the payments.
  Stripe Integration with Salesforce-Card Entry

3. Once the payment is processed check your stripe account for all the records and store the transaction Id in Salesforce for future reference(eg. Lead, if making payments for a lead record.)

sanjeet2401/Salesforce
Contribute to sanjeet2401/Salesforce development by creating an account on GitHub.

github.com

 

  Stripe Integration with Salesforce

Checkout the below video to know more:

Kizzy Consulting

Kizzy Consulting is a Salesforce Consulting Partner based in Panchkula, India. Kizzy has successfully implemented 100+ Salesforce projects for 100+ clients across sectors like Financial Services, Insurance, Retail, Sales, Manufacturing, Real estate, Logistics, and Healthcare in countries like the US, Europe, Germany, and Australia. Get a free consultation now by emailing us at [email protected] or Contact us.

Leave a Reply

Your email address will not be published. Required fields are marked *

wpChatIcon
Skip to content