Commit 842701df authored by mr.amirka's avatar mr.amirka

fixed status checking

parent 28bcf1d1
......@@ -527,13 +527,13 @@ if (
// Lunu Cryptocurrencies Gateway - Instant Payment Notification
public function lunupayment_callback($payment) {
public function lunupayment_callback($callback_data) {
lunuLogError(array(
'payment' => $payment,
'payment' => $callback_data,
), 'Payment callback');
$payment_id = $payment['id'];
$payment_id = $callback_data['id'];
if (!$payment_id) return false;
......@@ -566,6 +566,7 @@ if (
return false;
}
$callback_payment_status = strtolower($callback_data['status']);
$payment = lunu_payment_check(array(
'app_id' => $this->app_id,
......@@ -576,7 +577,8 @@ if (
$payment_status = strtolower($payment['status']);
if (
$payment_status !== LUNUPAYMENT_STATUS_PAID
$payment_status !== $callback_payment_status
|| $payment_status !== LUNUPAYMENT_STATUS_PAID
&& $payment_status !== LUNUPAYMENT_STATUS_AWAITING_CONFIRMATION
&& $payment_status !== LUNUPAYMENT_STATUS_FAILED
&& $payment_status !== LUNUPAYMENT_STATUS_CANCELED
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment