Integration Guide BJPAY

This document is intended for Merchant of BJPAY that wish to connect to BJPAY via API to access direct .

Getting started

Some things to consider before integration :

  • Prepare your Client ID and Client Secret. You can get Client ID and Client Secret after register to our Merchant Portal
  • Set your Content-Type in header to application/json
  • All request via API will use only the POST method

Security

During the onboarding process you will be provided with Client ID and Client Secret or you can retrieve it from our Merchant Portal.

To processed further integration, you must whitelist our IP Address into your Firewall

  • 188.166.255.162

In addition we will request your server IP address(es) for whitelisting to make sure requests are coming from a trusted client.

Signature Generation

When notify payment is triggered, Merchant must verify signature that have been send through X-Signature Header into provided callback url.

There's two things that need to be prepare in signature generation such as Payload and Key. To generate payload, you must concate timestamp, referenceNumber, paymentCode and amount. Here's an implementation in Javascript:

const timestamp = "2024-09-20T20:32:36+07:00"
const referenceNumber = "TX_556622123344"
const paymentCode = "GOPAY"
const amount = 15000

// Use ':' as a separator payload.
const payload = `${timestamp}:${referenceNumber}:${paymentCode}:${amount}`

Formula for the Key is md5(client_id, client_secret). Here's the implementation in Javascript:

const md5 = require('md5');

// Use ':' as a separator payload.
const formulaKey = `${client_id}:${client_secret}`
const key = md5(formulaKey)

And finally, compose the Signature using hmac_sha256(payload, key):

const md5 = require('md5');
const crypto = require('crypto');

// ...
// Payload and formula generation code goes here ...
// ...

const hmac = crypto.createHmac('sha256', key);
const data = hmac.update(payload);

// Signature result
const signature = data.digest('hex');


Base URL

There are 1 environments. Production with the following Base URL :

  • api.bjpay.co.id for live transaction.

Was this page helpful?