Table of Contents

Chargent Documentation

Testing Chargent

Chargent Testing

AppFrontier recommends that you ALWAYS test your configuration or any changes to your configuration in a Salesforce Sandbox before deploying to Production. Charging credit cards and bank accounts is serious business, so best practices in quality assurance and change management processes should be followed at all times.

Testing is especially important prior to:

  • Going Live with Chargent
  • Upgrading Chargent
  • Adding or changing workflow, validation, process builder or flows to Salesforce
  • Going Live with a new payment gateway
  • Updating payment gateway credentials
  • Updating payment gateway settings

AppFrontier is not liable for mis-configurations of the Chargent product. If you are not comfortable with this, please consider one of our consulting partners that has experience with Chargent.

For more recommendations on testing and change management, please see our guide:

Testing in your Salesforce Sandbox

If you would like to try Chargent quickly and easily, and don’t have a test payment account, you can sign up for an sandbox account. It takes only a few minutes, and is free. The confirmation page will give you the API Login (Merchant ID) and Transaction Key (Security Key) that you need to configure your gateway. Be sure to choose Test when setting up your gateway via the Gateway Wizard.

You will be able to test both credit cards and ACH (electronic check / direct debit) transactions. ACH (electronic check / direct debit) are available on most gateways however check your specific gateway to be sure.

For submitting test transactions, most payment gateways provide separate test accounts with separate test environments. Installed in a Salesforce Sandbox, Chargent always sends to your test gateway account. If you want to test live payments from the Sandbox account you can use the Endpoint Override field with the URL for your live gateway (see the documentation on your specific gateway for details).

When running test transactions, please consider the following:

  • Always use the test credit card and account numbers provided by your payment gateway.

  • Many gateways have specific approved / declined responses in their test environments, based on the following:

    • amount sent
    • Type of amount sent (cents vs. no cents)
    • card number
    • CVC (Card Verification Code)
    • expiration date

If you are consistently getting approved or declined messages, check your gateway testing documentation to see if the above values may be controlling the response.

For test credit cards specific to your Payment Gateway see our documentation for your gateway or see testing with your specific gateway.

Note: Some gateways provide test documentation only after login.

Testing in your Salesforce Developer Org

If you are testing with a Salesforce Developer account this is similar to a live Production environment and allows you to test both live and test transactions. When setting up your gateway be sure to specify whether you are setting up a test or live gateway using the correct credentials for each.

Test gateways will automatically have the Test Endpoint box checked and automatically send to a test endpoint for your gateway. Live gateway setup will leave this box unchecked and will automatically send the transaction to your live environment.

Testing Phases

After you have completed basic testing with a Developer or Sandbox account, it is critical to test with few real live transactions prior to going live with Chargent.

This is because not all features can be fully tested with test transactions, even if you are following along with your payment gateway's recommended tests and expected responses. For example, address verification (AVS) settings cannot be fully tested on most payment gateways, so transactions that were approved in test could be declined when live. Many gateway test environments also do not behave the same as live when it comes to things like fraud filters, refunds, and more. It is best to work any issues out before going live.

To test live transactions prior to going live:

  • Use your own credit card or a company credit card

  • Charge a small amount, such as $1 or $5

  • Go to the created Transaction record afterwards

  • Click the Void button


  • If voided the same day, the transaction will not settle, and should not appear on your statement or deduct funds from your account

  • Live transactions will incur per transaction fees (typically 10 to 30 cents/transaction).

If you are looking to test live transactions in your Salesforce Sandbox account, you will need to add the Endpoint Override to your Gateway setup. Developer account’s you just need to uncheck the Test Endpoint checkbox. For the correct Endpoint override you can view our documentation for your specific Payment Gateway or contact your gateway for this information.

For more information on testing phases, parallel systems, and contingency plans, please see our guide:

Moving from Sandbox to Production

AppFrontier recommends testing all Salesforce and Chargent configurations in a Salesforce sandbox, prior to moving into production. This is recommended for upgrades or changes in configuration once you are already live with Chargent as well.

You can migrate configuration changes from your sandbox to production using Salesforce Change Sets. Change Sets are a convenient way to move configuration changes from one Salesforce org to another, and only include changes you make under the Setup menu in Salesforce. No record data is included.

To Use Change Sets

Upload your Change set in your Sandbox:

  1. Click the gear icon gear icon on the top right side of Salesforce and click Setup

  2. Under Environments, select Change Sets, and Outbound Change Sets.

  3. environments
  4. Click New (if you haven’t yet setup any Change Sets)

  5. Select the Components and Profiles that will be part of the Change Set

  6. Save

  7. Click Upload

Deploy the Change Set from your Production Org:

  1. Click the gear icon gear icon on the top right side of Salesforce and click Setup

  2. Under Environments, select Change Sets, and Inbound Change Sets.

  3. objects
  4. Find the Change Set and click Deploy

  • Change Sets can only be sent between orgs that are affiliated with a Production Org.
  • You will still need to install Chargent into Production from our links provided. Change sets are simply a way of moving any custom work you have done from sandbox to production.

For more information on using Change Sets to move configuration updates from your Salesforce Sandbox to your Production Org, please see:

Data Migration

It is possible to migrate from other payment systems to Chargent providing you can export the data from the old system. If you have experience with data migration you should be able to load the data into Salesforce.

Note: Chargent recommends migrating tokens if you are using tokenization. If you are not using tokenization, please keep in mind that Chargent doesn’t store the CVC (Credit Card Verification Code). If your gateway requires the CVC you may need to obtain the tokens before migrating.

When migrating billing records from another system, always test with small batches (~10) before moving into full production.

For manual charge usage of Chargent, the migration is straightforward and requires only Amount and payment information be transferred to Salesforce.

Recurring Billing requires a bit more care so that there is no interruption in billing or duplicate charges. There are several fields that need to be populated in order to ensure charges occur on the date they are supposed to.

  • Payment Start Date - This is extremely important. Make sure this is the date of the next transaction otherwise it could be picked up in the batch and processed sooner than expected. This field also updates and automatically populates the Next Transaction Date field.

  • Payment Status - This needs to be set to Recurring in order to be processed in the batch.

  • Frequency - This will tell the batch how frequently the transactions should be processed (Annually, Monthly, Weekly).

  • Token - If you are using tokenization, you should be able to run a report at your gateway, and import this data into the Token field.

Again, always test with a small number of records, prior to migrating and setting all records up to be billed.

Chargent uses past Transactions and their Gateway Date to calculate the next date a transaction should be processed. We recommend loading data into "Transactions" and making sure you set these fields:

  • Gateway Date=Date and Time of transaction
  • Response Status=Approved
  • Type=Charge
  • Amount=the amount
  • Recurring=True (if applicable)

In data migration you should not turn off the old system until you have properly tested the migration. In many cases, running the old and new systems in parallel for some time is recommended. As soon as you get a successful batch of transactions that are part of Chargent's recurring schedule, you should be good to go from then forward.

AppFrontier® has a number of partners who are experts in data migration and payment systems who we can refer you to for assistance if needed.