Server-to-server

Server-to-server offers an alternative solution for establishing a server-to-server connection with BridgerPay's API. This integration method empowers you to develop a customized checkout form on your website, seamlessly collecting card information directly from your customers.

What is server-to-server API

Through the utilization of server-to-server API, you can leverage your own front-end solution to gather all the necessary information from customers. Subsequently, you will initiate the payment request method to facilitate transaction processing. Following this, you can dynamically display the relevant web page to the customer based on the response received from the acquirer. This could encompass scenarios such as presenting a 3D secure dialog or indicating the outcome of the transaction (e.g., successful or declined).


How to initiate a server-to-server transaction?

To achieve server-to-server transaction, please follow the requirements below:

  1. Get authorized as a merchant.
  2. Collect a fingerprint of the user's device.
GET https://api.bridgerpay.com/mpi/v2/{api_key}/fingerprint?country={country}&currency={currency}&cardBin={cardBin}
Content-Type: application/json
Authorization: Bearer {{ACCESS_TOKEN}}

πŸ“˜

To enhance security measures, it may be necessary to collect a unique fingerprint of the user's device. However, the specific requirements for obtaining this fingerprint may vary depending on the payment service provider (PSP) with which you are connected. It is recommended to consult with your designated onboarding specialist to determine the precise guidelines and procedures for collecting the device fingerprint in accordance with the PSP's specifications. They will provide you with the necessary guidance to ensure compliance and seamless implementation.

Please be aware that if you attempt to collect fingerprint information from a payment service provider (PSP) that does not require such data, you may receive an empty response when listening to the generated iframe.

  1. Copy the response and place the content inside the iFrame at the page you will initiate the payment at.
  2. Listen to the event from the new iFrame and collect the ddc information.
addEventListener('message', function (e) {
    yourVariable = JSON.stringify(e.data.fingerprint);
});
  1. Call the create deposit request with the collected finger print. Upon calling this request, the response received will include the following information:
    Status: "approved"
    Status: "declined"
    Status: "in_process"
POST https://api.bridgerpay.com/mpi/v2/{api_key}/deposit/credit-card
Content-Type: application/json
Authorization: Bearer {{ACCESS_TOKEN}}
{
  "cashier_key": "{cashier_key}",
  "order_id": "g173aa11",
  "first_name": "John",
  "last_name": "Smith",
  "email": "[email protected]",
  "currency": "EUR",
  "country": "BE",
  "state": null,
  "address1": "Rue du Pont Simon 115",
  "city": "Appelterre-eichem",
  "zip_code": "9900",
  "amount": 15.1,
  "phone": "+328141112233",
  "card_holder_name": "John Smith",
  "credit_card_number": "4012888888881881",
  "expire_month": 1,
  "expire_year": 2022,
  "cvv2": "111",
  "ddc":{"psp_name":"{string}"} 
}

The specific status provided in the response will indicate the outcome of the transaction, whether it has been approved, declined, or is currently in the process. In the case of "in_process," the URL will direct the user to the 3D Secure dialog box, allowing them to securely verify and confirm the payment.


How to initiate a server-to-server transaction using a single payment provider?

POST https://api.bridgerpay.com/mpi/v2/{api_key}/deposit/credit-card/{psp_name}
Content-Type: application/json
Authorization: Bearer {{ACCESS_TOKEN}}
{
  "cashier_key": "{cashier_key}",
  "order_id": "g173aa11",
  "first_name": "John",
  "last_name": "Smith",
  "email": "[email protected]",
  "currency": "EUR",
  "country": "BE",
  "state": null,
  "address1": "Rue du Pont Simon 115",
  "city": "Appelterre-eichem",
  "zip_code": "9900",
  "amount": 15.1,
  "phone": "+328141112233",
  "single_payment_mid_alias":"PSP-CreditCard-MID-1",
  "card_holder_name": "John Smith",
  "credit_card_number": "4012888888881881",
  "expire_month": 1,
  "expire_year": 2022,
  "cvv2": "111",
  "ddc":{"psp_name":"{string}"} 
}

πŸ“˜

If you have configured multiple MIDs for the selected PSP, you can choose which one to use for the payment by sending the single_payment_mid_alias parameter with the MID name that corresponds with the configuration present within your BridgerPay dashboard.