openfoodfoundation / openfoodnetwork

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

Snail when creating payment methods (Stripe and Paypal) #8210

Open filipefurtad0 opened 2 years ago

filipefurtad0 commented 2 years ago

Description

When creating a Stripe payment method the section Provider settings appears, in which one should select a Stripe Account Owner. If left blank, submitting the form will display an error (as expected) but it will also and automatically reset the Provider field back into the default selection (Cash/Check), while maintaining the section "Provider settings" on the screen.

Choosing a Stripe Account Owner and submitting the form then triggers an error 500.

Expected Behavior

After an unsuccessful form submission to create a Stripe payment method the Provider field should display the Stripe SCA provider, and not the default selection Cash/Check.

Actual Behaviour

After an unsuccessful form submission to create a Stripe payment method the Provider field displays the default selection Cash/Check.

Steps to Reproduce

  1. Create a stripe payment method
  2. Forget to add an account owner
  3. You should see this nice error message

image

  1. Select an account owner -> notice the Provider field displays the default selection Cash/Check

image

  1. Validate the form => :bumm: error 500.

Animated Gif/Screenshot

Peek 2021-09-20 17-03

Workaround

Fill in the for correctly on your first attempt or set the provider field back to Stripe SCA before resubmitting the form.

Severity

bug-s3: a feature is broken but there is a workaround

Your Environment

Possible Fix

drummer83 commented 2 years ago

The same just happened to me when creating a Paypal payment method. Let me know if this should be a separate issue!

Steps to reproduce

filipefurtad0 commented 2 years ago

Great, thanks for adding to this @drummer83 - I've updated the title to refer to both payment methods.