mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-09-06 10:55:00 +08:00
Remove attempt to use non-existing .issues property
I think it never worked, and the API docs do not mention it (only the single .issue property), and either way this usage here does not seem helpful, issue/description still contains the same unfriendly text as in the exception message already
This commit is contained in:
parent
966e3169e4
commit
81c786150d
2 changed files with 2 additions and 22 deletions
|
@ -111,15 +111,6 @@ class PayPalApiException extends RuntimeException {
|
|||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns response issues.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function issues(): array {
|
||||
return $this->response->issues ?? array();
|
||||
}
|
||||
|
||||
/**
|
||||
* The HTTP status code.
|
||||
*
|
||||
|
|
|
@ -229,22 +229,11 @@ trait ProcessPaymentTrait {
|
|||
);
|
||||
}
|
||||
|
||||
$error_message = $error->getMessage();
|
||||
if ( $error->issues() ) {
|
||||
$error_message = implode(
|
||||
array_map(
|
||||
function( $issue ) {
|
||||
return $issue->issue . ' ' . $issue->description . '<br/>';
|
||||
},
|
||||
$error->issues()
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
return $this->handle_payment_failure(
|
||||
$wc_order,
|
||||
new Exception(
|
||||
$error_message,
|
||||
__( 'Failed to process the payment. Please try again or contact the shop admin.', 'woocommerce-paypal-payments' )
|
||||
. ' ' . $error->getMessage(),
|
||||
$error->getCode(),
|
||||
$error
|
||||
)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue