2022-07-12 12:30:57 +03:00
|
|
|
<?php
|
|
|
|
/**
|
|
|
|
* Wrapper for more detailed gateway error.
|
|
|
|
*
|
|
|
|
* @package WooCommerce\PayPalCommerce\WcGateway\Exception
|
|
|
|
*/
|
|
|
|
|
|
|
|
declare(strict_types=1);
|
|
|
|
|
|
|
|
namespace WooCommerce\PayPalCommerce\WcGateway\Exception;
|
|
|
|
|
|
|
|
use Exception;
|
|
|
|
use Throwable;
|
2022-07-12 21:19:21 +03:00
|
|
|
use WooCommerce\PayPalCommerce\WcGateway\Gateway\Messages;
|
2022-07-12 12:30:57 +03:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Class GatewayGenericException
|
|
|
|
*/
|
|
|
|
class GatewayGenericException extends Exception {
|
|
|
|
/**
|
|
|
|
* GatewayGenericException constructor.
|
|
|
|
*
|
|
|
|
* @param Throwable|null $inner The exception.
|
|
|
|
*/
|
|
|
|
public function __construct( ?Throwable $inner = null ) {
|
|
|
|
parent::__construct(
|
2022-07-12 21:19:21 +03:00
|
|
|
Messages::generic_payment_error_message(),
|
2022-07-12 12:30:57 +03:00
|
|
|
$inner ? (int) $inner->getCode() : 0,
|
|
|
|
$inner
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|