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

[Stripe] BO Order refunds broken #12843

Open filipefurtad0 opened 2 months ago

filipefurtad0 commented 2 months ago

Description

Can't refund an order paid with Stripe.

There is still some circumstances to be cleared, as there are cases in which refunding works. However this has been reported in production and reproduced in staging. Bugsnag here:

Staging-AU: https://app.bugsnag.com/yaycode/openfoodnetwork-aus/errors/65634115ca43a90008dd181c?event_id=66d88bed00f873b34b940000&i=sk&m=nw

Staging-FR: https://app.bugsnag.com/open-food-france/coopcircuits/errors/66d88481265ea77fdaae1585?event_id=66d8848100f88e9bf1790000&i=sk&m=nw

Expected Behavior

On the Payment section of the order, clicking the Void button should display a success message. The payment state should change to balance due.

Actual Behaviour

On the Payment section of the order, clicking the Void button displays the message "Can't update payment"; clicking a second time indicates that the payment has already been refunded. The payment states remain unchanged.

Steps to Reproduce

  1. Create an order paid with Stripe.
  2. On the BO, edit the order and visit the Payments section.
  3. Click on "Void", next to Stripe payment entry.
  4. See the first error message (pic 1)
  5. Click a second time. See the second error message (pic 2).

Animated Gif/Screenshot

Pic 1

image

Pic 2 image

Workaround

No workaround.

Severity

S2? or S1? I looked on bugsnag and could not find evidence that this is occurring frequently. In fact, I found this to be affecting only ine user on CA - which of course, does not mean that it cannot affect others:

image

Your Environment

Possible Fix

RachL commented 2 months ago

here is an order that reproduces the problem on staging FR: https://staging.coopcircuits.fr/admin/orders/R568554400/payments

Def not s1 as it's not a lot of occurrences, but I think we should not let this as s3 and investigate

rioug commented 1 month ago

I couldn't reproduce the error, see my order on staging AU : https://staging.openfoodnetwork.org.au/admin/orders/R203268788/payments

@RachL unfortunately staging FR has been refresh so I can' t look at your order. Any chance you could try to reproduce the bug again ?

RachL commented 1 month ago

@rioug I haven't managed to reproduce on staging FR yet but this order on staging AU does reproduce it: https://staging.openfoodnetwork.org.au/admin/orders/R313654502/edit

Otherwise if it easy to fetch production data locally, order R082352013 is reproducing the problem in CA prod