Put declined payment message as the exception message

This commit is contained in:
dinamiko 2020-11-23 16:25:43 +01:00
parent adc00a7351
commit 947fda2473
2 changed files with 2 additions and 11 deletions

View file

@ -74,10 +74,7 @@ trait ProcessPaymentTrait {
$this->session_handler->destroy_session_data();
} catch ( RuntimeException $error ) {
$this->session_handler->destroy_session_data();
wc_add_notice(
__( 'Payment provider declined the payment, please use a different payment method.', 'woocommerce-paypal-payments' ),
'error'
);
wc_add_notice( $error->getMessage(), 'error' );
return null;
}