Integrating PayTrace 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 PayTrace with Salesforce using Chargent.
About This Guide
This guide walks you through the steps needed to integrate Chargent with the PayTrace 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 PayTrace gateway and includes links to gateway-specific documentation for configuration instructions.
Video Tutorial
If you’re a visual learner, like many of us, check out our overview video to get started with PayTrace. The text in this guide covers the video’s content in greater detail, so if you have any questions, make sure to follow along using the content below.
Before You Begin
Before you start integrating the PayTrace 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.
- Installing and Updating Chargent
- License Assignment (Production Only, not required for Sandbox)
- Permission Assignment
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 PayTrace Sandbox Account
If you don’t already have PayTrace credentials for testing, you must create a PayTrace Sandbox Account.
- Visit https://paytrace.net/developers.
- Click Set Up Sandbox.
- Fill out the form and click Set Me Up.
PayTrace’s team will review your request for a Sandbox and reach out to you shortly. Upon approval, you’ll receive an email containing the following credentials:
- Username
- Temporary Password to confirm the account
Follow the instructions provided in the email to finalize your account creation. If you need help creating your PayTrace Sandbox Account, contact PayTrace through their Support page.
After setting up your PayTrace Account, you will log into your ‘Web User’, which only allows you to perform web transactions directly in PayTrace. To take payments using Chargent, you must create an ‘API User’.
- Login to PayTrace.
- Select Users from the left sidebar.
- Click New User.
- Under ‘Type of User’, click the API User radio button.
- Complete the following required fields, keeping in mind that the User Name and Password will be used to complete your integration with Chargent:
- User Name
- Password
- Confirm Password
- Contact Name
- Email Address
- Check the checkboxes all permissions for this user.
- Click Show to the right of Advanced Options and set the following fields based on your specific requirements:
- Sale Ceiling Amount
- Refund Ceiling Amount
- Click Save.
To verify your gateway credentials in Salesforce, Chargent requires the following gateway information:
- Username
- Password
It’s important to note that the credentials do not refer to your user’s username and password (the credentials you use to log in to your PayTrace Account), but instead to the ‘API User’ created in Preparing Your PayTrace Account.
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 PayTrace in Salesforce.
- Login to your Salesforce sandbox (partial, full, or developer sandboxes work).
- Go to the App Launcher
and click the Chargent app.
- Click the Chargent Settings tab and choose the Setup Wizard subtab.
- Click Yes when prompted, “Do you have a Payment Gateway account?”.
- Select ‘PayTrace’ from the list and click Continue.
Note: In your Salesforce sandbox instance, Chargent automatically sends your transactions to your gateway’s test endpoint URL to ensure you don’t accidentally send live transactions from your Salesforce sandbox environment.
If your testing process requires creating live transactions in your sandbox environment, see Running Live Transactions in Sandbox.
- Enter the User Name and Password of the ‘API User’ (created in Preparing Your PayTrace Account), leaving the Endpoint Override field blank.
- Click Sign In.
- When you receive a message stating “Your credentials have been successfully verified!”, click Continue to complete the steps in the wizard.
- If you receive an error message in red, see the Checking Your Remote Site Settings section below or check out our troubleshooting tips.
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.
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.
- Click the gear icon
at the top right and choose Setup.
- Enter “remote” in the Quick Find box and choose Remote Site Settings.
- Locate the following Remote Site names and make sure the “Active” box is selected:
-
- PayTrace
- Paytrace_Sandbox
- If the “Active” box is not selected, click Edit, select Active, and click Save.
Setting Up Your Direct Debit Network
Setting up your direct debit network is optional but recommended. When you reach the gateway setup wizard page labeled “Select the Payment Methods you accept,” select the direct debit network for your region.
Our PayTrace integration supports the ‘ACH – US’ direct debit network. Choosing the correct direct debit network allows you to accept bank account payments and display the correct direct debit network fields in Chargent.

For more information, see Understanding Bank Account Payments.
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 PayTrace.
Testing Credit Card Transactions
Visit PayTrace’s documentation, PayTrace Testing Information, and click Testing Credit Cards 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 | 4012000098765439 | 12/24 | 999 |
MasterCard | 5499740000000057 | 12/24 | 998 |
American Express | 371449635392376 | 12/24 | 9997 |
Discover | 6011000993026909 | 12/24 | 996 |
Testing Bank Account Transactions
Visit PayTrace’s documentation, PayTrace Testing Information, and click Testing ACH for a complete list of test bank account numbers. To quickly verify your integration, you can use the following test bank account information to ensure Chargent is appropriately configured:
Routing Number | Account Number | Bank Name | Account Type |
---|---|---|---|
325070760 | 123456 | Any bank name | Checking |
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. When using PayTrace, you can test your response codes by submitting a specific Charge Amount. See the table below for a few examples:
Amount | Response |
---|---|
$0.00 | Amount Error |
$0.20 | Decline |
$0.29 | Expired Card |
$1.00 or more | APPROVAL |
Visit PayTrace’s documentation, PayTrace Testing Information, and click Testing Amount for a complete list of test amounts that will elicit specific response text. You can also click Testing Addresses for AVS Response for information about testing Address Verification System (AVS) responses.
Additionally, expiration dates in the future are returned as valid, while expiration dates in the past are returned as invalid.
It is not considered best practice to run live transactions in your sandbox environment. If you still wish to send live transactions from a Salesforce Sandbox as a final step in testing, add the PayTrace Production Endpoint URL noted below to the Endpoint Override field on your gateway record. You will also require your gateway’s production credentials, which can be obtained by following the steps in the next section of this guide.
PayTrace Production Endpoint URL: https://api.paytrace.com
For more information, see Testing Live Transactions in Sandbox.
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.
Obtaining Your Live Gateway Credentials
Now that you’re ready to take live payments in Production, you’ll need to register for a production account. Work with Paytrace’s Sales Team to get started with your production account.
As with your testing, you must create an ‘API User’ to take payments using Chargent. Revisit Preparing Your PayTrace Account and Obtaining Your PayTrace Account Credentials.
So far, you’ve used your test PayTrace 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.
- Log in to your production Salesforce org.
- Go to the App Launcher
and click the Chargent app.
- Click the Chargent Settings tab and choose the Setup Wizard subtab.
- Click Yes when prompted, “Do you have a Payment Gateway account?”.
- Select ‘PayTrace’ from the list and click Continue.
- Click Live Transactions and enter your new live gateway credential, leaving the Endpoint Override field blank.
- Click Sign In.
- When you receive a message stating “Your credentials have been successfully verified!”, click Continue to complete the steps in the wizard.
- If you receive an error message in red, see our troubleshooting tips.
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 PayTrace! You can now process transactions through PayTrace 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 PayTrace includes, but is not limited to, the following features:
ACH Validation
Using PayTrace, you can validate US bank accounts on the Automated Clearing House (ACH) network via our partner, Lyons, a leading data verification provider. This feature is designed to satisfy NACHA’s mandate—Supplementing Fraud Detection Standards for Web Debits.
For more information, see ACH Validation.
Chargent’s integration with PayTrace supports Address Verification System (AVS), a technology used to prevent fraud by validating the ownership of a credit card using the billing address of a credit card and matching it with the data on file at the credit card issuing company.
Your AVS results are stored in Salesforce using the AVS Response Code field on your transaction record. For definitions, see Paytrace’s AVS Responses.
For more information, see Address Verification System (AVS).
Currencies
Chargent’s integration with PayTrace supports the following currency:
- USD
For more information about currencies in Chargent, see Understanding Currencies.
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 PayTrace using Chargent:
- Level I
- Level II
- Level III
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 PayTrace gateway integration. For more information about payment methods supported by Chargent, see Payment Methods Supported.
Credit Cards
- Visa
- Mastercard
- Discover
- American Express
- JCB Card
- Diners Club
For more information, see Understanding Credit Card Payments.
Bank Accounts
- ACH – US
For more information, see Understanding Bank Account Payments.
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 PayTrace’s servers and not in Salesforce.
Chargent’s PayTrace integration supports tokenization for the following payment method types:
- Credit Card
- Bank Account
The token returned by PayTrace 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 Sync
Chargent sends charges and authorizations to the payment gateways, recording the result in a real-time transaction in Salesforce. Chargent also updates Salesforce records long after the initial transaction if, for example, ACH transactions are returned for non-sufficient funds (NSF) or credit card authorizations that expire.
The following are the various transaction status values for PayTrace Transactions. Use some of the values to learn when a transaction has been declined, and take appropriate action within Salesforce—such as sending an email or assigning a follow-up task.
- N
- GB or Settled (and batch number appended)
- Batch number itself
For setup instructions, visit Transaction Sync.
Transaction Types
Chargent’s integration with PayTrace supports the following transaction types:
- Authorize
- Capture
- Refund
- Partial Refund
- Void
- Credit (aka Unreferenced Credit)
- Unlinked 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. PayTrace stores the payment information as a transaction in your PayTrace account. Then, PayTrace returns a response to Salesforce, storing it in a Transaction record. The table below provides a few important examples of how the data is mapped between Salesforce and PayTrace.
Chargent Field | Salesforce Object | Direction | PayTrace Field |
---|---|---|---|
Gateway ID | Transaction | < | Transaction ID |
Tokenization | Transaction | < | Customer ID |
Token | Chargent Order | > | Customer ID |
Invoice Number* | Chargent Order | > | Invoice |
Order Information* | Chargent Order | > | Description |
PO Number | Chargent Order | > | Customer Reference |
*The Invoice Number and Order Information fields allow you to send additional custom information about your transaction. Chargent does not automatically populate this field.
Comparing Your Transactions
Oftentimes, it is valuable to compare the transaction records in Salesforce with those in your PayTrace account for the sake of reconciliation. Follow these steps for instructions:
- From your PayTrace account, click Dashboard in the left sidebar.
- Click View Transactions.

- From the Transaction record in Salesforce, copy the Gateway ID.
- Back in your PayTrace account, paste the Gateway ID in the search field to locate the specific transaction.
- Click the Transaction ID of the corresponding transaction.

Gateway Responses
The Reason Code field on a Transaction record stores a response code provided by PayTrace. To learn more about a specific response code, see Card Error/Decline Codes Explained.
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. PayTrace stores a code of 101 for successful transactions. |
Gateway ID | Corresponds to the Transaction ID in PayTrace. Use this field to reconcile your Salesforce transaction records with PayTrace’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 PayTrace, check out Chargent’s Knowledge Base.
Getting Help
Contacting PayTrace Support
Please visit PayTrace’s Help Documentation or reach out to PayTrace’s Support Team for gateway-specific support.
Contacting Chargent Support
Contact our support team if you encounter any issues related to Chargent.