- This topic has 4 replies, 3 voices, and was last updated 4 years, 5 months ago by .
Viewing 5 posts - 1 through 5 (of 5 total)
Viewing 5 posts - 1 through 5 (of 5 total)
- You must be logged in to reply to this topic.
Stripe payment plugins for your WordPress site
· ·
Home › Forums › Stripe Payments Plugin › Price of product different than what is actually charged.
I created a subscription product for $19.99 recurring monthly. It shows the price as being $19.99 but when the “Join Now” button is clicked, it shows the price being $19.98. I tried it with a different subscription of $20.00 even and the error didn’t happen [stephanievignery.com/wp-content/uploads/2020/06/Screen-Shot-2020-06-12-at-2.45.29-PM.png]
I create a new secret API key and it looks like it may have corrected the issue.
If you see the issue again, let us know.
Hmm, I was able to reproduce the issue.
I will investigate this further and get back to you.
Looks like it was precision inconsistency between frontend and backend calculations. JavaScript is trying to represent 19.99 with as much precision as possible. Since computers don’t have infinite precision, it picks the number that is closest: represents 19.99 as 19.98999999999999. So after the value is processed on backend, multiplied by 100 (Stripe API requires amount to be passed in cents) and gets fractional part removed, it becomes 1998.
This will be fixed in the upcoming version of the Subscriptions addon. Note you might have to re-create your plans if they still show improper amount.
Thank you for reporting this.