|
1 | 1 | <?php
|
2 | 2 | namespace Dfe\CheckoutCom;
|
3 |
| -use com\checkout\ApiServices\Cards\ResponseModels\Card; |
4 |
| -use com\checkout\ApiServices\Charges\RequestModels\ChargeCapture; |
5 |
| -use com\checkout\ApiServices\Charges\RequestModels\ChargeRefund; |
6 |
| -use com\checkout\ApiServices\Charges\RequestModels\ChargeUpdate; |
7 |
| -use com\checkout\ApiServices\Charges\RequestModels\ChargeVoid; |
8 |
| -use com\checkout\ApiServices\Charges\ResponseModels\Charge as ChargeResponse; |
9 |
| -use com\checkout\helpers\ApiHttpClientCustomException as CE; |
10 | 3 | use Df\Payment\PlaceOrderInternal as PO;
|
11 | 4 | use Df\Payment\Source\AC;
|
12 | 5 | use Df\Payment\Token;
|
13 | 6 | use Dfe\CheckoutCom\SDK\ChargeService;
|
14 | 7 | use Magento\Framework\DataObject as _DO;
|
15 | 8 | use Magento\Framework\Exception\LocalizedException as LE;
|
16 |
| -use Magento\Payment\Model\Info as I; |
17 | 9 | use Magento\Payment\Model\InfoInterface as II;
|
18 |
| -use Magento\Sales\Model\Order\Payment as OP; |
19 | 10 | use Magento\Sales\Model\Order\Payment\Transaction as T;
|
| 11 | +use \Throwable as Th; # 2023-08-02 "Treat `\Throwable` similar to `\Exception`": https://github.com/mage2pro/core/issues/311 |
| 12 | +use com\checkout\ApiServices\Cards\ResponseModels\Card; |
| 13 | +use com\checkout\ApiServices\Charges\RequestModels\ChargeCapture; |
| 14 | +use com\checkout\ApiServices\Charges\RequestModels\ChargeRefund; |
| 15 | +use com\checkout\ApiServices\Charges\RequestModels\ChargeUpdate; |
| 16 | +use com\checkout\ApiServices\Charges\RequestModels\ChargeVoid; |
| 17 | +use com\checkout\ApiServices\Charges\ResponseModels\Charge as ChargeResponse; |
| 18 | +use com\checkout\helpers\ApiHttpClientCustomException as CE; |
20 | 19 | /** @method Settings s() */
|
21 | 20 | final class Method extends \Df\Payment\Method {
|
22 | 21 | /**
|
@@ -543,12 +542,12 @@ private function isCaptureDesired():bool {return AC::c($this->s()->actionDesired
|
543 | 542 | * @return mixed
|
544 | 543 | * @throws \Exception
|
545 | 544 | */
|
546 |
| - private function leh(\Closure $f) {return df_try($f, function(\Exception $e):void { |
547 |
| - if ($e instanceof CE) { |
548 |
| - $e = new LE(__($e->getErrorMessage()), $e); |
| 545 | + private function leh(\Closure $f) {return df_try($f, function(Th $th):void { |
| 546 | + if ($th instanceof CE) { |
| 547 | + $th = new LE(__($th->getErrorMessage()), $th); |
549 | 548 | }
|
550 |
| - df_sentry($this, $e); |
551 |
| - throw df_lx($e); |
| 549 | + df_sentry($this, $th); |
| 550 | + throw df_lx($th); |
552 | 551 | });}
|
553 | 552 |
|
554 | 553 | /**
|
|
0 commit comments