AppFrontier

☰ Menu

Authorize.net Salesforce Integration Chargent


Integrating Authorize.net and Salesforce using Chargent

This guide shows you how you can easily connect the Authorize.net payment gateway to Salesforce using Chargent, in order to charge credit cards directly from Salesforce, either via embedded buttons or scheduled batches for recurring payments.

Note: This is primarily a synchronous integration, meaning that transactions sent to Authorize.net from Salesforce will receive the Auth.net responses (approved / declined with related information) and store them in Salesforce, but transactions that are not initiated from Salesforce will not be synced from Authorize.net to Salesforce.


Once your connection between Authorize.net and Salesforce is up and running with Chargent, however, we don't expect that you should need to initiate any transactions from Authorize.net (or really log into Authorize.net for any reason other than needing to update address verification settings (AVS) or similar).


  1. Install Chargent Payment Processing for Salesforce into your Salesforce org.
    • Note that Chargent is a paid application, but it has a 30 day trial.

  2. Configure Chargent according to the step by step documentation.

  3. Initial Testing

  4. We recommend first creating an Authorize.net Sandbox account, which is a separate, free account for testing purposes.
    • Authorize.net will instantly generate test API credentials for you

  5. Add a Gateway record for Authorize.net

    1. Navigate to the Gateways tab in Chargent and click New

    2. Add Authorize.net Gateway record to Salesforce


    3. Select Authorize.net as the record type from the list of prebuilt payment gateway integrations.

    4. Complete the Authorize.net gateway record as follows:
      1. Gateway Name - Anything you choose, for example "Authorize.net Sandbox" or "Authorize.net Test"
      2. Merchant ID - the API Login ID provided by Authorize.net
      3. Merchant Security Key - the Transaction Key provided by Authorize.net
      4. Active and Test Endpoint should both remain checked
      5. Click Save

    Authorize.net Gateway settings in Salesforce


  6. Create a test transaction record in Salesforce.
    • Chargent Payment Processing for Salesforce embeds its payment fields in either the Salesforce Opportunity, Case or Chargent Orders (custom) object. For this documentation we will be using the Chargent Orders object because it is a stand alone object, but the fields are the same as those you would add to the Opportunity or Case page layout in Salesforce should you choose to use one of those packages.

    1. Create a new Order record and enter sample data to run a test transaction.
      1. Name
      2. Amount
      3. Billing Address
      4. Authorize.net's suggested test credit card numbers, which are also emailed to you and are as follows:

        1. American Express Test Card: 370000000000002
        2. Discover Test Card: 6011000000000012
        3. Visa Test Card: 4007000000027
        4. Visa Test Card: 4012888818888
        5. MasterCard Test Card: 5424000000000015
        6. Visa Test Card: 4222222222222 (response code will = dollar amount charged)

      5. Any expiration date in the future in the format MM / YYYY

    2. By default, passing address or CVC data with the card number will cause the address and CVC checks to succeed.

    3. If you have more than one Active gateway record in Chargent (which you probably will not at this point), you will need to specify which one to use in the Order record. Otherwise, you can leave the gateway lookup field blank (and may wish to hide it from the page layout in the future since users should not need to access it).

    4. Although Chargent Payment Processing for Salesforce supports both credit card and ACH / eCheck payments from Salesforce, you need to have eCheck enabled on your Authorize.net account, so for this demo we are going to run test credit card transactions.

    Salesforce order record with Authorize.net gateway


  7. Run a test transaction
    1. Click the "Charge" button in your newly created Salesforce order record. You should receive a popup in a few moments with the response from Authorize.net.

    2. Approved Authorize.net Notification in Salesforce


    3. When you click Ok on the popup dialog box, the Salesforce page will refresh and you can then scroll down and see the Transactions related list, with the response and the Gateway ID that was sent back to Salesforce by Authorize.net.

    4. Authorize.net Transaction Record related list in Salesforce


    5. Sign into the Authorize.net test Merchant interface to check the test transaction under Search : Unsettled Transactions.

    6. Authorize.net Unsettled Transactions in merchant interface


    7. You also likely received a sample Authorize.net confirmation email, similar to what you will receive when you run live transactions. Once you go into production with Chargent, if you fill out the Billing Email field in Salesforce that Chargent provides, your customers will also receive an Authorize.net email receipt at that address.

    8. Authorize.net Email Receipt


  8. Your connection between Salesforce and Authorize.net is now set up and working. Let's proceed to the final tests before the system goes live.

  9. Going into Production

    There are many more options for customizing how Chargent works within Salesforce beyond the basic connection described above. Once you have configured Chargent to your satisfaction, and have fully set up and tested any automation or integration with other business processes that you wish, it is time to move into production.

  10. Optional: Keep the Sandbox Gateway for future testing

    1. Chargent allows you to have multiple gateway records, so you may wish to keep the initial gateway we set up earlier for future testing.
    2. Click Edit on your Authorize.net Sandbox / Developer account gateway
    3. Uncheck the Active checkbox, so no transactions are accidentally sent to this test gateway
    4. Click Save

  11. Add a Gateway record for Authorize.net

    1. Navigate to the Gateways tab in Chargent and click New

    2. Select Authorize.net as the record type from the list of prebuilt payment gateway integrations.

  12. Complete the Authorize.net gateway record as follows:

    1. Gateway Name - Anything you choose, for example "Authorize.net Live"
    2. Merchant ID - the API Login ID provided by Authorize.net
    3. Merchant Security Key - the Transaction Key provided by Authorize.net
    4. Active should be checked
    5. Test Endpoint should NOT be checked - test endpoint will send transactions to the test/sandbox Authorize.net server instead of the live server
    6. Click Save

    To find your Authorize.net production credentials, log into your LIVE Authorize.net Merchant Interface web site. Go to Account : Settings and look for the API Login ID and Transaction Key link. You can also create a new Transaction Key there if you wish.


    Authorize.net API Login ID and Transaction Key link in merchant interface


  13. Testing with Live Credentials

    1. During this next phase, we will be using your real Authorize.net credentials (rather than the developer sandbox we used in the first part), but setting Authorize.net to Test mode, so the transactions we send will only be test transactions.

    2. Note: If other integrations or departments in your company are already using the Authorize.net account, you should NOT put the account in test mode. If the Authorize.net account is already in use, you may need to skip this step proceed to step 12.

    3. IMPORTANT: Go to Account : Settings and look for the Test Mode link in the Security Settings area.

      • Click the button Turn Test On
      • Again, do not put your Authorize.net Live account into test mode if there are other users connecting to it (for example, a web site ecommerce integration or accounting person using the virtual terminal).

      Authorize.net Test Mode in merchant interface


    4. Run some test transactions using your live credentials in test mode.

    Please Note: When processing test transactions in Test Mode, Authorize.net will return a transaction ID of "0." This means you cannot test follow-on transactions, for example, credits, voids, etc., while in Test Mode, because the original transactions will not have the required Transaction IDs (stored in the Gateway ID field in Chargent). To test follow-on transactions, you can process a test transaction with any valid credit card number in live mode.

  14. If your testing in the live environment is successful, you are ready for the third and final phase, running Live transactions.

    1. Ensure Test mode is turned off in the Authorize.net Merchant Interface
    2. You can now run live transactions using valid credit card numbers

      • If you wish to test some live transactions, you can void them immediately after, to prevent the transactions from settling. Just go to the transaction record in Salesforce and click the Void button.


      • Voiding a Salesforce transaction from Authorize.net


      • If you do run live transactions as a test, it is recommended to make them very low amounts to minimize any impact, in the event you forget to void them.

      • Note: Live transactions will incur the per transaction fee (around 30 cents depending on your Authorize.net pricing), so you may wish to limit the number of live transactions run as tests

      • For Visa live transaction tests, you can submit $0.00 transactions

      • To test the AVS or CCV responses in the live environment, you will need to submit live transactions with correct street address, ZIP Code and Card Code information to generate successful responses, and 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.

  15. Congratulations! You have now successfully integrated Salesforce and Authorize.net, via the Chargent Payment Processing for Salesforce app. You can now process one-time or recurring credit card payments through Authorize.net directly from Salesforce.


  16. If you have any questions or need assistance, please contact us.