Payment Retry (EasyCard)

This API implement is necessary.

If the Retry value is 1 or more than 1 (Error code: 000125 or 0462xx) in the response data during transactions, please call Retry API

When some processes are not completed or are interrupted (eg. Cards are removed from the reader during payment process), the translations will not be completed and will lead some errors. Please follow the process below to complete the transaction:

  1. Check the reason of transaction failure, for example, re-place the card on the reader.

  2. Transaction retry will be made 3 times, if it is still failed at the 3rd time (Retry=3), the transaction will not be completed and the retry will no longer be available. Please report this transaction to EasyCard Company.

Request

Item

Mandatory

Data Type

Sample

Description

Method

YES

String(5)

31800

Fill in 31800 (EasyCard transaction)

ServiceType

YES

String

Payment

Enter the Response>Header>ServiceType of the erroneous transaction

MchId

YES

String

Account0001

Enter the Response>Header>MchID of the erroneous transaction

TradeKey

YES

String

sha256...hash

Marchant password provided by intella, this password must be encoded by SHA256

CreateTime

YES

String

20180101120000

Request time, the format is "yyyyMMddHHmmss"

Data

Item

Mandatory

Data Type

Sample

Description

Retry

YES

String

1

Enter the Response>Data>Retry of the erroneous transaction

DeviceId

YES

String

01301234

Enter the Response>Data>Request>DeviceID of the erroneous transaction

Amount

YES

String

50

Enter the Response>Data>request>Amount of the erroneous transaction

StoreOrderNo

YES

String

PO12345678

Enter the Response>Data>OrderId of the erroneous transaction

TerminalTXNNumber

YES

String

091212

Enter the Response>Data>request>TerminalTXNNumber of the erroneous transaction

HostSerialNumber

YES

String

091212

Enter the Response>Data>request>HostSerialNumber of the erroneous transaction

RefundKey

(YES)

String

sha256...hash

Refund password. If the ServiceType is Refund/Cancel/EZCRefund, this field will be required

ActionType

(YES)

String

If the ServiceType is Cancel, it can be obtained from the Response of erroneous transaction

Response

Header

Item

Mandatory

Data Type

Sample

Description

StatusCode

YES

String

0000

StatusDesc

YES

String

STATUS_SUCCESS

Description of transaction status

Method

YES

String

31800

Payment method code (EasyCard payment is 31800)

ServiceType

YES

String

Payment

Selected Scan2Pay Service type, same as the ServiceType in Resquest

MchId

YES

String

Account0001

Merchant ID

ResponseTime

YES

String

20180101120000

Transaction response time, the format is "yyyyMMddHHmmss"

Data

Item

Mandatory

Data Type

Sample

Description

request

YES

JSON String

Data in request

TXNResult

YES

String

Success

Transaction result

Retry

YES

String

0

The Retry value of next request

ErrorCode

YES

String

000000

OrderId

YES

String

PO12345678

Order number

NewAESKey

NO

String

For internal use

The fields in Data are different depend on the transaction result and type. Please refer to the Response code of each function (eg. Payment/Refund)

API Example

Transaction retry error (payment)

Request

{
  "Header": {
    "Method": "31800",
    "ServiceType": "Payment",
    "MchId": "Acoount0001",
    "TradeKey": "9af15b336e6a..........65606529a0",
    "CreateTime": "20180920152226"
  },
  "Data": "{\"DeviceId\":\"01304108\",\"Retry\":\"0\",\"Amount\":\"1\",\"StoreOrderNo\":\"PO123456\",\"Body\":\"milk\"}"
}

Response

{
  "Header": {
    "StatusCode": "0000",
    "StatusDesc": "STATUS_SUCCESS",
    "Method": "31800",
    "ServiceType": "Payment",
    "MchId": "Account0001",
    "ResponseTime": "20180920152235"
  },
  "Data": {
    "request": {
      "Amount": "1",
      "Retry": "0",
      "BatchNumber": "18092000",
      "SameCard": "0",
      "ServiceType": "Payment",
      "TerminalID": "08300000",
      "DeviceID": "01301234",
      "TerminalTXNNumber": "152226",
      "HostSerialNumber": "152226",
      "Time": "152226",
      "Date": "20180920",
      "AESKey": "ae83eef21d....f18a2644"
    },
    "TXNResult": "Fail",
    "Retry": "1",
    "ErrorCode": "000125",
    "OrderId": "PO123456",
    "NewAESKey": ""
  }
}

1st time retry (Failed)

Request

{
  "Header": {
    "Method": "31800",
    "ServiceType": "Payment",
    "MchId": "Account0001",
    "TradeKey": "9af15b336e6a96199......606529a0",
    "CreateTime": "20180920152531"
  },
  "Data": "{\"DeviceId\":\"01304108\",\"Retry\":\"1\",\"Amount\":\"1\",\"StoreOrderNo\":\"PO123456\",\"RefundKey\":\"milk\",\"ActionType\":\"\",\"TerminalTXNNumber\":\"152226\",\"HostSerialNumber\":\"152226\"}"
}

Response

{
  "Header": {
    "StatusCode": "0000",
    "StatusDesc": "STATUS_SUCCESS",
    "Method": "31800",
    "ServiceType": "Payment",
    "MchId": "Acoount0001",
    "ResponseTime": "20180920152538"
  },
  "Data": {
    "request": {
      "Amount": "1",
      "Retry": "1",
      "BatchNumber": "18092000",
      "SameCard": "1",
      "ServiceType": "Payment",
      "TerminalID": "08300000",
      "DeviceID": "01301234",
      "TerminalTXNNumber": "152226",
      "HostSerialNumber": "152226",
      "Time": "152531",
      "Date": "20180920",
      "AESKey": "ae83eef21d482......18a2644"
    },
    "TXNResult": "Fail",
    "Retry": "2",
    "ErrorCode": "000125",
    "OrderId": "PO123456",
    "NewAESKey": ""
  }
}

2nd time retry (Success)

Request

{
  "Header": {
    "Method": "31800",
    "ServiceType": "Payment",
    "MchId": "Account0001",
    "TradeKey": "9af15b336e6a96199......5606529a0",
    "CreateTime": "20180920152636"
  },
  "Data": "{\"DeviceId\":\"01301234\",\"Retry\":\"2\",\"Amount\":\"1\",\"StoreOrderNo\":\"PO123456\",\"RefundKey\":\"milk\",\"ActionType\":\"\",\"TerminalTXNNumber\":\"152226\",\"HostSerialNumber\":\"152226\"}"
}

Response

{
  "Header": {
    "StatusCode": "0000",
    "StatusDesc": "STATUS_SUCCESS",
    "Method": "31800",
    "ServiceType": "Payment",
    "MchId": "Account0001",
    "ResponseTime": "20180920152640"
  },
  "Data": {
    "EZCardID": "949104293",
    "EZCardType": "00",
    "PersonalProfile": "00",
    "CardNumberForPrint": "949104293",
    "Amount": "1",
    "Balance": "1917",
    "BeforeTXNBalance": "1918",
    "TerminalTXNNumber": "152226",
    "HostSerialNumber": "152226",
    "Time": "152226",
    "Date": "20180920",
    "ExpiryDate": "20191230",
    "CPUPurseVersion": "00",
    "BankCode": "00",
    "AreaCode": "01",
    "AutoTopUpAmount": "0",
    "request": {
      "Amount": "1",
      "Retry": "2",
      "BatchNumber": "18092000",
      "SameCard": "1",
      "ServiceType": "Payment",
      "TerminalID": "08300000",
      "DeviceID": "01301234",
      "TerminalTXNNumber": "152226",
      "HostSerialNumber": "152226",
      "Time": "152637",
      "Date": "20180920",
      "AESKey": "ae83eef....bf18a2644"
    },
    "TXNResult": "Success",
    "Retry": "0",
    "ErrorCode": "000000",
    "OrderId": "PO123456",
    "DongleDeviceID": "0C100DE0A57E",
    "RRNumber": "18092015222676",
    "TXNType": "Payment",
    "NewAESKey": "b9007bf485....9523d9783",
    "DeviceNumber": "0830000001301234"
  }
}

Last updated