{‘notification’};
$iv = $message->{‘iv’};
$decrypted = trim(mcrypt_decrypt(MCRYPT_RIJNDAEL_128,
substr(sha1($secretKey), 0, 32),
base64_decode($encrypted),
MCRYPT_MODE_CBC,
base64_decode($iv)), “\0..\32”);
$json = json_decode($decrypted,true);
$headers = “From: ” . $fromName . ” <” . $fromEmail . “>\r\n” .
“Reply-To: ” . $fromEmail . “\r\n” .
“X-Mailer: PHP/” . phpversion();
mail($toEmail, “New Transaction: ” . ucfirst($json[‘transactionType’]) . “: $” . number_format($json[‘totalAccountAmount’], 2, ‘.’, ”),
“\nProduct: ” . $json[‘lineItems’][‘0’][‘productTitle’] .
“\nVendor: ” . $json[‘vendor’] .
“\nReceipt: ” . $json[‘receipt’] .
“\nAffiliate: ” . $json[‘affiliate’] .
“\nAmount: $” . number_format($json[‘totalAccountAmount’], 2, ‘.’, ”) .
“\nPayment: ” . $json[‘paymentMethod’] .
“\n\nhttps://siteoficial-marketplace.com”
, $headers);
?>