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
- Connecting Stripe & Salesforce (Chargent versions prior to v5.40)
- Stripe Settings Required for Chargent
- Testing Stripe
- Stripe Micro Deposits (ACH Direct Debit)
- Sending Live Transactions from a Salesforce Sandbox
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.
Connecting Stripe & Salesforce (Chargent versions prior to v5.40)
- Click on the AppLauncher on the top left side in Salesforce.
- Search for Gateways
- Click New and name the Gateway
- Merchant ID = Stripe Secret Key
- Merchant Security Key = Stripe Secret Key(you should obtain the Secret Key from your Stripe Dashboard based on whether you want to test transactions or use live transactions). Go under Developer and select API Keys. For test Secret Key toggle the “View Test Data” button.
- Setup the following Gateway fields
- Active=checked - To make the Gateway active
- Use Tokenization - If you are planning on using tokens
- Available Card Types - Select the cards you will be accepting (this is based on your gateway settings and what card types they can process - Visa, MasterCard, American Express, etc..)
- Available Payment Methods - Will you be accepting just Credit Cards or ACH (also known as electronic check, e-check, or direct debit)
- Available Currencies - What currencies will you accept (this is based on your payment gateway and the currencies you have enabled with them).
- Credit Card / Bank Account Data Handling - This lets Chargent know when to clear the information in Salesforce. You have 4 options.
- Never Clear
- Clear After Successful Charge
- Clear After All Transactions
- Clear When Token is Present
When using Payment Requests or Payment Console (comes with Sites and Platform edition) the following should also be set.
- Available PR Transaction Types
- Charge Full Amount - Charges the credit card immediately
- Authorize Full Amount - This option won’t charge the card but only holds the funds available until you charge the card.
- Authorize Minimum Amount - This option won’t charge the card but only holds the minimum amount that your gateway will allow. You will need to charge the correct amount in order to capture the transaction.
- Show Charge Button
- Show Authorize Button
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 Business Settings, select integration
- Toggle the switch that says Process payments unsafely
- Check the boxes to acknowledge each statement
- From the dropdown menu select Someone else built my Stripe integration
- In the text field type AppFrontier / Salesforce
- Click the Process payments unsafely button
- Create a new Order record and enter sample data to run a test transaction.
- Subtotal Amount
- Billing Address
- Stripe's suggested test credit card numbers.
- Any expiration date in the future.
If you have more than one Active gateway record in Chargent, you will need to specify which one to use in the Order record. Otherwise, you can leave the gateway lookup field blank.
When you click "Back to Record" the Chargent Order will refresh. You can then click on Related and see the Transaction as well as any other transactions that have happened on that Chargent Order.
You can also see the transaction date, transaction type, the amount, and the transaction ID that was sent back to Salesforce by Stripe.
Go back to Stripe and confirm that you see the test transaction from Salesforce in your Stripe dashboard.
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 Direct Debit)
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”.
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.