openfoodfoundation / openfoodnetwork

Connect suppliers, distributors and consumers to trade local produce.
https://www.openfoodnetwork.org
GNU Affero General Public License v3.0
1.12k stars 724 forks source link

"Card declined" without trace in Stripe dashboard #6547

Open mkllnk opened 3 years ago

mkllnk commented 3 years ago

Description

A customer was unable to pay with a stored credit card during checkout. They were successful in the weeks before but the payment wouldn't go through on that day. The bank confirmed that everything was okay with the card. While the failures were reported in Bugsnag, the Stripe dashboard doesn't show the failed payments. It does show the customer record and previous successful payments though. The setup seems correct.

While the error message "Your card was declined." is usually triggered by the bank for a good reason, it should show up in the connected Stripe account. The fact that it doesn't show up, may indicate that we are not using the API correctly and that the payment attempt could not be associated with the right account.

Expected Behavior

Failed payments show up in the Stripe dashboard.

Actual Behaviour

Only previous successful payments show in Stripe.

Steps to Reproduce

  1. Check out with card id 21934 on au-prod.

We can't re-produce it without the user doing it themselves.

Animated Gif/Screenshot

Workaround

The user doesn't have another card. We will advise to re-enter the card details and wait for feedback.

Severity

bug-s1: a critical feature is broken: checkout, payments, signup, login bug-s2: a non-critical feature is broken, no workaround bug-s3: a feature is broken but there is a workaround bug-s4: it's annoying, but you can use it bug-s5: we can live with it, only a few users impacted

This is a critical feature without known workaround but since we know only of one affected card so far, I rated it only as S3.

Your Environment

Error in OpenFoodNetwork

RuntimeError in checkout#update Your card was declined.

View on Bugsnag

Stacktrace

app/controllers/checkout_controller.rb:219 - checkout_failed
app/controllers/checkout_controller.rb:214 - action_failed
app/controllers/checkout_controller.rb:159 - checkout_workflow
app/controllers/checkout_controller.rb:51 - update
app/services/current_order_locker.rb:11 - block in around
app/services/current_order_locker.rb:24 - block in lock_order_and_variants
app/services/current_order_locker.rb:22 - lock_order_and_variants
app/services/current_order_locker.rb:11 - around

View full stacktrace

Created by Maikel via Bugsnag

kirstenalarsen commented 3 years ago

from Renata

so the issue of the declined card at the Timbarra Farm shop continues (Previous conversation from last week HERE) The customer has again tried and failed to pay at checkout: “Hi Helen, I just placed a $57 order with you. My card wouldn’t work on the site again so I paid by bank transfer. Screen shots attached. I tried both browsers; Apple Safari and Google Chrome. I entered my card details in again from scratch but no luck. My card works everywhere else that I use it. Can’t think what may be the problem. Karen : )” The customer Karen took a screenshot, also attached. You can see from her email that she tried re-entering her details and different browsers.

![Uploading image.png…]()

kirstenalarsen commented 3 years ago

This is a repeat of the issue I was very concerned about in #5785. Read from comments at 23 July. ISo it seems we are now picking this up in Bugsnag, but not doing anything about it. The card is fine and is working on other websites - why is it not working on OFN? I am concerned that we have no idea how many users it is impacting. Making this S2 for reinvestigation

andrewpbrett commented 3 years ago

I looked up this account and I actually do see the declines in the Stripe logs for the shop. @mkllnk might have been looking at a different one, or at the platform account? I see two declines within two minutes of each other for the customer (Karen) on Dec 20 around 23:00 (that's probably adjusted to be my time zone, so Dec 21 at around 18:00 in AU) and several on Dec 14.

So that piece seems solved; as for why this card is being accepted elsewhere online, but not OFN, I'm going to keep digging.

andrewpbrett commented 3 years ago

I removed the saved card from Stripe/OFN to see if that might be the issue; in the logs, we're requesting the same customer/card combination every time.

mkllnk commented 3 years ago

@andrewpbrett So what's the next step? Shall we tell the customer that we removed the card and that they need to re-enter it?

andrewpbrett commented 3 years ago

@mkllnk sorry about that, I chatted with Renata in Slack and didn't recap it here. Renata contacted the customer and we were going to see if re-trying the card worked. I'll follow up with her.

kirstenalarsen commented 3 years ago

Stripe docs relevant to this issue - https://stripe.com/docs/connect/dashboard/managing-individual-accounts#inspecting-accounts image

RachL commented 3 years ago

@andrewpbrett your task on this issue is to provide screenshot of the declined state in stripe. If this is indeed the case this issue can be closed.

kirstenalarsen commented 3 years ago

hi @andrewpbrett I went looking for this to save you a task and couldn't find it so unfortunately still with you. This is what I get for Timbarra Farms / Brock Environmental on the 14 Dec image

Renatacumming commented 3 years ago

Please find attached images of the transaction declines on 24/12/2020 for reference

Screen_Shot_2020-12-14_at_4 39 06_pm
Renatacumming commented 3 years ago

The second image comes with the statement 'It might be worth noting that there are many incomplete orders by Karen too but there is no way of telling the date the cart was opened and therefore to know if it is related to this issue.'

Screen_Shot_2020-12-14_at_4 36 10_pm
andrewpbrett commented 3 years ago

Thanks for taking a look, appreciate it @kirstenalarsen :-) (and @Renatacumming! you added yours as I was composing this).

To find the declines I clicked on "Logs" under the "Developer" menu on the left (while logged in as the connected account, as Lynne pointed out today). Here's a screenshot of what I saw for the 14th; there were two more declines on Dec 20.

I redacted the customer ID (cus_IB...), but when I clicked on it, it wasn't found, so I had to copy it and search in the platform account to find the customer record. That was how I confirmed that it was the same customer.

Screen Shot 2021-01-18 at 7 53 34 PM
kirstenalarsen commented 3 years ago

thanks @andrewpbrett - do you have any clues as to why this would show in dev logs but not in actual ui? is that a hint of a problem in our connection with stripe rather than stripe itself? or are we 150% sure this is stripe declining the card, not us inadequately providing the card to stripe?

andrewpbrett commented 3 years ago

That's a good question to ask; I do see other failed payments that do show up under the Payments tab in the connected account (if I use the filter button and say Status = Failed). The thing I notice about those payments is that they have a specific decline message, whereas those in the screenshot I posted just have a generic decline code, so that might be one reason. They do share the same response code as the others, a 402.

We could put in a ticket with Stripe to ask why some declines appear under Payments and others don't. I'm reasonably confident that if we weren't providing enough information to Stripe, or providing it incorrectly in some way, that we wouldn't be seeing a message saying the card was declined.

andrewpbrett commented 3 years ago

I'm going to downgrade back to S3 and move this to All the Things unless there are any objections.