Integrating Stripe and Salesforce using Chargent


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.

  1. Install both Chargent Base and Chargent Transactions into your Salesforce org.
  2. Configure Chargent according to the step by step Quick Start Guide.
  3. 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
Connect Stripe and Salesforce with Chargent

See all Stripe transactions, manage refunds, send payment links and more, all inside Salesforce with Chargent, the top rated payments app on the Salesforce AppExchange.

Not yet a Chargent customer?

Contact us for a no-obligation 30 day trial, and see for yourself!

Learn More

Connecting Stripe & Salesforce using the Chargent Setup Wizard

  1. Click on the App Launcher on the top left side in Salesforce.
    App Launcher
  2. Select Chargent as the App
  3. Select the Chargent Settings Tab
  4. Choose Chargent Setup Wizard
  5. Follow the prompts to configure your gateway
    Payment 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.
      Secret Key
  • 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 (, 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.

Select the Payment Methods You Accept

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.

Payment Request Bank Account

Stripe Settings Required for Chargent

In order to allow transactions to be sent from Salesforce to Stripe you need to update your settings in Stripe to “Are you sure you want to directly handle sensitive credit card data?”, 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.

  1. Under Settings, search for integration from the top search bar.
  2. Click Show Advanced Options
  3. Toggle the switch that says Handle card information directly
  4. Click Check the boxes to acknowledge each statementt
  5. From the dropdown menu select “I need to collect full credit card numbers to run my business.
  6. In the text field type “The payments application I use replaces the card / bank account data with the token provided by Stripe during the transaction.
  7. Click the Continue button

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.

  1. Click the [PaymentConsole] button
  2. If you are using multiple gateways select your gateway from the dropdown otherwise continue to step 3
  3. Enter all the Billing Information and click [Next]
  4. Enter in a test credit card number, expiration date, and CVC code based on the Stripe test credit cards and test ACH numbers.
  5. Click the [Charge] button.

You should receive a green box showing Approved.

Stripe Charge

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.

  1. Click the [Send Payment Request] button
  2. If you have multiple Payment Request templates set up you will first choose what template you want to use.
  3. Enter an email address where you want to send the test Payment Request along with any amount.
  4. Enter a Contact name (Optional)
  5. Click the [Send Request] button

Send Payment Request

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.

Card Bank Payment

You should receive a green box confirmation

Card Bank payment

Go back to Stripe and confirm that you see the test transaction from Salesforce in your Stripe dashboard.

Salesforce Filter

That’s it! You have now setup and tested your Stripe integration.

ACH Validation

The ACH Validation feature works with Lyon’s ACH Validation service to validate the bank account, and store the validation in your Salesforce Org. During your Gateway Setup you will authenticate your Lyon’s credentials and Chargent uses a referral relationship for all first-time transactions.

If you are not using Lyon’s ACH Verification you want to disable this.

If you are using Lyon’s ACH Validation you will enter the following credentials.

  • Company ID
  • Username
  • Password

Note: If you are testing in a Salesforce Sandbox or Developer account, you want to be sure to check the ‘Test Transactions Only’ box.

  1. Enabled: this setting will enable or disable the ACH Validation.
  2. Company Id: The company Id in Lyons validation.
  3. Username: Username to log in Lyons validation.
  4. Password: Password to log in Lyons validation.
  5. Test Transactions Only: If this setting is checked, you will send all validations, through a test gateway.

In case you decide to turn off ACH Validation, you will see this warning message.

On the other hand, when you edit the gateway, in “Advanced Settings” you will see this new checkbox, Allow “No-Hit” Transactions.

A “no hit” ACH Validation Response is neither positive or negative. It indicates that ACH validation couldn’t be completed as this account is not listed in the reference database at this time.

On failure validation you will receive this message

New Behavior

NACHA validation, when enabled and correctly configured, applies to all Orders with Bank Account payment method and ACH as Bank Account type in the related gateway.

The only exception to the above mentioned rule is for orders with already-approved transactions, with the same Account Number last 4; these Bank Accounts are treated valid without using the Lyons service.

In case that there was an error from Lyons service the transaction will continue as usual but this Bank Account will try to get validated again on the next transaction.

If the transaction doesn’t count with the necessary information to get validated because of the tokenization will count as a valid transaction, without the ACH validation.


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.

Customer Migration

If you didn’t enable tokenization when setting up Stripe using the Gateway Setup Wizard, you can enable tokenization by following these steps.

  1. Click on the App Launcher in the top left hand side of Salesforce.
  2. Search for Gateways.
  3. Edit the Stripe Gateway record.
  4. 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.

Micro Deposits

That’s it!

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.

Gateway Mapping

Chargent Salesforce Field Stripe Field
Invoice Number > Invoice Number
Order Information > Description
Billing First Name / Billing Last Name > Name
Billing Address / Billing Address 2 / City / State / Zip Code > Address
Billing Country > Origin
Billing Email Address > Email
Gateway ID < Gateway ID
Token < Customer 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