From b64cd1082640ee5d5ff7889e1c2b8a080b110cc2 Mon Sep 17 00:00:00 2001 From: root Date: Thu, 9 May 2024 10:35:32 +0300 Subject: [PATCH] fix --- callback.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/callback.php b/callback.php index 43e2212..9479e5b 100644 --- a/callback.php +++ b/callback.php @@ -35,7 +35,7 @@ defined('MOODLE_INTERNAL') || die(); $status = required_param('status', PARAM_TEXT); -$invoiceid = required_param('invoice_id', PARAM_TEXT); +$invoiceid = required_param('invoice_id', PARAM_ALPHANUMEXT); $amountcrypto = required_param('amount_crypto', PARAM_TEXT); $currency = required_param('currency', PARAM_TEXT); $orderid = required_param('order_id', PARAM_INT); @@ -105,7 +105,11 @@ ); // Write to DB. -$cryptocloudtx->success = 1; +if ($response->result[0]->test_mode == true) { + $cryptocloudtx->success = 3; +} else { + $cryptocloudtx->success = 1; +} if (!$DB->update_record('paygw_cryptocloud', $cryptocloudtx)) { die('FAIL. Update db error.'); } else {