woocommerce / woocommerce-gateway-stripe

The official Stripe Payment Gateway for WooCommerce
https://wordpress.org/plugins/woocommerce-gateway-stripe/
237 stars 207 forks source link

Cannot add GB sepa Direct Debit payments (intermittent) #2312

Open englishincourbevoie opened 2 years ago

englishincourbevoie commented 2 years ago

Describe the bug UK IBANs (country code GB) are not accepted by Woocommerce Stripe Gateway on add payment methods page.

Error message is

Unable to save this payment method, please try again or use alternative method.

On Stripe's end, the logs show that the POST request doesn't contain a required field, that is the address

{ "type": "sepa_debit", "owner": { "name": "Mr Redacted", "email": "readacted@test.com", "address": { "country": } },

To Reproduce Steps to reproduce the behavior: Log into Wordpress account, go to My Account > Payment Methods > Add Payment Method

Environment (please complete the following information):

WooCommerce version: |   | 6.0.0 WooCommerce REST API package: |   | 6.0.0

thracefulton commented 2 years ago

A merchant in 4950500-zen has encountered this as well. WP 5.9.3 / WC 6.4.0 / Stripe 6.3.0

When trying to add a real or test account with the GB country code, the Stripe logs show the parameter_missing - owner.address.country error.

(See StripeDocs here: https://stripe.com/docs/sources/sepa-debit#custom-client-side-source-creation)

thracefulton commented 2 years ago

I was able to replicate this on a fresh test site (only Woo/JP/Stripe installed). I tested with GB82WEST12345698765432 and then AT611904300234573201 with the following results:

Screenshot on 2022-04-19 at 12-42-00 Screenshot on 2022-04-19 at 12-43-14

In both cases, these are test IBANs that have not been used by the customer and are just attempted to be added as saved payment methods via the account.

dougaitken commented 2 years ago

Details from 4950500-zen via @rupole1185 in https://github.com/woocommerce/woocommerce/issues/32590

Describe the bug

Error when saving SEPA DD on stripe using WOOCOMMERCE. Stripe replies that a "Parameter missing: owner.addresss.country”.

I investigated a bit more and I found in Stripe documentation that:

Creating a SEPA Direct Debit PaymentMethod requires that you include the customer's name and email address in the billing_details property of the payment_method parameter. Additionally, IBANs with the country codes AD, PF, TF, GI, GB, GG, VA, IM, JE, MC, NC, BL, PM, SM, CH, and WF require the country and line1 properties of the billing_details.address property

I guess currently woocommerce is not doing so [for the sake of clarification my IBAN is a UK one].

I here link the stripe documentation: https://stripe.com/docs/payments/sepa-debit/accept-a-payment?platform=web

Expected behavior

In the stripe request we have to add the "address" part nested inside the "owner" if country is one among AD, PF, TF, GI, GB, GG, VA, IM, JE, MC, NC, BL, PM, SM, CH, and WF.

{ "type": "sepadebit", "owner": { "name": "Name Surname", "email": "email@email.com", "address": { "country": GB }_ }, "currency": "eur", "mandate": { "notification_method": "email" }, "sepa_debit": { "iban": "GB****" }, "guid": "XX", "muid": "XX", "sid": "XX", "payment_user_agent": "XX", "time_on_page": "XX", "key": "XX" }

Actual behavior

Post request made without address

Steps to reproduce

  1. Attempt to save a GB IBAN as saved SEPA DIRECT DEBIT payment method using stripe plugin

WordPress Environment

Woocommerce: Version 6.3.1 WordPress5.9.3

ryanr14 commented 9 months ago

Experiencing this issue in 7802691-zen using a IBAN number beginning with CH.