Skip to content

Fix StripeProviderV3.refund() returning cents instead of currency units#474

Open
YounesOMK wants to merge 1 commit intojazzband:mainfrom
YounesOMK:fix/stripe-refund-return-currency-units
Open

Fix StripeProviderV3.refund() returning cents instead of currency units#474
YounesOMK wants to merge 1 commit intojazzband:mainfrom
YounesOMK:fix/stripe-refund-return-currency-units

Conversation

@YounesOMK
Copy link

Fixes #470

@mariofix
Copy link
Member

mariofix commented Mar 2, 2026

@YounesOMK Are we sure about this? I understand Stripe always uses the smallest amount possible for the currency

@YounesOMK
Copy link
Author

YounesOMK commented Mar 2, 2026

@YounesOMK Are we sure about this? I understand Stripe always uses the smallest amount possible for the currency

@mariofix
The conversion to cents still happens for the API call, that part didn't change. the fix is only about what gets returned. Before, the refund method returned the converted amount (in cents) back to BasePayment.refund(), which does self.captured_amount -= amount. Since captured_amount is stored in currency units, the subtracted amount must also be in the same unit otherwise we will have negative values in captured_amount field

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

StripeProviderV3.refund() returns cents instead of currency units

2 participants