From 0ab036a59f7b7e526891021a962296be1eee4ace Mon Sep 17 00:00:00 2001 From: nikita tarasov Date: Wed, 15 Nov 2017 17:28:35 +0300 Subject: [PATCH] Transaction Type Verification --- Model/Payment/Transaction.php | 46 +++++++++++++++++++++++++++++++++++ etc/di.xml | 4 +-- 2 files changed, 48 insertions(+), 2 deletions(-) create mode 100644 Model/Payment/Transaction.php diff --git a/Model/Payment/Transaction.php b/Model/Payment/Transaction.php new file mode 100644 index 0000000..91eeba2 --- /dev/null +++ b/Model/Payment/Transaction.php @@ -0,0 +1,46 @@ +getTxnType(); + } + switch ($txnType) { + case self::TYPE_PAYMENT: + case self::TYPE_ORDER: + case self::TYPE_AUTH: + case self::TYPE_CAPTURE: + case self::TYPE_VOID: + case self::TYPE_REFUND: + case self::TYPE_FISCAL: + case self::TYPE_FISCAL_REFUND: + break; + default: + throw new LocalizedException( + __('We found an unsupported transaction type "%1".', $txnType) + ); + } + } +} diff --git a/etc/di.xml b/etc/di.xml index e84f93d..318a422 100644 --- a/etc/di.xml +++ b/etc/di.xml @@ -6,9 +6,9 @@ * @package Mygento_Base */ --> - + +