Skip to content

use round instead of intval to convert amount to kobo#14

Merged
whales-paystack merged 1 commit intomasterfrom
patch/amount-fix
Aug 26, 2021
Merged

use round instead of intval to convert amount to kobo#14
whales-paystack merged 1 commit intomasterfrom
patch/amount-fix

Conversation

@lukman-paystack
Copy link
Copy Markdown
Collaborator

Why was this change made?

A bug was reported where the Paystack checkout was loading a different amount than what was set in WHMCS, we traced this to an error in the line

$amountinkobo = intval(floatval($params['amount']) * 100); //where $params['amount'] is 19.74, the checkout loaded 19.73 instead.

It's unclear why this is happening, but using round() in place of intval() appears to resolve the issue.

Ref #? (Enter an issue this references.)
https://paystack.zendesk.com/agent/tickets/944623
----- READ, then delete below this line -----

IMPORTANT!

Please be sure to send a coherent commit history - Make sure each individual commit in your pull request is meaningful. If you had to make multiple intermediate commits while developing, please squash them before submitting. Here's an article we'd like you to read > http://chris.beams.io/posts/git-commit/

@whales-paystack whales-paystack merged commit 9b290f3 into master Aug 26, 2021
@lukman-paystack lukman-paystack deleted the patch/amount-fix branch August 26, 2021 14:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants