Revert action to re-run migration externally

This commit is contained in:
Emili Castells Guasch 2023-06-23 11:51:19 +02:00
parent ba10ef98f3
commit e38bd8f503

View file

@ -178,6 +178,19 @@ class VaultingModule implements ModuleInterface {
}
);
/**
* Allows running migration externally via `do_action('pcp_migrate_payment_tokens')`.
*/
add_action(
'pcp_migrate_payment_tokens',
function() use ( $container ) {
$logger = $container->get( 'woocommerce.logger.woocommerce' );
assert( $logger instanceof LoggerInterface );
$this->migrate_payment_tokens( $logger );
}
);
add_action(
'woocommerce_paypal_payments_payment_tokens_migration',
function( int $customer_id ) use ( $container ) {