Skip to content

Commit ae2bacb

Browse files
1 parent 41bc25b commit ae2bacb

File tree

3 files changed

+10
-10
lines changed

3 files changed

+10
-10
lines changed

Handler.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
namespace Dfe\TwoCheckout;
33
use Dfe\TwoCheckout\Handler\DefaultT;
44
use Dfe\TwoCheckout\Settings as S;
5-
use Exception as E;
5+
use \Throwable as Th; # 2023-08-02 "Treat `\Throwable` similar to `\Exception`": https://github.com/mage2pro/core/issues/311
66
/**
77
* @see \Dfe\TwoCheckout\Handler\DefaultT
88
* @see \Dfe\TwoCheckout\Handler\RefundIssued
@@ -40,7 +40,6 @@ final protected function type():string {return $this['message_type'];}
4040
* 2016-03-25
4141
* @param array(string => mixed) $request
4242
* @return mixed
43-
* @throws E
4443
*/
4544
final static function p(array $request) {/** @var mixed $r */
4645
try {
@@ -81,15 +80,16 @@ final static function p(array $request) {/** @var mixed $r */
8180
$i = df_new(df_con(__CLASS__, $suffix, DefaultT::class), $request); /** @var Handler $i */
8281
$r = $i->eligible() ? $i->process() : 'The event is not for our store.';
8382
}
84-
catch (E $e) {
83+
# 2023-08-02 "Treat `\Throwable` similar to `\Exception`": https://github.com/mage2pro/core/issues/311
84+
catch (Th $th) {
8585
df_500();
8686
# 2023-07-25
8787
# "Change the 3rd argument of `df_sentry` from `$context` to `$extra`": https://github.com/mage2pro/core/issues/249
88-
df_sentry(__CLASS__, $e, ['request' => $request]);
88+
df_sentry(__CLASS__, $th, ['request' => $request]);
8989
if (df_my_local()) {
90-
throw $e; # 2016-03-27 Удобно видеть стек на экране.
90+
throw $th; # 2016-03-27 Удобно видеть стек на экране.
9191
}
92-
$r = __($e->getMessage());
92+
$r = __($th->getMessage());
9393
}
9494
return $r;
9595
}

Method.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,9 @@
33
use Df\Payment\Token;
44
use Dfe\TwoCheckout\Block\Info as InfoBlock;
55
use Magento\Framework\Exception\LocalizedException as LE;
6-
use Magento\Sales\Model\Order as O;
76
use Magento\Sales\Model\Order\Creditmemo as CM;
8-
use Magento\Sales\Model\Order\Payment as OP;
97
use Magento\Sales\Model\Order\Payment\Transaction as T;
8+
use \Throwable as Th; # 2023-08-02 "Treat `\Throwable` similar to `\Exception`": https://github.com/mage2pro/core/issues/311
109
# 2016-05-17
1110
/** @method Settings s() */
1211
final class Method extends \Df\Payment\Method {
@@ -459,7 +458,8 @@ protected function iiaKeys():array {return [Token::KEY];}
459458
private function api(\Closure $f) {
460459
try {$this->s()->init(); return $f();}
461460
catch (Exception $e) {throw $e;}
462-
catch (\Exception $e) {throw df_lx($e);}
461+
# 2023-08-02 "Treat `\Throwable` similar to `\Exception`": https://github.com/mage2pro/core/issues/311
462+
catch (Th $th) {throw df_lx($th);}
463463
}
464464

465465
/**

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "mage2pro/2checkout"
3-
,"version": "1.7.4"
3+
,"version": "1.7.5"
44
,"description": "2Checkout integration with Magento 2"
55
,"type": "magento2-module"
66
,"homepage": "https://mage2.pro/c/extensions/2checkout"

0 commit comments

Comments
 (0)