TopUp Transaction

In this section you will learn how to process a TopUp transaction

TopUp Overview

If the final amount of the transaction is likely to exceed the amount of the PreAuthorization, a top-up can be done. A top-up transaction increments the original preAuthorization amount and requests authorization of the incremented amount. A merchant may process one or more top-up transactions or none at all.

How to process a TopUp transaction request message

The merchant's system Posts a JSON PreAuthorization transaction message to the ANYpay Gateway. Section Card Transactions describes the elements required to build a TopUp transaction request transaction message.

📘

Key elements of a TopUp transaction request message

Type MUST be set to [ecom.topUp] or [mailorder.topUp]

clientSystemInvoiceId Must match the same value used in the associated PreAuthorization transaction

cardTokenizedNumber Must match the same value returned in the associated PreAuthorization transaction

An example of a TopUp Transaction message can be seen below.

{ 
  "merchantId": "BDD", 
  "storeId": "BDD500000005", 
  "userId": "BDDTest", 
  "type": "ecom.topUp", 
  "amount": "10.00", 
  "currencyCode": "GBP", 
  "clientSystemInvoiceId": "1", 
  "clientSystemTransactionId": "1-2",
  "accountDetails": {
    "cardTokenizedNumber": "9997000000005071111"
  }
}

Handling a Card Transaction

An example of a TopUp transaction response message can be seen below.

{
  "id": "7890ff90-e277-4ead-a7d8-6929a3f83286",
  "state": "Authorised",
  "providerStateCode": "000",
  "providerStateMessage": null,
  "currencyCode": "USD",
  "accountDetails": {
    "cardNumber": "444433******1111",
    "tokenizedCardNumber": "9997000000005071111",
    "isVisaCheckout": null
  },
  "details": {
    "providerMerchantId": "542929008043127",
    "providerTerminalId": "00630376"
  },
  "stateDetails": {
    "approvalCode": "06268A"
  }
}
{
  "code": "4017740",
  "details": {
    "message": "Invalid username or password"
  }
}