· 5 years ago · Feb 18, 2020, 06:04 AM
1<?php
2
3$name = urlencode($_GET['name']);
4$email = urlencode($_GET['email']);
5$phone = urlencode($_GET['phone']);
6$amount = urlencode($_GET['amount']);
7$txnStatus = urlencode($_GET['txn_status']);
8$orderId = urlencode($_GET['order_id']);
9$txnRef = urlencode($_GET['txn_ref']);
10$txnMsg = urlencode($_GET['txn_msg']);
11$txnType = urlencode($_GET['txn_type']);
12$secretKey = ''; // Your secret key here
13
14$returnURLParamsresult = "$secretKey?name=$name&email=$email&phone=$phone&amount=$amount&txn_status=$txnStatus&order_id=$orderId&txn_ref=$txnRef&txn_msg=$txnMsg&hash=[HASH]&txn_type=$txnType";
15$hash_verify = md5($returnURLParamsresult);
16
17echo 'Return URL Param Result: ' . $returnURLParamsresult . '<br><br>';
18echo 'Hash verify: ' . $hash_verify . '<br><br>';
19if ($hash_verify == $_GET['hash']) {
20 echo 'Hash verified...';
21} else {
22 echo 'Invalid hash';
23}