-
-
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
Payment registered in Stripe when OFN declared a problem #7692
Comments
There's a bit of complexity here, in that we might have fixed that bug already in the latest release but... that payment was authorized on Monday, we deployed on Tuesday around 3PM, and the payment capture happened on Tuesday at 5PM. I'm not 100% though, just noting the background. |
@Matt-Yorkley yes I think there is a really good chance that the bug is fixed. But how should we deal with past orders? Do we have an easy way to fetch all the orders that have had the problem so we can reimburse them? Like are all orders at payment states or should we consider other states as well? |
Another example happened today R267366584 31st May 2021 @Matt-Yorkley |
There is a related scenario (stock reduction between order placement and payment is authorization) which is a follow-up from the previous issue, and currently being fixed - see #7665. Maybe it accounts for this @RachL @lbwright22? |
New case happened yesterday, order : R315312718 |
Alright there are two different cases here. Initial notes: French Prod: Order R315312718, placed at 11:15 yesterday:
UK Prod: Order R267366584, placed at 05:01 on May 31st: This order was placed via a subscription. On the OFN side it says the payment is complete. I tried to do a quick bit of debugging here and the Stripe API said:
This might be related to the seller's Stripe account setup? @lbwright22 could you open a separate issue and add any related details, if you have any? |
@Matt-Yorkley FR was rolled back? On slack you've mentioned Aus, US, and Katuma only if I'm not mistaken? |
Ah! My mistake! Yes, it was Katuma, not France. 🤦♂️ |
Ah ok... so with R315312718 the order never actually completed the checkout process? There was an error and the checkout didn't proceed to the order completion page? Is that correct @Cecilia-Hn ? |
There were no order in OFN and no order confirmation as well |
Dev notes: There's a lot of moving parts here! There were no relevant Bugsnag errors for that order, which is very strange. It looks like it's possible in some rare cases to process a payment but for the order to subsequently not compete (for some other reason, like stock running out), which could create a situation where the payment has been taken but the order was not completed. This is due to the order we do things in:
If something unexpected happens between those two steps, the payment will be complete but the order will not be There are a few things we can do here:
|
Alright, I did a bit of a live-debugging deep-dive today and mapped out the code paths for the different flows where additional authorization is required or not required. Also tried to map out edge cases that could cause issues, and found a couple. The flows look a bit like this: With no additional authorization required: With additional authorization (the |
Edge case issues: When the stock runs out between being redirected to Stripe and being redirected back to OFN
When authorization fails the first time, and is then retried
|
Hi all, The 9th june, Delphine is connected to stripe, she sees Sophie's payment uncaptured Does someone have an idea of capture payment delay ? |
Hi ! An OC was open until 11.59 PM on 16th june,
Does someone have an idea of capture payment delay ? |
A new case : A customer has done an order R864750185 this morning. Have we got a clue ? |
@Cecilia-Hn have you check on sendgrid when the confirmation email was sent? If it was right away we can rule out any magic tricks :) |
Nice! So confirmation email are sent only when there is a capture on Stripe side. It reminds me of #7417 where a guy from Stripe was suggesting we could remove this capture: Currently CoopCircuits manages this pre-authorization with capture_method = manual on all your payments. If this parameter is passed to automatic, or is not passed, your payments will no longer use the pre-authorization feature. You can ask the CoopCircuit team if this integration is available. Maybe a clue? |
An occurrence very similar to this happened in UK yesterday: and assumed order had not been placed. However, order confirmation email was sent and money from customer's Stripe account was taken at the time. Bugsnag is here: https://app.bugsnag.com/yaycode/open-food-network-js-uk/errors/5f587e8727d37a0017aabc06 |
I took a look through this issue, I think there's potentially several different things going on, some of which are likely fixed in v3.8.4 and/or by @Matt-Yorkley's PR #7779, which is ready for testing. However, these last few comments sound really odd, so I want to clarify what we're saying here @Cecilia-Hn - it sounds like these are the steps to reproduce:
Is that right? |
Hi Andrew and thanks a lot. Your steps seems correct except that the customer does not saw error message.
We wrote to Stripe for having more informations about payment delay on their side, I'll come back to you as we'll get an answer. |
@Cecilia-Hn so far our only clue is what is now describe here: #7922 (orders were dealing with products going out of stock during the authorization process). I'm closing here. If we have other requests coming in which are not linked to a stock problem, we can reopen. |
Thanks for reporting @Cecilia-Hn . |
@filipefurtad0 Thanks ! |
We are still seeing this in UK as well. The pain it is causing is high! And I am not sure all the occurrences are actually being reported. |
Always through the shopfront for UK experience. |
The payment (
There are 52 such payments in FR-prod:
The first payment with this message appeared in 2021-03-19. And 4 of them UK-prod:
Hopefully this is a clue. I'm not sure they (all) relate to the same scenario. We've seen a similar message before, on a different context: |
If the order cycle closes during checkout on the shopfront, and while payment is being processed, then:
This seems to be different than the scenario above though... In this case, the order does not have any payments: So there might be more scenarios which account for this bug. |
Thanks for the update @Cecilia-Hn - definitely correct to reopen this. That screenshot you provided was super helpful. With the timestamp I was able to look through the logs on FR and find the request that we saw after the customer authorized and was redirected to OFN. The next line in the logs is:
So we're not marking the payment as complete in OFN because of that redirect. I think @filipefurtad0 is on the right track here, but I need to dig a little more to figure out why In any case, though, it might be a good idea to move the handling of the redirect from Stripe to its own controller action entirely. |
@RachL @filipefurtad0 could you elaborate on this comment? #7692 (comment) You say that Stripe said that they automatically capture payments after seven days, but in this documentation, it says that the payment is actually held and then released after seven days: https://stripe.com/docs/payments/capture-later I'm wondering if this is the same flow, or if there's another one that we're not accounting for. |
@andrewpbrett I'm afraid I made that comment based on an email exchange I had with stripe for issue #7417. And I was writing to them in French, so a lot can go wrong with my translations. Maybe I could reach out to them again and ask specific questions/ answers in English? They seemed quite reactive. |
@RachL Yes that would be great if you could ask them to clarify, thank you! |
@RachL Also based on the issue description for #7417 it looks like they're saying that the transaction is in fact canceled after 7 days, not captured:
(I assume this was quoting Stripe's reply but I'm not positive) |
Multiple reports a week of this. This is one of the worst bugs we've had and its hung around all of August. There's no one to work on it but it is an S1. |
@andrewpbrett stripe went back to me and asked that a developer contact them directly. They are happy to have a look at our integration. They are available through their chat system or with https://support.stripe.com/contact/email?topic=api_integration You will need to use this link while being loogedin FR's account (this way they answer faster as they see we are customers). You can do it with your personal access you have on FR account. Otherwise, if you log in with the credentials on bitwarden there is a 2FA on my phone, so I need to be around^^ |
For the specific payment most recently posted by @Cecilia-Hn, the problem was that we were redirecting to the home page. As @Matt-Yorkley theorized, this may be due to the person being logged in on the non-www domain and then being redirected by the payment provider to the www domain (or vice versa). To test this theory, I started a cart session and entered a card that requires SCA redirection. When I got to the SCA auth page I copied the URL and visited it in a new private window, to simulate the situation where the customer is authorizing the SCA payment but not logged in on the domain that they're about to be redirected to. Sure enough, I got:
So I believe the specific, most latest scenario described by this issue will be resolved by #8090, which is already merged and will be in the next release. It would be good to look into whether the 56 payments that @filipefurtad0 found and see if we can verify if they were all related to this same scenario (non-www vs www). I'll take some time to do that now. If it starts to take longer than an hour or two, I'd say we should move it to its own issue and close this one. |
The four payments in the UK that @filipefurtad0 found are all from late July/early August. So @lin-d-hop's report that this is still happening multiple times per week looks like a separate issue. #8090 will prevent the scenario that @Cecilia-Hn most recently mentioned, but probably not whatever is still happening in the UK. @lin-d-hop are you able to provide any order numbers of examples that you've seen recently to help narrow this down? |
Seems like this case where the order cycle closes just before the user gets redirected back is still a good candidate for improvement, right? #7692 (comment) |
I think so, yes; but I think it's unlikely that that's the root cause of these payment issues. If the order cycle closes while the customer is performing the SCA auth, the customer gets a clear message indicating what happened. They're also redirected by the I looked at the logs in the UK, and there's nothing that matches the entries you would expect for the order cycle closing scenario: there are no redirects by the So I believe:
|
I'm going to close this in favor of those two issues which more concisely describe the current state of the problem. |
Description
We've got some order R453734851 for hub ID 844 with this behavior :
1 - An order is done through OFN
2 - Payment done through Stripe
3 - Stripe indicates that the amount has been paid
4 - OFN declared a problem with the payment
Its a big problem for hub and their clients because the order status is invalid so the hub doesnt prepare the order and the client come to collect an order that wasn't prepared.
Expected Behavior
See the order on the OFN side with the "completed" status
Actual Behaviour
Order is claimed as incomplete by OFN
Steps to Reproduce
we don't know :(
Animated Gif/Screenshot
OFN :
Stripe :
Workaround
None
Severity
bug-s2: a non-critical feature is broken, no workaround
Your Environment
The text was updated successfully, but these errors were encountered: