After creating a thorough test plan, we always recommend testing all new installations, updates, and changes to your Chargent configuration in a sandbox environment prior to implementing them in your production environment.
What is a Sandbox? #
A Salesforce sandbox is a completely separate test environment that allows you to build configurations and test them without affecting your production data. After you have built and tested new components or changes, you can package these changes and deploy them to your production environment. For more information, see When to Use a Sandbox.
Creating A Salesforce Sandbox #
Create a sandbox environment in Salesforce, giving it a meaningful name that reminds you it is for testing Chargent. We recommend creating a full sandbox with all your data to test Chargent’s functionality thoroughly. Review the types of sandboxes Salesforce offers and follow these steps to create a sandbox that is appropriate for your testing needs.
See Creating your Salesforce Sandbox for more information.
Note: When creating a full or partial sandbox, Salesforce copies your data, batches, and gateways (including any value in the Endpoint Override field) from your production org. To make sure no live transactions are processed from your sandbox, disable the Recurring Billing Batch and remove any value in the Endpoint Override field of your gateway settings.
When testing in a sandbox environment, all of Chargent’s features are automatically enabled, including the Payment Console and Payment Methods. This allows you to try out a variety of payment solutions to ensure you know exactly what features will help you meet your payment processing goals prior to going live.
Selecting A Gateway #
Not sure what gateway is right for you? No problem! The following steps show you how to set up a test gateway with Authorize.net because it is quick, easy, and free. If you’d prefer to use a different gateway, review the list of gateway’s Chargent supports.
Creating A Test Gateway #
If you want a quick and easy way to test Chargent, sign up for an Authorize.net sandbox account and test it in your Salesforce sandbox. It only takes a few minutes, and it’s free. You don’t have to commit to using Authorize.net as your gateway since there are plenty of others. To set up a test account for your preferred gateway, visit our gateway-specific guides. Be sure to choose the “Test Transactions” tab when setting up your gateway using the Gateway Setup Wizard.
After you’ve added your test gateway credentials to Chargent, you can test any type of transaction that the gateway supports. For example, you can test credit card and ACH (electronic check and direct debit) transactions. ACH (electronic check and direct debit) are available on most gateways, but check your specific gateway to be sure.
Like most gateways, Authorize.net provides a separate test account with test credentials for you to test transactions without processing payments. When you use a Salesforce sandbox, Chargent sends transactions through your test gateway account. So, you don’t have to worry about mistakenly processing a live transaction from your sandbox. But you can override this by entering your live gateway URL in the Endpoint Override field of your Chargent gateway settings.
Running Test Transactions #
After creating and validating your test gateway record, we recommend sending Payment Requests or using the Payment Console to test your transactions.
Testing with Payment Console
To test using the Payment Console, navigate to any record in your Sandbox with the Chargent Anywhere component enabled.
- Click Payment Console in Chargent Anywhere
- If you are using multiple gateways, select your test gateway from the dropdown; otherwise, continue to step 3
- Enter all the Billing Information and click Next
- Enter a test credit card number, expiration date, and CVC code based on your gateway’s accepted test cards. For more information about test cards, see your gateway-specific guide.
For additional details, see Chargent Payment Console.
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 Setting Up Payment Request. Navigate to any record in your Sandbox with the Chargent Anywhere component enabled.
- Click Send Payment Request in Chargent Anywhere
- If you have multiple Payment Request templates set up, you will first choose which one to use.
- Enter an email address where you want to send the test Payment Request and an amount.
- Enter a Contact name (Optional)
- Click Send Request
- Click the pay link sent to the email address chosen in step 3
- Enter all the Billing Information and click Next
- Enter a test credit card number, expiration date, and CVC code based on your gateway’s accepted test cards. For more information about test cards, see your gateway-specific guide.
For additional details, see Sending a Payment Request.
Testing Specific Responses #
We recommend testing various gateway responses. Please consider the following while running through your test cases:
- Always use the test credit card and account numbers provided by your payment gateway.
- Many gateways have specific approved and declined responses in their test environments based on the following:
- Amount sent
- Type of amount sent (cents or no cents)
- Card number
- CVC (Card Verification Code)
- Expiration date
If you consistently get unexpected approved or declined messages, check your gateway’s testing documentation to see if the above values may be controlling the response. Use the test credit cards or bank account information specified for your gateway. You can access your gateway’s documentation from Chargent’s gateways page.
Testing Live Transactions in Sandbox #
If you use a Full or Partial copy sandbox, your data, batches, and gateways (including any value in the Endpoint Override field) will be copied from your Production org. For this reason, we do not recommend conducting live testing in your Salesforce sandbox. If your testing process requires testing live transactions in a sandbox environment, see Testing Live Transactions in a Sandbox.
Additional Tips #
- Keep a list of the components you add or change to simplify what you want to package in a change set and deploy to production. If you are reading after the fact and can’t remember everything you’ve changed, you can review your setup audit trail.
- Build your outbound change set from within your Salesforce sandbox before you make any changes. Then, add each component to the change set as you work. This is the fastest way to take a big step out of your deployment.
- Use your list of test cases from Best Practices for Testing Chargent to ensure you’ve met all your requirements. You can easily turn these requirements and test cases into a list of enhancements to broadcast to your organization and add to your documentation.
Next Steps #
Deploying to Production
When all your test cases have passed, you are ready to move your changes to production. Follow these steps to deploy changes to production.
Testing in Production
After all your test cases have passed, run live transactions in production before rolling out. All test environments and gateways behave differently. So, follow our instructions to start testing in production.
See Also
Gateway Setup and User Guides
Installing and Updating Chargent
Chargent’s Payment Gateway Guides