Increase saved payment checking time to allow webhook to arrive before

This commit is contained in:
Emili Castells Guasch 2023-07-21 15:49:32 +02:00
parent 81a735751b
commit ff7e505028
2 changed files with 2 additions and 1 deletions

View file

@ -72,6 +72,7 @@ class VaultingModule implements ModuleInterface {
'woocommerce_paypal_payments_check_saved_payment',
function ( int $order_id, int $customer_id, string $intent ) use ( $container ) {
$payment_token_checker = $container->get( 'vaulting.payment-token-checker' );
assert( $payment_token_checker instanceof PaymentTokenChecker );
$payment_token_checker->check_and_update( $order_id, $customer_id, $intent );
},
10,

View file

@ -40,7 +40,7 @@ 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;
$timestamp = 3 * MINUTE_IN_SECONDS;
if (
$this->config->has( 'subscription_behavior_when_vault_fails' )
&& $this->config->get( 'subscription_behavior_when_vault_fails' ) === 'capture_auth'