mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-09-06 09:08:09 +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() );
|
$tokens = $this->repository->all_for_user_id( (int) $customer->get_id() );
|
||||||
if ( ! $tokens ) {
|
if ( ! $tokens ) {
|
||||||
$this->logger->log(
|
|
||||||
'error',
|
$error_message = sprintf(
|
||||||
sprintf(
|
|
||||||
// translators: %d is the customer id.
|
// translators: %d is the customer id.
|
||||||
__(
|
__(
|
||||||
'No payment tokens found for customer %d',
|
'Payment failed. No payment tokens found for customer %d.',
|
||||||
'woocommerce-paypal-payments'
|
'woocommerce-paypal-payments'
|
||||||
),
|
),
|
||||||
(int) $customer->get_id()
|
(int) $customer->get_id()
|
||||||
),
|
);
|
||||||
|
|
||||||
|
$wc_order->update_status(
|
||||||
|
'failed',
|
||||||
|
$error_message
|
||||||
|
);
|
||||||
|
|
||||||
|
$this->logger->log(
|
||||||
|
'error',
|
||||||
|
$error_message,
|
||||||
array(
|
array(
|
||||||
'customer' => $customer,
|
'customer' => $customer,
|
||||||
'order' => $wc_order,
|
'order' => $wc_order,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue