Stripe & Decimal point payments

Regarding Stripe and payments.

I have a payment form setup where the user can enter their own amount.
I then put on, say a 2% charge, and update the value in the Stripe amount field/data attribute.

Say the user puts in 10.00, the JS will update it to 10.20 (the 2% charge).

When submitted though, Stripe still says that its 10 gross payment. (not 10.20)

My question is has anyone played with something similar or come across anything funky with stripe and decimals?

Playing around with some test payments I tried 10.20 and in the Stripe pop-up it showed $10.19.
But the payment in Stripe is just $10.00.

Tried another with cents and same result.

Tried a value of 0.26 and got an error:
{ “Error”: 1, “ErrorMessages”: [ “Invalid positive integer” ] }

So it’s like Treepl’s code is rounding down to whole dollars perhaps.

When first testing payments a month or so ago the cents where being processed fine.
I wonder if it’s something to do with the ‘Advanced Payment Flow’ beta feature? the old trial site I’m testing on doesn’t have this beta feature available.

@James, do you have this feature on or off?

OK I was going crazy - I’m glad you could replicate these exact numbers!

I have the feature OFF, as was recommended by Treepl to even process the form. (With it ON, I would have that issue of the payment not appearing we discussed on slack).

I’m guessing, with the change to subscription based Stripe billing, that the Treepl/Stripe API might need to be change to pass a different value amount type, as per this article:
https://stripe.com/docs/billing/subscriptions/decimal-amounts

It seems to make sense to the issues we are seeing and might be related to this part of Treepl’s code:

But… I’m well out of my depth here so I’m just throwing ideas out there :slight_smile:

@vlad.z ?