mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-08-31 06:52:50 +08:00
Merge pull request #839 from woocommerce/PCP-782-resubscribe-webhooks-on-plugin-upgrades
Resubscribe the WebHooks after updating plugin to newer version.
This commit is contained in:
commit
33bd09e745
1 changed files with 15 additions and 0 deletions
|
@ -143,6 +143,21 @@ class WebhookModule implements ModuleInterface {
|
|||
$logger->error( 'Failed to load webhooks list: ' . $exception->getMessage() );
|
||||
}
|
||||
}
|
||||
|
||||
add_action(
|
||||
'woocommerce_paypal_payments_gateway_migrate',
|
||||
static function () use ( $container ) {
|
||||
$registrar = $container->get( 'webhook.registrar' );
|
||||
assert( $registrar instanceof WebhookRegistrar );
|
||||
add_action(
|
||||
'init',
|
||||
function () use ( $registrar ) {
|
||||
$registrar->unregister();
|
||||
$registrar->register();
|
||||
}
|
||||
);
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue