Fixed Stripe seems to be charging 1 penny less than the actual amount for subscription.

robdog

Well-known member
Affected version
2.1
I am not exactly sure what is going on, I have been trying to debug the situation to fix it on my end but the purchase price is correct in the admin but when it get processed through Stripe it is off by 1 penny. Any thoughts?
 
Maybe ask stripe if they can shed any light on this. They have telephone and chat support that responds very quickly
 
I suspect it may be this issue:


Can you confirm the amount you were charging?
 
I suspect it may be this issue:


Can you confirm the amount you were charging?

That link sounds exactly like what I am experiencing. I am charging 9.95 and Stripe is actually charging 9.94

EDIT

In the meantime, I have implemented the strval() fix suggested in that thread. Is this something that can get into a fix for 2.1.x product line? Thanks.
 
Yeah it will be the same issue then.

To fix this you will either need to make the change yourself or wait for XF 2.2.

To make the change yourself open src/XF/Payment/Stripe.php and find:
PHP:
return intval($cost);

Replace with:
PHP:
return intval(strval($cost));
 
Actually I need to bring this back. It looks like there are more changes that are needed to resolve this, because Stripe will try to use the existing plan/price and that isn't paying the correct amount.
 
Thank you for reporting this issue, it has now been resolved. We are aiming to include any changes that have been made in a future XF release (2.2.0 RC2).

Change log:
Expanded rounded error fix for Stripe payments that better accounts for existing plans and active subscriptions
There may be a delay before changes are rolled out to the XenForo Community.
 
So to provide some more context, the change mentioned above is correct in isolation, but unfortunately it causes issues if the subscription has been purchased before, so it's unlikely to be a sufficient fix. I have just made further changes to account for all of this (so existing subscriptions would continue at 9.94 as that's what the subscription was set up with, but new purchasers would use 9.95).

This is a fairly complex change and may possibly depend on some specific changes in the 2.2 Stripe integration (as the way we setup subscriptions is now fairly different).
 
Back
Top Bottom