Integrating BlueSnap and Salesforce using Chargent

BlueSnap
Connect BlueSnap and Salesforce with Chargent

See all BlueSnap transactions, manage refunds, send payment links and more, all inside Salesforce with Chargent, the top rated payments app on the Salesforce AppExchange.

Not yet a Chargent customer?

Contact us for a no-obligation 30 day trial, and see for yourself!

Overview

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

Connecting 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 tokenization for processing credit card payments.

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 obtain a sandbox account, complete the form on the sign up page.

sandbox

You will receive an email to verify your account. Click the link and fill out the necessary information. Once completed you will be able to access your BlueSnap Dashboard.

Whitelist IP Address

Login to your BlueSnap account. You will need to whitelist all of Salesforce IP addresses and ranges in order to process payments using your API username and password.

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.

ip

Note: If you don’t want to use IP Verification you can disable this by clicking the check box below showing Disable IP Checking. This will allow you to send transactions to BlueSnap without verifying the IP address.

ip

API User ID, API Password, and Store ID

Access the API settings page again (if you aren’t already there from whitelisting your IP addresses), and you will 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 (we will discuss this more in the next section).

api settings

Prior to setting up BlueSnap in Salesforce

Prior to following the steps in this guide, Chargent should be installed in your Salesforce org and licenses assigned. If you have not yet installed, a 30 day free trial is available on our Installation Page.

Setting Up Salesforce to Connect to BlueSnap

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

  • Click on the App Launcher on the top left side in Salesforce.
    applauncher
  • Select Chargent as the App
  • Select the Chargent Settings Tab
  • Choose Chargent Setup Wizard
  • Select Yes when asked if you have a Payment Gateway account.
  • Select BlueSnap from the dropdown and follow the prompts to configure your gateway
    chargent settings
  • Select Test Transactions for testing or Live Transactions if you are looking to process real time payments.
  • Follow the prompts to configure your gateway.

You will need the following information:

  • Add your credentials based on your Sandbox (Test) or Production Live BlueSnap account.
    • User ID: This is your BlueSnap User ID (Agent Code)
    • Password: This is the BlueSnap Password

Continue through the Setup:

    • Use Tokenization? (recommended)
    • Select your Payment Gateway Currency (USD, CAD, etc..)
    • Do you want to use Payment Console? (Requires Platform Edition and higher)
    • Select the Payment Methods you accept
      • Card: Credit Cards you will be accepting? (Visa, MasterCard, etc…)
      • Bank Account: If your Gateway allows for bank account transactions, you should set the Direct Debit Network to ACH for BlueSnap.
      • ACH Validation (optional – disable if you are not using Lyon’s Validation): If you use Lyons ACH verification, you should enable this feature to validate ACH transactions. The ACH Validation feature works with Lyon’s ACH Validation service to validate the bank account and store the validation in your Salesforce Org. During your Gateway Setup, you will authenticate your Lyons credentials, and Chargent uses a referral relationship for all first-time transactions. For more information about implementing validation for your ACH transactions, see our ACH Validation documentation. Select payment methods
  • Setup your Payment Console (Premium feature for Platform Edition)
    • Show Charge Button
    • Show / Create Update Token Button
    • Show Authorize Button
  • Will you be using recurring, scheduled, or installment payments? Do you want to set up Chargent Recurring Billing for subscription billing.
    • If Yes, you will be prompted to select the time. Chargent recommends 3am but you can choose no and select the days and times of the week for the batch to run.

Congratulations! You successfully configured a new gateway. Now you can easily start payments.

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

  • US – ACH (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

Testing using Chargent Anywhere

Testing with Payment Console

To test using the Payment Console, you want to navigate to any record in your Sandbox that has the Chargent Anywhere Component enabled.

  1. Click the [PaymentConsole] button
  2. If you are using multiple gateways select your gateway from the dropdown otherwise continue to step 3
  3. Enter all the Billing Information and click [Next]
  4. Enter in a test credit card number, expiration date, and CVC code based on the BlueSnap test credit cards below. If you are testing ACH you can use the BlueSnap Bank Account test numbers.
  5. Click the [Charge] button.

You should receive a green box showing Approved.

record

Testing using Payment Request

To test using a Payment Request you want to be sure you have the Chargent Payment Request feature set up as outlined in our documentation.

  1. Click the [Send Payment Request] button
  2. If you have multiple Payment Request templates set up you will first choose what template you want to use.
  3. Enter an email address where you want to send the test Payment Request along with any amount.
  4. Enter a Contact name (Optional)
  5. Click the [Send Request] button

Send Payment Request

When you receive the email, click the secure link for the Payment Request. Use one of BlueSnap Credit Cards or bank account testing numbers testing numbers to complete the payform and submit the payment.

Card Bank Payment

You should receive a green box confirmation

Card Bank payment

BlueSnap Test Credit Cards

For testing BlueSnap with Latin America (LatAm) accounts and integrations please see the full BlueSnap testing information from their website.

Card Type Card Number Exp. Date CVV Code Country Result
Amex 374245455400126 05/2023 Success
Amex 378282246310005 05/2023 Failure
Discover 60115564485789458 12/2023 US, USD Success
Discover 6011000991300009 12/2023 US, USD Success
JCB 3566000020000410 02/2023 123 CA, CAD Success
JCB 3530111333300000 03/2023 JP, JPY Failure
MasterCard 5425233430109903 04/2023 Success
MasterCard 5425233430109903 12/2004 Invalid Exp Date
MasterCard 2222420000001113 08/2020 Success
MasterCard 2223000048410010 09/2020 Success
Visa 4263982640269299 02/2023 837 Success
Visa 4263982640269299 04/2023 738 Success
Visa 4917484589897107 01/2023 ARS, EUR, USD Failure

BlueSnap Test ACH

Routing Number Account Number Response
123456789 123456789 Decline
Any number except 123456789 Any number except 123456789 Success

Congratulations!

You are now up and running with BlueSnap in Salesforce!

We recommend additional testing prior to going live, as well as running a few live transactions prior to launch (test and live BlueSnap environments are not always the same.

For additional details on testing and validating your BlueSnap Salesforce integration, please see the additional sections below.

Sending Live Transactions from a Salesforce Sandbox

When Chargent is installed in a Salesforce Sandbox, transactions are typically 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, checking the Test Endpoint checkbox on the Gateway record will route transactions to the test environments provided by the gateway.

Note: Some gateways use the same endpoint for live and test environments. For these gateways, the Chargent application does not prevent live transaction processing. As such, it is best practice to deactivate your live gateway records in orgs used for testing.

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.

BlueSnap Production endpoint URL:

https://ws.bluesnap.com/

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 BlueSnap gateway, a new transaction record is created in Salesforce. The listing of transactions can be found under the Related tab on the Chargent Order.

chargent ord

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.

details

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

transaction details

You’ll see a transaction listing similar to this one.

invoice

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.

reference

Moving to Production

You’ll need a BlueSnap production account for this step. 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.

Follow these steps to configure the production integration in Salesforce:

  1. First, obtain the production credentials for the BlueSnap production gateway account—similar to the method given for sandbox credentials in Obtain a BlueSnap Sandbox Account.
  2. Also get the production API Username and API password, in a manner similar to the instructions found in the API User ID, API Password, and Store ID section above.
  3. Repeat the steps in the Configuring Salesforce for BlueSnap Integration section above, but substitute the production credentials.
  4. Repeat the steps in the Testing the BlueSnap Integration section above with respect to the SalesForce production environment, using the production credentials.
  5. 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.

Tokenization

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

BlueSnap stores your customer’s information and replaces it with a unique identifier or token. Chargent then stores the token in the Token field in Salesforce, to be used for future payments.

The BlueSnap token identifies the credit card as well as the associated billing, shipping, and card information of a customer.

Chargent by default does not store any sensitive cardholder and account data in Salesforce this is accomplished by using the Payment Console feature which is available in the Platform Edition of Chargent. With Payment Console Chargent users can create a BlueSnap token without ever saving sensitive data to the Salesforce database.

Tokenization should already be enabled, if you used the Gateway Wizard . If you haven’t already set up tokenization during the initial configuration of your BlueSnap account in Salesforce, this section will assist you in setting it up.

  1. In the top left corner click on the App Launcher
  2. Search and select Gateways
  3. Click on BlueSnap
  4. Click Edit
  5. Check the box that Says Tokenization
  6. Under the Credit Card / Bank Account handling field choose one of the following.
    • Never Clear
    • Clear After Successful Charge
    • Clear After All Transactions
    • Clear When Token Present (Recommended):
  7. Click Save.

record

Note: The token is stored in Chargent’s Token field in Salesforce after your first successful transaction, and the credit card fields are handled as specified in the procedure.

Transaction Synchronization

Chargent has always sent charges and authorizations to the payment gateways, and records the result in a real-time Transaction in Salesforce. On select gateways like BlueSnap, Chargent can also update Salesforce records long after the initial transaction—for ACH 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 receive any updates.

To schedule the batch, navigate to Setup > Develop > Apex classes, and then click the Schedule Apex button.

Batch Name: ChargentOrders.scheduledBatchUpdateTransactionStatus()

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 the status of such transactions.

Card Transactions

  • SUCCESS
  • FAIL
  • IN_PROGRESS : Batch processing is in progress
  • IN_QUEUE : Batch was created and is waiting to be processed

ACH Transactions

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

Gateway Field Mapping

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
Order Information > softDescriptor
Customer IP shopperIpAddress
Token < vaultedShopperId