Hi @camna
First, the ‘Save Payment Method’ is not actually saving the bank information for future use.
The mechanism behind the ACH payment method being saved is dependent on your webhook working properly. Are ACH payments completing via the webhook?
Secondly, is there an option to remove the…
Unfortunately this is an all or nothing integration and there isn’t a clean way to break the micro-deposit functionality out of how Stripe does ACH.
We saw an older version that looked to work this way
Which version are you referring to? That has never been a supported feature as payment is always take via the checkout page or the pay for order page.
Kind Regards
Thread Starter
camna
(@camna)
Hi Payment Plugins,
We confirmed the webhook is setup. However, one thing different with our flow is we are auto-completing orders once placed (even before payment_intent.succeeded). Could that be messing up the saving of the payment method? If so, is there a way we can mark an order as completed before payment_intent.succeeded without causing problems?
Version 3.3.62 seems to use the functionality of asking the customer for their bank information after they click on the ‘Pay’ Button.
Thanks,
Martin
Hi @camna
Could that be messing up the saving of the payment method?
Yes that will prevent the customer’s bank information from being saved in the WooCommerce database.
If so, is there a way we can mark an order as completed before payment_intent.succeeded without causing problems?
Yes, you can make sure the date_paid property of the order is unset after you mark the order completed. Or you could use the webhook actions to write your own code that stores the payment method.
Version 3.3.62 seems to use the functionality of asking the customer for their bank information after they click on the ‘Pay’ Button.
That used a different integration with Stripe. It’s hard to make everyone happy. When ACH used to work that way, we received many requests to support micro-deposits.
Kind Regards
Thread Starter
camna
(@camna)
Hi Payment Plugins,
Would the Version 3.3.62 have the same issue of cards not saving as the new version. We might have to temporary revert to the old version while we resolve the payment intent issue.
Thanks,
Martin
Hi @camna
Would the Version 3.3.62 have the same issue of cards not saving as the new version.
Your original request stated that it was the ACH payment method that wasn’t saving. Did you mean to say ACH instead of cards here?
The mechanism for how the ACH payment method was saved is the same in version 3.3.62. It relies on the payment _intent.succeeded webhook.
Kind Regards
Thread Starter
camna
(@camna)
Hi Payment Plugins,
Apologies im strictly talking about save method for ACH.
So if I remove the post meta field _date_paid if im autocompleting the order it would allow the the payment method to be saved correct? Do I also remove the _paid_date?
Thanks,
Martin
Hi @camna
So if I remove the post meta field _date_paid if im autocompleting the order it would allow the the payment method to be saved correct?
Yes, that should do the trick. Here are the first couple lines of the code that receives the payment_intent.succeeded webhook. Notice if the $order->get_date_paid() value exists, then the plugin does not continue. Since you’re auto-completing, that’s causing the plugin to exit the event.
if ( $payment_method instanceof WC_Payment_Gateway_Stripe ) {
if ( $payment_method->has_order_lock( $order ) || $order->get_date_paid() ) {
wc_stripe_log_info( sprintf( 'payment_intent.succeeded event received. Intent has been completed for order %s. Event exited.', $order->get_id() ) );
return;
}
Kind Regards
Thread Starter
camna
(@camna)
Hi Payment Plugins
We are moving the order to the completed status and immediately running delete_post_meta($order_id, ‘_date_paid’) to remove the _date_paid meta field.
This process is triggered when the order status changes:
From pending payment to on-hold.
From on-hold to processing.
However, we are observing that the _date_paid meta field gets re-added after what appears inital webhook interacts with the database. Despite this, the payment method (stripe_ach) is still not visible during the process.
Can you confirm if it’s correct that the order should be marked as paid once the initial webhook fires? Additionally, when is the saved payment method stored? Does this happen after the initial webhook or only after the final webhook confirms that the money has been received? If it’s the latter, does the payment date need to be cleared for that final webhook to function correctly?
Thanks,
Martin
Hi @camna
The WooCommerce order is completed and payment method saved when the payment_intent.succeeded webhook event is received.
I am not sure what initial webhook you are referring to.
I wouldn’t recommend using delete_post_meta since that depends on the postmeta table. If you’re using the newer orders table, then that function won’t actually delete the meta value. You should use the WC_Order object instead, which has helper methods for removing metadata.
Kind Regards,