Check Transaction API

The Check transaction API gives you the status of the transaction. PayWay recommends using this API to reconcile with PayWay database after you receive the response.

API ENDPOINTS

Testing url:

https://checkout-sandbox.payway.com.kh/api/payment-gateway/v1/payments/check-transaction

Production url:

https://checkout.payway.com.kh/api/payment-gateway/v1/payments/check-transaction

Method: POST

Response Parameters Description

# Field name Data type Remark Example
1 language

optional

HEADER/string [2] Support [en, km] – to be included on header of the request to request Payment page in specific language.

en – English
km – Khmer
en
2 req_time Timestamp [UTC] Format YYYYmmddHis 20210123234559
3 merchant_id
mandatory
String [30] Merchant id provided by PayWay integration team. onlinesshop24
4 tran_id
mandatory
String [20] Transaction ID – unique order ID 24os-pr0001 or 12345 or OS12345
5 hash
mandatory
Text

Base64 encode of hash hmac sha512 encryption

merchant_id + tran_id with public_key.

Ex in php: base64_encode(hash_hmac('sha512', request_body, $public_key, true));

request_body is a sequence of request parameters separated with '&' (key1=value1&key2=value2&key3=value3) and sorted by parameter name in ascending order.

public_key - ABA will be provided when client on board.

• Step 1 Generate Hash hash: (req_time + merchant_id + tran_id)

• Step 2 Encrypt with: "[\"sha512_true\",\"fb629880e9a741dc9862a4ad260f6668\"]"

Example Request

  • 
            {
              "req_time":"20210922050705",
              "merchant_id":"ec000002",
              "tran_id":"trx-20201019130940"
              "hash":"20210922050705ec000002trx-20201019130940"
            }
          

Example Response

  • 
            {
              "description":"approved",
              "tran_id":"trx-20201019130940"
              "transaction date":"2021-08-21 15:00:23"
              "apv": "90909999",
              "payment_type": "ABA Pay",
              "original_amount": 5,
              "refund_amount": 0,
              "payment_amount": 5,
              "first_name": "hello",
              "last_name": "world",
              "email": "[email protected]",
              "topup_channel": "",
              "phone": "+855923232323",
              "bank_ref": "",
              "original_currency": "USD",
              "payer_account": "000217163"
            }
          

Response Parameter Description

# description Data type Remark Example
1 description String approved
2 tran_id String trx-20201019130940
3 transaction date 2021-08-21 15:00:23
4 apv String 90909999
5 payment_type String ABA Pay
6 original_amount 5
7 refund_amount 0
8 payment_amount 5
9 first_name String hello
10 last_name String world
11 email String [email protected]
12 topup_channel
13 phone String +855923232323
14 bank_ref String 100FT90908989787
15 original_currency String USD
16 payer_account String *****7163