202-ecommerce / stripe_official

After years of hard work with Stripe connector for PrestaShop, 202 ecommerce stop the development of Stripe module on January 9th 2023. Thanks for all contributors that help us!
20 stars 20 forks source link

Wrong capture amount with reductions #98

Closed arbizgit closed 3 years ago

arbizgit commented 3 years ago

PS Version : 1.7 Stripe module version : 2.3.6

I am getting an error when applying % reductions in prestashop. Reductions are correctly applied in cart. The stripe dashboard also shows the correct amount but payments remain as uncaptured.

Checking the log I get the following error: "message": "The payment could not be captured because the requested capture amount is greater than the authorized amount. If you are trying to collect a tip or over-capture, your account might not be configured for those features. Contact us via https://support.stripe.com/contact/" "type": "invalid_request_error"

And indeed the "amount_to_capture" parameter is wrong as it's showing the cart amount without the reduction. What could be the reason for sending the amount to capture without the reduction ?

It could be related to the way the reductions are applied in prestashop as they are applied by a custom module... How does the stripe module trigger the capture amount ? Is it recalculated somehow rather than using what the cart actually shows ?

arbizgit commented 3 years ago

If anyone interested, this seems to occur with versions 2.3.6 and 2.3.7. Switching back to version 2.3.1 fixes the issue. It looks like the new releases haven't been thouroughly tested...

mribeiro202 commented 3 years ago

Hello @arbizgit ,

Can you create a support ticket, this could be useful for us to make a fix.

Here is the support url : https://addons.prestashop.com/en/contact-us?id_product=24922

Have a nice day