Added options to enable/disable account upgrades and coinpayments
This commit is contained in:
@ -1,29 +1,30 @@
|
||||
<?php
|
||||
require('../common.php');
|
||||
|
||||
if(!ENABLE_UPGRADES){
|
||||
die('Upgrades disabled');
|
||||
}
|
||||
if(!COINPAYMENTS_ENABLED){
|
||||
die('CoinPayments disabled');
|
||||
}
|
||||
if(empty($_SERVER['HTTP_HMAC'])){
|
||||
die("No HMAC signature sent");
|
||||
}
|
||||
|
||||
$merchant = $_POST['merchant'] ?? '';
|
||||
if(empty($merchant)){
|
||||
die("No Merchant ID passed");
|
||||
}
|
||||
|
||||
if($merchant !== COINPAYMENTS_MERCHANT_ID){
|
||||
die("Invalid Merchant ID");
|
||||
}
|
||||
|
||||
$request = file_get_contents('php://input');
|
||||
if(empty($request)){
|
||||
die("Error reading POST data");
|
||||
}
|
||||
|
||||
$hmac = hash_hmac("sha512", $request, COINPAYMENTS_IPN_SECRET);
|
||||
if($hmac !== $_SERVER['HTTP_HMAC']){
|
||||
die("HMAC signature does not match");
|
||||
}
|
||||
|
||||
$db = get_db_instance();
|
||||
$status = 0;
|
||||
if($_POST['status'] < 0){
|
||||
|
Reference in New Issue
Block a user