You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
$this->msg = 'Paystack does not support your store currency. Kindly set it to Nigerian Naira ₦ <a href="' . admin_url( 'admin.php?page=wc-settings&tab=general' ) . '">here</a>';
66
+
$this->msg = 'Paystack does not support your store currency. Kindly set it to either NGN (₦), USD ($) or GBP (£) <a href="' . admin_url( 'admin.php?page=wc-settings&tab=general' ) . '">here</a>';
67
67
68
68
returnfalse;
69
69
@@ -111,8 +111,11 @@ public function is_available() {
111
111
if ( $this->enabled == "yes" ) {
112
112
113
113
if ( ! ( $this->public_key && $this->secret_key ) ) {
114
+
114
115
returnfalse;
116
+
115
117
}
118
+
116
119
returntrue;
117
120
}
118
121
@@ -235,9 +238,12 @@ public function payment_scripts() {
// check if the amount paid is equal to the order amount.
328
-
if ( $order_total != $amount_paid ) {
338
+
if ( $amount_paid < $order_total ) {
329
339
330
340
$order->update_status( 'on-hold', '' );
331
341
@@ -338,15 +348,15 @@ public function verify_paystack_transaction() {
338
348
$order->add_order_note( $notice, 1 );
339
349
340
350
// Add Admin Order Note
341
-
$order->add_order_note('<strong>Look into this order</strong><br />This order is currently on hold.<br />Reason: Amount paid is less than the total order amount.<br />Amount Paid was <strong>₦'.$amount_paid.'</strong> while the total order amount is <strong>₦'.$order_total.'</strong><br />Paystack Transaction Reference: '.$paystack_ref );
351
+
$order->add_order_note('<strong>Look into this order</strong><br />This order is currently on hold.<br />Reason: Amount paid is less than the total order amount.<br />Amount Paid was <strong>'. $currency_symbol . $amount_paid . '</strong> while the total order amount is <strong>'. $currency_symbol . $order_total . '</strong><br />Paystack Transaction Reference: '.$paystack_ref );
342
352
343
353
$order->reduce_order_stock();
344
354
345
355
wc_add_notice( $notice, $notice_type );
346
356
347
357
wc_empty_cart();
348
-
}
349
-
else {
358
+
359
+
} else {
350
360
351
361
$order->payment_complete( $paystack_ref );
352
362
@@ -355,8 +365,7 @@ public function verify_paystack_transaction() {
// check if the amount paid is equal to the order amount.
429
-
if ( $order_total != $amount_paid ) {
442
+
if ( $amount_paid < $order_total ) {
430
443
431
444
$order->update_status( 'on-hold', '' );
432
445
@@ -439,15 +452,15 @@ public function process_webhooks() {
439
452
$order->add_order_note( $notice, 1 );
440
453
441
454
// Add Admin Order Note
442
-
$order->add_order_note('<strong>Look into this order</strong><br />This order is currently on hold.<br />Reason: Amount paid is less than the total order amount.<br />Amount Paid was <strong>₦'.$amount_paid.'</strong> while the total order amount is <strong>₦'.$order_total.'</strong><br />Paystack Transaction Reference: '.$paystack_ref );
455
+
$order->add_order_note('<strong>Look into this order</strong><br />This order is currently on hold.<br />Reason: Amount paid is less than the total order amount.<br />Amount Paid was <strong>'. $currency_symbol . $amount_paid . '</strong> while the total order amount is <strong>'. $currency_symbol . $order_total . '</strong><br />Paystack Transaction Reference: '.$paystack_ref );
$this->msg = 'Paystack does not support your store currency. Kindly set it to Nigerian Naira, USD or GBP ₦ <a href="' . admin_url( 'admin.php?page=wc-settings&tab=general' ) . '">here</a>';
81
+
$this->msg = 'Paystack does not support your store currency. Kindly set it to either NGN (₦), USD ($) or GBP (£) <a href="' . admin_url( 'admin.php?page=wc-settings&tab=general' ) . '">here</a>';
82
82
83
83
returnfalse;
84
84
@@ -127,7 +127,9 @@ public function is_available() {
127
127
if ( $this->enabled == "yes" ) {
128
128
129
129
if ( ! ( $this->public_key && $this->secret_key ) ) {
130
+
130
131
returnfalse;
132
+
131
133
}
132
134
133
135
returntrue;
@@ -282,9 +284,10 @@ public function payment_scripts() {
// check if the amount paid is equal to the order amount.
395
-
if ( $order_total != $amount_paid ) {
410
+
if ( $amount_paid < $order_total ) {
396
411
397
412
$order->update_status( 'on-hold', '' );
398
413
@@ -405,7 +420,7 @@ public function process_token_payment( $token, $order_id ) {
405
420
$order->add_order_note( $notice, 1 );
406
421
407
422
// Add Admin Order Note
408
-
$order->add_order_note('<strong>Look into this order</strong><br />This order is currently on hold.<br />Reason: Amount paid is less than the total order amount.<br />Amount Paid was <strong>₦'.$amount_paid.'</strong> while the total order amount is <strong>₦'.$order_total.'</strong><br />Paystack Transaction Reference: '.$paystack_ref );
423
+
$order->add_order_note('<strong>Look into this order</strong><br />This order is currently on hold.<br />Reason: Amount paid is less than the total order amount.<br />Amount Paid was <strong>'. $currency_symbol . $amount_paid . '</strong> while the total order amount is <strong>'. $currency_symbol . $order_total . '</strong><br />Paystack Transaction Reference: '.$paystack_ref );
409
424
410
425
wc_add_notice( $notice, $notice_type );
411
426
@@ -503,8 +518,11 @@ public function verify_paystack_transaction() {
// check if the amount paid is equal to the order amount.
517
-
if ( $order_total != $amount_paid ) {
535
+
if ( $amount_paid < $order_total ) {
518
536
519
537
$order->update_status( 'on-hold', '' );
520
538
@@ -527,11 +545,12 @@ public function verify_paystack_transaction() {
527
545
$order->add_order_note( $notice, 1 );
528
546
529
547
// Add Admin Order Note
530
-
$order->add_order_note('<strong>Look into this order</strong><br />This order is currently on hold.<br />Reason: Amount paid is less than the total order amount.<br />Amount Paid was <strong>₦'.$amount_paid.'</strong> while the total order amount is <strong>₦'.$order_total.'</strong><br />Paystack Transaction Reference: '.$paystack_ref );
548
+
$order->add_order_note('<strong>Look into this order</strong><br />This order is currently on hold.<br />Reason: Amount paid is less than the total order amount.<br />Amount Paid was <strong>₦'.$amount_paid.'</strong> while the total order amount is <strong>₦'.$order_total.'</strong><br />Paystack Transaction Reference: '.$paystack_ref );
531
549
532
550
$order->reduce_order_stock();
533
551
534
552
wc_add_notice( $notice, $notice_type );
553
+
535
554
} else {
536
555
537
556
$order->payment_complete( $paystack_ref );
@@ -608,14 +627,18 @@ public function process_webhooks() {
// check if the amount paid is equal to the order amount.
618
-
if ( $order_total != $amount_paid ) {
641
+
if ( $amount_paid < $order_total ) {
619
642
620
643
$order->update_status( 'on-hold', '' );
621
644
@@ -628,7 +651,7 @@ public function process_webhooks() {
628
651
$order->add_order_note( $notice, 1 );
629
652
630
653
// Add Admin Order Note
631
-
$order->add_order_note('<strong>Look into this order</strong><br />This order is currently on hold.<br />Reason: Amount paid is less than the total order amount.<br />Amount Paid was <strong>₦'.$amount_paid.'</strong> while the total order amount is <strong>₦'.$order_total.'</strong><br />Paystack Transaction Reference: '.$paystack_ref );
654
+
$order->add_order_note('<strong>Look into this order</strong><br />This order is currently on hold.<br />Reason: Amount paid is less than the total order amount.<br />Amount Paid was <strong>'. $currency_symbol . $amount_paid . '</strong> while the total order amount is <strong>'. $currency_symbol . $order_total . '</strong><br />Paystack Transaction Reference: '.$paystack_ref );
0 commit comments