Stripe

Integrating Stripe With Chargent In Salesforce

Salesforce Payments by Chargent is the leading payment application available on the Salesforce AppExchange. Chargent allows you to process payments directly from within Salesforce. This guide shows you how you can easily connect Stripe with Salesforce using Chargent.

Not yet a Chargent customer? Get started today with a 30-day free trial!

About This Guide

This guide walks you through the steps needed to integrate Chargent with the Stripe gateway. It assumes you have already installed and configured Chargent, but links are provided to installation, user management, and configuration topics where more details are available so you can get up and running quickly. It also assumes you have chosen the Stripe gateway and includes links to gateway-specific documentation for configuration instructions.

Before You Begin

Before you start integrating the Stripe gateway in Chargent with Salesforce, make sure you have completed the following steps:

Installing and Configuring Chargent

Before setting up your gateway, install the latest version of Chargent and configure your user permissions. Guides for these topics are available below to help you get started.

Prerequisites for Stripe

In order to allow credit card transactions to be sent from Salesforce to Stripe, you must comply with Stripe’s policy for enabling access to raw card data APIs. For more information about this requirement, see our Knowledge Article about Stripe’s Raw Credit Card Transaction Policy.

If you have any questions about the requirements, please contact us.

Setting Up Your Test Environment

Before installing Chargent in production, we highly recommend installing and testing in a Salesforce sandbox. The following topics provide instructions for obtaining your test gateway credentials and creating a test gateway record in Salesforce. Remember to refresh your sandbox beforehand to ensure that your sandbox is aligned with your production configurations.

Creating Your Stripe Account

If you don’t already have Stripe credentials for testing, you must set up an account and place it in ‘Test mode’. Review the information on Stripe’s website to register for an account.

Using Your Stripe Account

Stripe has two modes: Test and Live. For testing, ensure that the setting is toggled to ‘Test mode’. This setting can be turned on by logging in to your Stripe account and activating the ‘Test mode’ toggle on the top right of your window.

When ‘Test mode’ is activated, you will see a bar at the top of your screen notifying you that “You’re using test data. To accept payments, complete your business profile.” You will not be able to perform live transactions when in ‘Test mode’. Learn more by visiting Test Mode and Use Cases.

Obtaining Your Stripe Account Credentials

Chargent requires the Secret Key credential to verify your Stripe integration in Salesforce.  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’.

See the instructions below to find and save the Secret Key:

  1. Log in to your Stripe Test Account.
  2. From the search bar, search for and select API Keys.
  3. In the ‘Standard Keys’ section, find and copy the ‘Secret Key’ value, found in the ‘Token’ column.
    • When creating your test gateway, choose the key that starts with ‘sk_test_’
    • When creating your live gateway, choose the key that starts with ‘sk_live_’.

Creating Your Test Gateway in Chargent

With your credentials in hand, it’s time to create a gateway record in Chargent and verify your integration with Stripe in Salesforce.

  1. Login to your Salesforce sandbox (partial, full, or developer sandboxes work).
  2. Go to the App Launcher and click the Chargent app.
  3. Click the Chargent Settings tab and choose the Setup Wizard subtab.
  4. Click Yes when prompted, “Do you have a Payment Gateway account?”.
  5. Select ‘Stripe’ from the list and click Continue.
  1. Enter your Stripe Account credentials, leaving the Endpoint Override field blank.
  2. Click Sign In.
  3. When you receive a message stating “Your credentials have been successfully verified!”, click Continue to complete the steps in the wizard.

The remaining choices in the Gateway Setup Wizard are determined by your specific use case. For more detailed information about the steps, see Gateway Setup Wizard.


Checking Your Remote Site Settings

The remote sites for your gateway should automatically activate when completing the Gateway Setup Wizard using the steps in the previous section. If you encounter any issues connecting to Chargent using your gateway credentials, ensure they have been correctly activated in your org.

  1. Click the gear icon at the top right and choose Setup.
  2. Enter “remote” in the Quick Find box and choose Remote Site Settings.
  3. Locate the following Remote Site names and make sure the “Active” box is selected:
    • https://api.stripe.com
  1. If the “Active” box is not selected, click Edit, select Active, and click Save.

Disabling the Direct Debit Network

Chargent’s Cybersource integration does not currently support a Direct Debit Network. Disable the ‘Bank Account’ toggle to continue.

Running Test Transactions

After successfully creating your test gateway record, you can attempt your first test transaction. See Testing in Sandbox for instructions and best practices for testing. Every gateway has its own test payment methods and response codes. See the list below for information and resources specific to Stripe.

Testing Credit Card Transactions

Visit Stripe’s Testing Documentation for a complete list of test credit card numbers. To quickly verify your integration, you can use the following test credit card number to ensure Chargent is appropriately configured:

Processing Network Card Number Expiration  CVC
Visa 4242424242424242 Any date in the future Any 3-digit number
MasterCard 5555555555554444 Any date in the future Any 3-digit number
American Express 378282246310005 Any date in the future Any 4-digit number
Discover 6011111111111117 Any date in the future Any 3-digit number

Testing Response Codes

It’s important to test different gateway responses to ensure that your gateway is configured properly. The gateway’s response is stored on a transaction record (see the Response Code and Response Status fields) in Salesforce.

Every gateway has its own response codes. For more information about testing various responses, such as declined transactions, see the Declined Payments section in Stripe’s testing documentation. See the table below for a few example test cards that will generate a decline.

Decline Reason Card Number Expiration  CVC
Generic decline 4000000000000002 Any date in the future Any 3-digit number
Insufficient funds 4000000000009995 Any date in the future Any 3-digit number
Lost card 4000000000009987 Any date in the future Any 3-digit number
Processing error 4000000000000119 Any date in the future Any 3-digit number

Running Live Transactions in Sandbox

Testing live transactions in your Sandbox is not considered best practice. However, if you wish to send live transactions from a Salesforce Sandbox, as a final step in testing, you must complete these steps:

Going Live in Production

Once you’ve tested your gateway integration in a Salesforce sandbox, you’re ready to move to production. See Moving from Sandbox to Production to learn how to migrate your Chargent configuration changes to your production environment. After moving Chargent to production, see Testing in Production for best practices prior to going live.

You can learn more about Going Live via Stripe’s Go-Live Checklist.

Prepare Your Stripe Account for Live Transactions

To prepare your Stripe account to accept live payments, please follow these steps:

  1. Ensure you’ve completed the Prerequisites for Stripe.
  2. Complete your business profile and activate Payments.
  3. Disable ‘Test mode’ for your Stripe account.
    • This setting can be turned off by logging in to your Stripe account and disabling the ‘Test mode’ toggle on the top right of your window. When ‘Test mode’ is disabled, you cannot perform test transactions using test cards.
  4. Find and save your ‘Live Secret Key’.

Creating Your Live Gateway Integration in Salesforce

So far, you’ve used your test Stripe credentials and created a test gateway in your Sandbox. Now, it’s time to create a new gateway record in your production environment specifically for processing live transactions.

  1. Log in to your production Salesforce org.
  2. Go to the App Launcher    and click the Chargent app.
  3. Click the Chargent Settings tab and choose the Setup Wizard subtab.
  4. Click Yes when prompted, “Do you have a Payment Gateway account?”.
  5. Select ‘Stripe’ from the list and click Continue.
  6. Click Live Transactions and enter your new live gateway credential, leaving the Endpoint Override field blank.
  1. Click Sign In.
  2. When you receive a message stating “Your credentials have been successfully verified!”, click Continue to complete the steps in the wizard.

For more detailed information about these steps, see our documentation for the Gateway Setup Wizard.

Running Live Transactions

With your live gateway record created, you are ready for the final phase of testing: running live transactions in a production environment. Visit Testing in Production for considerations and best practices related to testing in your production environment.

When testing with live payment information, you can prevent transactions from settling by voiding them immediately afterward. For more information, see Refunding and Voiding Transactions. As a precaution, we recommend using very low amounts to minimize any impact in the event you forget to void them.

To test gateway responses in the live environment, submit live transactions with the correct street address, zip code, and CVC information to generate successful responses. Likewise, submit incorrect street address, zip code, and card code information to generate other responses. You can void successful transactions immediately to prevent live test transactions from being processed.

Congratulations! You have successfully integrated Salesforce and Stripe! You can now process transactions through Stripe directly in Salesforce using Chargent!

Supported Features

All of Chargent’s gateway integrations support most of Chargent’s core features. Some features are reliant on support by the gateway itself. Chargent’s integration with Stripe includes, but is not limited to, the following features:

Currencies

Chargent’s integration with Stripe supports multiple currencies. See Stripe’s documentation for Supported Currencies.

Additionally, Salesforce’s Multiple Currencies feature is supported when integrating Stripe with Salesforce using Chargent.

For more information about currencies in Chargent, see Understanding Currencies.

Data Levels

Data levels allow you to send more information with each transaction, ensuring the security and authenticity of the payment. Higher data levels translate to higher savings on transaction fees. The following levels of data are supported by Stripe using Chargent:

  • Level I

For more information about data levels, see Understanding Data Levels.

Payment Method Types

Below, we’ve listed the payment method types that are supported when using the Stripe gateway integration. For more information about payment methods supported by Chargent, see Payment Methods Supported.

Credit Cards

  • Visa
  • Mastercard
  • Discover
  • American Express
  • MC Eurocard
  • UK Maestro
  • JCB Card
  • Diners Club

For more information, see Understanding Credit Card Payments.

Bank Accounts

  • Not currently supported

Tokenization

Tokenization allows you to store payment information at your gateway and not in Salesforce. Tokenization helps you decrease the scope of your PCI compliance and improve security by storing your customers’ payment information on Stripe’s servers and not in Salesforce.

Chargent’s Stripe integration supports tokenization for the following payment method type:

  • Credit Card

The token returned by Stripe is stored in the Token field on the Chargent Order and Tokenization on the Transaction records in Salesforce. Additionally, tokens are stored in a Chargent Tokens record when Payment Methods is enabled in your org.

To learn more about why we recommend tokenization, visit Salesforce Tokenization.

Transaction Types

Chargent’s integration with Stripe supports the following transaction types:

  • Authorize
  • Capture
  • Partial Capture
  • Refund
  • Partial Refund

For more information about Transaction Types, see Understanding Payments.

Field Mapping

Salesforce sends payment information to your gateway based on the field values in your Chargent Order records. You can find your payment information in your Stripe account by clicking Transactions in the left sidebar. Then, the gateway sends a response to Salesforce, storing it in a Transaction record. Here are a few important examples of how the data is mapped between Salesforce and Stripe.

Chargent Field Salesforce Object Direction Stripe Field
Gateway ID Transaction < Payment ID
Tokenization Transaction < Customer
Token Chargent Order > Customer
Order Information* Chargent Order > Description
Billing First Name Chargent Order > Card[name]
Billing Last Name Chargent Order > Card[name]
Billing Country Chargent Order > Card[address_country]
Billing Email Address Chargent Order > Email
Currency Chargent Order > Currency

*The Order Information field allows you to send additional custom information about your transaction. Chargent does not automatically populate this field.

Gateway Responses

The Reason Code field on a Transaction record stores a response code provided by Stripe. To learn more about a specific response code, including the HTTP status code summary, see Stripe’s Error Documentation.

To review gateway responses in Salesforce, go to the transaction record in Chargent and examine these field values:

Transaction Field Name Description
Response Status The state of the transaction, such as “Approved,” “Declined,” or  “Error” received from the payment gateway.
Reason Code The code provided by the gateway, indicating why the transaction was successful or not. Stripe stores a code of 200 for successful transactions.
Gateway ID Corresponds to the Payment ID in Stripe. Use this field to reconcile your Salesforce transaction records with Stripe’s transaction records.
Gateway Response Contains the entire message received from the gateway and stored in the Salesforce transaction record. This field is helpful when troubleshooting your transactions.

Troubleshooting

If you are having trouble connecting to your gateway, we recommend starting with these troubleshooting steps.

For additional troubleshooting tips or frequently asked questions about Stripe, check out Chargent’s knowledge base articles.

Getting Help

Contacting Stripe Support

Please contact Stripe if you experience any issues with or have questions about your gateway account.

Contacting Chargent Support

Contact our support team if you encounter any issues related to Chargent.