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

staging-UK: payments with Stripe-SCA - page not found after authentication step #6931

Closed
filipefurtad0 opened this issue Feb 22, 2021 · 7 comments
Labels
bug-s4 The bug is annoying, but doesn't prevent from using the platform. Not so many users are impacted. bugsnag

Comments

@filipefurtad0
Copy link
Contributor

filipefurtad0 commented Feb 22, 2021

Description

Checking out using Stripe SCA leads to a "page not found", after the authentication step, on staging-UK.

This seems only related to staging-UK. After staging master - https://semaphoreci.com/openfoodfoundation/openfoodnetwork-2/branches/master/builds/2204 - in staging-AU, I could not reproduce the issue.

Broken link:

https://demo.openfoodnetwork.org/checkout?payment_intent=pi_1INb0GKuuB1fWySnlcjek3UU&payment_intent_client_secret=pi_1INb0GKuuB1fWySnlcjek3UU_secret_7r254T92ftvzB97Y5C0eeEbbp

Console:

image.png

stripe_sca_broken_in_staging_uk.gif

Steps to reproduce

  1. As a customer, visit a hub, which has stripe-SCA set up
  2. Insert some items and proceed to check-out
  3. Insert card 4000002760003184 or any card which requires authentication
  4. Try to authenticate, and finish the purchase
@filipefurtad0 filipefurtad0 added pr-staged-au staging.openfoodnetwork.org.au and removed pr-staged-au staging.openfoodnetwork.org.au labels Feb 22, 2021
@filipefurtad0
Copy link
Contributor Author

This seems to be the case, with staging Katuma as well:
image

But working on staging-FR, and AU. I'm using the same Stripe account to connect to all staging servers.

@filipefurtad0 filipefurtad0 added bug-s3 The bug is stopping a critical or non-critical feature but there is a usable workaround. bugsnag bug-s4 The bug is annoying, but doesn't prevent from using the platform. Not so many users are impacted. and removed bug-s3 The bug is stopping a critical or non-critical feature but there is a usable workaround. labels Feb 23, 2021
@filipefurtad0
Copy link
Contributor Author

filipefurtad0 commented Feb 23, 2021

Perhaps not a Sysadmin issue, maybe even expected behavior, it needs further investigation. I'm moving this to All the things for now. I haven't found this error on production, so -> S4.

On orders/servers/(situations?) in which for some reason are not going through with a 3D-auth. card., payments with non-3D-auth. card (like 424242...) card triggers this error:`

RuntimeError: You cannot capture a payment for an amount greater than it already has`

https://app.bugsnag.com/katuma/katuma/errors/602cbf57d9fdda00188e2bbe?event_id=6034bfbd006ca08d237b0000&i=sk&m=nw

image

Attempting once again, with the 424242... card then works, but we can see the several attempts on the transaction fee:

image

A tentative explanation here is that Stripe charges a fee for 3D-auth. transactions. This fee is expected on the subsequent payment (non-3D-auth) which triggers the error. This would explain everything, except:

  • that the hubs transaction fees pile up on the shopfront as well - although this seems to happen only in this scenario (1) attempting payment with a 3D-auth card, and, after failing, pay the order with a non-3D-auth card.
  • the fact that 3D payments are not going through in some cases (the title of this issue)

@Matt-Yorkley
Copy link
Contributor

It looks like the Spree::Config['site_url'] value has been reset to the default somehow (demo.openfoodnetwork.org). That's what's breaking the redirects. I imagine if you click a link in an email (like reset password) it will also be broken...

@filipefurtad0
Copy link
Contributor Author

Yes, I just confirmed that now (for password reset). Wondering how we lost that config... After a deployment? 🤔

@Matt-Yorkley
Copy link
Contributor

I've just reset it via superadmin, we can keep an eye on it...

@filipefurtad0
Copy link
Contributor Author

Ok, it's back now - after restarting unicorn, changes took effect 👍

@filipefurtad0
Copy link
Contributor Author

filipefurtad0 commented Feb 27, 2021

I think the issue can be closed now, but I'm thinking if we could somehow automate post-deployment checks. In /spec/features/admin/configuration/general_settings_spec.rb we have this like:

expect(find("#site_url").value).to eq("demo.openfoodnetwork.org")

Which is of course not catching changes in this field after deployment, on other environments...

We also had this issue in the past #5932 (which probably can be closed as well).

This issue/comment also seems related:
#6529 (comment)

How could we improve automatic post-deployment checks? Opened #6968.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug-s4 The bug is annoying, but doesn't prevent from using the platform. Not so many users are impacted. bugsnag
Projects
None yet
Development

No branches or pull requests

2 participants