Verify Paid Order
When you receive Instant Payment Notification, you might need to confirm on your side to finish billing and deliver ordered product.
There is a simple verify script which you can use :
// Fetch IPN Request Logs
$url = file_get_contents("requests.json");
$json = json_decode($url);
// Merchant side parameters
$amount = '5.0000000';
// A secret key for your merchant account on StellarPay
$apiSecret = "5df5c4a7e88da7c3e72460d17e69d07c";
// orderDescription is passed from merchant page
$orderDescription = 'ORDER2991-LATTE-XL';
// Create hash from merchant parameters
$secretParameters=
$amount.':'
.$apiSecret.':'
.$orderDescription;
// Finalize hash
$finalSecret = strtoupper(md5($secretParameters));
// Compare the hash with fetched request from StellarPay
if($finalSecret == $json->hash){
echo "Payment valid.";
}else{
echo "Payment invalid.";
}