Do not schedule check saved payment if subscription behavior when fail is capture auth

This commit is contained in:
dinamiko 2022-08-16 15:04:18 +02:00
parent 2e814c8d38
commit ac31130649

View file

@ -53,6 +53,13 @@ trait ProcessPaymentTrait {
* @param int $customer_id The customer ID.
*/
protected function schedule_saved_payment_check( int $wc_order_id, int $customer_id ): void {
if (
$this->config->has( 'subscription_behavior_when_vault_fails' )
&& $this->config->get( 'subscription_behavior_when_vault_fails' ) === 'capture_auth'
) {
return;
}
as_schedule_single_action(
time() + ( 1 * MINUTE_IN_SECONDS ),
'woocommerce_paypal_payments_check_saved_payment',