USAePay

Integrating USAePay 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 USAePay 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 USAePay 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 USAePay gateway and includes links to gateway-specific documentation for configuration instructions.

Before You Begin

Before you start integrating the USAePay 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.

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 USAePay Sandbox Account

If you don’t already have USAePay credentials for testing, you must create a USAePay Sandbox Account using a Developer Portal.

  1. Visit the Developer Portal Login Page.
  2. Click Register for an account.
  3. Complete the form and click Register new account.

Now that you have a Developer Portal, you must request a Test Account.

  1. Log in to your Developer Portal.
  2. In the left sidebar, click Request Test Account.
  3. Complete the form (do not leave any field blank) and click Submit Request.

When access has been granted, you will see a success message on the ‘Request Test Account’ page. This process can take a few hours during regular business hours on weekdays and 24 hours or more on weekends.

You can now use the following link to log in to your Sandbox Account: https://sandbox.usaepay.com/login

See USAePay’s documentation, Sandbox System, for more information.

Creating Your USAePay Account Credentials

To verify your test gateway credentials in Salesforce, Chargent requires the following gateway information:

  • Source Key
  • PIN

You can access your USAePay Sandbox Account credentials by following these steps:

  1. Log in to your Sandbox Account.
  2. In the left sidebar, click API Keys
  3. Click Add API Key
  4. Name your API Key (for example, ‘Chargent API Key’)
  5. Click Add Public Api Key to the right of the API Key field.
  6. Create a PIN (must be 4 characters or longer).
  7. Click Apply, which will generate your API Keys.
  8. Copy the API Key and PIN and save them in a secure location.
    • These two credentials will be used to complete your integration with Chargent.
  9. Click Save.

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 USAePay in Salesforce.

Please note that tokenization for bank account transactions is not supported. If you plan to support both credit card and bank account transactions in Chargent, you must create two separate gateway records. For more information, see Tokenization and Bank Account Payments.

  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 ‘USAePay’ from the list and click Continue.
  1. Enter your USAePay Sandbox 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:
    • USAePAY_Live
    • USAePAY_Test
  1. 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 USAePay integration supports the ‘ACH – US’ and ‘EFT (ACSS) – Canada’ direct debit networks. Choosing the correct direct debit network allows you to accept bank account payments and display the correct direct debit network fields in Chargent.

Please note that tokenization for bank account transactions is not supported. If you plan to support both credit card and bank account transactions in Chargent, see Tokenization and Bank Account Payments.

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 USAePay.

Testing Credit Card Transactions

Visit USAePay’s documentation, USAePay Test Credit Cards, for a complete list of test credit card numbers. It’s important to test different gateway responses to ensure your gateway is configured correctly. 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. USAePay provides specific test cards to help you test for various response messages. Use the table below to quickly verify your integration:

Card Number Expiration CVC  Response Message
4000100011112224 Any month in the future 123 Approved
4000300011112220 Any month in the future Any 3-digit number Declined
4000300211112228 Any month in the future Any 3-digit number Do Not Honor
4000300611112224 Any month in the future Any 3-digit number Insufficient Funds
4000301311112225 Any month in the future Any 3-digit number Decline for CVV Failure

Testing Bank Account Transactions

Visit USAePay’s documentation, USAePay Test ACH Data, for a complete list of test bank account numbers. As with the test credit cards above, you can quickly verify your integration by testing various response messages. Use the following test bank account information to ensure Chargent is appropriately configured:

Routing Number Account Number Amount Response Message
987654321 Any 9-digit number Any Error
Any 9-digit number Any 9-digit number 5.99 Decline
Any 9-digit number Any 9-digit number 9999.99 ManagerApproval

When testing, any other combination of a 9-digit routing and account numbers will result in an approved transaction. All approved transactions will be moved to ‘submitted’ at 5 pm PST and ‘settled’ the following day at 8 am PST.

Running Live Transactions in Sandbox

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 USAePay 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.

USAePay Production Endpoint URL: https://www.usaepay.com/gate

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 USAePay Account

USAePay works through resellers and does not provide payment gateway accounts directly to merchants. If you don’t already have a USAePay account, contact our sales team, and we’ll help you get up and running.

Once you’re all set up, login to your Live USAePay account and follow the instructions in Creating Your USAePay Account Credentials.

Creating Your Live Gateway Integration in Salesforce

So far, you’ve used your test USAePay 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.

Please note that tokenization for bank account transactions is not supported. If you plan to support both credit card and bank account transactions in Chargent, you must create two separate gateway records. For more information, see Tokenization and Bank Account Payments.

  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 ‘USAePay’ 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 USAePay! You can now process transactions through USAePay 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 USAePay includes, but is not limited to, the following features:

ACH Validation

Using USAePay, 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.

Address Verification System (AVS)

Chargent’s integration with USAePay 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 code definitions, see USAePay’s AVS Result Codes.

For more information, see Address Verification System (AVS).

Currencies

Chargent’s integration with USAePay supports many currencies. See USAePay Currency Codes for a list of supported currencies.

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 USAePay 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 USAePay 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
  • EFT (ACSS) – Canada (aka Electronic Funds Transfer)

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 USAePay’s servers and not in Salesforce.

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

  • Credit Card

The token returned by USAePay 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.

Tokenization for bank account transactions is not supported. If you plan to support both credit card and bank account transactions in Chargent, see Tokenization and Bank Account Payments.

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 list represents potential final transaction status values for USAePay. Visit Transaction Status Codes for definitions.

  • queued
  • pending
  • submitted
  • funded
  • settled
  • error
  • voided
  • returned
  • timed out
  • manager approval req.

For setup instructions, visit Transaction Sync.

Transaction Types

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

  • Authorize
  • Capture
  • Partial Capture
  • Refund
  • Partial Refund
  • Void
  • Credit (aka Unreferenced Credit)

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. USAePay stores the payment information as a transaction in your USAePay account. Then, USAePay returns 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 USAePay.

Chargent Field Salesforce Object Direction USAePay Field
Gateway ID Transaction < Transaction ID
Tokenization Transaction < Customer Code
Token Chargent Order > Customer Code
Invoice Number* Chargent Order > Invoice Number
Order Information* Chargent Order > Comment
Chargent Order Record ID Chargent Order > Order ID

*The Invoice Number and Order Information fields allow you to send additional custom information about your transaction. Chargent does not automatically populate this field.

Gateway Responses

The Reason Message field on a Transaction record stores a response provided by USAePay. To learn more about a specific response or error, see USAePay’s Error Code List.

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 Message The message provided by the gateway indicating why the transaction was successful or not.
Gateway ID Corresponds to the Transaction ID in USAePay. Use this field to reconcile your Salesforce transaction records with your gateway’s transaction records. Enter the Gateway ID in the search box within your USAePay account to quickly find a transaction.
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.

Considerations

Tokenization and Bank Account Payments

Our USAePay gateway integration only supports tokenization for credit card transactions. This means tokenization is not supported for bank account transactions (ACH or EFT/ACSS). However, you can accept tokenized credit card transactions and non-tokenized bank account transactions by creating two separate gateway records in Salesforce using the same USAePay account credentials.

Learn more by visiting Gateway setup when tokenization is only supported for credit card transactions.

Troubleshooting

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

We’ve listed a few of the most common errors below. For additional troubleshooting tips or frequently asked questions about USAePay, check out Chargent’s Knowledge Base.

Customer Name Not Submitted

Please complete the Name and Billing Address in your Chargent Order record. Incomplete information will generate this error.

Specified Source Key Not Found

This error indicates you have entered incorrect credentials for your USAePay gateway account or the credentials are being sent to the wrong endpoint.

To resolve this issue, follow the steps in Error: The Credentials you provided are not valid. Please check and try again.

Transaction Authentication Failed

This indicates that your USAePay key/pin combination entered in the Chargent Gateway record in Salesforce is incorrect or that you may be sending it to the wrong environment to match your credentials.

To resolve this issue, follow the steps in Error: The Credentials you provided are not valid. Please check and try again.

Testing Decline Transactions Keep Showing as Approved

Ensure you have the Test Mode unchecked in your Source Key settings in USAePay.

Getting Help

Contacting USAePay Support

For gateway-specific questions, please see USAePay’s Help Site or contact their customer support by calling +1(866)872-3729.

Contacting Chargent Support

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