ACH Failed Payment Bug
-
I’m testing in sandbox ACH and regardless if I choose a valid or bad payment method, the order completes with no error.
-
Hi @joesrocha
This isn’t a bug, it’s supposed to work that way. ACH payments are asynchronous, meaning it takes some time between when the payment is initiated and when it’s actually complete/failed.
If you have your webhook setup correctly, you should see that a webhook event is received and the order’s status is updated to
failedorprocessing/completebased on the selection you made in the ACH popup.Example of an order where “Failure” was chosen in the ACH popup:
The customer’s bank account could not be located. Order status changed from On hold to Failed.Kind Regards,
-
This reply was modified 2 years, 4 months ago by
Clayton R.
Hey @mrclayton
Understood. I connected my local via ngrok. Verified sk updated. Stripe webhook attempts succeeded in connecting to my ngrok, however the order status sits in pending payment despite success pay. I do see this in debug.log:
[08-Feb-2024 01:03:53 UTC] PHP Notice: Function register_rest_route was called incorrectly. The REST API route definition for wqc/v1/query is missing the required permission_callback argument. For REST API routes that are intended to be public, use __return_true as the permission callback. Please see <a>Debugging in WordPress</a> for more information. (This message was added in version 5.5.0.) in /var/www/html/wp-includes/functions.php on line 6031
Thanks,
Joe[08-Feb-2024 01:03:53 UTC] PHP Notice: Function register_rest_route was called incorrectly. The REST API route definition for wqc/v1/query is missing the required permission_callback argument.
That route is unrelated to the Stripe plugin. Localhost testing can be tricky, I wouldn’t take issues with localhost as indicating there is a plugin issue.
I’d recommend using Stripe’s CLI which allows you to setup a webhook listener. It’s what we use internally for testing.
https://stripe.com/docs/stripe-cli
https://stripe.com/docs/webhooks#local-listener
Kind Regards
Ok, CLI worked much better. The order status changes properly to Failed when using bad card, but a successful card does not update to Completed. I’ve tried both default and completed under order status of ACH settings.
I’m going to need to trigger some custom actions when successful anyways, so I can handle status change there. If you can help point me to a hook I can use.
Thanks @mrclayton
JoeIf you can help point me to a hook I can use.
The best filter to use for changing the order status after payment completion is:
woocommerce_payment_complete_order_statusExample:
add_filter('woocommerce_payment_complete_order_status', function($status, $order_id, $order){ // your custom logic here return $status; }, 10, 3);Kind Regards
Ok, I was able to do my success actions and update status on
wc_stripe_webhook_payment_intent_succeededAppreciate your help!You’re welcome. If you have a moment we always appreciate a good review. https://ww.wp.xz.cn/support/plugin/woo-stripe-payment/reviews/
-
This reply was modified 2 years, 4 months ago by
The topic ‘ACH Failed Payment Bug’ is closed to new replies.