Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve logging of invalid payment intent required params scenarios #3467

Open
james-allan opened this issue Sep 25, 2024 · 0 comments
Open
Labels
priority: low The issue/PR is low priority—not many people are affected or there’s a workaround, etc. type: support request

Comments

@james-allan
Copy link
Contributor

james-allan commented Sep 25, 2024

Describe the bug
There's been a number of reports of customers getting failed payment where in the Stripe log there's the following error:

Error: The information for creating and confirming the intent is missing the following data: payment_method.

This error is logged from the WC_Stripe_Intent_Controller::validate_payment_intent_required_params() function.

At the moment there's further logs that help us troubleshoot what has led to this occurring. There's no logging of the intent request or the raw $payment_information array.

To Reproduce
I haven't been able to replicate an issue naturally so the steps below force the same error but I suspect there's something else happening.

  1. Add the following code snippet to your store.
add_action( 'init', function() {
	unset( $_POST['wc-stripe-payment-method'] );
} );
  1. Add a product to your cart.
  2. Using the shortcode checkout enter a new payment method 4242424242424242.
  3. The checkout will fail with the generic error.

Screenshot 2024-09-25 at 3 06 22 pm

  1. If you check the Stripe logs you will see the following logs related to the requests.
2024-09-25T05:03:03+00:00 DEBUG 
====Stripe Version: 8.7.0====
====Stripe Plugin API Version: 2024-06-20====
====Start Log====
payment_methods/
====End Log====

2024-09-25T05:03:03+00:00 DEBUG 
====Stripe Version: 8.7.0====
====Stripe Plugin API Version: 2024-06-20====
====Start Log====
payment_methods/
====End Log====

2024-09-25T05:03:03+00:00 DEBUG 
====Stripe Version: 8.7.0====
====Stripe Plugin API Version: 2024-06-20====
====Start Log====
Error: The information for creating and confirming the intent is missing the following data: payment_method.
====End Log====

Note

There's no information about the request that helps troubleshoot the request at all.

Expected behavior

We should log additional information about the request that might help us troubleshoot the issue including the intent request and/or payment information.

Tickets

8699575-zd-a8c
8708661-zd-a8c
8739384-zd-a8c

@james-allan james-allan added priority: low The issue/PR is low priority—not many people are affected or there’s a workaround, etc. type: support request labels Sep 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
priority: low The issue/PR is low priority—not many people are affected or there’s a workaround, etc. type: support request
Projects
None yet
Development

No branches or pull requests

1 participant