You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Sometimes, when a payment is processed via the Stripe module, the amount submitted to stripe is not equal to the value of the items in the order. This issue does not affect every order, but does seem to affect values ending .99. For example, a recent order for 18.99 was submitted to Stripe as 18.98.
As far as I can tell, the amount which is sent to Stripe is generated in classes/StripeApi.php line 70:
This value is obtained by converting the order total into the correct amount per the currency settings for Stripe. In our case, using GBP, this means multiplying the value by 100:
if (in_array(mb_strtolower($currency->iso_code), Stripe::$zeroDecimalCurrencies)) {
return (int)$amount;
}
return (int)($amount * 100);
}
I can't see anything in the above which would cause the value to change in this way, but the case remains that the amount recorded everywhere in the CMS is 18.99, but the amount submitted to & captured by Stripe is 18.98. I'm guessing that this is due to float value rounding somewhere but haven't been able to figure this out. It's worth noting that the application is also making use of the Vat Exemption Module, however this issue affects orders both with & without VAT.
If there's any additional information or detail I can provide to help with this issue, please let me know.
The text was updated successfully, but these errors were encountered:
Sometimes, when a payment is processed via the Stripe module, the amount submitted to stripe is not equal to the value of the items in the order. This issue does not affect every order, but does seem to affect values ending .99. For example, a recent order for 18.99 was submitted to Stripe as 18.98.
As far as I can tell, the amount which is sent to Stripe is generated in classes/StripeApi.php line 70:
stripe/classes/StripeApi.php
Line 70 in 8d5274c
This value is obtained by converting the order total into the correct amount per the currency settings for Stripe. In our case, using GBP, this means multiplying the value by 100:
stripe/classes/Utils.php
Lines 64 to 78 in 8d5274c
I can't see anything in the above which would cause the value to change in this way, but the case remains that the amount recorded everywhere in the CMS is 18.99, but the amount submitted to & captured by Stripe is 18.98. I'm guessing that this is due to float value rounding somewhere but haven't been able to figure this out. It's worth noting that the application is also making use of the Vat Exemption Module, however this issue affects orders both with & without VAT.
If there's any additional information or detail I can provide to help with this issue, please let me know.
The text was updated successfully, but these errors were encountered: