Note:

In order to proceed with Server-Side integration Checkout needs to be activated.


You need to pass three steps to form the checkout widget:

  1. Get authorized as a merchant.

  2. Create a server session to generate a cashier token.

  3. Create a Checkout session to load the Checkout in your website.


Authorization

To get authorized as a merchant you need to establish a connection with the BridgerPay system by using the POST request below.

The response will contain "access_token.token" (JWT token).
Use this value as a Bearer token when calling the following method.

  1. Create a new POST request with URL provided below.
    Content-Type: application/json

    https://api.bridgerpay.com/v2/auth/login

  2. Press on the “body”, select “raw” and choose “JSON” from drop down list.

  3. In the Body of the request paste the text shown below and replace user_name and password with the credentials generated in Authorization step.

    { 
    "user_name": "{{user_name}}",
    "password": "{{password}}"
    }

    The request for Authorization should look like this:

    The response of the request will contain an Bearer token that will be used further.


Cashier Token generation

Create a server session for BridgerPay's Checkout to generate a unique cashier token by using the POST request below.


You will find session data, business data, personal information and other input parameters.

The more information you specify, the less the customer will need to enter manually in the Checkout form.

Please follow the steps below:

  1. Create a new POST request with URL provided below
    Content-Type: application/json
    Authorization: Bearer {{ACCESS_TOKEN}}
    Accept-Language: EN

    https://api.bridgerpay.com/v2/cashier/session/create/{{API_KEY}}

    *API key should be replaced with your API key generated during activation process.

  2. Press on the “body”, select “raw” and choose “JSON” from drop down list.

  3. In the body of the request paste the text from below and change fields with your credentials along “cashier_key” that was generated during Activation process.

    { 
    "cashier_key": "{{CASHIER_KEY}}",
    "order_id": "",
    "first_name": "",
    "last_name": "",
    "email": "",
    "language": "en",
    "currency": "",
    "country": "",
    "state": "",
    "address": "",
    "city": "",
    "zip_code": "",
    "amount":,
    "currency_lock": true,
    "amount_lock": true,
    "phone": "",
    "affiliate_id": null,
    "tracking_id": null,
    "platform_id": null,
    "payload": null,
    "hide_header": true
    }

    Mandatory fields:

    "cashier_key" - provided by BridgerPay.
    "order ID" - transaction ID within your system.
    "currency"
    "country"
    "Amount" - required if you create a server session first.

    Note:

    state” - only mandatory for countries that have states (e.g U.S).

    "currency_lock": true - this parameter forces customer to pay in the currency shown without change in the UI.

    "amount_lock": true - this parameter stops the user from changing the amount on the UI.


    A request for Server Session should look like this:

  4. Press on Authorization, select Bearer Token from the type dropdown list and paste Bearer token that was generated in Authorization step.

  5. By pressing Send cashier token will be generated.


Checkout Form

Insert the code snippet shown below into your website code. At this step, the server-side checkout can be integrated as an embedded script.

*Please replace “data-cashier key” with credentials generated during Activation process and “data-cashier-token” generated in the previous step.

<!DOCTYPE html> 
<html>
<body>
<script src="https://checkout.bridgerpay.com/v2/loader"

//session parameters (required)

data-cashier-key="{{CASHIER_KEY}}"
data-cashier-token="{{CASHIER_TOKEN}}"

>
</script>
</body>
</html>

There are several parameters that can be used in the script tag, such as the ones shown below.

data-single-payment-method=""

This parameter is making the shopper to pay using a particular method (e.g. "credit_card" or "apm".
If specified, the step which the customer could choose a method at is skipped, and the form of the "imposed" payment method is shown right away)

data-single-payment-provider=""

This parameter making the shopper pay through a particular PSP (e.g. "zota_pay"). If specified, the step which the shopper could choose a method at is skipped, and the form of the "imposed" PSP is shown. Only this PSP will be requested to execute the payment transaction.

Additionally, when this parameter is used for a credit card PSP, you need to make sure that data-single-payment-method is also present and set to credit_card.
Cascading will not be in effect and only the specified credit card PSP will be used.

data-theme=""

This parameter allows to change the theme of the Cashier interface. The possible options are "dark" (used by default), "light", and "transparent".

Based on the selected parameters checkout should be displayed.

Note:

If you want to show only alternative payment method (APM), it is required to send both a single payment method and a single payment provider.

For Credit Card, you can specify the single payment method which will show only the credit card form. In case you have more than one solution available, cascading (retry) will not work if you call PSP credit card directly.
AKA - use data-single-payment-provider.


*Didn’t find what you were looking for?
Visit our FAQ page regarding integration questions or contact us via live chat.


Integration Update for CRM(v2)

Important note:
This guide is made for users who are using V1 of BridgerPay platform and need to migrate to V2. Please skip this guide if you’re a new user.

For all integrations:
For any endpoint URL that you integrated from our documentation, please make sure you replace {{version}} with v2. We have updated the checkout URL:

For iFRAME integrations:
from: https://cashier.bridgerpay.com
to: https://checkout.bridgerpay.com/v2/


For SCRIPT integrations:
from: https://cashier.bridgerpay.com/loader
to: https://checkout.bridgerpay.com/v2/loader


For API integrations:
from: https://api.bridgerpay.com/v1/
to: https://api.bridgerpay.com/v2/

Since you will have a brand new Bridger Admin you will also have new API credentials. When you are ready to move to your new Back office you will need to switch to your new API credentials and processing will be moved to BridgerPay V2!

Bear in mind that no changes need to be made in the API requests themselves and no parameters are affected.

Did this answer your question?