Integrating Stripe and Salesforce using Chargent
Easily connect Stripe and Salesforce with Chargent,the leading payments app on the Salesforce AppExchange. See all Stripe transactions, manage refunds, send payment links and more, all inside Salesforce.
Contact us for a no-obligation 30 day trial, and see for yourself!
- Connecting Stripe & Salesforce using the Chargent Setup Wizard
- Stripe Settings Required for Chargent
- Testing using Chargent Anywhere
- Stripe Micro Deposits (ACH)
- Sending Live Transactions from a Salesforce Sandbox
- Gateway Mapping
If you do not already have a Stripe account, you can sign up for an account in just seconds.
This guide shows you how to connect Salesforce to Stripe using Chargent. Chargent will allow you to initiate Stripe payments (charge credit cards or ACH / eChecks) directly from Salesforce, as well as being able to manage Stripe refunds from Salesforce.
Note: Chargent’s integration to Stripe from Salesforce sends transactions to Stripe, and updates Salesforce with the Stripe responses (approved / declined with related information), but historical data or transactions that are not initiated from Salesforce will not be synced from Stripe to Salesforce.
- Install both Chargent Base and Chargent Transactions into your Salesforce org.
- Configure Chargent according to the step by step Quick Start Guide.
- Activate the Remote Site Settings in Salesforce if they aren’t already active for Stripe.
- Click the gear icon on the top right and select Settings
- Under Security select Remote Site Settings
- Locate Stripe and click edit
- Check the Active box
- Click Save
Connecting Stripe & Salesforce using the Chargent Setup Wizard
- Click on the App Launcher on the top left side in Salesforce.
- Select Chargent as the App
- Select the Chargent Settings Tab
- Choose Chargent Setup Wizard
- Follow the prompts to configure your gateway
Once you click Yes and select Stripe as your payment gateway, you will need the following information to configure the gateway setup:
- Secret Key from Stripe (either Live or Test)
- In your Stripe dashboard, go under Developers and select API keys (For testing, toggle the “View Test Data” button to get the Test Secret Key). Click Reveal test key token and copy the token into the Wizard.
- What currency you will be using
- What Payment Methods you will be accepting (credit card, electronic checks, what types of credit cards).
All Stripe transactions use the same server endpoint (https://api.stripe.com), so test transactions should be sent using the "Test Secret Key", and live transactions should be sent using the "Live Secret Key". We recommend creating two different Gateway records in Chargent. One for testing and another for live production. You can easily deactivate the test gateway record in Salesforce when you are ready to process live credit card transactions, but you may wish to use it again for future testing at some point.
Direct Debit Network
Starting with Chargent version 6.15, you can now select the Bank Account network for your region during the gateway setup process. Stripe uses the ACH Network. This will allow for the correct Direct Debit Network fields to be displayed on Payment Requests and Payment Console based on your region.
You should choose ACH - US as the network. ACH is also known as echeck or electronic check.
Once you have your Direct Debit Network set, you will see the appropriate field names on your Payment Request that are sent as well as your internal Payment Console.
Stripe Settings Required for Chargent
In October of 2017, Stripe made changes to the way applications integrate using the Stripe API. It indicates that processing payments using a 3rd party integration is an “unsafe transaction”, pushing customers to use their hosted payment pages that are not connected to Salesforce.
In order to allow transactions to be sent from Salesforce to Stripe you need to update your settings in Stripe to “Process payments unsafely”, but Chargent does not consider these payments unsafe (and if you are using the Payment Console or Payment Request, credit card data is not saved to Salesforce prior to being sent to Stripe anyway).
For more information see our article in our knowledge base.
- Under Settings, search for integration from the top search bar.
- Click Show Advanced Options
- Toggle the switch that says Handle card information directly
- Click Check the boxes to acknowledge each statementt
- From the dropdown menu select Someone else built my Stripe integration
- In the text field type AppFrontier / Salesforce
- Click the Continue buttonn
Testing using Chargent Anywhere
Testing with Payment Console
To test using the Payment Console, you want to navigate to any record in your Sandbox that has the Chargent Anywhere Component enabled.
- Click the [PaymentConsole] button
- If you are using multiple gateways select your gateway from the dropdown otherwise continue to step 3
- Enter all the Billing Information and click [Next]
- Enter in a test credit card number, expiration date, and CVC code based on the Stripe test credit cards and test ACH numbers.
- Click the [Charge] button.
You should receive a green box showing Approved.
Testing using Payment Request
To test using a Payment Request you want to be sure you have the Chargent Payment Request feature set up as outlined in our documentation.
- Click the [Send Payment Request] button
- If you have multiple Payment Request templates set up you will first choose what template you want to use.
- Enter an email address where you want to send the test Payment Request along with any amount.
- Enter a Contact name (Optional)
- Click the [Send Request] button
When you receive the email, click the secure link for the Payment Request. Use one of Stripe's credit cards or bank account testing numbers to complete the payform and submit the payment.
You should receive a green box showing Approved.
You should receive a green box confirmation
Go back to Stripe and confirm that you see the test transaction from Salesforce in your Stripe dashboard.
That's it! You have now setup and tested your Stripe integration.
Chargent Payment Processing for Salesforce supports Stripe's secure tokenization feature. Tokenization helps you decrease PCI compliance scope and improve security, by storing transaction data such as credit card numbers on Stripe's servers, and associating it with a token Chargent stores in Salesforce for use in future transactions.
The token returned by Stripe is stored in the Token field on the Chargent Order record in Salesforce.
Customer Token Migration
You can also use the tokenization feature when migrating existing customers in Stripe to Chargent. This is useful because the customer tokens can easily be exported and imported into Salesforce, whereas credit card numbers cannot.
Stripe tokens are strings of letters and numbers that start with cus_. Click Customers on the left and export on the upper right to get the data you need to import your customers into Salesforce. Insert the id column in the export file to the Chargent Token field to complete the migration. We recommend setting a Stripe test gateway record in Salesforce using the test credentials from Stripe, per the instructions above, then running it in parallel to your current system for a full month to validate that all is correct.
If you didn’t enable tokenization when setting up Stripe using the Gateway Setup Wizard, you can enable tokenization by following these steps.
- Click on the App Launcher in the top left hand side of Salesforce.
- Search for Gateways.
- Edit the Stripe Gateway record.
- Check the box that says Use Tokenization.
You can then set the Credit Card Handling field to one of the following
- Never Clear: Chargent will not remove any card data automatically.
- Clear After Successful Charge: Chargent will clear the credit card number, expiration dates and card security code only after a successful charge is run.
- Clear After All Transactions: The credit card number, expiration date and card security code will be erased after any approved transaction (Charge, Void, Refund)
- Clear When Token Present: (Recommended) Only when a token is present in the token field, will the credit card number, expiration date and card security code be cleared.
- When your first successful charge goes through, the Credit Card Number field in Salesforce will be deleted, and a token will be stored for future transactions in the Chargent Token field.
- If you are using Chargent's Payment Console or Payment Request feature, the card number will never be stored during the generation of the token.
Stripe Micro Deposits (ACH)
Micro deposits need to be disabled within the gateway record in order for ACH to work correctly, as Chargent does not currently support them. To do this, in Salesforce, go into the App Launcher, search Gateways, and edit your Gateway record to enable the checkbox that says “Disable Micro Deposits”.
Important: In order for Chargent to work with Stripe ACH, you must also contact Stripe to have Micro Deposits disabled from your Stripe account.
You have now successfully integrated Salesforce and Stripe, via the Chargent app. There are many more options for integrating business processes, as well as ways to customize Chargent further. But the basic connection is now in place, and you can process one-time or recurring credit card payments through Stripe directly from Salesforce.
Sending Live Transactions from a Salesforce Sandbox
Chargent is configured to always send transactions from a Salesforce Sandbox as test transactions, regardless of whether it is set to test or live. Since Stripe always sends transactions to the same endpoint, however, you only need to setup a Stripe Gateway using your Live Secret Key. Once you have your new gateway setup with your live credentials you will be able to send live transactions from your sandbox account.
|Chargent Salesforce Field||Stripe Field|
|Invoice Number||>||Invoice Number|
|Billing First Name / Billing Last Name||>||Name|
|Billing Address / Billing Address 2 / City / State / Zip Code||>||Address|
|Billing Email Address||>|
|Gateway ID||<||Gateway ID|
For Stripe, the ID number is reflected for the Gateway ID, Customer ID and Payment ID. This number is the same with a different prefix.
Gateway ID = ch_1H9vDaDI21N91uCjGNc6sWTK
Token = cus_1H9vDaDI21N91uCjGNc6sWTK
Payment ID = card_1H9vDaDI21N91uCjGNc6sWTK