Stripe Salesforce Integration

We are working on a Loyalty Program to provide it as a SaaS. To provide it as a SaaS one of the challenges in front of us was the automation of payment from Customers. In order to facilitate quick, easy and effective payment system we decided to do Stripe Salesforce Integration.

Stripe is a US technology company, operating in over 25 countries, that allows both private individuals and businesses to accept payments over the Internet. Stripe focuses on providing the technical, fraud prevention, and banking infrastructure required to operate on-line payment systems.

In Loyalty Program we involve members in several gamification activities (answering polls, watching videos etc.) and give them loyalty points on successful completion. Members can buy products from the same portal using their loyalty points.

We need to provide a Wallet Facility to the client so that he can track his current credit balance and points utilized by his members at any time with proper expenditure details. There are wallet transactions, transaction can be of two type “Credit Purchased” or “Order Placed by Members”. We achieved this task by using stripe payment gateway integration with Salesforce. So when user pays us using stripe we create wallet transaction record with type “Credit Purchased”. When members order any product from portal first we check credit balance or wallet and if there is sufficient balance we create wallet transaction record with type “Order Placed by Members” and let member order the product. On Wallet Object we summarize the wallet transaction records for available credit balance.

Stripe Functionality: -

  1. Syncing Stripe and Salesforce
    • For Salesforce and Stripe Integration we have generated the Secret key
    Syncing Stripe
  2. Fetching the Stripe Product Info and SKU details: We have created some product and its SKU (inventory) on stripe and to make it available on the Salesforce side for purchase we used stripe APIs. With the help of Stripe APIs we fetched the Product and SKU info. It was in JSON format so we had parsed it and displayed it on Salesforce side.
  3. Stripe Product Info and SKU details Stripe Product Info and SKU details
  4. Pay with Card: When user selects any product for purchase we display its detail and provide user a button “Pay with Card” button. This is the standard button provided by Stripe along with the form. When user clicks the button we open the payment gateway of Stripe which enables user to pay using card.
  5. Pay with Card
  6. Wallet and Wallet Transaction Records Creation: After the successful payment we create a wallet transaction record of type “Credit Purchased” for the default Wallet record. This increases the Current Credit Balance by the Purchased amount. We have Different summary fields on Wallet object

    i.e Total Credit Purchased --> Total Credit Purchased using Stripe Total Credit used --> Credit used by the Members of the Program to Order Products from portal as per their Loyalty Points. This can never be more than Total Credit Purchased. Current Credit --> Total Credit Purchased - Total Credit Used.
  7. Wallet Transaction Records Creation

    Whenever any Member try to order any product from the portal we check if there is sufficient balance in the wallet, only then we allow members to place an order. In other cases we send email to the System Admin. We also have an active process which automatically sends email when Wallet Current Credit is below $100. Now the stripe integration is precisely tested and it is working fine with the Loyalty Program’s other Business logic.Thus, whenever a business scenario occurs to manage the payments efficiently, the user needs to integrate Salesforce to Stripe to achieve this goal.

For any query on Stripe Salesforce Integration, contact