CyberSource Salesforce Integration Chargent

Integrating CyberSource and Salesforce using Chargent


CyberSource is a global payment gateway and a pioneering company in eCommerce, having gotten its start back in 1994 focused on large merchants. In addition to its own payment gateway, in 2007 it acquired, the leading US small business payments provider.

The CyberSource payment gateway works in over 190 different markets worldwide, in 20 different currencies, and provides a single connection to over 40 banks / payment processors on the backend.

Now that CyberSource is integrated with Salesforce through the Chargent Payment Processing application, you can take advantage of all the payment acceptance capabilities of CyberSource, right in your Salesforce CRM system.

Install a free 30 day trial to see for yourself, or contact us for more information about Chargent and its CyberSource / Salesforce integration capabilities.

CyberSource Logo


  1. Install both the Base Package and a Transaction Package of Chargent Payment Processing for Salesforce into your Salesforce org.

    • Choose Chargent Orders, Opportunities (SFA), or Cases for the second piece that you install, the Chargent Transaction Package. This determines where you want the Chargent billing fields embedded in Salesforce.

    • Chargent is a paid application, but there is a 30 day free trial, no signup required. You can also install Chargent into your Salesforce Sandbox.

  2. Configure Chargent according to the documentation.

  3. Get a CyberSource test account

    • Sign up at

    • CyberSource gives you two accounts / logins: Account Admin and Merchant Admin.

      The Account Admin account is the master Account for a specific Merchant ID.

      The credentials we will use for setting up Salesforce are the Merchant ID, Password, and Security Key from the Merchant admin account.

    • Click on the links in an email you received to confirm and create usernames and passwords for both accounts.
      • We are using the credentials from the second account, the Merchant admin
      • Your Username and Merchant ID can be the same.

    CyberSource Business Center

  4. Get a Transaction Security Key

    • Log into the CyberSource Test Business Center using your new credentials
    • Click on Account Management in the left side menu
    • Click on Transaction Security Keys
    • Click on Security Keys for the SOAP Toolkit API
    • Click Generate Key

    • Copy the string of characters and store in another document or paste directly into the Transaction Security Key field in the Chargent Gateway record in Salesforce, as you will not be able to access the key from CyberSource again.
      • (NOTE: key can be used for tests for 30 days)

    CyberSource Transaction Security Key

  5. Add a Chargent Gateway record in Salesforce for CyberSource

    • Switch to the Chargent app in Salesforce (top right corner menu)
    • Go to the Gateways tab
    • Click New
    • Select CyberSource as the record type from the list of Chargent's payment gateway integration options for Salesforce.

    Adding the CyberSource Gateway in Salesforce

  6. Fill out the CyberSource gateway record in Salesforce, using the credentials from steps 3 and 4 above:

    • Gateway Name: Your choice, for example "CyberSource Test"
    • Merchant ID: Merchant ID
    • Merchant Security Key: Password (for Merchant Admin account, not Account Admin)
    • Merchant Reference: N/A (not used in CyberSource)
    • Transaction Security Key: Transaction Security Key
    • Active should be checked
    • Test Endpoint should be checked (this sends to the CyberSource test environment instead of Live)
    • Click Save



    Now that you have created the CyberSource gateway record in Salesforce, it is time to run some test transactions to ensure it was set up correctly, and understand how Chargent works to charge credit cards within Salesforce.

  7. Create a test record in Salesforce to run test credit card transactions

    • (either a Chargent Order, Opportunity, or Case record based on which of the 3 Chargent Transaction packages you installed).

    • Enter data in the following fields:
      • Billing First Name, Billing Last Name, Billing Address, Billing State, Billing Zip, Billing Country
      • Billing Email
      • Total (or Amount if using Opportunities / Cases)
      • Card Type (only required in some cases but generally recommended)
      • Card Number, Card Expiration Month, Card Expiration Year (see below for test cards)

    • Optional fields
      • Shipping First Name, Shipping Last Name, Shipping Address, Shipping State, Shipping Zip, Shipping Country (required by Cybersource in some cases)
      • Currency (for testing leave blank or set to USD unless your account is configured differently)

    • CyberSource Test Cards
      • CyberSource provides a number of test cards for testing purposes. Real Credit Cards should not be used for testing purposes.
      • You can use any Expiration Month and Expiration Year in the future
      • Visa 4111 1111 1111 1111
        MasterCard 5555 5555 5555 4444
        American Express 3782 8224 6310 005
        Discover 6011 1111 1111 1117
        JCB 3566 1111 1111 1113

  8. Click the Charge or Authorize button

    • You will receive a popup window stating the test transaction results
    • After you click OK, the page will refresh
    • You can then view the Transaction details from the related list near the bottom of the page in Salesforce.

    Salesforce CyberSource response message

  9. Understanding Cybersource Test Responses

    • By default, all new accounts are set up with Chase Paymentech as the simulated processor.
    • Since responses and acceptance criteria differ among processors, if you are using a different payment processor you should contact CyberSource Customer Support to have your test account configured to use the simulator of that processor.

    • Test responses are dependent upon the Charge Amount field in Salesforce

      • Response Status in the Salesforce transaction record will equal ACCEPT for successful transactions, REJECT for declined transactions, ERROR for failed transactions
      • Reason Codes in the Salesforce transaction record will be 100 for successful transactions, otherwise they will vary according to the error they are supposed to simulate
      • Gateway ID in the Salesforce transaction record (which corresponds to CyberSource's RequestID) will vary and are incremented automatically across all merchants.

      • For additional test response details, please see the CyberSource documentation

      • For additional information about a particular error, you can view the details in the test Enterprise Business Center (in addition to the Chargent Transaction record in Salesforce).

    Sending Live Transactions from a Salesforce Sandbox

    When Chargent is installed in a Salesforce Sandbox, transactions are always sent to the payment gateway's test / sandbox / development environment, regardless of whether Chargent's Test Endpoint checkbox is checked. This is done as a security precaution, to prevent real transactions from being accidentally sent from a Salesforce Sandbox.

    When Chargent is installed in a production or developer Salesforce org, the Test Endpoint checkbox on the Gateway record will select between sending to the payment gateway's live and test environments. (There are a few exceptions, such as Stripe, which has a single endpoint to send transactions to, and different credentials for live versus test transactions).

    If you wish to send live transactions from a Salesforce Sandbox, as a final step in testing, simply use Chargent's Endpoint Override field on the Gateway record, and enter the production endpoint of your chosen gateway there.

    Here is the production endpoint URL for Chargent's integration with CyberSource :

    Note that the full endpoint URL must be entered in the Endpoint Override field, and the domain must be present in the Remote Site Settings (for standard Chargent integrations it should be already present).

    Going Live

    Once you have completed a number of test transactions, you may wish to complete additional customizations to Salesforce to support CyberSource payments, such as automated workflows driven by payments, any reporting requirements, user interface optimizations, etc.

    To process real payments with CyberSource, you will need to migrate your Evaluation account to a Production system, and update your Merchant ID status.

    Please contact your local Sales Representative to go live with real transactions with CyberSource.

    In terms of configuring Salesforce to go live, you would simply do the following:

  10. Deactivate the CyberSource Test gateway record in Salesforce

    • Uncheck the Active checkbox and click save

  11. Create a new CyberSource gateway record in Salesforce, using the credentials from steps 3 and 4 above, but obtained from your Live Business Center (not the test one):

    • Gateway Name: Your choice, for example "CyberSource Live"
    • Merchant ID: Merchant ID
    • Merchant Security Key: Password (for Merchant Admin account, not Account Admin)
    • Merchant Reference: N/A (not used in CyberSource)
    • Transaction Security Key: Transaction Security Key
    • Active should be checked
    • Test Endpoint should NOT be checked

  12. You should test a live transaction with a real credit card, just to make sure everything is working smoothly (test cards above will not work in the live environment).

    • Run small dollar amount transactions, and VOID them immediately after, to minimize any impact
    • Using your own or company credit cards for live tests is recommended, as customers could still see notifications of a charge even if voided
    • Note that Transaction fees are incurred in the live environment, so any testing should be kept to a minimum



    CyberSource offers the ability to store customer payment profiles, eliminating account numbers and other sensitive payment data from your Salesforce account. This lowers the scope of your PCI compliance efforts and ensures that your customer's sensitive information is not compromised in the event of a security breach.

    CyberSource stores your customer's information and replaces it with a unique identifier or token, known as a profile ID. Chargent then stores the profile ID in the Token field in Salesforce, to be used for future payments.

    The CyberSource profile ID, also known as the payment token, identifies the credit card as well as the associated billing, shipping, and card information of a customer.

    Chargent can automatically delete credit card and account numbers from Salesforce upon a successful transaction and creation of a token, or the optional Payment Console feature available in the Platform Edition of Chargent can create CyberSource tokens without ever saving sensitive data to the Salesforce database.

    Please contact us for additional information on security and PCI compliance options for Salesforce.

  13. To enable CyberSource Tokenization for Payments in Salesforce:

    • Request that Tokenization be enabled for your account by CyberSource (this may be required also for the test account).
    • Check the Use Tokenization checkbox in the Chargent Gateway record you have set up for CyberSource

    • Set the Credit Card Handling field (unless you are using Payment Console)

      • Never Clear: Chargent will not remove any card data automatically.
      • Clear After Successful Charge: Chargent will clear the credit card number, expiration dates and card security code only after a successful charge is run.
      • Clear After All Transactions: The credit card number, expiration date and card security code will be erased after any transaction (Charge, Void, Refund)
      • Clear When Token Present: Only when a token is present in the token field, will the credit card number, expiration date and card security code be cleared.

    • The CyberSource token is stored in Chargent's Token field in Salesforce after your first successful transaction, and the credit card fields are handled as you specified in the preceding step

    Chargent Payment Console Update Token Button

    Field Mapping

    Here are some relevant fields and their mappings between the Chargent software in Salesforce and the CyberSource system.

    Salesforce Direction CyberSource
    Gateway ID < Request ID
    PO Number > User PO
    Salesforce record ID (of Chargent Order, Opportunity, or Case) > Your Reference Number

    Custom Mapping Tool

    Chargent's CyberSource Custom Mapping tool allows to you send values from almost any fields on the Chargent Order, Opportunity or Case objects to the CyberSource gateway via Merchant Defined Data fields.

    The feature is designed to send up to 20 fields in a request. Any Chargent Order, Opportunity or Case field can be selected - both from fields from the Chargent package or any unmanaged standard or custom field.

    Note: Cybersource doesn't allow the sending of personally identifying information to Merchant Defined Data fields: name, address, credit card number, etc. (see details)

    To open the configuration page, navigate to Chargent Settings tab and open the CyberSource Custom Mapping sub-tab:

    Chargent CyberSource Custom Mapping Tool

    1. Select the object in the picklist at the top of the page (either Chargent Order, Opportunity or Case).
    2. The fields from the selected object are presented in the left column and CyberSource custom fields are in the right.
    3. Map the fields you require and push Save button:

    4. Chargent CyberSource Custom Mapping Tool

    One Chargent Order, Opportunity or Case object field can be mapped multiple times to different CyberSource custom fields.

    The mapped fields will be sent in "Authorize" and "Charge" requests:

    Chargent CyberSource Custom Mapping Tool

    On the CyberSource side the fields are shown on the detailed transaction description page:

    Chargent CyberSource Custom Mapping Tool

You have now completed the integration of Salesforce and the CyberSource Payment Gateway using Chargent. You can begin processing one-time or recurring credit card and ACH payments through CyberSource directly from Salesforce.

If you need help or have questions, please contact us.