Ensure WC payment token does not exist before creating it

This commit is contained in:
Emili Castells Guasch 2023-09-04 16:33:04 +02:00
parent fa60c3c8f5
commit e819dc68df
5 changed files with 93 additions and 45 deletions

View file

@ -56,10 +56,14 @@ return array(
'vaulting.payment-token-factory' => function( ContainerInterface $container ): PaymentTokenFactory {
return new PaymentTokenFactory();
},
'vaulting.payment-token-helper' => function( ContainerInterface $container ): PaymentTokenHelper {
return new PaymentTokenHelper();
},
'vaulting.payment-tokens-migration' => function( ContainerInterface $container ): PaymentTokensMigration {
return new PaymentTokensMigration(
$container->get( 'vaulting.payment-token-factory' ),
$container->get( 'vaulting.repository.payment-token' ),
$container->get( 'vaulting.payment-token-helper' ),
$container->get( 'woocommerce.logger.woocommerce' )
);
},