@@ -137,15 +137,15 @@ public function add_for_kobo($amountinkobo)
137137 if ($ amountinkobo > $ this ->flatline ) {
138138 return $ amountinkobo + $ this ->cap ;
139139 } elseif ($ amountinkobo > $ this ->crossover ) {
140- return ceil (( $ amountinkobo + $ this ->additional_charge ) / $ this ->charge_divider );
140+ return round ((( $ amountinkobo + $ this ->additional_charge ) / $ this ->charge_divider ), 2 );
141141 } else {
142- return ceil ( $ amountinkobo / $ this ->charge_divider );
142+ return round (( $ amountinkobo / $ this ->charge_divider ), 2 );
143143 }
144144 }
145145
146146 public function add_for_ngn ($ amountinngn )
147147 {
148- return $ this ->add_for_kobo (ceil ( $ amountinngn * 100 )) / 100 ;
148+ return $ this ->add_for_kobo (round (( $ amountinngn * 100 ), 2 )) / 100 ;
149149 }
150150}
151151
@@ -2950,24 +2950,6 @@ function kkd_pff_paystack_confirm_payment()
29502950 $ result = "success " ;
29512951 // kkd_pff_paystack_send_receipt($currency,$amount,$name,$payment_array->email,$code,$metadata)
29522952 } else {
2953- $ usequantity = get_post_meta ($ payment_array ->post_id , '_usequantity ' , true );
2954- if ($ usequantity == 'no ' ) {
2955- $ oamount = (int ) str_replace (' ' , '' , $ amount );
2956- } else {
2957- $ quantity = $ _POST ["quantity " ];
2958- $ unitamount = (int ) str_replace (' ' , '' , $ amount );
2959- $ oamount = $ quantity * $ unitamount ;
2960- }
2961- if ($ txncharge == 'customer ' ) {
2962- if ($ minimum == 0 && $ amount != 0 ) {
2963- $ oamount = kkd_pff_paystack_add_paystack_charge ($ oamount );
2964- }
2965- }
2966-
2967-
2968- // if ($txncharge == 'customer') {
2969- // $amount = kkd_pff_paystack_add_paystack_charge($amount);
2970- // }
29712953 if ($ oamount != $ amount_paid ) {
29722954 // echo $oamount. ' - '.$amount_paid;
29732955 $ message = "Invalid amount Paid. Amount required is " . $ currency . "<b> " . number_format ($ oamount ) . "</b> " ;
0 commit comments