From 2c1c7e10ce3dfdde1d48ea1f9ec8dabd535b2e60 Mon Sep 17 00:00:00 2001 From: Stanley Ume Date: Sun, 26 Mar 2023 16:07:04 +0100 Subject: [PATCH] Fix fee calculation when amount = threshold This should be threshold inclusive according to the pricing page. https://paystack.com/pricing --- PaystackFees.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PaystackFees.js b/PaystackFees.js index 827043f..2f28de0 100644 --- a/PaystackFees.js +++ b/PaystackFees.js @@ -208,7 +208,7 @@ class PaystackFees { .required(), }), ); - const flat = amountInLowerDenomination > this.threshold ? this.additionalCharge : 0; + const flat = amountInLowerDenomination >= this.threshold ? this.additionalCharge : 0; const fees = Math.ceil(this.percentage * amountInLowerDenomination + flat); return Math.min(fees, this.cap); }