mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-09-04 08:47:23 +08:00
Change order status to failed and add note when no payment tokens found
This commit is contained in:
parent
a4e76afd4d
commit
17f1a91241
1 changed files with 16 additions and 8 deletions
|
@ -178,16 +178,24 @@ class RenewalHandler {
|
|||
|
||||
$tokens = $this->repository->all_for_user_id( (int) $customer->get_id() );
|
||||
if ( ! $tokens ) {
|
||||
|
||||
$error_message = sprintf(
|
||||
// translators: %d is the customer id.
|
||||
__(
|
||||
'Payment failed. No payment tokens found for customer %d.',
|
||||
'woocommerce-paypal-payments'
|
||||
),
|
||||
(int) $customer->get_id()
|
||||
);
|
||||
|
||||
$wc_order->update_status(
|
||||
'failed',
|
||||
$error_message
|
||||
);
|
||||
|
||||
$this->logger->log(
|
||||
'error',
|
||||
sprintf(
|
||||
// translators: %d is the customer id.
|
||||
__(
|
||||
'No payment tokens found for customer %d',
|
||||
'woocommerce-paypal-payments'
|
||||
),
|
||||
(int) $customer->get_id()
|
||||
),
|
||||
$error_message,
|
||||
array(
|
||||
'customer' => $customer,
|
||||
'order' => $wc_order,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue