Integrating BlueSnap with Salesforce using Chargent
Easily connect BlueSnap and Salesforce with Chargent,the leading payments app on the Salesforce AppExchange. See all BlueSnap transactions, manage refunds, send payment links and more, all inside Salesforce.
Contact us for a no-obligation 30 day trial, and see for yourself!
This guide contains instructions for integrating your Salesforce.com environment with the BlueSnap payment gateway in as little as 5 minutes —using the Chargent payment processing application.
Click a link to go directly to one of these sections:
- Your BlueSnap Sandbox Account
- Prior to setting up BlueSnap in Salesforce
- Setting Up Salesforce to Connect to BlueSnap
- Add a BlueSnap Gateway record in Salesforce using Chargent’s Gateway Wizard.
- Add a BlueSnap Gateway record in Salesforce (Chargent versions prior to 5.40)
- Testing the Integration
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.
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
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.
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.
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).
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.
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 BlueSnap.
- Click the gear icon on the top right and select Settings
- Under Security select Remote Site Settings
- Locate BlueSnap_Test and click edit
- Check the Active box
- Click Save
- Do the same for BlueSnap_Test
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.
- Select Chargent as the App
- Select the Chargent Settings Tab
- Choose Chargent Setup Wizard
- Do you have a Payment Gateway account - Select Yes
- Select BlueSnap as your Payment gateway.
- 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 API Username
- Password: This is the BlueSnap API Password
Other information that will be asked:
- Will you be using tokenization? (recommended)
- What currency will you be using? (USD, CAN, etc.)
- What payment methods will you be accepting?
- Credit cards and/or Direct Debit / 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 BlueSnap Gateway record in Salesforce (Chargent versions prior to 5.40)
- Click on the AppLauncher on the top left side in Salesforce.
- In the Search for apps or items box, Search for Gateways and select
- Click New and select BlueSnap as the Gateway Type
- Map the following fields in Chargent with your credentials from BlueSnap:
- Merchant ID: BlueSnap API User Name
- Merchant Security Key: BlueSnap API Password
- Active - Check to make the Gateway active
- Use Tokenization - If you are planning on using BlueSnap 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 Direct Debit / ACH
- 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.
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 capture them.
- 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
- Show Charge Button
- Show Authorize Button
Your Gateway page should look similar to the figure below once you have saved.
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.
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.
Testing the Integration
Now that you have created the BlueSnap 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 take payments within Salesforce.
Create a Chargent Order in Salesforce to run test transactions
- Click on the App Launcher in the top left side and select Chargent as the App.
- Click the Chargent Orders Tab.
- Click on New
- Enter in the following information:
- Account: The Account the Chargent Order should be associated with.
- Payment Type should either be credit card or check depending on if you are testing credit cards or Direct Debit / ACH (electronic check)
- Billing Information
- Billing First Name
- Billing Last Name
- Billing Address
- Billing City
- Billing State / Province
- Billing Zip Code / Postal Code
- Billing Email Address(if you want to test the email receipt that gets triggered upon a successful transaction)
- Charge Amount- The amount you want to test with in order to process a test transaction.
- Manual Charge check this box to enter a number directly in the Charge Amount. If you are entering Subtotal, Tax, and/or Shipping then the Charge Amount will be automatically calculated and the Manual Charge box does not need to be checked.
- IP Address c(if you are using IP Check in BlueSnap). This field may need to be added to your Page Layout in Salesforce. You can also disable IP check from within in your BlueSnap account settings.
- Credit Card Number = See BlueSnap test credit card information. BlueSnap uses different test credit card numbers to determine the response message and whether it’s approved or declined for specific reasons. For ACH testing see BlueSnap’s Test ACH Account and Routing Numbers.
- Card type (Visa, MasterCard, etc..) or Bank Account Type for Direct Debit / ACH (Checking or Savings).
- Card Expiration Month and Card Expiration Year should be in the future
You should receive a popup that shows the test transaction was approved.
BlueSnap Test Credit Cards
|Card Type||Card Number||Exp. Date||CVV Code||Country||Result|
|MasterCard||5425233430109903||12/2004||Invalid Exp Date|
|Visa||4917484589897107||01/2023||ARS, EUR, USD||Failure|
BlueSnap Test ACH
|Routing Number||Account Number||Response|
|Any number except 123456789||Any number except 123456789||Success|
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
- Understanding Transactions
- Moving to Production
- Transaction Synchronization
- Gateway Field Mapping
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.
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).
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.
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.
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:
- 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.
- 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.
- Repeat the steps in the Configuring Salesforce for BlueSnap Integration section above, but substitute the production credentials.
- Add a BlueSnap Gateway record in Salesforce using Chargent’s Gateway Wizard
- Add a BlueSnap Gateway record versions prior to v5.40
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.
- In the top left corner click on the App Launcher
- Search and select Gateways
- Click on BlueSnap
- Click Edit
- Check the box that Says Tokenization
- 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):
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.
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.
- 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.
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|