Integrating BlueSnap with Salesforce using Chargent
This guide contains instructions for integrating your Salesforce.com environment with the BlueSnap payment gateway—using the Chargent payment processing plug-in.
Click a link to go directly to one of these sections:
- Your BlueSnap Sandbox Account
- Configuring Salesforce for BlueSnap Integration
- Testing the Integration
- Understanding Transactions
- Correspondence in the Transaction Fields
- Moving to Production
- Transaction Synchronization
BlueSnap is a global payments company that believes every customer has the right to a seamless online experience and the ability to purchase easily, quickly, and securely. According to BlueSnap, since merchants spend countless hours bringing their products to market, they deserve the technology, tools, and support to create an exceptional buying experience.
Using the stepwise instructions in this guide, it’s easy to connect Salesforce to the BlueSnap Payments gateway with the Chargent app. 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 BlueSnap 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 BlueSnap gateway directly to Salesforce. Chargent also supports BlueSnap gateway tokenization for processing credit card payments. See Configuring Salesforce for BlueSnap Integration for additional information on the gateway.
Your BlueSnap Sandbox Account
The first task is to get a sandbox / test account from BlueSnap so that you can run test transactions from Salesforce. To being the process for obtaining a sandbox account, complete the form on the sign up page.
Upon approval, you’ll receive an email that contains these testing credentials:
- Login user ID
- Temporary password
Click the link in the email to go to the test test login page. Login with your username and temporary password, and then follow the prompts to change your password.
Need help? Contact BlueSnap through the options given on the Support page.
On your first successful login, you’ll get a prompt to enter a permanent password of your own choosing. Take note of any restrictions on the required strength of the password.
NOTE : You must get each of these gateway credentials from BlueSnap before moving on to the steps in the next section, Configuring Salesforce for BlueSnap Integration.
Whitelist IP Address
You’ll need to whitelist an IP address prior to generating your BlueSnap credentials. BlueSnap has whitelisted all Salesforce IP addresses for the Chargent integration, however this step is required to generate your API credentials . IP check will be disabled once API credentials have been generated.
Click the Settings menu in the upper-right, then click the API Settings item to access the page, then scroll to the Authorized IPs section. Enter the new IP address that you need to whitelist, and then click the Add button.
We recommend whitelisting the Salesforce IP address 184.108.40.206, but any IP address in Salesforce’s range should work.
After logging in with your permanent password, access the API settings page to see your API Username, API Password , and Default Store ID . The API Username and Password must be specified when configuring the Gateway setup in Salesforce (see the next section).
Click the Settings menu in the upper-right and then click the API Settings item to access this page.
Configuring Salesforce for BlueSnap Integration
Follow the steps below to configure Salesforce to integrate with BlueSnap:
Install the Chargent Base Package into Salesforce, as we describe on the
Install the Chargent Orders Transaction Package in Salesforce, as we describe on the Chargent Installation page.
Complete the basic Chargent setup, such as assigning user licenses and updating page layouts. For more information, please consult our
Quick Start Guide.
item in upper-right corner of Salesforce.
In the upper-left of the Salesforce page, click the
tab, then click the
drop-down, and then select
In the Gateway Record Type panel, select the
item from the
drop-down, and then click the
On the Gateway Edit page, begin by entering a
(such as “BlueSnap Test”). This is merely an internal Salesforce name that you choose for the gateway.
Use the table below for guidance when entering the remaining necessary values for the Gateway Edit page:
Gateway Page Field Value Gateway Name Enter an easily recognizable name for this gateway, such as “BlueSnap Test”. Merchant ID BlueSnap API User ID Merchant Security Key BlueSnap API Password Active Check this box
NOTE: The values for the API User ID (Merchant ID) and API Password (Merchant Security Key) are taken from your BlueSnap account API Settings page. See the section above, API Username and temporary password
Your Gateway page should look similar to the figure below. Click the
button to commit your changes.
Testing the Integration
This section contains the procedure for testing the integration that you set up according to the procedure given in Configuring Salesforce for BlueSnap Integration, using your BlueSnap sandbox credentials.
Follow the steps below to verify that the integration is correct.
In the upper-left corner of the Salesforce page, click the
tab to open the All Tabs page.
In the tabs listing, locate the link that corresponds to the Chargent Transaction Package that you installed during the
Configuring Salesforce for BlueSnap Integration
See the figure below, 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).
On the next page, click the
button (see the figure below).
Taken from the
BlueSnap Test Cards
page, the table below contains valid test credit card numbers. Using a particular test card number will generate various approved and declined transactions for each credit card type. You can trigger an error by varying the use of card numbers to include those not denoted by “Success” in the
In the Chargent Order Edit page, enter or select information to complete the essential parts of the form, including:
- 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.
button to commit the changes on the record. On the next page, click the
button (as shown below).
When the transaction is complete, you see a small pop-up as shown in this figure. Click the
button to close the pop-up window, then scroll to the bottom of the Order page.
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 BlueSnap. See the figure below for an example.
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 BlueSnap:
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).
When a transaction occurs between Chargent and the BlueSnap 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 BlueSnap sends in its response, including the transaction Type (Charge, Authorize, Refund or Void), the Response Status (Approved, Declined, Error), and any related approval or error messages.
Verifying Transactions in the BlueSnap Dashboard
You can compare the transaction records in Salesforce with the records in your BlueSnap dashboard. Login to the BlueSnap test dashboard and click the Reports menu item on the left side, and then click the Transaction Detail link in the first section (as shown in the figure below).
You’ll see a transaction listing similar to this one.
In the listing, locate the transaction of interest and click on one of the links in the transaction row, then click again on the item of interest on the next page to see the details for that transaction.
Correspondence in the Transaction Fields
This table contains the mapping information between the gateway and Salesforce fields.
|Salesforce field||Direction||Gateway field|
|Gateway ID||<||Order reference at the top of BlueSnap detail page|
|Gateway Date||>||Date/Time at the top of BlueSnap detail page|
|Invoice Number||>||Merchant Transaction ID|
Moving to Production
This section contains the procedure for configuring the integration in a production system.
You’ll also need to register for a production account. When you’re ready, use the contact information in the enrollment email messages to work with BlueSnap Support and obtain the same set of credentials for your production account.
NOTE: It’s important that you do not proceed here until the testing procedure is successful—as described in the section, Testing the Integration.
Follow these steps to configure the production integration in Salesforce:
First, obtain the
credentials for the BlueSnap production gateway account—similar to the method given for sandbox credentials in
Obtain a BlueSnap Sandbox Account.
Also get the
API Username and API password, in a manner similar to the instructions found in the
API User ID, API Password, and Store ID
Repeat the steps in the
Configuring Salesforce for BlueSnap Integration
section above, but substitute the
Repeat the steps in the
Testing the BlueSnap Integration
section above with respect to the SalesForce
environment, using the
Void auth transactions only: If you’re using an actual credit card and want to prevent the charge from settling, remember to void the transaction after testing. This is only possible for auth transactions.
- 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.
Chargent supports BlueSnap tokenization for both credit card and direct debit transactions. This section contains the procedure for configuring the use of tokens that pass between Chargent and BlueSnap. Tokens are used to improve security by replacing account numbers in Salesforce, and referencing the data securely stored at BlueSnap.
From the drop-down in the upper-right of the Salesforce page, choose
as the app.
tab in Chargent app.
Click on the
that you are using for the integration.
Credit Card Data Handling
field. A drop-down will open, as shown in the figure below.
We recommend that you choose the Clear When Token Present option, which would cause the Chargent system to erase the credit card number, expiration date, and card security code after any transaction (Charge, Void, Refund) for a card only if there is a value in the token field.
Otherwise, you can choose from among these other options:
- Chargent will not automatically remove card data.
Clear After Successful Charge
- Chargent will clear the credit card number, expiration dates, and card security code only after a successful charge occurs for a card.
Clear After All Transactions
- Chargent will erase the credit card number, expiration date, and card security code after any transaction (Charge, Void, Refund) occurs for a card.
- Never Clear - Chargent will not automatically remove card data.
to commit your changes.
NOTE: After your first successful transaction, the token is stored in the Chargent Token field in Salesforce and the credit card fields are handled according to the choice in the Credit Card Data Handling field.
Chargent has always sent charges and authorizations to the payment gateways, and recorded the result in a real-time Transaction in Salesforce. Chargent can also update Salesforce records long after the initial transaction—for ACH / Direct Debit transactions that are returned for non-sufficient funds (NSF), credit card authorizations that expire, and more.
Two fields, Transaction Status and Settlement Date can now be updated through a daily scheduled batch in Salesforce.
Possible values of the Transaction Status are either final or non-final. It the status is final, then no more updates will occur for that transaction. Also, batches will not pick up any transaction having a final status.
The Settlement Date field stores the date and time when the Transaction Status is changed to final (such as "Settled" or "Voided"), after which it will no longer receives any updates.
To schedule the batch, navigate to Setup > Develop > Apex classes, and then click the Schedule Apex button. These are the batch names:
As shown in the documentation, the following are the various transaction status values for BlueSnap. Use either of the last two values to learn when a transaction has been dishonoured, and take appropriate action within Salesforce—such as sending an email or assigning a follow-up task. Previously, it was necessary to do a daily check of BlueSnap reports or wait for a letter in the mail to learn about about the status of such transactions.
- IN_PROGRESS : Batch processing is in progress
- IN_QUEUE : Batch was created and is waiting to be processed
- PENDING: Invoice was not yet approved.
- SUCCESS: Invoice was approved and the shopper's account was debited.
- FAIL: Invoice was canceled and the shopper's account was not debited.
- REFUNDED: Invoice was refunded in response to a chargeback or refund requested by the shopper.