add hook to remove cache on listening request

This commit is contained in:
carmenmaymo 2023-08-24 11:49:54 +02:00
parent c10c4feb09
commit 9a85d86ef5
No known key found for this signature in database
GPG key ID: 6023F686B0F3102E

View file

@ -104,6 +104,16 @@ class ApplepayModule implements ModuleInterface {
$apple_status->apple_is_active();
}
);
add_action(
'woocommerce_paypal_payments_on_listening_request',
static function() use ( $c ) {
$apple_status = $c->get( 'applepay.apple-product-status' );
if ( $apple_status->has( AppleProductStatus::APPLE_STATUS_CACHE_KEY ) ) {
$apple_status->delete( AppleProductStatus::APPLE_STATUS_CACHE_KEY );
}
}
);
}
/**