woocommerce / woocommerce-gateway-stripe

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

Indicate reason to merchant when Stripe SEPA test mode not working #1080

Open jobthomas opened 5 years ago

jobthomas commented 5 years ago

Describe the bug When I enable Stripe SEPA together with Stripe Test Mode, I can't get it to work. I get the following error in the checkout:

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

I've tested with both the

In the Stripe logs, the only thing I see is:

2019-11-07T08:21:15+00:00 DEBUG 
====Stripe Version: 4.3.0====
====Start Log====
customers/cus_G8MwgpayEQmGVJ/sources request: Array
(
    [limit] => 100
)

====End Log====

failure Link to image here: https://cld.wthms.co/HCTYZq.

To Reproduce Steps to reproduce the behavior:

  1. Go to WooCommerce > Settings > Payments > Stripe
  2. Enable Stripe and test mode + make sure that the webhook is working as required for SEPA (not sure if that's also required for testmode)
  3. Go to WooCommerce > Settings > Payments > Stripe SEPA
  4. Enabled
  5. Add a product to cart and try to pay with SEPA

Error confirmed by @treibalen and @dougaitken p1573115109025900-slack-C2C8F5PNJ

madeincosmos commented 4 years ago

Changing priority to High, as it makes us unable to test any SEPA scenario, or even confirm if it's working or not.

jobthomas commented 4 years ago

So it is actually working in test mode, you just need Stripe to give you permission to use SEPA in test mode. I'm not sure this is something we can change on our side @madeincosmos

dougaitken commented 4 years ago

Closing as we've confirmed that to test SEPA, Stripe.com needs to activate SEPA on the Stripe.comaccount.

Internal discussion - p6q7sZ-6Do-p2

cc @grigorijurasov @jrick1229

jobthomas commented 4 years ago

I'm reopening this, I think the error notice should be more clear towards the users. It took us a while to figure out why it wasn't working; I assume that's the same for users.

dougaitken commented 4 years ago

I believe providing a correct error message relating to what is or isn't enabled on the Stripe.com account will need checking account status via the API - I'm unsure if that is available.

jobthomas commented 4 years ago

In that case, some conditional response would be nice

Or something like that

jessepearson commented 4 years ago

In 2776631-zen the customer contacted Stripe directly while testing SEPA and they reported this back from Stripe:

I checked the latest test and noticed that while you already use version 4.2.3 of the Plugin, charges still seem to created with the v1/charges endpoint, which is why the test fails. You may therefore want to reach out to WooCommerce to check with them why that is the case.

I think the 4.2.3 is a typo here, because the current version of the Stripe extension is using an older version of the API: https://github.com/woocommerce/woocommerce-gateway-stripe/blob/4.3.2/includes/class-wc-stripe-api.php#L16-L17 https://stripe.com/docs/upgrades#api-changelog

jessepearson commented 4 years ago

@jobthomas Any chance you can test to make sure SEPA is still working in test mode for you?

jobthomas commented 4 years ago

Yup, just tested it:

``` 2020-03-11T08:45:40+00:00 DEBUG ====Stripe Version: 4.3.2==== ====Start Log==== Info: Begin processing payment for order 1414 for the amount of 12.10 ====End Log==== 2020-03-11T08:45:40+00:00 DEBUG ====Stripe Version: 4.3.2==== ====Start Log==== charges request: Array ( [currency] => eur [amount] => 1210 [description] => WooCommerce Test Site - Order 1414 [expand[]] => balance_transaction [metadata] => Array ( [customer_name] => Zoe Tamayo [customer_email] => zoe@sales.local [order_id] => 1414 [payment_type] => recurring [site_url] => https://thomas.mystagingwebsite.com ) [customer] => cus_G8MwgpayEQmGVJ [source] => src_1GLQC6HqYkdL8KtQee8hJONK ) ====End Log==== 2020-03-11T08:45:41+00:00 DEBUG ====Stripe Version: 4.3.2==== ====Start Log==== Processing response: stdClass Object ( [id] => py_1GLQC9HqYkdL8KtQAAPTqaca [object] => charge [amount] => 1210 [amount_refunded] => 0 [application] => [application_fee] => [application_fee_amount] => [balance_transaction] => [billing_details] => stdClass Object ( [address] => stdClass Object ( [city] => Old Monroe [country] => FR [line1] => 2349 Court Street [line2] => [postal_code] => 63369 [state] => ) [email] => zoe@sales.local [name] => Zoe Tamayo [phone] => 636-665-8080 ) [captured] => 1 [created] => 1583916341 [currency] => eur [customer] => cus_G8MwgpayEQmGVJ [description] => WooCommerce Test Site - Order 1414 [destination] => [dispute] => [disputed] => [failure_code] => [failure_message] => [fraud_details] => stdClass Object ( ) [invoice] => [livemode] => [metadata] => stdClass Object ( [customer_name] => Zoe Tamayo [customer_email] => zoe@sales.local [order_id] => 1414 [payment_type] => recurring [site_url] => https://thomas.mystagingwebsite.com ) [on_behalf_of] => [order] => [outcome] => stdClass Object ( [network_status] => approved_by_network [reason] => [risk_level] => not_assessed [seller_message] => Payment complete. [type] => authorized ) [paid] => [payment_intent] => [payment_method] => src_1GLQC6HqYkdL8KtQee8hJONK [payment_method_details] => stdClass Object ( [sepa_debit] => stdClass Object ( [bank_code] => 37040044 [branch_code] => [country] => DE [fingerprint] => lRcR96mEH7i1MnxE [last4] => 3000 [mandate] => ) [type] => sepa_debit ) [receipt_email] => [receipt_number] => [receipt_url] => https://pay.stripe.com/receipts/acct_1AP8nNHqYkdL8KtQ/py_1GLQC9HqYkdL8KtQAAPTqaca/rcpt_GtCb8Wa64fx64dj0Z3i1PA0OOP9SDgW [refunded] => [refunds] => stdClass Object ( [object] => list [data] => Array ( ) [has_more] => [total_count] => 0 [url] => /v1/charges/py_1GLQC9HqYkdL8KtQAAPTqaca/refunds ) [review] => [shipping] => [source] => stdClass Object ( [id] => src_1GLQC6HqYkdL8KtQee8hJONK [object] => source [amount] => [client_secret] => src_client_secret_b70xzKiwvBDfMpMISS483QMC [created] => 1583916341 [currency] => eur [customer] => cus_G8MwgpayEQmGVJ [flow] => none [livemode] => [mandate] => stdClass Object ( [acceptance] => stdClass Object ( [date] => [ip] => [offline] => [online] => [status] => pending [type] => [user_agent] => ) [amount] => [currency] => [interval] => variable [notification_method] => email [reference] => QTA6U8IDCVSJLRG6 [url] => https://hooks.stripe.com/adapter/sepa_debit/file/src_1GLQC6HqYkdL8KtQee8hJONK/src_client_secret_b70xzKiwvBDfMpMISS483QMC ) [metadata] => stdClass Object ( ) [owner] => stdClass Object ( [address] => stdClass Object ( [city] => Old Monroe [country] => FR [line1] => 2349 Court Street [line2] => [postal_code] => 63369 [state] => ) [email] => zoe@sales.local [name] => Zoe Tamayo [phone] => 636-665-8080 [verified_address] => [verified_email] => [verified_name] => [verified_phone] => ) [sepa_debit] => stdClass Object ( [last4] => 3000 [bank_code] => 37040044 [fingerprint] => lRcR96mEH7i1MnxE [country] => DE [mandate_reference] => QTA6U8IDCVSJLRG6 [mandate_url] => https://hooks.stripe.com/adapter/sepa_debit/file/src_1GLQC6HqYkdL8KtQee8hJONK/src_client_secret_b70xzKiwvBDfMpMISS483QMC [branch_code] => ) [statement_descriptor] => [status] => chargeable [type] => sepa_debit [usage] => reusable ) [source_transfer] => [statement_descriptor] => [statement_descriptor_suffix] => [status] => pending [transfer_data] => [transfer_group] => ) ====End Log==== 2020-03-11T08:45:43+00:00 DEBUG ====Stripe Version: 4.3.2==== ====Start Log==== balance/history/txn_1GLQCAHqYkdL8KtQvZ0NdRrY ====End Log==== ```
jessepearson commented 4 years ago

@jobthomas Great, thank you!