Open glagonikas opened 1 year ago
Exactly the same problem for me.
This happens for us too.
Same for us:
Uncaught TypeError: WC_Stripe_API::detach_payment_method_from_customer(): Argument #2 ($payment_method_id) must be of type string, null given, called in /woocommerce-gateway-stripe/includes/class-wc-stripe-customer.php on line 472 and defined in /woocommerce-gateway-stripe/includes/class-wc-stripe-api.php:327 Stack trace: #0 /woocommerce-gateway-stripe/includes/class-wc-stripe-customer.php(472): WC_Stripe_API::detach_payment_method_from_customer() #1 /woocommerce-gateway-stripe/includes/class-wc-stripe-intent-controller.php(132): WC_Stripe_Customer->delete_source() #2 /wp-includes/class-wp-hook.php(308): WC_Stripe_Intent_Controller->verify_intent() #3 /wp-includes/class-wp-hook.php(332): WP_Hook->apply_filters() #4 /wp-includes/plugin.php(517): WP_Hook->do_action() #5 /woocommerce/includes/class-wc-ajax.php(96): do_action() #6 /wp-includes/class-wp-hook.php(308): WC_AJAX::do_wc_ajax() #7 /wp-includes/class-wp-hook.php(332): WP_Hook->apply_filters() #8 /wp-includes/plugin.php(517): WP_Hook->do_action() #9 /wp-includes/template-loader.php(13): do_action() #10 /wp-blog-header.php(19): require_once('...') #11 /index.php(17): require('...') #12 {main} thrown in /woocommerce-gateway-stripe/includes/class-wc-stripe-api.php at row 327
@nicomollet @duotive @andreDane do you also see paid orders going into pending / failed?
My PR seems to be resolving the issue and we've not seen any unexpected behaviour so far.
Also, you have more than one gateways? Like Braintree etc?
I'm trying to debug another (possibly related) bug...
Spotted in 6523490-zen while investigating a different issue.
6585471-zen
This happens when the customer tries to delete their old payment method after a payment has failed.
In WC_Stripe_Intent_Controller::verify_intent()
, NULL
is passed to WC_Stripe_Customer::delete_source()
at code:
$customer = new WC_Stripe_Customer( wp_get_current_user()->ID );
$customer->delete_source( $intent->last_payment_error->source->id )
I'm not sure why an error would be used to fetch the ID, but in any case, a few lines prior, isset( $intent->last_payment_error )
is tested, while $intent->last_payment_error->source->id
is used. I recommend extending the test to verify the children-objects' properties or otherwise always falling back to the actual metadata instead of the error.
--
Edit: looking more closely... what does that code even do when we already rely on woocommerce_payment_token_deleted
?
[Internal] We received another report of this on 6712627-zen
7238549-zen
7360317-zen - on this site, when a payment fails, a duplicate card entry is created under "payment methods" which is quite odd:
The duplicate payment method does not work, but the original one often does if the customer retries a payment.
This is the error:
Argument 2 passed to WC_Stripe_API::detach_payment_method_from_customer() must be of the type string, null given, called in /home/sportin1/public_html/wp-content/plugins/woocommerce-gateway-stripe/includes/class-wc-stripe-customer.php on line 489 and defined in /home/sportin1/public_html/wp-content/plugins/woocommerce-gateway-stripe/includes/class-wc-stripe-api.php:327
7950081-zd
8062147-zen
8219514-Zen appears to be experiencing this issue as well, may also be a secondary issue involved.
I am seeing the same error in my site's logs too
zen - 8311446
Describe the bug We're coming across a number of errors in our logs stating the following
Steps to reproduce While in test mode use cards 4000000000003220 or 4000000000003063, and when the 3ds modal comes up fail the validation. That will result in a payment intent response from the API with an last_payment_error object that does not contain the source. This can be reproduced on vanilla installation.
Additional Context In the comment found here https://github.com/woocommerce/woocommerce-gateway-stripe/blob/12f1e41fe65632fee47156545efdbdd46c3a621e/includes/class-wc-stripe-intent-controller.php#L133-L135 you state that Stripe "Stripe saves the payment method even if the authentication fails for 3DS cards.". This has probably changed and it's what's causing this fatal?
Environment (please complete the following information):