CyberSource Salesforce Integration Chargent

Integrating CyberSource and Salesforce using Chargent

Easily connect CyberSource and Salesforce with Chargent,

the leading payments app on the Salesforce AppExchange. See all CyberSource transactions, manage refunds,
send payment links and more, all inside Salesforce.

Not yet a Chargent customer?
Contact us for a no-obligation 30 day trial, and see for yourself!


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.

Installation and Configuration

  1. Install both the Base Package and the Chargent Orders Transaction Package of Chargent into your Salesforce org.

  2. Configure Chargent according to the Quick Start Guide.

  3. For Chargent versions prior to 5.57 you may need to activate the Remote Site Settings in Salesforce if they aren’t already active for CyberSource.

    • Click the gear icon on the top right and select Settings
    • Under Security select Remote Site Settings
    • Locate CyberSourceLiveA and click edit
    • Check the Active box
    • Click Save
    • Do the same for CyberSourceTestA

  4. 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, and is not used for this integration.

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


  5. Get a Transaction Security Key

    • Log into the CyberSource Test Business Center using your new credentials

    • From the left panel select Payment Configuration

    • Select Key Management

    • Click Generate Key

    • Select SOAP Toolkit

    • Click Generate Key on the bottom

    • Use the ‘Copy this one time key’ icon on the right to copy the key to your clipboard

    • Cybersource Cybersource


Add a CyberSource Gateway record in Salesforce using Chargent’s Gateway Wizard.

  1. Click on the App Launcher on the top left side in Salesforce.

  2. applauncher

  3. Select Chargent as the App

  4. Select the Chargent Settings Tab

  5. Choose Chargent Setup Wizard

  6. chargent seetings

  7. Do you have a Payment Gateway account - Select Yes

  8. Select CyberSource as your Payment gateway.

  9. Select Test Transactions for testing in Sandbox or Live Transactions if you are looking to process real time payments.

  10. Follow the prompts to configure your gateway.

You will need the following information:

  • Add your credentials based on your Sandbox (Test) or Production Live CyberSource account.

    • User Name: This is your CyberSource Merchant ID
    • User Password: Password (for Merchant Admin account, not Account Admin)
    • Transaction Security Key: Transaction Security Key You copied from CyberSource in the Installation and Setup of CyberSource section above.

Other information that will be asked:

  • Will you be using tokenization? (recommended)

  • What currency will you be using? (USD, CAD, etc..)

  • What payment methods will you be accepting?

  • Credit cards and/or ACH (electronic check)

    • What Credit Card types will you be accepting? (Visa, Mastercard, etc…)

  • Payment Console Setup (Premium feature for Platform Edition)

    • Show Charge Button
    • Show / Create Update Token Button
    • Show Authorize Button

Add a CyberSource Gateway record in Salesforce (Chargent versions prior to 5.40)

  1. Click on the AppLauncher on the top left side in Salesforce.

  2. applauncher

  3. In the Search for apps or items box, Search for Gateways and select

  4. gateways

  5. Click New and select Cybersource as the Gateway Type

  6. Map the following fields in Chargent with your credentials from CyberSource:

    • Merchant ID: Your CyberSource Merchant ID

    • Transaction Security Key: Transaction Security Key You copied from CyberSource in the Installation and Setup of CyberSource section above.

  7. Setup the following Gateway fields

    • Check the Active box - To make the Gateway active

    • Use Tokenization - If you are planning on using CyberSource tokenization (recommended)

    • Available Card Types - Select the cards you will be accepting (this is based on your gateway settings and what card types they can process - Visa, Mastercard, American Express, etc..)

    • Available Payment Methods - Will you be accepting just Credit Cards or ACH (also known as electronic check, e-check, or direct debit)

    • Available Currencies - What currencies will you accept (this is based on your payment gateway and the currencies they accept payment in.

    • Credit Card / Bank Account Data Handling - This lets Chargent know when to clear the information in Salesforce. You have 4 options.

      • Never Clear
      • Clear After Successful Charge
      • Clear After All Transactions
      • Clear When Token is Present (recommended)

      • new gateways

When using Payment Requests or Payment Console the following should also be set. Please note these features come with Sites and Platform edition & require activation in your Production Org.

  • Available PR Transaction Types

    • Charge Full Amount - Charges the credit card immediately

    • Authorize Full Amount - This option won’t charge the card but only holds the funds available until you charge the card.

    • Authorize Minimum Amount - This option won’t charge the card but only holds the minimum amount that your gateway will allow. You will need to charge the correct amount in order to capture the transaction

      card types pr transaction

    • Show Charge Button

    • Show Authorize Button


Direct Debit Network

Starting with Chargent version 6.15, you can now select the Bank Account network for your region during the gateway setup process. Cybersource uses the ACH Network. This will allow for the correct Direct Debit Network fields to be displayed on Payment Requests and Payment Console based on your region.

You should choose ACH - US as the network. ACH is also known as echeck or electronic check.

Select the Payment Methods You Accept

Once you have your Direct Debit Network set, you will see the appropriate field names on your Payment Request that are sent as well as your internal Payment Console.

Payment Request Bank Account


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.

Create a Chargent Order in Salesforce to run test transactions

  1. Click on the App Launcher in the top left side and select Chargent as the App.

  2. chargent app

  3. Click the Chargent Orders Tab.

  4. Click on New

  5. Enter in the following information:

    • Account: The Account the Chargent Order should be associated with.

    • Charge Type should be either credit card or Check depending on if you are testing credit cards or electronic check (ACH or direct debit)

    • Billing Information

      • Billing First Name
      • Billing Last Name
      • Billing Address
      • Billing City
      • Billing State / Province
      • Billing Zip Code / Postal Code
      • Billing Country
      • Billing Email Address (if you want to test the email receipt that gets triggered upon a successful transaction)

      Cybersource requires the Billing Country be sent. Leaving this field blank can cause the transaction to be rejected.

    • Charge Amount (check the Manual Charge to enter a specific amount. If you are entering Subtotal, Tax, and Shipping then the Charge Amount will default to the Balance Due and the Manual Charge box does not need to be checked).

    • Credit Card Number = See CyberSource test credit card information

    • Card type ( (Visa, MasterCard, etc..) or Bank Account Type for ACH (Checking or Savings).

    • Card Expiration Month and Card Expiration Year should be in the future

    • order


  6. Click Save

  7. Click the Charge button. You will receive a pop-up asking for the CSC (Card Security Code). This can be any 3 digits for Visa, MasterCard or Discover or 4 digits for American Express when testing in the Sandbox.

  8. charge

  9. Press the Charge button

  10. You should receive a popup that shows the test transaction was approved.

CyberSource Test Credit Cards

  • CyberSource provides a number of test cards for testing purposes. Real Credit Cards should not be used for testing purposes.

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


Order Source Field

The Order Source field can be set for ACH transactions. The below mapping of the Order Source field will send the corresponding SEC code to Cybersource when you Charge an ACH transaction.

Order Source (Chargent Order field) SEC Codes (Cybersource)
Corporate Cash Disbursement CCD
E-commerce WEB
Installment PPD
Mail ARC
Prearranged Payment and Deposit PPD
Recurring PPD
Recurring Mail ARC
Recurring Telephone TEL
Retail POP
Telephone TEL

Understanding Cybersource Test Responses

Test responses are dependent upon the Charge Amount field, Credit Card Information, and Expiration Date fields 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.

  • General Testing Responses:

    Field Input Response
    Charge Amount field is greater than 1 Successful transaction
    Charge Amount field is less than 1 Rejection: Invalid data - Invalid Amount less than $0
    Charge Amount field is 100,000,000,000 Rejection: Invalid data - Invalid Amount; amount too large
    Charge Amount field is Blank Rejection: Missing required fields = Empty credit card number
    Credit Card Number is 4111111111111112 Rejection: Invalid account number. Request different card or other form of payment.
    Credit Card Number is 412345678912345678914 Rejection: 21-digit credit card number
    Expiration Month 13 Rejection: Invalid expiration month
    Expiration Year 1998 Rejection: Expiration date passed

    If you are looking for specific responses for your payment processor, they are listed here:

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

See Cybersource Reason Codes for additional Responses.

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, if you don’t already have a live account.

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

  1. Deactivate the CyberSource Test gateway record in Salesforce by unchecking the Active checkbox
  2. Click save
  3. Create a new CyberSource live gateway record in Salesforce, either using the Gateway Wizard or using the steps in versions prior to 5.40.

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.

To enable CyberSource Tokenization for Payments in Salesforce:

Ensure that Tokenization is enabled for your account by CyberSource.

  • 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 (Recommended): 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

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 Feature

Chargent's CyberSource Custom Mapping feature allows to you send values from almost any fields on the Chargent Order object to the CyberSource gateway using CyberSource’s Merchant Defined Data fields.

The feature is purely optional and not required for processing Cybersource payments. It is designed to send up to 20 fields in a request. Any Chargent Order can be selected - both from fields from the Chargent package or any 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)

  1. To open the configuration page, navigate to Chargent Settings tab and open the CyberSource Custom Mapping sub-tab: (App Launcher > Chargent > Chargent Settings > CyberSource Custom Mapping)

  2. chargent orders

  3. Select the object in the picklist at the top of the page (normally Chargent Orders, unless you are using the legacy Opportunity or Case packages).

  4. The fields from the selected object are presented in the left column and CyberSource custom fields are in the right.

  5. Map the fields you require and push Save button:


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

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


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


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.