mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-09-04 08:47:23 +08:00
Add filter to short-circuit RenewalHandler::get_token_for_customer()
This commit is contained in:
parent
d5ddbdf927
commit
069b89f1ad
1 changed files with 4 additions and 0 deletions
|
@ -175,6 +175,10 @@ class RenewalHandler {
|
|||
* @return PaymentToken|null
|
||||
*/
|
||||
private function get_token_for_customer( \WC_Customer $customer, \WC_Order $wc_order ) {
|
||||
$token = apply_filters( 'woocommerce_paypal_payments_subscriptions_get_token_for_customer', null, $customer, $wc_order );
|
||||
if ( null !== $token ) {
|
||||
return $token;
|
||||
}
|
||||
|
||||
$tokens = $this->repository->all_for_user_id( (int) $customer->get_id() );
|
||||
if ( ! $tokens ) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue