mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-09-06 18:16:38 +08:00
Update order status to failed when instrument is declined
This commit is contained in:
parent
5a84bd1430
commit
ba07030dac
1 changed files with 5 additions and 0 deletions
|
@ -141,6 +141,11 @@ trait ProcessPaymentTrait {
|
|||
}
|
||||
} catch ( PayPalApiException $error ) {
|
||||
if ( $error->has_detail( 'INSTRUMENT_DECLINED' ) ) {
|
||||
$wc_order->update_status(
|
||||
'failed',
|
||||
__( 'Instrument declined.', 'woocommerce-paypal-payments' )
|
||||
);
|
||||
|
||||
$this->session_handler->increment_insufficient_funding_tries();
|
||||
$host = $this->config->has( 'sandbox_on' ) && $this->config->get( 'sandbox_on' ) ?
|
||||
'https://www.sandbox.paypal.com/' : 'https://www.paypal.com/';
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue