Jump to content

Stripe / Coupon Math Bug -- Causes Payment Error


Alex

Recommended Posts

I have a coupon I made for a friend which was for 50% off. I set him up as a client and created the service, applying the discount code. The service normally costs $29.99, and Blesta calculated 50% to $15. However, when the friend went to pay, the following errors came about:

https://api.stripe.com/v1/charges
a:1:{s:5:"error";a:3:{s:4:"type";s:21:"invalid_request_error";s:7:"message";s:23:"Invalid integer: 1499.5";s:5:"param";s:6:"amount";}}
I'm sort of glad it failed and didn't hit his bank for nearly $1500!

 

Oddly, when he tried again, it worked! (It charged him $15 correctly, but not going to post the successful log since it contains personal information)

 

Here is the mail Blesta sent him regarding the failed transaction:

 

We tried to charge your Visa, ending in 4321, in the amount of $15.00, but the request resulted in an error.

Error Response: Invalid integer: 1499.5

Please verify that the account details we have on file are correct.

We will attempt to charge your card again once a day until it is successful, up to three times.

Link to comment
Share on other sites

What currency was this for (USD)?

 

What is the format of the currency (####.##)?

 

What was different about the first attempt (that failed) and the subsequent attempt? Was the first through an order form while the other was in the client interface, or...?

Link to comment
Share on other sites

What currency was this for (USD)?

 

What is the format of the currency (####.##)?

 

What was different about the first attempt (that failed) and the subsequent attempt? Was the first through an order form while the other was in the client interface, or...?

 

USD. (That's all we use) It was a $29.99 package with 50% off coupon, so it came to $15.00. The format we use is ##.##. This was not a manual payment amount, but actually paying an invoice so the amount was generated by Blesta.

 

I believe he did the exact same thing the second time around when it worked, so that is the odd part. As I said, I added him as a client and added his service manually, so I believe he just clicked in the invoice email to go to the client portal and pay the invoice there, so it was not through the order form. Since this fella is a friend I consider very smart and technically adept, and a Systems Analyst for a Fortune 1000 company, I find it quite doubtful that it was human error. He wouldn't have tested it differently the second time around. The only difference may have been that he did a manual payment for $15 after the failure, rather than letting the system generate the amount. But after that, I asked him to try the original method (invoice payment) again and get a screenshot of the error for us, and when he did, he just paid us an extra $15 and it worked in the same method which had not worked at first.

Link to comment
Share on other sites

I can't imagine identical behavior concluding in different results in this instance, but to me, this looks like a rounding issue in Stripe (or lack thereof) since only integers should be sent.

 

By the way, Stripe expects the amount in cents, so 1499.5 = $14.995

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • Create New...