· 5 years ago · Feb 18, 2020, 04:04 AM
1<?php
2
3$amount_paid = urlencode($_GET['amount_paid']);
4$txn_status = urlencode($_GET['txn_status']);
5$txn_msg = urlencode($_GET['txn_msg']);
6$order_id = urlencode($_GET['order_id']);
7$transaction_id = urlencode($_GET['transaction_id']);
8$secretKey = ''; // Your secret key here
9
10$returnURLParamsresult = "$secretKey?mode=senangpay&type=topup&amount_paid=$amount_paid&txn_status=$txn_status&txn_msg=$txn_msg&order_id=$order_id&transaction_id=$transaction_id&hashed_value=[HASH]";
11$hash_verify = md5($returnURLParamsresult);
12
13echo 'Return URL Param Result: ' . $returnURLParamsresult . '<br><br>';
14echo 'Hash verify: ' . $hash_verify . '<br><br>';
15if ($hash_verify == $_GET['hash']) {
16 echo 'Hash verified...';
17} else {
18 echo 'Invalid hash';
19}