Webhook

The webhook integration provides merchants with real-time notifications regarding the status of their transactions. By integrating our webhook events into your system, you can stay informed about various events, enabling you to take appropriate actions based on the received information.

We will push events to the webhook URL you provide, and the request header will carry a signature for validating the request's authenticity.

Method: POST

Our request headers

contentType: 'application/json',
Signature: '74f102b356ff5d44e4bd419259ae36d270badb2248939ac6120066c767720cac'

Below is the method for validating the signature.

const HmacSHA256 = crypto.createHmac('SHA256',  <AppSecret>);
const signature = HmacSHA256.update(JSON.stringify(<body data>)).digest('hex');

Our post data

//success
{
  status: 200,
  message: 'success',
  data: {
    reference: 'X1212312323426',
    orderId: 1140634,
    orderNo: 'AP2406241653394339',
    mchId: 30327862,
    gameId: 1450015065,
    productId: 1637524,
    productName: '60 UC',
    displayPrice: '0.99',
    displayCurrency: 'USD',
    salePrice: '0.72',
    saleCurrency: 'USD'
  }
}
//failed
{
  status: -1,
  message: 'failed',
  data: {
    reference: 'X1212312323426',
    orderId: 1140634,
    orderNo: 'AP2406241653394339',
    mchId: 30327862,
    gameId: 1450015065,
    productId: 1637524,
    productName: '60 UC',
    failedType: '',
    failedReason: ''
  }
}

Other Considerations

1. notify callback notification response

Must return a clear result, the HTTP response code should be 200, and return the specified string: success (non-json format, does not contain other symbols of the plain string); if the return of other results, will trigger 3 retries.

Last updated