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:
Alex P 2022-07-12 15:46:34 +03:00
parent 966e3169e4
commit 81c786150d
2 changed files with 2 additions and 22 deletions

View file

@ -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.
*

View file

@ -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
)