BluePay Salesforce Integration Chargent

Integrating BluePay with Salesforce using Chargent

This guide contains instructions for integrating your environment with the BluePay payment gateway—using the Chargent payment processing plug-in.

Please note that the following BluePay instructions will also work for any payment gateways that support AIM emulation.. You will simply need to use different endpoints.

Click a link to go directly to one of these sections:


BluePay is a leading provider of technology-enabled payment processing for merchants and suppliers of any size in the United States and Canada. Through online and mobile interfaces, as well as CRM and ERP software integrations, BluePay processes business-to-consumer and business-to-business payments while providing real-time settlement, reporting, and reconciliation—along with robust security features such as tokenization and point-to-point encryption.

Bluepay Logo

Using the step-wise instructions in this guide, it’s easy to connect Salesforce to the BluePay gateway with Chargent Payment Processing using emulation. Chargent has many features to offer, including automating and streamlining Salesforce payment processes, easy subscription management, click-to-charge buttons, payment request emails, and more.

Integrating BluePay with Chargent gives you the ability to easily build a seamless process for completing payment for orders that you manage in Salesforce. The integration connects the BluePay gateway directly to Salesforce. Optionally, Chargent enables gateway tokenization for processing credit card payments, and also offers support for ACH/eCheck payments. See Setting Up Salesforce For Integration for additional information on the gateways.

Obtain a BluePay Sandbox Account

The first task is to get a test account from BluePay so that you can run test transactions from Salesforce.

To request a sandbox account, complete the form on the Sandbox Account Request page.

Bluepay Sandobx

Upon approval, you’ll receive an email that contains these testing credentials:

  • Account ID
  • User ID
  • Password (temporary)

If you need any help, contact BluePay through their Support page, email at, or by phone at 800-350-2684.

Production account: You’ll also need to register for a production account. Use the contact information in the enrollment email messages to work with BluePay Support and obtain the same set of credentials for your production account.

NOTE: You must get each of these gateway credentials from BluePay before moving on to the steps in the next section, Configuring Salesforce For Integration.

Obtain the Secret key from your BluePay test account

As we explain in the next section, it’s necessary to enter the Security Key into Salesforce. Follow these steps below to locate your Secret Key for your BluePay account:

  1. Login to the BluePay Account page.

    Bluepay Login

  2. In the menu, click Admin > Accounts.

  3. In the Account List panel, click the Account Name link.

    Bluepay account list

  4. Scroll down to find the 32-character Secret Key. It is this key that you need to copy and paste into the Merchant Security Key field on the Gateway page in Salesforce (as given in the instructions in the next section).

    Bluepay secret key

Configuring Salesforce for BluePay Integration

NOTE: You must get each of these gateway credentials from BluePay before moving on to the steps in the next section, Configuring Salesforce For Integration.

  • The steps in this section are written with the assumption that Chargent has not already been installed into your Salesforce account.

  • Before moving on to the procedure below, you must successfully complete all of the steps given in the previous section, Obtain a BluePay Sandbox Account.

Follow the steps below to configure Salesforce to integrate with BluePay:

  1. Install the Chargent Base Package into Salesforce, as we describe on the Chargent Installation page.

    NOTE: Both the sandbox and production installation of Chargent include a free, 30-day trial license.

  2. Install the Chargent Orders Transaction Package in Salesforce, as we describe on the Chargent Installation page.

  3. Complete the basic Chargent setup, such as assigning user licenses and updating page layouts. For more information, please consult our Quick Start Guide.

  4. As shown in the figure at right, select the Chargent item in upper-right corner of Salesforce.

  5. In the upper-left of the Salesforce page, click the Gateways tab, then click the Create New drop-down, and then select Gateway.

    Bluepay Gateway

  6. Chargent uses emulation to for integrating BluePay with Salesforce. In the Gateway Record Type panel, select the item from the Record Type drop-down, and then click the Continue button.

    Bluepay Gateway

  7. On the Gateway Edit page, enter the Gateway Name (such as “BluePay Test”), which is an internal Salesforce name that you choose for the gateway.

    Bluepay Gateway list

  8. Use the table below for guidance when entering the test credentials that can be found in the email from BluePay Support:

    Gateway Page Field Value
    Gateway Name Enter an easily recognizable name for this gateway, such as “BluePay Test”.
    Merchant ID Your 12-digit BluePay ACCOUNT ID
    Merchant Security Key 32-character BluePay Secret Key (see the previous section, Obtain the Secret key from your BluePay test account)
    Endpoint Override
    Active Check this box

  9. In Salesforce, it’s necessary to add the remote site entry for BluePay as we explain in the next section (Enabling a Remote Site in Salesforce).

  10. Your Gateway page should look similar to the figure below. Click the Save button to commit your changes.

    Bluepay Gateway

Enabling a Remote Site in Salesforce

Follow these steps to connect your Salesforce environment to the BluePay endpoint:

  1. In the left-side menu in Salesforce, navigate to Setup > Administer / Security Controls > Remote Site Settings.

  2. Click the New Remote Site button (see the figure below).

    Bluepay Enabling Remote

  3. For the new remote site, enter “BluePay” for the Remote Site Name.

  4. Enter “” for the Remote Site URL.

  5. Click Save.

Testing the BluePay Integration

This section contains the procedure for testing the integration that you set up according to the procedure given in Setting Up Salesforce For Integration, using your BluePay sandbox credentials.

Follow the steps below to verify that the integration is correct.

  1. In the upper-left corner of the Salesforce page, click the + tab to open the All Tabs page.

  2. In the tabs listing, locate the link that corresponds to the Chargent Transaction Package that you installed during the Configuring Salesforce For Integration procedure.

    See the figure to the right, which indicates Chargent Orders for the purpose of illustration. (If you installed the Chargent Opportunities or Cases package, you would use that object for testing).

    Bluepay Testing

  3. On the next page, click the New button (see the figure below).

  4. As shown on the BluePay Testing page, these are valid test credit card numbers.

    Card Type Card Number
    Visa 4111111111111111
    Visa 4242424242424242
    MasterCard 5439750001500222
    MasterCard 5439750001500347
    Discover 6011111111111117
    American Express 378282246310005

  5. Use a test CVC value of 123.

  6. For BluePay, submission of an odd dollar amount such as $1.00, $9.00, or $25.00 will cause a APPROVED message to return. Even dollar amounts such as $2.00, $16.00, or $32.15 will cause the return of a DECLINE message.

  7. Expiration dates in the future are returned as valid; expiration dates in the past are returned as invalid.

  8. In the Chargent Order Edit page, enter or select information to correctly complete the essential parts of the form, including:

    • Gateway
    • Billing First Name
    • Billing Last Name
    • Billing Address (City, State, Zipcode)
    • Billing Email Address (to get a receipt)
    • Charge Amount (check Manual Charge if this amount is not calculated from Subtotal + Tax + Shipping)
    • Payment Method
    • Card Type
    • Card Number
    • Card Expiration Month
    • Card Expiration Year (use a future year)
    • Card Last 4

    See the figure below for the placement of these fields.

    Bluepay Testing

  9. Click the Save button to commit the changes on the form. On the next page, click the Charge button (as shown below).

    Bluepay Testing

  10. When the transaction is complete, you see a small pop-up as shown in this figure. Click the OK button to close the pop-up window, then scroll to the bottom of the Order page.

    Bluepay Chargent

  11. A record is created for each error and each successful transaction, and this record contains the response messages and details that are sent back from BluePay. See the figure below for an example.

    Bluepay Chargent Transactions

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 BluePay:

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

Understanding Transactions

When a transaction occurs between Chargent and the BluePay gateway, a new transaction record is created in Salesforce. The listing of transactions can be found in the Transaction section near the bottom of the Chargent Order page (or Opportunities or Cases, if you are using those packages). See the figure above.

On the order page, scroll down to that Transactions section and click a Transaction ID link to see the details, as shown in the figure below. This transaction record contains the entire set of data that BluePay sends in its response, including transaction Type (Charge, Authorize, Refund or Void), the Response Status (Approved, Declined, Error), and any related approval or error messages.

Bluepay Chargent Order

You can compare the transaction records in Salesforce with the records in your BluePay administrative app. As shown in the figure below, click the Processing menu category, then click Transactions > Transaction List. Then click the link for a specific transaction to view details.

Bluepay Transactions

Correspondence in the Transaction Fields

The Gateway Date is the timestamp for the submission to BluePay, and the Gateway ID field corresponds to the BluePay Transaction ID for use in reconciliation between two systems.

This table contains the mapping information between BluePay and Salesforce fields.

Salesforce field Direction Gateway field
Gateway ID < Transaction ID
Invoice Number > Invoice ID
PO Number > Order ID

Going Live

This section contains the procedure for configuring the integration in a production system.

NOTE: Do not proceed here until the testing procedure described in Testing the Integration is successful.

  1. First, obtain the production credentials for the BluePay production gateway account (similar to the method given for sandbox credentials in Obtain a BluePay Sandbox Account.

  2. Get these production credentials from your enrollment email message:

    • Account ID
    • User ID
    • Password (temporary)

  3. Repeat the steps in the Configuring Salesforce for BluePay Integration section above, but substitute the production credentials.

  4. For the production Endpoint Override field, enter:

  5. Repeat the steps in the Testing the BluePay Integration section above with respect to the SalesForce production environment, using the production credentials.

    Void the transactions: If you’re using an actual credit card and want to prevent the charge from settling, remember to void the transaction after testing.

  6. Be sure to successfully transmit at least one real credit card transaction using company or personal accounts. We recommend that you submit a transaction with a very small amount and then void that transaction afterwards. This ensures that the system works with your production credentials.