mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-09-05 08:59:14 +08:00
Do not throw error if customer does not have payment tokens
This commit is contained in:
parent
821627ce2e
commit
0034e4dd51
1 changed files with 1 additions and 18 deletions
|
@ -139,24 +139,7 @@ class PaymentTokenEndpoint {
|
|||
foreach ( $json->payment_tokens as $token_value ) {
|
||||
$tokens[] = $this->factory->from_paypal_response( $token_value );
|
||||
}
|
||||
if ( empty( $tokens ) ) {
|
||||
$error = new RuntimeException(
|
||||
sprintf(
|
||||
// translators: %d is the customer id.
|
||||
__( 'No token stored for customer %d.', 'woocommerce-paypal-payments' ),
|
||||
$id
|
||||
)
|
||||
);
|
||||
$this->logger->log(
|
||||
'warning',
|
||||
$error->getMessage(),
|
||||
array(
|
||||
'args' => $args,
|
||||
'response' => $response,
|
||||
)
|
||||
);
|
||||
throw $error;
|
||||
}
|
||||
|
||||
return $tokens;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue