mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-09-05 08:59:14 +08:00
Do not delay scheduled action when subscription behavior is capture auth
This commit is contained in:
parent
ac31130649
commit
b1a49a9af1
3 changed files with 6 additions and 5 deletions
|
@ -53,15 +53,16 @@ trait ProcessPaymentTrait {
|
|||
* @param int $customer_id The customer ID.
|
||||
*/
|
||||
protected function schedule_saved_payment_check( int $wc_order_id, int $customer_id ): void {
|
||||
$timestamp = 1 * MINUTE_IN_SECONDS;
|
||||
if (
|
||||
$this->config->has( 'subscription_behavior_when_vault_fails' )
|
||||
&& $this->config->get( 'subscription_behavior_when_vault_fails' ) === 'capture_auth'
|
||||
) {
|
||||
return;
|
||||
$timestamp = 0;
|
||||
}
|
||||
|
||||
as_schedule_single_action(
|
||||
time() + ( 1 * MINUTE_IN_SECONDS ),
|
||||
time() + $timestamp,
|
||||
'woocommerce_paypal_payments_check_saved_payment',
|
||||
array(
|
||||
'order_id' => $wc_order_id,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue