fbpx
← back

Get Transaction List

This is to retrieve the transaction results for a specific transaction reference

1. URL: https://app.senangpay.my/apiv1/get_transaction_list

2. Method: GET

3. Parameters:

  • merchant_id
  • timestamp_start
  • timestamp_end
  • hash

4. Return format: JSON

5. In order to generate the hash, create a single string consisting of the values (according to sequence) below:

  • merchant_id
  • secret key
  • timestamp_start
  • timestamp_end

6. Then please use md5 to hash the string. Sample code in PHP as shown below :

$secret_key = '21245-957';
$timestamp_start = '1577808000';//January 1, 2020 12:00:00 AM
$timestamp_end = '1577894399';// January 1, 2020 11:59:59 PM

this will generate 5606f217f05896ae0937c7f96437327b as hash

$hash = md5($merchant_id.$secret_key.$timestamp_start.$timestamp_end);

?>

7. If you choose SHA256, sample code in PHP as shown below :

$secret_key = '21245-957';
$timestamp_start = '1577808000';//January 1, 2020 12:00:00 AM
$timestamp_end = '1577894399';// January 1, 2020 11:59:59 PM

this will generate 58e13aadcac0070a32c504949e2b2da6b0b4341828461eac5fbd101f5a481616 as hash

$hash = hash_hmac('sha256',$merchant_id.$secret_key.$timestamp_start.$timestamp_end, $secret_key);
?>

8. The value of timestamps must be more than 0 and the end timestamp must be more than start timestamp.

9.. Timestamps refer to UNIX timestamp.