Skip to content
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

Multiple Customer entries in Stripe but Order was not processed #5862

Closed
emilyjeanrogers opened this issue Aug 5, 2020 · 7 comments
Closed
Labels
bug-s2 The bug is affecting any of the non-critical features described in S1 and there is no workaround.

Comments

@emilyjeanrogers
Copy link

emilyjeanrogers commented Aug 5, 2020

Description

There are multiple entries in Aus Stripe Connect account for a Customer (User ID 13923) who tried to create an order on OFN. Customer says they had trouble processing payment and were unable to place an order with Prom Coast Food Collective 1965

Expected Behavior

Order created, payment processed

Actual Behaviour

Customer (User ID 13923) made 7 attempts using one credit card and 1 attempt using another credit card between 9.28am and 9.39am on August 3rd. No fraud report in Stripe.

There is an incomplete order record for this transaction on OFN, with a zero amount

Steps to Reproduce

Unable to reproduce

Animated Gif/Screenshot

Customer listed 8 times in Stripe Connect:
Screen Shot 2020-08-05 at 10 12 03 AM

Customer order is incomplete, in Cart state, with a zero balance:
Screen Shot 2020-08-05 at 11 03 13 AM

Order is empty:
Screen Shot 2020-08-05 at 11 19 29 AM

No results in User Report on OFN:
Screen Shot 2020-08-05 at 10 41 01 AM

Workaround

The hub can manually create an order for this customer.
We can manually monitor the Stripe Connect account to identify future occurrences

Severity

S2

https://github.com/openfoodfoundation/openfoodnetwork/wiki/Bug-severity
-->

Your Environment

  • Version used:
  • Browser name and version:
  • Operating System and version (desktop or mobile):

Possible Fix

@RachL
Copy link
Contributor

RachL commented Aug 5, 2020

@luisramos0 @kirstenalarsen could this be similar to #5785 ?

@sigmundpetersen sigmundpetersen added the bug-s2 The bug is affecting any of the non-critical features described in S1 and there is no workaround. label Aug 5, 2020
@kirstenalarsen
Copy link
Contributor

I don't know @RachL - I suspect somehow it is. I didn't monitor Stripe to see if my attempts on that day were picked up in the customer list.

when I look back I see only 4 customers created on that day - which seems small but I'm not sure what triggers a customer to be created. I don't see the list of attempts like above though, so I don't think it's exactly the same thing

@luisramos0
Copy link
Contributor

luisramos0 commented Aug 5, 2020

Nice issue description @emilyjeanrogers 👏

Off the top of my head, I think a customer is only created when the user saves the card. This can be easily tested.

#5785 is just a generic "payment failed with potentially no record of it on our side or stripe", we dont know anything specific about it. So it is related in that it is a failed payment here too.

But in this case we do have records.
I can see this in bugsnag:
image

I see several of these as in Stripe.
I see a log for the 7971 card as well security code problem:
image
I see the summary and the flash message do not match in this case, I think this could be due to multiple retries and the "memory effect" on flashes that @filipefurtad0 has been noticing. But I dont think it would be the cause of this issue.

This shows that the backend replied correctly with a flash message, the question is: did the user not see the flash message? was the flash message displayed? Checkout failed because of the card.

I wonder if we have a problem with flashes, one hypothesis is that the flash was only showed on the first attempt (this can be tested) and not afterwards.

I wonder why the order is empty. Do we have any info about that? Did the user remove the items afterwards? Did they got removed automatically? I don't think we have ever seen that before. We have seen fees disappear but not items.

On a parallel note, on the tech side, I am not sure I understand why, with this stack trace, we don't have a payment object in the database:

gems/bugsnag-6.14.0/lib/bugsnag/report.rb:185:in `new': Your card's security code is incorrect. (RuntimeError)
    from gems/bugsnag-6.14.0/lib/bugsnag/report.rb:185:in `block in generate_exception_list'
    from gems/bugsnag-6.14.0/lib/bugsnag/report.rb:181:in `map'
    from gems/bugsnag-6.14.0/lib/bugsnag/report.rb:181:in `generate_exception_list'
    from gems/bugsnag-6.14.0/lib/bugsnag/report.rb:51:in `initialize'
    from gems/bugsnag-6.14.0/lib/bugsnag.rb:71:in `new'
    from gems/bugsnag-6.14.0/lib/bugsnag.rb:71:in `notify'
    from app/controllers/checkout_controller.rb:242:in `update_failed'
    from app/controllers/checkout_controller.rb:178:in `checkout_workflow'
    from app/controllers/checkout_controller.rb:52:in `update'

This problem happened in 3.2.0 which includes PR #5806 but it does not include #5824 from v3.2.1 (deployed this week).

@Matt-Yorkley
Copy link
Contributor

This problem happened in 3.2.0 which includes PR #5806 but it does not include #5824 from v3.2.1 (deployed this week).

So this was potentially fixed by #5824 in v3.2.1, right?

@luisramos0
Copy link
Contributor

luisramos0 commented Aug 16, 2020

yes, correct @Matt-Yorkley 5824 (in v3.2.1) may have fixed this.

I am sure #5906 will improve the flash message problem I describe above
And #5905 is also very promising.
Both these 2 last PRs are not merged yet.

I don't understand the missing payment object and I am not sure any of the PRs above will fix the problem...
The only hope is really that order.destroy process (removed in #5905) deletes the payments but fails to delete the order itself? I am not sure about this as I believe a rollback would keep all data as is.

I think we need to stream line both #5905 and #5906 and get them on the next release (to be prepared on the 20th Aug and to be deployed on the 25th Aug).

@Matt-Yorkley
Copy link
Contributor

Agreed. We're pretty low on capacity though.

@luisramos0
Copy link
Contributor

Both #5905 and #5906 are merged and will be on the next release.
I am closing this issue for now. If this happens again after the next release is deployed we should reopen this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug-s2 The bug is affecting any of the non-critical features described in S1 and there is no workaround.
Projects
None yet
Development

No branches or pull requests

6 participants