Payment Gateway
  • 20 Oct 2022
  • 5 Minutes to read
  • Dark
    Light

Payment Gateway

  • Dark
    Light

In Blackthorn Payments, a Payment Gateway record is synonymous with a gateway (i.e. Stripe, Authorize.net etc.) account. Each Payment Gateway record you create connects your Salesforce org to one gateway account, in either test or live mode. To have your gateway account in both test and live mode, create two Payment Gateway records. There is no limit on the number of Payment Gateway accounts you can connect to your org.

Note on Payment Gateway Records

Do not change your Payment Gateway record from test mode to live mode or vice versa by clicking Connect to Gateway or checking/unchecking the Test Mode checkbox. Instead, create a new record for the other mode you wish to enable.

Supported Payment Gateway Providers

Blackthorn supports several Payment Gateway providers. The primary Payment Gateway providers are Stripe, Authorize.net, and Spreedly. Blackthorn also supports several providers via the primary providers.

Stripe

  • Alipay
  • Bacs Direct Debit
  • Bancontact
  • EPS
  • Giropay
  • iDEAL
  • Plaid (must be set up in Stripe)
  • SEPA Direct Debit
  • SEPASOFORT

Spreedly

  • Cybersource (Blackthorn only supports Events Checkout using credit card Payment Methods.)

Events Checkout

Blackthorn also supports two Payment Gateway providers that only work with Events Checkout. They are TouchNet and CashNet.

First Payment Gateway Record

Your first Payment Gateway record, named "primary" was created automatically during the Setup Wizard.

  1. Navigate to the Payment Gateway object.

Lightning/Classic: Payments (Admin) App > Click the "Payment Gateways" Tab

  1. Select All from the list of List Views.
  2. Click on the record named "primary".

If you connected to your gateway account in test mode, the Test Mode field will be checked

  • The Default field is checked.
    Objects with a Payment Gateway lookup field (such as Transaction and Payment Method) will default to the Payment Gateway record marked "Default" if the field is left blank on save.

  • The Gateway Information section provides all the connection details.
    If these fields are blank, data in Salesforce will not process in the gateway. Do not copy your Stripe API keys and insert them here as these keys are different than your Stripe keys (they are OAuth keys). You can only get them by clicking the Connect to Gateway button.

H_01_07_first payment gateway record

Create Payment Gateway Records (for Stripe)

Create a Payment Gateway for Stripe

Each Stripe account mode (test and live) needs its own Payment Gateway record. This is to ensure that your data is separated from "Live" and "Test".

For example, if you connected to your account in Test Mode during setup, create a new Stripe Payment Gateway record for live mode.

  1. Navigate to the Payment Gateway object.

Lightning/Classic: Payments (Admin) App > Click the "Payment Gateways" Tab

  1. Click New.
  2. Populate the following fields:
    • Payment Gateway Name = Name for this record
    • Webhook Label = Name for the webhook URL
      This is needed to configure webhooks.
    • Default= Check this field if you want this as your default Payment Gateway.
      If you have multiple Stripe Payment Gateway accounts, you can change which one should default.
    • Test Mode = Check this field if you are connecting to the test mode in your Stripe account.
  3. Click Save.
  4. Click the Connect to Gateway button.
  5. Enter your Stripe Credentials.

Once you sign in, all fields under the "Gateway Information" section in the Payment Gateway record will be filled out.

There will be no data in the Related Lists section. Connecting to your Stripe Account does not automatically sync existing data over into Salesforce. If you have data in your Stripe Account that needs to come over into Salesforce, see our Historical Sync documentation.

Available and Pending Balances

There are several fields and a button on the Payment Gateway object to track your available and pending balances for both Salesforce and Stripe. Having both balances allows you to compare your Stripe and Salesforce balances.

Stripe

Stripe Balance Available and Stripe Balance Pending
These fields are updated via the Stripe's Balance.Available or Account.Updated Webhook Events.

Stripe Balance Last Updated
This is a date and time field that is updated when the balances are updated, giving you an insight as to when the two balances were last updated.

Held in Reserve
This field shows the funds held from your account due to negative balances on Connected Accounts. This field is automatically updated from Stripe through a webhook.

Salesforce

Calculate Salesforce Balances From
This field is for calculating historical transactions that were processed through Stripe before the balance fields were packaged.

Salesforce Balance Available and Salesforce Balance Pending
These fields are automatically calculated based on related Transactions.

  • If the related Transaction's Balance Status = "Available", then the Retained Net Amount is rolled up to the Salesforce Balance Available.
  • If the Transaction's Balance Status is "Pending" then the Retained Net Amount is rolled up to the Salesforce Balance Pending.

Stripe Balance Last Updated
This is a date and time field that is updated when the balances are updated.

Balance(s) Incorrect 
When this field is checked, it means the Stripe Balance Available and Stripe Balance Pending and Salesforce Balance Available and Salesforce Balance Pending do not match. Often, they won't match based upon timing of the Stripe webhook and the Salesforce batch process running.

Update Balance button
There is a daily apex job that runs and updates the Salesforce and Stripe available and pending balances. Clicking this button forces the job to run immediately.

IMPORTANT

If you have a high Transaction volume, don't click the Update Balance button. You will run into a query limit error.

H_01_07_available pending balances_salesforce

Scheduled Apex Job

There is Scheduled Job called, Blackthorn | Payments Balance Update that runs daily. This job updates the Stripe Balance Available and Stripe Balance Pending and Salesforce Balance Available and Salesforce Balance Pending fields on the Payment Gateway record(s).

  1. Navigate to Setup.
  2. In the Quick Find/Search, type in and click Scheduled Jobs.

H_01_07_scheduled apex job

Block Amex Payment Methods

Some providers like Stripe charge higher fees for using the American Express Payment Method. In order to help customers mitigate these extra fees we've provided a field on the Payment Gateway object to block Transactions from the REST API that are attempting to charge a payment with an American Express card. This field is labeled Block Amex Transactions In Rest API and can be used with:

  • PayLink
  • DocumentLink
  • REST API requests (custom front-end code)

Don't forget to add this field to your Payment Gateway page layout if you would like to use it.

Here is an example of what a customer will see if the Block Amex Transactions In Rest API checkbox = "True":

H_01_07_block amex pm

Payment Gateway Owner - Known Limitation

If you have configured a Sharing Rule for the Payment Gateway object, there is a known limitation in Salesforceow if the Payment Gateway owner is listed as "Automated Process User". If your Payment Gateway Owner field is displaying the value "Automated Process User" you may notice that Sharing Rules are not being applied. The work around for this is to update the Owner field to reflect another user in your org such as the System Administrator. Read more about this here.

Troubleshooting

If you have received an error with your Payment Gateway or have a question, please view our Troubleshooting page.