-
-
Notifications
You must be signed in to change notification settings - Fork 725
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Stripe Payment processed with incorrect amount #5774
Comments
We don't have any automated tests around failed Stripe payments. I think it's time to start using VCR and Puffing Billy to test payments properly. They work really well in our Ceres Fair Food project. |
I tried a failed checkout locally and found two fees:
Trying to check out a second time creates another transaction fee. That sounds right. Update: I could reproduce the problem. I forgot to reload the payment object. It got updated to contain only items and admin fee, no shipping or transaction fees. |
Hello, I tried to replicate this with sample data but I cant reproduce it. The live issue is with StripeConnect btw. @mkllnk can you please add more details about how you have managed to reproduce this problem? |
Let's remove the v3regression label until we know it's a regression, ok? |
I downloaded the production database and tried to checkout with the shop which reported this problem. When I tried to check out, it failed because the production Stripe API keys don't work with my development account and in test mode. So the payment failed. Then I pressed the button again and it failed again. Looking into the database, I saw two failed payments. The first was for the full amount, the second one was missing fees. |
I've been looking through Stripe and this is happening more often than not - I'm not sure that it's every time but looks like it for Prom Coast (see also #5785) On the basis of that I'm putting the regression label back on @luisramos0 as it wasn't happening before the release. |
ok about the regression label 👍 we are not 100% sure it's a regression but it's fair to assume it is. I am saying this because then that means this should block the v3 roll out plan. No more upgrades to v3 until this is sorted. Right? |
Yes definitely @luisramos0 and the sooner we can get it sorted the better as it's a lot of faffing around to try and get it sorted at hub / customer end and we now have at least 17 occurrences of it . . |
@kirstenalarsen all 17 occurrences are for the same hub? |
Prom Coast (#2252) North Arm Farms (#2331) Fawkner Commons (#1411) The Bicycle Baker (#2876) |
ok, I can replicate this locally. This problem is related to the complicated order workflow and recalculation of order adjustments. I am trying to understand what's happening but no luck yet. I will report back in an hour or so. |
ok, I found the problem, in the order workflow there's a step where the fees are recalculated, charge_shipping_and_payment_fees! (there are multiple places where the fees are updated, this is one of them 🙈). In this method we are updating the payment amount based on the order total, but the process is selecting the first payment of the order (not the first pending payment) which can result in updating the total in a past failed payment, not the payment that will be processed. |
Can I please have some order numbers for each of the cases above so that I can check in ofn and stripe before contacting the users @luisramos0 @sauloperez ? And more information on the case where you think it could only have been done by super-admin (seems very unlikely to me - we really don't switch people's payment methods) |
@luisramos0 I believe you opened this issue by mistake. This has been solved by #5798 and the remaining issue about Stripe-SCA has a new issue: #5816 I'm closing this now but feel free to correct me if I'm wrong. |
I kept it open to clean up data and address any questions about the topic from the support team as some orders were not correct after the fix. Sorry, I could have commented. |
Description
Customer progressed through order to payment via stripe and received a payment failed message due to an incorrect expiry date for the credit card number.
Customer revised the expiry date and made no other changes to the order - stripe payment was successful however the amount charged was not the full order total.
Discrepancy is $18.62 - which is the combined total of the orders shipping $15.00 and the transaction fee $3.62.
Expected Behavior
Payment should have progressed for the full order total.
Actual Behaviour
Payment progressed for an amount less than the full order total.
Steps to Reproduce
Have not been able reproduced
Workaround
No workaround
Severity
bug-s2: a non-critical feature is broken, no workaround
https://github.com/openfoodfoundation/openfoodnetwork/wiki/Bug-severity
-->
Your Environment
Possible Fix
The text was updated successfully, but these errors were encountered: