Skip to content

Commit ce210b2

Browse files
committed
Use the amount sent like it's in naira
1 parent f8b0e1b commit ce210b2

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

public/class-paystack-forms-public.php

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -51,14 +51,15 @@ public function enqueue_scripts() {
5151
define('KKD_PFF_PAYSTACK_FLATLINE_AMOUNT_PLUS_CHARGE', intval((PAYSTACK_LOCAL_CAP-PAYSTACK_ADDITIONAL_CHARGE)/PAYSTACK_PERCENTAGE));
5252
define('KKD_PFF_PAYSTACK_FLATLINE_AMOUNT', PAYSTACK_FLATLINE_AMOUNT_PLUS_CHARGE - PAYSTACK_LOCAL_CAP);
5353

54-
function kkd_pff_paystack_add_paystack_charge($amountinkobo)
54+
function kkd_pff_paystack_add_paystack_charge($amount)
5555
{
56+
$amountinkobo = $amount * 100;
5657
if ($amountinkobo > PAYSTACK_FLATLINE_AMOUNT)
57-
return $amountinkobo + PAYSTACK_LOCAL_CAP;
58+
return ($amountinkobo + PAYSTACK_LOCAL_CAP)/100;
5859
elseif ($amountinkobo > PAYSTACK_CROSSOVER_AMOUNT)
59-
return intval(($amountinkobo + PAYSTACK_ADDITIONAL_CHARGE) / PAYSTACK_CHARGE_DIVIDER);
60+
return (intval(($amountinkobo + PAYSTACK_ADDITIONAL_CHARGE) / PAYSTACK_CHARGE_DIVIDER))/100;
6061
else
61-
return intval($amountinkobo / PAYSTACK_CHARGE_DIVIDER);
62+
return (intval($amountinkobo / PAYSTACK_CHARGE_DIVIDER))/100;
6263
}
6364

6465
add_filter ("wp_mail_content_type", "kkd_pff_paystack_mail_content_type");

0 commit comments

Comments
 (0)