diff --git a/Api/NNRepositoryInterface.php b/Api/NNRepositoryInterface.php
new file mode 100755
index 0000000..609970b
--- /dev/null
+++ b/Api/NNRepositoryInterface.php
@@ -0,0 +1,146 @@
+coreRegistry = $registry;
+ $this->novalnetConfig = $novalnetConfig;
+ $this->novalnetRequestHelper = $novalnetRequestHelper;
+ $this->serializer = $serializer;
+ }
+
+ /**
+ * Before push buttons
+ *
+ * @param ToolbarContext $toolbar
+ * @param AbstractBlock $context
+ * @param ButtonList $buttonList
+ * @return mixed
+ */
+ public function beforePushButtons(
+ ToolbarContext $toolbar,
+ \Magento\Framework\View\Element\AbstractBlock $context,
+ \Magento\Backend\Block\Widget\Button\ButtonList $buttonList
+ ) {
+ if ($context instanceof \Magento\Sales\Block\Adminhtml\Order\Invoice\View) {
+ $orderPayment = $context->getInvoice()->getOrder()->getPayment();
+ if ($orderPayment->getMethodInstance()->getCode() == ConfigProvider::NOVALNET_INVOICE) {
+ $buttonList->remove('capture');
+ }
+ return [$context, $buttonList];
+ }
+
+ if (!$context instanceof \Magento\Sales\Block\Adminhtml\Order\View) {
+ return [$context, $buttonList];
+ }
+
+ $order = $this->getOrder();
+ $payment = $order->getPayment();
+ $paymentMethodCode = $payment->getMethodInstance()->getCode();
+ if (!empty($paymentMethodCode) && preg_match('/novalnet/i', $paymentMethodCode)) {
+
+ $additionalData = [];
+ if (!empty($payment->getAdditionalData())) {
+ $additionalData = $this->novalnetRequestHelper->isSerialized($payment->getAdditionalData())
+ ? $this->serializer->unserialize($payment->getAdditionalData())
+ : json_decode($payment->getAdditionalData(), true);
+ }
+
+ $transactionStatus = !empty($additionalData['NnStatus'])
+ ? $this->novalnetRequestHelper->getStatus($additionalData['NnStatus'], $order) : '';
+
+ if ($transactionStatus) {
+ // remove Capture button
+ $buttonList->update('order_invoice', 'label', __('Capture'));
+
+ if (in_array($transactionStatus, ['PENDING', 'DEACTIVATED']) || !empty($additionalData['NnZeroAmountBooking'])) {
+ $buttonList->remove('order_invoice');
+ }
+
+ if ($order->canInvoice() && $transactionStatus == 'ON_HOLD' &&
+ $paymentMethodCode == ConfigProvider::NOVALNET_INVOICE
+ ) {
+ $buttonList->remove('order_invoice');
+ $message = __('Are you sure you want to capture the payment?');
+ $capturePaymentUrl = $context->getUrl(
+ 'novalnetpayment/sales/ordercapture',
+ ['order_id' => $order->getId()]
+ );
+
+ $buttonList->add(
+ 'novalnet_confirm',
+ [
+ 'label' => __('Novalnet Capture'),
+ 'onclick' => "confirmSetLocation('{$message}', '{$capturePaymentUrl}')"
+ ]
+ );
+ }
+
+ if ($transactionStatus == 'ON_HOLD') {
+ $buttonList->remove('void_payment');
+ $message = __('Are you sure you want to cancel the payment?');
+ $voidPaymentUrl = $context->getUrl(
+ 'sales/*/voidPayment',
+ ['order_id' => $order->getId()]
+ );
+ $buttonList->add(
+ 'void_payment',
+ [
+ 'label' => __('Void'),
+ 'onclick' => "confirmSetLocation('{$message}', '{$voidPaymentUrl}')"
+ ]
+ );
+ }
+
+ if ($transactionStatus == 'PENDING' && $this->novalnetConfig->isRedirectPayment($paymentMethodCode) ||
+ in_array(
+ $paymentMethodCode,
+ [
+ ConfigProvider::NOVALNET_PREPAYMENT,
+ ConfigProvider::NOVALNET_CASHPAYMENT,
+ ConfigProvider::NOVALNET_MULTIBANCO
+ ]
+ )
+ ) {
+ $buttonList->remove('order_cancel'); // remove Cancel button
+ $buttonList->remove('void_payment'); // remove Void button
+ }
+ }
+ }
+
+ return [$context, $buttonList];
+ }
+
+ /**
+ * Retrieve order model object
+ *
+ * @return \Magento\Sales\Model\Order
+ */
+ public function getOrder()
+ {
+ return $this->coreRegistry->registry('sales_order');
+ }
+}
diff --git a/Block/Adminhtml/Sales/Order/View/Tab/Instalment.php b/Block/Adminhtml/Sales/Order/View/Tab/Instalment.php
new file mode 100755
index 0000000..7ee028d
--- /dev/null
+++ b/Block/Adminhtml/Sales/Order/View/Tab/Instalment.php
@@ -0,0 +1,263 @@
+coreRegistry = $registry;
+ $this->pricingHelper = $pricingHelper;
+ $this->datetime = $datetime;
+ $this->novalnetRequestHelper = $novalnetRequestHelper;
+ $this->serializer = $serializer;
+ parent::__construct($context, $data);
+ }
+
+ /**
+ * Retrieve order model instance
+ *
+ * @return \Magento\Sales\Model\Order
+ */
+ public function getOrder()
+ {
+ return $this->coreRegistry->registry('current_order');
+ }
+
+ /**
+ * @inheritdoc
+ */
+ public function getTabLabel()
+ {
+ return __('Instalment');
+ }
+
+ /**
+ * @inheritdoc
+ */
+ public function getTabTitle()
+ {
+ return __('Instalment');
+ }
+
+ /**
+ * @inheritdoc
+ */
+ public function canShowTab()
+ {
+ $payment = $this->getOrder()->getPayment();
+ if (in_array(
+ $payment->getMethodInstance()->getCode(),
+ [
+ ConfigProvider::NOVALNET_SEPA_INSTALMENT,
+ ConfigProvider::NOVALNET_INVOICE_INSTALMENT
+ ]
+ )) {
+ $additionalData = [];
+ if (!empty($payment->getAdditionalData())) {
+ $additionalData = $this->novalnetRequestHelper->isSerialized($payment->getAdditionalData())
+ ? $this->serializer->unserialize($payment->getAdditionalData())
+ : json_decode($payment->getAdditionalData(), true);
+ }
+
+ $paymentStatus = !empty($additionalData['NnStatus'])
+ ? $this->novalnetRequestHelper->getStatus($additionalData['NnStatus'], $this->getOrder()) : '';
+ return (bool) ($paymentStatus == 'CONFIRMED');
+ }
+
+ return false;
+ }
+
+ /**
+ * @inheritdoc
+ */
+ public function isHidden()
+ {
+ return false;
+ }
+
+ /**
+ * Get Tab Class
+ *
+ * @return string
+ */
+ public function getTabClass()
+ {
+ return 'ajax only';
+ }
+
+ /**
+ * Get Class
+ *
+ * @return string
+ */
+ public function getClass()
+ {
+ return $this->getTabClass();
+ }
+
+ /**
+ * Get Tab Url
+ *
+ * @return string
+ */
+ public function getTabUrl()
+ {
+ return $this->getUrl('novalnetpayment/sales/instalment', ['_current' => true]);
+ }
+
+ /**
+ * Get URL to edit the customer.
+ *
+ * @return string
+ */
+ public function getCustomerViewUrl()
+ {
+ if ($this->getOrder()->getCustomerIsGuest() || !$this->getOrder()->getCustomerId()) {
+ return '';
+ }
+
+ return $this->getUrl('customer/index/edit', ['id' => $this->getOrder()->getCustomerId()]);
+ }
+
+ /**
+ * Check if is single store mode
+ *
+ * @return bool
+ */
+ public function isSingleStoreMode()
+ {
+ return $this->_storeManager->isSingleStoreMode();
+ }
+
+ /**
+ * Get order store name
+ *
+ * @return null|string
+ */
+ public function getOrderStoreName()
+ {
+ if ($this->getOrder()) {
+ $storeId = $this->getOrder()->getStoreId();
+ if ($storeId === null) {
+ $deleted = __(' [deleted]');
+ return nl2br($this->getOrder()->getStoreName()) . $deleted;
+ }
+ $store = $this->_storeManager->getStore($storeId);
+ $name = [$store->getWebsite()->getName(), $store->getGroup()->getName(), $store->getName()];
+ return (!empty($name)) ? implode(' ', $name) : '';
+ }
+
+ return null;
+ }
+
+ /**
+ * Get payment additional data
+ *
+ * @param string $key
+ * @return null|string
+ */
+ public function getAdditionalData($key)
+ {
+ $payment = $this->getOrder()->getPayment();
+ $details = [];
+ if (!empty($payment->getAdditionalData())) {
+ $details = $this->novalnetRequestHelper->isSerialized($payment->getAdditionalData())
+ ? $this->serializer->unserialize($payment->getAdditionalData())
+ : json_decode($payment->getAdditionalData(), true);
+ }
+
+ if (is_array($details)) {
+ return (!empty($key) && !empty($details[$key])) ? $details[$key] : '';
+ }
+
+ return null;
+ }
+
+ /**
+ * Get Formated Date
+ *
+ * @param string $date
+ * @return string
+ */
+ public function getFormatedDate($date)
+ {
+ return $this->datetime->formatDate($date, \IntlDateFormatter::LONG);
+ }
+
+ /**
+ * Update Currency
+ *
+ * @param string $amount
+ * @return float|string
+ */
+ public function updateCurrency($amount)
+ {
+ return $this->pricingHelper->currency($amount);
+ }
+}
diff --git a/Block/Adminhtml/Sales/Order/View/Tab/ZeroAmountBooking.php b/Block/Adminhtml/Sales/Order/View/Tab/ZeroAmountBooking.php
new file mode 100755
index 0000000..80c4c29
--- /dev/null
+++ b/Block/Adminhtml/Sales/Order/View/Tab/ZeroAmountBooking.php
@@ -0,0 +1,198 @@
+coreRegistry = $registry;
+ $this->novalnetRequestHelper = $novalnetRequestHelper;
+ $this->serializer = $serializer;
+ parent::__construct($context, $data);
+ }
+
+ /**
+ * Retrieve order model instance
+ *
+ * @return \Magento\Sales\Model\Order
+ */
+ public function getOrder()
+ {
+ return $this->coreRegistry->registry('current_order');
+ }
+
+ /**
+ * @inheritdoc
+ */
+ public function getTabLabel()
+ {
+ return __('Zero amount booking');
+ }
+
+ /**
+ * @inheritdoc
+ */
+ public function getTabTitle()
+ {
+ return __('Zero amount booking');
+ }
+
+ /**
+ * @inheritdoc
+ */
+ public function canShowTab()
+ {
+ $payment = $this->getOrder()->getPayment();
+
+ if ($this->getOrder()->getStatus() == \Magento\Sales\Model\Order::STATE_CANCELED) {
+ return false;
+ }
+
+ if (in_array(
+ $payment->getMethodInstance()->getCode(),
+ [
+ ConfigProvider::NOVALNET_SEPA,
+ ConfigProvider::NOVALNET_CC
+ ]
+ )) {
+ $additionalData = [];
+ if (!empty($payment->getAdditionalData())) {
+ $additionalData = $this->novalnetRequestHelper->isSerialized($payment->getAdditionalData())
+ ? $this->serializer->unserialize($payment->getAdditionalData())
+ : json_decode($payment->getAdditionalData(), true);
+ }
+
+ $paymentStatus = !empty($additionalData['NnStatus'])
+ ? $this->novalnetRequestHelper->getStatus($additionalData['NnStatus'], $this->getOrder()) : '';
+ return (bool) ($paymentStatus == 'CONFIRMED' && !empty($additionalData['NnZeroAmountBooking']) && empty($additionalData['NnZeroAmountDone']));
+ }
+
+ return false;
+ }
+
+ /**
+ * @inheritdoc
+ */
+ public function isHidden()
+ {
+ return false;
+ }
+
+ /**
+ * Get Tab Class
+ *
+ * @return string
+ */
+ public function getTabClass()
+ {
+ return 'ajax only';
+ }
+
+ /**
+ * Get Class
+ *
+ * @return string
+ */
+ public function getClass()
+ {
+ return $this->getTabClass();
+ }
+
+ /**
+ * Get Tab Url
+ *
+ * @return string
+ */
+ public function getTabUrl()
+ {
+ return $this->getUrl('novalnetpayment/sales/zeroamountbookingTab', ['_current' => true]);
+ }
+
+ /**
+ * Get payment additional data
+ *
+ * @param string $key
+ *
+ * @return null|string
+ */
+ public function getAdditionalData($key)
+ {
+ $payment = $this->getOrder()->getPayment();
+ $details = [];
+ if (!empty($payment->getAdditionalData())) {
+ $details = $this->novalnetRequestHelper->isSerialized($payment->getAdditionalData())
+ ? $this->serializer->unserialize($payment->getAdditionalData())
+ : json_decode($payment->getAdditionalData(), true);
+ }
+
+ if (is_array($details)) {
+ return (!empty($key) && isset($details[$key])) ? $details[$key] : '';
+ }
+
+ return null;
+ }
+
+ /**
+ * Get the formated amount in cents/euro
+ *
+ * @param float $amount
+ * @param string $type
+ * @return int
+ */
+ public function getFormattedAmount($amount, $type = 'CENT')
+ {
+ return $this->novalnetRequestHelper->getFormattedAmount($amount, $type);
+ }
+}
diff --git a/Block/Checkout/Cart/Shortcut.php b/Block/Checkout/Cart/Shortcut.php
new file mode 100755
index 0000000..6ad6297
--- /dev/null
+++ b/Block/Checkout/Cart/Shortcut.php
@@ -0,0 +1,99 @@
+getData(self::ALIAS_ELEMENT_INDEX);
+ }
+
+ /**
+ * Set is in catalog product
+ *
+ * @param bool $isCatalog
+ *
+ * @return $this
+ */
+ public function setIsInCatalogProduct($isCatalog)
+ {
+ $this->isMiniCart = !$isCatalog;
+ return $this;
+ }
+
+ /**
+ * Set is in shopping cart
+ *
+ * @param bool $isShoppingCart
+ * @return void
+ */
+ public function setIsShoppingCart($isShoppingCart)
+ {
+ $this->isShoppingCart = $isShoppingCart;
+
+ if ($isShoppingCart) {
+ $this->_template = 'Novalnet_Payment::checkout/CartPageShortcut.phtml';
+ } else {
+ $this->_template = 'Novalnet_Payment::checkout/MinicartShortcut.phtml';
+ }
+ }
+
+ /**
+ * Is Should Rendered
+ *
+ * @return bool
+ */
+ protected function shouldRender()
+ {
+ $objectManager = \Magento\Framework\App\ObjectManager::getInstance();
+ $session = $objectManager->create(\Magento\Checkout\Model\Session::class);
+
+ if ($this->isShoppingCart) {
+ return true;
+ }
+
+ return $this->isMiniCart;
+ }
+
+ /**
+ * Render the block if needed
+ *
+ * @return string
+ */
+ protected function _toHtml()
+ {
+ if (!$this->shouldRender()) {
+ return '';
+ }
+
+ return parent::_toHtml();
+ }
+}
diff --git a/Block/Checkout/Cart/ShortcutButtonsConfig.php b/Block/Checkout/Cart/ShortcutButtonsConfig.php
new file mode 100755
index 0000000..856357e
--- /dev/null
+++ b/Block/Checkout/Cart/ShortcutButtonsConfig.php
@@ -0,0 +1,99 @@
+productFactory = $productFactory;
+ $this->registry = $registry;
+ $this->novalnetRequestHelper = $novalnetRequestHelper;
+ parent::__construct($context, $data);
+ }
+
+ /**
+ * Get Payment method active status
+ *
+ * @param string $page
+ * @return array
+ */
+ public function isPageEnabledForExpressCheckout($page)
+ {
+ return $this->novalnetRequestHelper->isPageEnabledForExpressCheckout($page);
+ }
+
+ /**
+ * Get Product Id
+ *
+ * @return int
+ */
+ public function getProductId()
+ {
+ $product = $this->registry->registry('product');
+ return $product->getId();
+ }
+
+ /**
+ * Get Product Type
+ *
+ * @return array
+ */
+ public function loadProductById()
+ {
+ $productId = $this->getProductId();
+ $model = $this->productFactory->create();
+ $product = $model->load($productId);
+ return [
+ 'productId' => $product->getId(),
+ 'isVirtual' => (in_array($product->getTypeId(), [ProductType::TYPE_VIRTUAL, DownloadableProduct::TYPE_DOWNLOADABLE])) ? true : false
+ ];
+ }
+}
diff --git a/Block/Form/Cashpayment.php b/Block/Form/Cashpayment.php
new file mode 100755
index 0000000..f91f66e
--- /dev/null
+++ b/Block/Form/Cashpayment.php
@@ -0,0 +1,91 @@
+setTemplate('Novalnet_Payment::form/Cashpayment.phtml');
+ $this->novalnetConfig = $novalnetConfig;
+ $this->novalnetConfigProvider = $novalnetConfigProvider;
+ $this->novalnetRequestHelper = $novalnetRequestHelper;
+ }
+
+ /**
+ * Get payment logo enabled status
+ *
+ * @param string $paymentMethodcode
+ * @return string
+ */
+ public function getPaymentLogo($paymentMethodcode)
+ {
+ return $this->novalnetConfigProvider->getPaymentLogo($paymentMethodcode);
+ }
+
+ /**
+ * Verify whether the payment is in Test mode
+ *
+ * @param string $paymentMethodcode
+ * @return int
+ */
+ public function getTestMode($paymentMethodcode)
+ {
+ return $this->novalnetConfig->getTestMode($paymentMethodcode);
+ }
+
+ /**
+ * Get novalnet helper
+ *
+ * @return mixed
+ */
+ public function novalnetHelper()
+ {
+ return $this->novalnetRequestHelper;
+ }
+}
diff --git a/Block/Form/Cc.php b/Block/Form/Cc.php
new file mode 100755
index 0000000..a119094
--- /dev/null
+++ b/Block/Form/Cc.php
@@ -0,0 +1,178 @@
+setTemplate('Novalnet_Payment::form/Cc.phtml'); // Sets form template
+ $this->novalnetConfig = $novalnetConfig;
+ $this->novalnetConfigProvider = $novalnetConfigProvider;
+ $this->novalnetRequestHelper = $novalnetRequestHelper;
+ $this->jsonHelperRequest = $jsonHelperRequest;
+ }
+
+ /**
+ * Get payment logo enabled status
+ *
+ * @param string $paymentMethodcode
+ * @return string
+ */
+ public function getPaymentLogo($paymentMethodcode)
+ {
+ return $this->novalnetConfigProvider->getPaymentLogo($paymentMethodcode);
+ }
+
+ /**
+ * Get Credit Card logos
+ *
+ * @param string $paymentMethodcode
+ * @return array|bool
+ */
+ public function getCreditCardLogos($paymentMethodcode)
+ {
+ return $this->novalnetConfigProvider->getCcAvailableTypes($paymentMethodcode);
+ }
+
+ /**
+ * Verify whether the payment is in Test mode
+ *
+ * @param string $paymentMethodcode
+ * @return int
+ */
+ public function getTestMode($paymentMethodcode)
+ {
+ return $this->novalnetConfig->getTestMode($paymentMethodcode);
+ }
+
+ /**
+ * Get instructions text from config
+ *
+ * @return string|null
+ */
+ public function isInlineForm()
+ {
+ return $this->getMethod()->getConfigData('inline_form');
+ }
+
+ /**
+ * Retrieve Credit Card iframe params
+ *
+ * @return array
+ */
+ public function getCcIframeParams()
+ {
+ return $this->novalnetConfigProvider->getCcIframeParams();
+ }
+
+ /**
+ * Get form style configuration
+ *
+ * @param string $param
+ * @return string|null
+ */
+ public function getStyleConfig($param)
+ {
+ $creditCardStyle = $this->novalnetConfigProvider->getCcStyleConfig();
+ if (isset($creditCardStyle[$param])) {
+ return $creditCardStyle[$param];
+ }
+
+ return '';
+ }
+
+ /**
+ * Retrieve Credit Card configs
+ *
+ * @param string $paymentMethodcode
+ * @return array
+ */
+ public function getConfig($paymentMethodcode)
+ {
+ $config = $this->novalnetConfigProvider->getConfig();
+ return $config['payment'][$paymentMethodcode];
+ }
+
+ /**
+ * Get novalnet helper
+ *
+ * @return mixed
+ */
+ public function novalnetHelper()
+ {
+ return $this->novalnetRequestHelper;
+ }
+
+ /**
+ * Get json helper request
+ *
+ * @return mixed
+ */
+ public function jsonHelper()
+ {
+ return $this->jsonHelperRequest;
+ }
+
+ /**
+ * To get is zero amount booking
+ *
+ * @return bool
+ */
+ public function isZeroAmountBooking()
+ {
+ return ($this->novalnetConfig->getPaymentConfig(\Novalnet\Payment\Model\Ui\ConfigProvider::NOVALNET_CC, 'payment_action') == \Novalnet\Payment\Model\NNConfig::ACTION_ZERO_AMOUNT_BOOKING);
+ }
+}
diff --git a/Block/Form/Invoice.php b/Block/Form/Invoice.php
new file mode 100755
index 0000000..c86792f
--- /dev/null
+++ b/Block/Form/Invoice.php
@@ -0,0 +1,91 @@
+setTemplate('Novalnet_Payment::form/Invoice.phtml');
+ $this->novalnetConfig = $novalnetConfig;
+ $this->novalnetConfigProvider = $novalnetConfigProvider;
+ $this->novalnetRequestHelper = $novalnetRequestHelper;
+ }
+
+ /**
+ * Get payment logo enabled status
+ *
+ * @param string $paymentMethodcode
+ * @return string
+ */
+ public function getPaymentLogo($paymentMethodcode)
+ {
+ return $this->novalnetConfigProvider->getPaymentLogo($paymentMethodcode);
+ }
+
+ /**
+ * Verify whether the payment is in Test mode
+ *
+ * @param string $paymentMethodcode
+ * @return int
+ */
+ public function getTestMode($paymentMethodcode)
+ {
+ return $this->novalnetConfig->getTestMode($paymentMethodcode);
+ }
+
+ /**
+ * Get novalnet helper
+ *
+ * @return mixed
+ */
+ public function novalnetHelper()
+ {
+ return $this->novalnetRequestHelper;
+ }
+}
diff --git a/Block/Form/InvoiceGuarantee.php b/Block/Form/InvoiceGuarantee.php
new file mode 100755
index 0000000..8867839
--- /dev/null
+++ b/Block/Form/InvoiceGuarantee.php
@@ -0,0 +1,109 @@
+setTemplate('Novalnet_Payment::form/InvoiceGuarantee.phtml');
+ $this->novalnetConfig = $novalnetConfig;
+ $this->novalnetConfigProvider = $novalnetConfigProvider;
+ $this->novalnetRequestHelper = $novalnetRequestHelper;
+ $this->jsonHelperRequest = $jsonHelperRequest;
+ }
+
+ /**
+ * Get payment logo enabled status
+ *
+ * @param string $paymentMethodcode
+ * @return string
+ */
+ public function getPaymentLogo($paymentMethodcode)
+ {
+ return $this->novalnetConfigProvider->getPaymentLogo($paymentMethodcode);
+ }
+
+ /**
+ * Verify whether the payment is in Test mode
+ *
+ * @param string $paymentMethodcode
+ * @return int
+ */
+ public function getTestMode($paymentMethodcode)
+ {
+ return $this->novalnetConfig->getTestMode($paymentMethodcode);
+ }
+
+ /**
+ * Get novalnet helper
+ *
+ * @return mixed
+ */
+ public function novalnetHelper()
+ {
+ return $this->novalnetRequestHelper;
+ }
+
+ /**
+ * Get json helper request
+ *
+ * @return mixed
+ */
+ public function jsonHelper()
+ {
+ return $this->jsonHelperRequest;
+ }
+}
diff --git a/Block/Form/InvoiceInstalment.php b/Block/Form/InvoiceInstalment.php
new file mode 100755
index 0000000..8b1ca6c
--- /dev/null
+++ b/Block/Form/InvoiceInstalment.php
@@ -0,0 +1,179 @@
+setTemplate('Novalnet_Payment::form/InvoiceInstalment.phtml');
+ $this->priceHelper = $priceHelper;
+ $this->novalnetConfig = $novalnetConfig;
+ $this->novalnetConfigProvider = $novalnetConfigProvider;
+ $this->novalnetRequestHelper = $novalnetRequestHelper;
+ $this->jsonHelperRequest = $jsonHelperRequest;
+ $this->currency = $currency;
+ $this->storeManager = $storeManager;
+ }
+
+ /**
+ * Get payment logo enabled status
+ *
+ * @param string $paymentMethodcode
+ * @return string
+ */
+ public function getPaymentLogo($paymentMethodcode)
+ {
+ return $this->novalnetConfigProvider->getPaymentLogo($paymentMethodcode);
+ }
+
+ /**
+ * Verify whether the payment is in Test mode
+ *
+ * @param string $paymentMethodcode
+ * @return int
+ */
+ public function getTestMode($paymentMethodcode)
+ {
+ return $this->novalnetConfig->getTestMode($paymentMethodcode);
+ }
+
+ /**
+ * Get Novalnet Guarantee instalment cycles
+ *
+ * @return null|string
+ */
+ public function getInstalmentCycles()
+ {
+ return $this->novalnetConfig->getPaymentConfig($this->getMethodCode(), 'instalment_cycles');
+ }
+
+ /**
+ * Get amount with currency
+ *
+ * @param int $amount
+ * @return null|string
+ */
+ public function updateCurrency($amount)
+ {
+ return $this->priceHelper->currency($amount, true, false);
+ }
+
+ /**
+ * Returns Instalment cycle details api URL for the Novalnet module
+ *
+ * @return string
+ */
+ public function getInstalmentCycleDetailUrl()
+ {
+ $baseUrl = $this->_storeManager->getStore()->getBaseUrl();
+ return str_replace('index.php/', '', $baseUrl) . 'rest/V1/novalnet/payment/instalment_cycle/';
+ }
+
+ /**
+ * Get novalnet helper
+ *
+ * @return mixed
+ */
+ public function novalnetHelper()
+ {
+ return $this->novalnetRequestHelper;
+ }
+
+ /**
+ * Get json helper request
+ *
+ * @return mixed
+ */
+ public function jsonHelper()
+ {
+ return $this->jsonHelperRequest;
+ }
+
+ /**
+ * Get currency symbol for current locale and currency code
+ *
+ * @return string|null
+ */
+ public function getCurrentCurrencySymbol()
+ {
+ $store = $this->storeManager->getStore();
+ $currencyCode = $store->getCurrentCurrencyCode();
+ $currentCurrency = trim($currencyCode);
+ $currency = $this->currency->load($currentCurrency);
+ return $currency->getCurrencySymbol();
+ }
+}
diff --git a/Block/Form/Multibanco.php b/Block/Form/Multibanco.php
new file mode 100755
index 0000000..148327e
--- /dev/null
+++ b/Block/Form/Multibanco.php
@@ -0,0 +1,91 @@
+setTemplate('Novalnet_Payment::form/Multibanco.phtml');
+ $this->novalnetConfig = $novalnetConfig;
+ $this->novalnetConfigProvider = $novalnetConfigProvider;
+ $this->novalnetRequestHelper = $novalnetRequestHelper;
+ }
+
+ /**
+ * Get payment logo enabled status
+ *
+ * @param string $paymentMethodcode
+ * @return string
+ */
+ public function getPaymentLogo($paymentMethodcode)
+ {
+ return $this->novalnetConfigProvider->getPaymentLogo($paymentMethodcode);
+ }
+
+ /**
+ * Verify whether the payment is in Test mode
+ *
+ * @param string $paymentMethodcode
+ * @return int
+ */
+ public function getTestMode($paymentMethodcode)
+ {
+ return $this->novalnetConfig->getTestMode($paymentMethodcode);
+ }
+
+ /**
+ * Get novalnet helper
+ *
+ * @return mixed
+ */
+ public function novalnetHelper()
+ {
+ return $this->novalnetRequestHelper;
+ }
+}
diff --git a/Block/Form/Prepayment.php b/Block/Form/Prepayment.php
new file mode 100755
index 0000000..4782576
--- /dev/null
+++ b/Block/Form/Prepayment.php
@@ -0,0 +1,91 @@
+setTemplate('Novalnet_Payment::form/Prepayment.phtml');
+ $this->novalnetConfig = $novalnetConfig;
+ $this->novalnetConfigProvider = $novalnetConfigProvider;
+ $this->novalnetRequestHelper = $novalnetRequestHelper;
+ }
+
+ /**
+ * Get payment logo enabled status
+ *
+ * @param string $paymentMethodcode
+ * @return string
+ */
+ public function getPaymentLogo($paymentMethodcode)
+ {
+ return $this->novalnetConfigProvider->getPaymentLogo($paymentMethodcode);
+ }
+
+ /**
+ * Verify whether the payment is in Test mode
+ *
+ * @param string $paymentMethodcode
+ * @return int
+ */
+ public function getTestMode($paymentMethodcode)
+ {
+ return $this->novalnetConfig->getTestMode($paymentMethodcode);
+ }
+
+ /**
+ * Get novalnet helper
+ *
+ * @return mixed
+ */
+ public function novalnetHelper()
+ {
+ return $this->novalnetRequestHelper;
+ }
+}
diff --git a/Block/Form/Sepa.php b/Block/Form/Sepa.php
new file mode 100755
index 0000000..324326f
--- /dev/null
+++ b/Block/Form/Sepa.php
@@ -0,0 +1,119 @@
+setTemplate('Novalnet_Payment::form/Sepa.phtml');
+ $this->novalnetConfig = $novalnetConfig;
+ $this->novalnetConfigProvider = $novalnetConfigProvider;
+ $this->novalnetRequestHelper = $novalnetRequestHelper;
+ $this->jsonHelperRequest = $jsonHelperRequest;
+ }
+
+ /**
+ * Get payment logo enabled status
+ *
+ * @param string $paymentMethodcode
+ * @return string
+ */
+ public function getPaymentLogo($paymentMethodcode)
+ {
+ return $this->novalnetConfigProvider->getPaymentLogo($paymentMethodcode);
+ }
+
+ /**
+ * Verify whether the payment is in Test mode
+ *
+ * @param string $paymentMethodcode
+ * @return int
+ */
+ public function getTestMode($paymentMethodcode)
+ {
+ return $this->novalnetConfig->getTestMode($paymentMethodcode);
+ }
+
+ /**
+ * Get novalnet helper
+ *
+ * @return mixed
+ */
+ public function novalnetHelper()
+ {
+ return $this->novalnetRequestHelper;
+ }
+
+ /**
+ * Get json helper request
+ *
+ * @return mixed
+ */
+ public function jsonHelper()
+ {
+ return $this->jsonHelperRequest;
+ }
+
+ /**
+ * To get is zero amount booking
+ *
+ * @return bool
+ */
+ public function isZeroAmountBooking()
+ {
+ return ($this->novalnetConfig->getPaymentConfig(\Novalnet\Payment\Model\Ui\ConfigProvider::NOVALNET_CC, 'payment_action') == \Novalnet\Payment\Model\NNConfig::ACTION_ZERO_AMOUNT_BOOKING);
+ }
+}
diff --git a/Block/Form/SepaGuarantee.php b/Block/Form/SepaGuarantee.php
new file mode 100755
index 0000000..43d0c57
--- /dev/null
+++ b/Block/Form/SepaGuarantee.php
@@ -0,0 +1,109 @@
+setTemplate('Novalnet_Payment::form/SepaGuarantee.phtml');
+ $this->novalnetConfig = $novalnetConfig;
+ $this->novalnetConfigProvider = $novalnetConfigProvider;
+ $this->novalnetRequestHelper = $novalnetRequestHelper;
+ $this->jsonHelperRequest = $jsonHelperRequest;
+ }
+
+ /**
+ * Get payment logo enabled status
+ *
+ * @param string $paymentMethodcode
+ * @return string
+ */
+ public function getPaymentLogo($paymentMethodcode)
+ {
+ return $this->novalnetConfigProvider->getPaymentLogo($paymentMethodcode);
+ }
+
+ /**
+ * Verify whether the payment is in Test mode
+ *
+ * @param string $paymentMethodcode
+ * @return int
+ */
+ public function getTestMode($paymentMethodcode)
+ {
+ return $this->novalnetConfig->getTestMode($paymentMethodcode);
+ }
+
+ /**
+ * Get novalnet helper
+ *
+ * @return mixed
+ */
+ public function novalnetHelper()
+ {
+ return $this->novalnetRequestHelper;
+ }
+
+ /**
+ * Get json helper request
+ *
+ * @return mixed
+ */
+ public function jsonHelper()
+ {
+ return $this->jsonHelperRequest;
+ }
+}
diff --git a/Block/Form/SepaInstalment.php b/Block/Form/SepaInstalment.php
new file mode 100755
index 0000000..b856200
--- /dev/null
+++ b/Block/Form/SepaInstalment.php
@@ -0,0 +1,179 @@
+setTemplate('Novalnet_Payment::form/SepaInstalment.phtml');
+ $this->priceHelper = $priceHelper;
+ $this->novalnetConfig = $novalnetConfig;
+ $this->novalnetConfigProvider = $novalnetConfigProvider;
+ $this->novalnetRequestHelper = $novalnetRequestHelper;
+ $this->jsonHelperRequest = $jsonHelperRequest;
+ $this->currency = $currency;
+ $this->storeManager = $storeManager;
+ }
+
+ /**
+ * Get payment logo enabled status
+ *
+ * @param string $paymentMethodcode
+ * @return string
+ */
+ public function getPaymentLogo($paymentMethodcode)
+ {
+ return $this->novalnetConfigProvider->getPaymentLogo($paymentMethodcode);
+ }
+
+ /**
+ * Verify whether the payment is in Test mode
+ *
+ * @param string $paymentMethodcode
+ * @return int
+ */
+ public function getTestMode($paymentMethodcode)
+ {
+ return $this->novalnetConfig->getTestMode($paymentMethodcode);
+ }
+
+ /**
+ * Get Novalnet Guarantee instalment cycles
+ *
+ * @return null|string
+ */
+ public function getInstalmentCycles()
+ {
+ return $this->novalnetConfig->getPaymentConfig($this->getMethodCode(), 'instalment_cycles');
+ }
+
+ /**
+ * Get amount with currency
+ *
+ * @param int $amount
+ * @return null|string
+ */
+ public function updateCurrency($amount)
+ {
+ return $this->priceHelper->currency($amount, true, false);
+ }
+
+ /**
+ * Get novalnet helper
+ *
+ * @return mixed
+ */
+ public function novalnetHelper()
+ {
+ return $this->novalnetRequestHelper;
+ }
+
+ /**
+ * Returns Instalment cycle details api URL for the Novalnet module
+ *
+ * @return string
+ */
+ public function getInstalmentCycleDetailUrl()
+ {
+ $baseUrl = $this->_storeManager->getStore()->getBaseUrl();
+ return str_replace('index.php/', '', $baseUrl) . 'rest/V1/novalnet/payment/instalment_cycle/';
+ }
+
+ /**
+ * Get json helper request
+ *
+ * @return mixed
+ */
+ public function jsonHelper()
+ {
+ return $this->jsonHelperRequest;
+ }
+
+ /**
+ * Get currency symbol for current locale and currency code
+ *
+ * @return string|null
+ */
+ public function getCurrentCurrencySymbol()
+ {
+ $store = $this->storeManager->getStore();
+ $currencyCode = $store->getCurrentCurrencyCode();
+ $currentCurrency = trim($currencyCode);
+ $currency = $this->currency->load($currentCurrency);
+ return $currency->getCurrencySymbol();
+ }
+}
diff --git a/Block/Info/Alipay.php b/Block/Info/Alipay.php
new file mode 100755
index 0000000..9e1c006
--- /dev/null
+++ b/Block/Info/Alipay.php
@@ -0,0 +1,98 @@
+novalnetRequestHelper = $novalnetRequestHelper;
+ $this->serializer = $serializer;
+ parent::__construct($context, $data);
+ }
+
+ /**
+ * Set template for Pdf
+ *
+ * @return string
+ */
+ public function toPdf()
+ {
+ $this->setTemplate('Novalnet_Payment::pdf/Alipay.phtml');
+ return $this->toHtml();
+ }
+
+ /**
+ * Get additional information for the payment
+ *
+ * @param string $key
+ * @return string|null
+ */
+ public function getAdditionalData($key)
+ {
+ $details = [];
+ if (!empty($this->getInfo()->getAdditionalData())) {
+ $details = $this->novalnetRequestHelper->isSerialized($this->getInfo()->getAdditionalData())
+ ? $this->serializer->unserialize($this->getInfo()->getAdditionalData())
+ : json_decode($this->getInfo()->getAdditionalData(), true);
+ }
+
+ if (is_array($details)) {
+ return (!empty($key) && isset($details[$key])) ? $details[$key] : '';
+ }
+
+ return null;
+ }
+
+ /**
+ * Get novalnet helper
+ *
+ * @return mixed
+ */
+ public function novalnetHelper()
+ {
+ return $this->novalnetRequestHelper;
+ }
+}
diff --git a/Block/Info/Applepay.php b/Block/Info/Applepay.php
new file mode 100755
index 0000000..10b5328
--- /dev/null
+++ b/Block/Info/Applepay.php
@@ -0,0 +1,98 @@
+novalnetRequestHelper = $novalnetRequestHelper;
+ $this->serializer = $serializer;
+ parent::__construct($context, $data);
+ }
+
+ /**
+ * Set template forPdf
+ *
+ * @return string
+ */
+ public function toPdf()
+ {
+ $this->setTemplate('Novalnet_Payment::pdf/Applepay.phtml');
+ return $this->toHtml();
+ }
+
+ /**
+ * Get additional information for the payment
+ *
+ * @param string $key
+ * @return string|null
+ */
+ public function getAdditionalData($key)
+ {
+ $details = [];
+ if (!empty($this->getInfo()->getAdditionalData())) {
+ $details = $this->novalnetRequestHelper->isSerialized($this->getInfo()->getAdditionalData())
+ ? $this->serializer->unserialize($this->getInfo()->getAdditionalData())
+ : json_decode($this->getInfo()->getAdditionalData(), true);
+ }
+
+ if (is_array($details)) {
+ return (!empty($key) && isset($details[$key])) ? $details[$key] : '';
+ }
+
+ return null;
+ }
+
+ /**
+ * Get novalnet helper
+ *
+ * @return mixed
+ */
+ public function novalnetHelper()
+ {
+ return $this->novalnetRequestHelper;
+ }
+}
diff --git a/Block/Info/Bancontact.php b/Block/Info/Bancontact.php
new file mode 100755
index 0000000..36dd5a9
--- /dev/null
+++ b/Block/Info/Bancontact.php
@@ -0,0 +1,98 @@
+novalnetRequestHelper = $novalnetRequestHelper;
+ $this->serializer = $serializer;
+ parent::__construct($context, $data);
+ }
+
+ /**
+ * Set template for Pdf
+ *
+ * @return string
+ */
+ public function toPdf()
+ {
+ $this->setTemplate('Novalnet_Payment::pdf/Bancontact.phtml');
+ return $this->toHtml();
+ }
+
+ /**
+ * Get additional information for the payment
+ *
+ * @param string $key
+ * @return string|null
+ */
+ public function getAdditionalData($key)
+ {
+ $details = [];
+ if (!empty($this->getInfo()->getAdditionalData())) {
+ $details = $this->novalnetRequestHelper->isSerialized($this->getInfo()->getAdditionalData())
+ ? $this->serializer->unserialize($this->getInfo()->getAdditionalData())
+ : json_decode($this->getInfo()->getAdditionalData(), true);
+ }
+
+ if (is_array($details)) {
+ return (!empty($key) && isset($details[$key])) ? $details[$key] : '';
+ }
+
+ return null;
+ }
+
+ /**
+ * Get novalnet helper
+ *
+ * @return mixed
+ */
+ public function novalnetHelper()
+ {
+ return $this->novalnetRequestHelper;
+ }
+}
diff --git a/Block/Info/Banktransfer.php b/Block/Info/Banktransfer.php
new file mode 100755
index 0000000..50d82c9
--- /dev/null
+++ b/Block/Info/Banktransfer.php
@@ -0,0 +1,98 @@
+novalnetRequestHelper = $novalnetRequestHelper;
+ $this->serializer = $serializer;
+ parent::__construct($context, $data);
+ }
+
+ /**
+ * Set template for Pdf
+ *
+ * @return string
+ */
+ public function toPdf()
+ {
+ $this->setTemplate('Novalnet_Payment::pdf/Banktransfer.phtml');
+ return $this->toHtml();
+ }
+
+ /**
+ * Get additional information for the payment
+ *
+ * @param string $key
+ * @return string|null
+ */
+ public function getAdditionalData($key)
+ {
+ $details = [];
+ if (!empty($this->getInfo()->getAdditionalData())) {
+ $details = $this->novalnetRequestHelper->isSerialized($this->getInfo()->getAdditionalData())
+ ? $this->serializer->unserialize($this->getInfo()->getAdditionalData())
+ : json_decode($this->getInfo()->getAdditionalData(), true);
+ }
+
+ if (is_array($details)) {
+ return (!empty($key) && isset($details[$key])) ? $details[$key] : '';
+ }
+
+ return null;
+ }
+
+ /**
+ * Get novalnet helper
+ *
+ * @return mixed
+ */
+ public function novalnetHelper()
+ {
+ return $this->novalnetRequestHelper;
+ }
+}
diff --git a/Block/Info/Blik.php b/Block/Info/Blik.php
new file mode 100755
index 0000000..29a1094
--- /dev/null
+++ b/Block/Info/Blik.php
@@ -0,0 +1,98 @@
+novalnetRequestHelper = $novalnetRequestHelper;
+ $this->serializer = $serializer;
+ parent::__construct($context, $data);
+ }
+
+ /**
+ * Set template forPdf
+ *
+ * @return string
+ */
+ public function toPdf()
+ {
+ $this->setTemplate('Novalnet_Payment::pdf/Blik.phtml');
+ return $this->toHtml();
+ }
+
+ /**
+ * Get additional information for the payment
+ *
+ * @param string $key
+ * @return string|null
+ */
+ public function getAdditionalData($key)
+ {
+ $details = [];
+ if (!empty($this->getInfo()->getAdditionalData())) {
+ $details = $this->novalnetRequestHelper->isSerialized($this->getInfo()->getAdditionalData())
+ ? $this->serializer->unserialize($this->getInfo()->getAdditionalData())
+ : json_decode($this->getInfo()->getAdditionalData(), true);
+ }
+
+ if (is_array($details)) {
+ return (!empty($key) && isset($details[$key])) ? $details[$key] : '';
+ }
+
+ return null;
+ }
+
+ /**
+ * Get novalnet helper
+ *
+ * @return mixed
+ */
+ public function novalnetHelper()
+ {
+ return $this->novalnetRequestHelper;
+ }
+}
diff --git a/Block/Info/Cashpayment.php b/Block/Info/Cashpayment.php
new file mode 100755
index 0000000..89a0f8a
--- /dev/null
+++ b/Block/Info/Cashpayment.php
@@ -0,0 +1,108 @@
+novalnetRequestHelper = $novalnetRequestHelper;
+ $this->serializer = $serializer;
+ parent::__construct($context, $data);
+ }
+
+ /**
+ * Set template for Pdf
+ *
+ * @return string
+ */
+ public function toPdf()
+ {
+ $this->setTemplate('Novalnet_Payment::pdf/Cashpayment.phtml');
+ return $this->toHtml();
+ }
+
+ /**
+ * Get additional information for the payment
+ *
+ * @param string $key
+ * @return string|null
+ */
+ public function getAdditionalData($key)
+ {
+ $details = [];
+ if (!empty($this->getInfo()->getAdditionalData())) {
+ $details = $this->novalnetRequestHelper->isSerialized($this->getInfo()->getAdditionalData())
+ ? $this->serializer->unserialize($this->getInfo()->getAdditionalData())
+ : json_decode($this->getInfo()->getAdditionalData(), true);
+ }
+
+ if (is_array($details)) {
+ return (!empty($key) && isset($details[$key])) ? $details[$key] : '';
+ }
+
+ return null;
+ }
+
+ /**
+ * Get novalnet helper
+ *
+ * @return mixed
+ */
+ public function novalnetHelper()
+ {
+ return $this->novalnetRequestHelper;
+ }
+
+ /**
+ * Get GrandTotal
+ *
+ * @return mixed
+ */
+ public function getGrandTotal()
+ {
+ return $this->novalnetRequestHelper->getAmountWithSymbol($this->getInfo()->getOrder()->getGrandTotal(), $this->getInfo()->getOrder()->getStoreId());
+ }
+}
diff --git a/Block/Info/Cc.php b/Block/Info/Cc.php
new file mode 100755
index 0000000..ae8cef2
--- /dev/null
+++ b/Block/Info/Cc.php
@@ -0,0 +1,98 @@
+novalnetRequestHelper = $novalnetRequestHelper;
+ $this->serializer = $serializer;
+ parent::__construct($context, $data);
+ }
+
+ /**
+ * Set template for Pdf
+ *
+ * @return string
+ */
+ public function toPdf()
+ {
+ $this->setTemplate('Novalnet_Payment::pdf/Cc.phtml');
+ return $this->toHtml();
+ }
+
+ /**
+ * Get additional information for the payment
+ *
+ * @param string $key
+ * @return string|null
+ */
+ public function getAdditionalData($key)
+ {
+ $details = [];
+ if (!empty($this->getInfo()->getAdditionalData())) {
+ $details = $this->novalnetRequestHelper->isSerialized($this->getInfo()->getAdditionalData())
+ ? $this->serializer->unserialize($this->getInfo()->getAdditionalData())
+ : json_decode($this->getInfo()->getAdditionalData(), true);
+ }
+
+ if (is_array($details)) {
+ return (!empty($key) && isset($details[$key])) ? $details[$key] : '';
+ }
+
+ return null;
+ }
+
+ /**
+ * Get novalnet helper
+ *
+ * @return mixed
+ */
+ public function novalnetHelper()
+ {
+ return $this->novalnetRequestHelper;
+ }
+}
diff --git a/Block/Info/Eps.php b/Block/Info/Eps.php
new file mode 100755
index 0000000..072e689
--- /dev/null
+++ b/Block/Info/Eps.php
@@ -0,0 +1,98 @@
+novalnetRequestHelper = $novalnetRequestHelper;
+ $this->serializer = $serializer;
+ parent::__construct($context, $data);
+ }
+
+ /**
+ * Set template forPdf
+ *
+ * @return string
+ */
+ public function toPdf()
+ {
+ $this->setTemplate('Novalnet_Payment::pdf/Eps.phtml');
+ return $this->toHtml();
+ }
+
+ /**
+ * Get additional information for the payment
+ *
+ * @param string $key
+ * @return string|null
+ */
+ public function getAdditionalData($key)
+ {
+ $details = [];
+ if (!empty($this->getInfo()->getAdditionalData())) {
+ $details = $this->novalnetRequestHelper->isSerialized($this->getInfo()->getAdditionalData())
+ ? $this->serializer->unserialize($this->getInfo()->getAdditionalData())
+ : json_decode($this->getInfo()->getAdditionalData(), true);
+ }
+
+ if (is_array($details)) {
+ return (!empty($key) && isset($details[$key])) ? $details[$key] : '';
+ }
+
+ return null;
+ }
+
+ /**
+ * Get novalnet helper
+ *
+ * @return mixed
+ */
+ public function novalnetHelper()
+ {
+ return $this->novalnetRequestHelper;
+ }
+}
diff --git a/Block/Info/Giropay.php b/Block/Info/Giropay.php
new file mode 100755
index 0000000..73a65cc
--- /dev/null
+++ b/Block/Info/Giropay.php
@@ -0,0 +1,98 @@
+novalnetRequestHelper = $novalnetRequestHelper;
+ $this->serializer = $serializer;
+ parent::__construct($context, $data);
+ }
+
+ /**
+ * Set template forPdf
+ *
+ * @return string
+ */
+ public function toPdf()
+ {
+ $this->setTemplate('Novalnet_Payment::pdf/Giropay.phtml');
+ return $this->toHtml();
+ }
+
+ /**
+ * Get additional information for the payment
+ *
+ * @param string $key
+ * @return string|null
+ */
+ public function getAdditionalData($key)
+ {
+ $details = [];
+ if (!empty($this->getInfo()->getAdditionalData())) {
+ $details = $this->novalnetRequestHelper->isSerialized($this->getInfo()->getAdditionalData())
+ ? $this->serializer->unserialize($this->getInfo()->getAdditionalData())
+ : json_decode($this->getInfo()->getAdditionalData(), true);
+ }
+
+ if (is_array($details)) {
+ return (!empty($key) && isset($details[$key])) ? $details[$key] : '';
+ }
+
+ return null;
+ }
+
+ /**
+ * Get novalnet helper
+ *
+ * @return mixed
+ */
+ public function novalnetHelper()
+ {
+ return $this->novalnetRequestHelper;
+ }
+}
diff --git a/Block/Info/Googlepay.php b/Block/Info/Googlepay.php
new file mode 100755
index 0000000..4b84bd3
--- /dev/null
+++ b/Block/Info/Googlepay.php
@@ -0,0 +1,98 @@
+novalnetRequestHelper = $novalnetRequestHelper;
+ $this->serializer = $serializer;
+ parent::__construct($context, $data);
+ }
+
+ /**
+ * Set template forPdf
+ *
+ * @return string
+ */
+ public function toPdf()
+ {
+ $this->setTemplate('Novalnet_Payment::pdf/Googlepay.phtml');
+ return $this->toHtml();
+ }
+
+ /**
+ * Get additional information for the payment
+ *
+ * @param string $key
+ * @return string|null
+ */
+ public function getAdditionalData($key)
+ {
+ $details = [];
+ if (!empty($this->getInfo()->getAdditionalData())) {
+ $details = $this->novalnetRequestHelper->isSerialized($this->getInfo()->getAdditionalData())
+ ? $this->serializer->unserialize($this->getInfo()->getAdditionalData())
+ : json_decode($this->getInfo()->getAdditionalData(), true);
+ }
+
+ if (is_array($details)) {
+ return (!empty($key) && isset($details[$key])) ? $details[$key] : '';
+ }
+
+ return null;
+ }
+
+ /**
+ * Get novalnet helper
+ *
+ * @return mixed
+ */
+ public function novalnetHelper()
+ {
+ return $this->novalnetRequestHelper;
+ }
+}
diff --git a/Block/Info/Ideal.php b/Block/Info/Ideal.php
new file mode 100755
index 0000000..b9d8ed3
--- /dev/null
+++ b/Block/Info/Ideal.php
@@ -0,0 +1,98 @@
+novalnetRequestHelper = $novalnetRequestHelper;
+ $this->serializer = $serializer;
+ parent::__construct($context, $data);
+ }
+
+ /**
+ * Set template forPdf
+ *
+ * @return string
+ */
+ public function toPdf()
+ {
+ $this->setTemplate('Novalnet_Payment::pdf/Ideal.phtml');
+ return $this->toHtml();
+ }
+
+ /**
+ * Get additional information for the payment
+ *
+ * @param string $key
+ * @return string|null
+ */
+ public function getAdditionalData($key)
+ {
+ $details = [];
+ if (!empty($this->getInfo()->getAdditionalData())) {
+ $details = $this->novalnetRequestHelper->isSerialized($this->getInfo()->getAdditionalData())
+ ? $this->serializer->unserialize($this->getInfo()->getAdditionalData())
+ : json_decode($this->getInfo()->getAdditionalData(), true);
+ }
+
+ if (is_array($details)) {
+ return (!empty($key) && isset($details[$key])) ? $details[$key] : '';
+ }
+
+ return null;
+ }
+
+ /**
+ * Get novalnet helper
+ *
+ * @return mixed
+ */
+ public function novalnetHelper()
+ {
+ return $this->novalnetRequestHelper;
+ }
+}
diff --git a/Block/Info/Invoice.php b/Block/Info/Invoice.php
new file mode 100755
index 0000000..32fb049
--- /dev/null
+++ b/Block/Info/Invoice.php
@@ -0,0 +1,108 @@
+novalnetRequestHelper = $novalnetRequestHelper;
+ $this->serializer = $serializer;
+ parent::__construct($context, $data);
+ }
+
+ /**
+ * Set template for Pdf
+ *
+ * @return string
+ */
+ public function toPdf()
+ {
+ $this->setTemplate('Novalnet_Payment::pdf/Invoice.phtml');
+ return $this->toHtml();
+ }
+
+ /**
+ * Get additional information for the payment
+ *
+ * @param string $key
+ * @return string|null
+ */
+ public function getAdditionalData($key)
+ {
+ $details = [];
+ if (!empty($this->getInfo()->getAdditionalData())) {
+ $details = $this->novalnetRequestHelper->isSerialized($this->getInfo()->getAdditionalData())
+ ? $this->serializer->unserialize($this->getInfo()->getAdditionalData())
+ : json_decode($this->getInfo()->getAdditionalData(), true);
+ }
+
+ if (is_array($details)) {
+ return (!empty($key) && isset($details[$key])) ? $details[$key] : '';
+ }
+
+ return null;
+ }
+
+ /**
+ * Get novalnet helper
+ *
+ * @return mixed
+ */
+ public function novalnetHelper()
+ {
+ return $this->novalnetRequestHelper;
+ }
+
+ /**
+ * Get GrandTotal
+ *
+ * @return mixed
+ */
+ public function getGrandTotal()
+ {
+ return $this->novalnetRequestHelper->getAmountWithSymbol($this->getInfo()->getOrder()->getGrandTotal(), $this->getInfo()->getOrder()->getStoreId());
+ }
+}
diff --git a/Block/Info/InvoiceGuarantee.php b/Block/Info/InvoiceGuarantee.php
new file mode 100755
index 0000000..f09f200
--- /dev/null
+++ b/Block/Info/InvoiceGuarantee.php
@@ -0,0 +1,108 @@
+novalnetRequestHelper = $novalnetRequestHelper;
+ $this->serializer = $serializer;
+ parent::__construct($context, $data);
+ }
+
+ /**
+ * Set template forPdf
+ *
+ * @return string
+ */
+ public function toPdf()
+ {
+ $this->setTemplate('Novalnet_Payment::pdf/InvoiceGuarantee.phtml');
+ return $this->toHtml();
+ }
+
+ /**
+ * Get additional information for the payment
+ *
+ * @param string $key
+ * @return string|null
+ */
+ public function getAdditionalData($key)
+ {
+ $details = [];
+ if (!empty($this->getInfo()->getAdditionalData())) {
+ $details = $this->novalnetRequestHelper->isSerialized($this->getInfo()->getAdditionalData())
+ ? $this->serializer->unserialize($this->getInfo()->getAdditionalData())
+ : json_decode($this->getInfo()->getAdditionalData(), true);
+ }
+
+ if (is_array($details)) {
+ return (!empty($key) && isset($details[$key])) ? $details[$key] : '';
+ }
+
+ return null;
+ }
+
+ /**
+ * Get novalnet helper
+ *
+ * @return mixed
+ */
+ public function novalnetHelper()
+ {
+ return $this->novalnetRequestHelper;
+ }
+
+ /**
+ * Get GrandTotal
+ *
+ * @return mixed
+ */
+ public function getGrandTotal()
+ {
+ return $this->novalnetRequestHelper->getAmountWithSymbol($this->getInfo()->getOrder()->getGrandTotal(), $this->getInfo()->getOrder()->getStoreId());
+ }
+}
diff --git a/Block/Info/InvoiceInstalment.php b/Block/Info/InvoiceInstalment.php
new file mode 100755
index 0000000..7ae8067
--- /dev/null
+++ b/Block/Info/InvoiceInstalment.php
@@ -0,0 +1,127 @@
+priceHelper = $priceHelper;
+ $this->novalnetRequestHelper = $novalnetRequestHelper;
+ $this->serializer = $serializer;
+ }
+
+ /**
+ * Set template forPdf
+ *
+ * @return string
+ */
+ public function toPdf()
+ {
+ $this->setTemplate('Novalnet_Payment::pdf/InvoiceInstalment.phtml');
+ return $this->toHtml();
+ }
+
+ /**
+ * Get additional information for the payment
+ *
+ * @param string $key
+ * @return string|null
+ */
+ public function getAdditionalData($key)
+ {
+ $details = [];
+ if (!empty($this->getInfo()->getAdditionalData())) {
+ $details = $this->novalnetRequestHelper->isSerialized($this->getInfo()->getAdditionalData())
+ ? $this->serializer->unserialize($this->getInfo()->getAdditionalData())
+ : json_decode($this->getInfo()->getAdditionalData(), true);
+ }
+
+ if (is_array($details)) {
+ return (!empty($key) && isset($details[$key])) ? $details[$key] : '';
+ }
+
+ return null;
+ }
+
+ /**
+ * Get amount with currency
+ *
+ * @param int $amount
+ * @return null|string
+ */
+ public function updateCurrency($amount)
+ {
+ return $this->priceHelper->currency($amount, true, false);
+ }
+
+ /**
+ * Get novalnet helper
+ *
+ * @return mixed
+ */
+ public function novalnetHelper()
+ {
+ return $this->novalnetRequestHelper;
+ }
+
+ /**
+ * Get GrandTotal
+ *
+ * @return mixed
+ */
+ public function getGrandTotal()
+ {
+ return $this->novalnetRequestHelper->getAmountWithSymbol($this->getInfo()->getOrder()->getGrandTotal(), $this->getInfo()->getOrder()->getStoreId());
+ }
+}
diff --git a/Block/Info/Multibanco.php b/Block/Info/Multibanco.php
new file mode 100755
index 0000000..9b17177
--- /dev/null
+++ b/Block/Info/Multibanco.php
@@ -0,0 +1,108 @@
+novalnetRequestHelper = $novalnetRequestHelper;
+ $this->serializer = $serializer;
+ parent::__construct($context, $data);
+ }
+
+ /**
+ * Set template forPdf
+ *
+ * @return string
+ */
+ public function toPdf()
+ {
+ $this->setTemplate('Novalnet_Payment::pdf/Multibanco.phtml');
+ return $this->toHtml();
+ }
+
+ /**
+ * Get additional information for the payment
+ *
+ * @param string $key
+ * @return string|null
+ */
+ public function getAdditionalData($key)
+ {
+ $details = [];
+ if (!empty($this->getInfo()->getAdditionalData())) {
+ $details = $this->novalnetRequestHelper->isSerialized($this->getInfo()->getAdditionalData())
+ ? $this->serializer->unserialize($this->getInfo()->getAdditionalData())
+ : json_decode($this->getInfo()->getAdditionalData(), true);
+ }
+
+ if (is_array($details)) {
+ return (!empty($key) && isset($details[$key])) ? $details[$key] : '';
+ }
+
+ return null;
+ }
+
+ /**
+ * Get novalnet helper
+ *
+ * @return mixed
+ */
+ public function novalnetHelper()
+ {
+ return $this->novalnetRequestHelper;
+ }
+
+ /**
+ * Get GrandTotal
+ *
+ * @return mixed
+ */
+ public function getGrandTotal()
+ {
+ return $this->novalnetRequestHelper->getAmountWithSymbol($this->getInfo()->getOrder()->getGrandTotal(), $this->getInfo()->getOrder()->getStoreId());
+ }
+}
diff --git a/Block/Info/OnlineBanktransfer.php b/Block/Info/OnlineBanktransfer.php
new file mode 100755
index 0000000..bca9f1a
--- /dev/null
+++ b/Block/Info/OnlineBanktransfer.php
@@ -0,0 +1,98 @@
+novalnetRequestHelper = $novalnetRequestHelper;
+ $this->serializer = $serializer;
+ parent::__construct($context, $data);
+ }
+
+ /**
+ * Set template for Pdf
+ *
+ * @return string
+ */
+ public function toPdf()
+ {
+ $this->setTemplate('Novalnet_Payment::pdf/OnlineBanktransfer.phtml');
+ return $this->toHtml();
+ }
+
+ /**
+ * Get additional information for the payment
+ *
+ * @param string $key
+ * @return string|null
+ */
+ public function getAdditionalData($key)
+ {
+ $details = [];
+ if (!empty($this->getInfo()->getAdditionalData())) {
+ $details = $this->novalnetRequestHelper->isSerialized($this->getInfo()->getAdditionalData())
+ ? $this->serializer->unserialize($this->getInfo()->getAdditionalData())
+ : json_decode($this->getInfo()->getAdditionalData(), true);
+ }
+
+ if (is_array($details)) {
+ return (!empty($key) && isset($details[$key])) ? $details[$key] : '';
+ }
+
+ return null;
+ }
+
+ /**
+ * Get novalnet helper
+ *
+ * @return mixed
+ */
+ public function novalnetHelper()
+ {
+ return $this->novalnetRequestHelper;
+ }
+}
diff --git a/Block/Info/Paypal.php b/Block/Info/Paypal.php
new file mode 100755
index 0000000..6438b57
--- /dev/null
+++ b/Block/Info/Paypal.php
@@ -0,0 +1,98 @@
+novalnetRequestHelper = $novalnetRequestHelper;
+ $this->serializer = $serializer;
+ parent::__construct($context, $data);
+ }
+
+ /**
+ * Set template forPdf
+ *
+ * @return string
+ */
+ public function toPdf()
+ {
+ $this->setTemplate('Novalnet_Payment::pdf/Paypal.phtml');
+ return $this->toHtml();
+ }
+
+ /**
+ * Get additional information for the payment
+ *
+ * @param string $key
+ * @return string|null
+ */
+ public function getAdditionalData($key)
+ {
+ $details = [];
+ if (!empty($this->getInfo()->getAdditionalData())) {
+ $details = $this->novalnetRequestHelper->isSerialized($this->getInfo()->getAdditionalData())
+ ? $this->serializer->unserialize($this->getInfo()->getAdditionalData())
+ : json_decode($this->getInfo()->getAdditionalData(), true);
+ }
+
+ if (is_array($details)) {
+ return (!empty($key) && isset($details[$key])) ? $details[$key] : '';
+ }
+
+ return null;
+ }
+
+ /**
+ * Get novalnet helper
+ *
+ * @return mixed
+ */
+ public function novalnetHelper()
+ {
+ return $this->novalnetRequestHelper;
+ }
+}
diff --git a/Block/Info/PostFinance.php b/Block/Info/PostFinance.php
new file mode 100755
index 0000000..3553c19
--- /dev/null
+++ b/Block/Info/PostFinance.php
@@ -0,0 +1,98 @@
+novalnetRequestHelper = $novalnetRequestHelper;
+ $this->serializer = $serializer;
+ parent::__construct($context, $data);
+ }
+
+ /**
+ * Set template forPdf
+ *
+ * @return string
+ */
+ public function toPdf()
+ {
+ $this->setTemplate('Novalnet_Payment::pdf/PostFinance.phtml');
+ return $this->toHtml();
+ }
+
+ /**
+ * Get additional information for the payment
+ *
+ * @param string $key
+ * @return string|null
+ */
+ public function getAdditionalData($key)
+ {
+ $details = [];
+ if (!empty($this->getInfo()->getAdditionalData())) {
+ $details = $this->novalnetRequestHelper->isSerialized($this->getInfo()->getAdditionalData())
+ ? $this->serializer->unserialize($this->getInfo()->getAdditionalData())
+ : json_decode($this->getInfo()->getAdditionalData(), true);
+ }
+
+ if (is_array($details)) {
+ return (!empty($key) && isset($details[$key])) ? $details[$key] : '';
+ }
+
+ return null;
+ }
+
+ /**
+ * Get novalnet helper
+ *
+ * @return mixed
+ */
+ public function novalnetHelper()
+ {
+ return $this->novalnetRequestHelper;
+ }
+}
diff --git a/Block/Info/PostFinanceCard.php b/Block/Info/PostFinanceCard.php
new file mode 100755
index 0000000..036be3e
--- /dev/null
+++ b/Block/Info/PostFinanceCard.php
@@ -0,0 +1,94 @@
+novalnetRequestHelper = $novalnetRequestHelper;
+ $this->serializer = $serializer;
+ parent::__construct($context, $data);
+ }
+
+ /**
+ * Set template forPdf
+ *
+ * @return string
+ */
+ public function toPdf()
+ {
+ $this->setTemplate('Novalnet_Payment::pdf/PostFinanceCard.phtml');
+ return $this->toHtml();
+ }
+
+ /**
+ * Get additional information for the payment
+ *
+ * @param string $key
+ * @return string|null
+ */
+ public function getAdditionalData($key)
+ {
+ $details = (!empty($this->getInfo()->getAdditionalData())) ? ($this->novalnetRequestHelper->isSerialized($this->getInfo()->getAdditionalData())
+ ? $this->serializer->unserialize($this->getInfo()->getAdditionalData())
+ : json_decode($this->getInfo()->getAdditionalData(), true)) : [];
+ if (is_array($details)) {
+ return (!empty($key) && isset($details[$key])) ? $details[$key] : '';
+ }
+
+ return null;
+ }
+
+ /**
+ * Get novalnet helper
+ *
+ * @return mixed
+ */
+ public function novalnetHelper()
+ {
+ return $this->novalnetRequestHelper;
+ }
+}
diff --git a/Block/Info/Prepayment.php b/Block/Info/Prepayment.php
new file mode 100755
index 0000000..b6fc4eb
--- /dev/null
+++ b/Block/Info/Prepayment.php
@@ -0,0 +1,108 @@
+novalnetRequestHelper = $novalnetRequestHelper;
+ $this->serializer = $serializer;
+ parent::__construct($context, $data);
+ }
+
+ /**
+ * Set template forPdf
+ *
+ * @return string
+ */
+ public function toPdf()
+ {
+ $this->setTemplate('Novalnet_Payment::pdf/Prepayment.phtml');
+ return $this->toHtml();
+ }
+
+ /**
+ * Get additional information for the payment
+ *
+ * @param string $key
+ * @return string|null
+ */
+ public function getAdditionalData($key)
+ {
+ $details = [];
+ if (!empty($this->getInfo()->getAdditionalData())) {
+ $details = $this->novalnetRequestHelper->isSerialized($this->getInfo()->getAdditionalData())
+ ? $this->serializer->unserialize($this->getInfo()->getAdditionalData())
+ : json_decode($this->getInfo()->getAdditionalData(), true);
+ }
+
+ if (is_array($details)) {
+ return (!empty($key) && isset($details[$key])) ? $details[$key] : '';
+ }
+
+ return null;
+ }
+
+ /**
+ * Get novalnet helper
+ *
+ * @return mixed
+ */
+ public function novalnetHelper()
+ {
+ return $this->novalnetRequestHelper;
+ }
+
+ /**
+ * Get GrandTotal
+ *
+ * @return mixed
+ */
+ public function getGrandTotal()
+ {
+ return $this->novalnetRequestHelper->getAmountWithSymbol($this->getInfo()->getOrder()->getGrandTotal(), $this->getInfo()->getOrder()->getStoreId());
+ }
+}
diff --git a/Block/Info/Przelewy.php b/Block/Info/Przelewy.php
new file mode 100755
index 0000000..1154fcc
--- /dev/null
+++ b/Block/Info/Przelewy.php
@@ -0,0 +1,98 @@
+novalnetRequestHelper = $novalnetRequestHelper;
+ $this->serializer = $serializer;
+ parent::__construct($context, $data);
+ }
+
+ /**
+ * Set template forPdf
+ *
+ * @return string
+ */
+ public function toPdf()
+ {
+ $this->setTemplate('Novalnet_Payment::pdf/Przelewy.phtml');
+ return $this->toHtml();
+ }
+
+ /**
+ * Get additional information for the payment
+ *
+ * @param string $key
+ * @return string|null
+ */
+ public function getAdditionalData($key)
+ {
+ $details = [];
+ if (!empty($this->getInfo()->getAdditionalData())) {
+ $details = $this->novalnetRequestHelper->isSerialized($this->getInfo()->getAdditionalData())
+ ? $this->serializer->unserialize($this->getInfo()->getAdditionalData())
+ : json_decode($this->getInfo()->getAdditionalData(), true);
+ }
+
+ if (is_array($details)) {
+ return (!empty($key) && isset($details[$key])) ? $details[$key] : '';
+ }
+
+ return null;
+ }
+
+ /**
+ * Get novalnet helper
+ *
+ * @return mixed
+ */
+ public function novalnetHelper()
+ {
+ return $this->novalnetRequestHelper;
+ }
+}
diff --git a/Block/Info/Sepa.php b/Block/Info/Sepa.php
new file mode 100755
index 0000000..3248eef
--- /dev/null
+++ b/Block/Info/Sepa.php
@@ -0,0 +1,98 @@
+novalnetRequestHelper = $novalnetRequestHelper;
+ $this->serializer = $serializer;
+ parent::__construct($context, $data);
+ }
+
+ /**
+ * Set template for Pdf
+ *
+ * @return string
+ */
+ public function toPdf()
+ {
+ $this->setTemplate('Novalnet_Payment::pdf/Sepa.phtml');
+ return $this->toHtml();
+ }
+
+ /**
+ * Get additional information for the payment
+ *
+ * @param string $key
+ * @return string|null
+ */
+ public function getAdditionalData($key)
+ {
+ $details = [];
+ if (!empty($this->getInfo()->getAdditionalData())) {
+ $details = $this->novalnetRequestHelper->isSerialized($this->getInfo()->getAdditionalData())
+ ? $this->serializer->unserialize($this->getInfo()->getAdditionalData())
+ : json_decode($this->getInfo()->getAdditionalData(), true);
+ }
+
+ if (is_array($details)) {
+ return (!empty($key) && isset($details[$key])) ? $details[$key] : '';
+ }
+
+ return null;
+ }
+
+ /**
+ * Get novalnet helper
+ *
+ * @return mixed
+ */
+ public function novalnetHelper()
+ {
+ return $this->novalnetRequestHelper;
+ }
+}
diff --git a/Block/Info/SepaGuarantee.php b/Block/Info/SepaGuarantee.php
new file mode 100755
index 0000000..4ad298f
--- /dev/null
+++ b/Block/Info/SepaGuarantee.php
@@ -0,0 +1,98 @@
+novalnetRequestHelper = $novalnetRequestHelper;
+ $this->serializer = $serializer;
+ parent::__construct($context, $data);
+ }
+
+ /**
+ * Set template forPdf
+ *
+ * @return string
+ */
+ public function toPdf()
+ {
+ $this->setTemplate('Novalnet_Payment::pdf/SepaGuarantee.phtml');
+ return $this->toHtml();
+ }
+
+ /**
+ * Get additional information for the payment
+ *
+ * @param string $key
+ * @return string|null
+ */
+ public function getAdditionalData($key)
+ {
+ $details = [];
+ if (!empty($this->getInfo()->getAdditionalData())) {
+ $details = $this->novalnetRequestHelper->isSerialized($this->getInfo()->getAdditionalData())
+ ? $this->serializer->unserialize($this->getInfo()->getAdditionalData())
+ : json_decode($this->getInfo()->getAdditionalData(), true);
+ }
+
+ if (is_array($details)) {
+ return (!empty($key) && isset($details[$key])) ? $details[$key] : '';
+ }
+
+ return null;
+ }
+
+ /**
+ * Get novalnet helper
+ *
+ * @return mixed
+ */
+ public function novalnetHelper()
+ {
+ return $this->novalnetRequestHelper;
+ }
+}
diff --git a/Block/Info/SepaInstalment.php b/Block/Info/SepaInstalment.php
new file mode 100755
index 0000000..3eaedf6
--- /dev/null
+++ b/Block/Info/SepaInstalment.php
@@ -0,0 +1,117 @@
+priceHelper = $priceHelper;
+ $this->novalnetRequestHelper = $novalnetRequestHelper;
+ $this->serializer = $serializer;
+ }
+
+ /**
+ * Set template forPdf
+ *
+ * @return string
+ */
+ public function toPdf()
+ {
+ $this->setTemplate('Novalnet_Payment::pdf/SepaInstalment.phtml');
+ return $this->toHtml();
+ }
+
+ /**
+ * Get additional information for the payment
+ *
+ * @param string $key
+ * @return string|null
+ */
+ public function getAdditionalData($key)
+ {
+ $details = [];
+ if (!empty($this->getInfo()->getAdditionalData())) {
+ $details = $this->novalnetRequestHelper->isSerialized($this->getInfo()->getAdditionalData())
+ ? $this->serializer->unserialize($this->getInfo()->getAdditionalData())
+ : json_decode($this->getInfo()->getAdditionalData(), true);
+ }
+
+ if (is_array($details)) {
+ return (!empty($key) && isset($details[$key])) ? $details[$key] : '';
+ }
+
+ return null;
+ }
+
+ /**
+ * Get amount with currency
+ *
+ * @param int $amount
+ * @return float|string
+ */
+ public function updateCurrency($amount)
+ {
+ return $this->priceHelper->currency($amount, true, false);
+ }
+
+ /**
+ * Get novalnet helper
+ *
+ * @return mixed
+ */
+ public function novalnetHelper()
+ {
+ return $this->novalnetRequestHelper;
+ }
+}
diff --git a/Block/Info/Trustly.php b/Block/Info/Trustly.php
new file mode 100755
index 0000000..a05b0bf
--- /dev/null
+++ b/Block/Info/Trustly.php
@@ -0,0 +1,98 @@
+novalnetRequestHelper = $novalnetRequestHelper;
+ $this->serializer = $serializer;
+ parent::__construct($context, $data);
+ }
+
+ /**
+ * Set template for Pdf
+ *
+ * @return string
+ */
+ public function toPdf()
+ {
+ $this->setTemplate('Novalnet_Payment::pdf/Trustly.phtml');
+ return $this->toHtml();
+ }
+
+ /**
+ * Get additional information for the payment
+ *
+ * @param string $key
+ * @return string|null
+ */
+ public function getAdditionalData($key)
+ {
+ $details = [];
+ if (!empty($this->getInfo()->getAdditionalData())) {
+ $details = $this->novalnetRequestHelper->isSerialized($this->getInfo()->getAdditionalData())
+ ? $this->serializer->unserialize($this->getInfo()->getAdditionalData())
+ : json_decode($this->getInfo()->getAdditionalData(), true);
+ }
+
+ if (is_array($details)) {
+ return (!empty($key) && isset($details[$key])) ? $details[$key] : '';
+ }
+
+ return null;
+ }
+
+ /**
+ * Get novalnet helper
+ *
+ * @return mixed
+ */
+ public function novalnetHelper()
+ {
+ return $this->novalnetRequestHelper;
+ }
+}
diff --git a/Block/Info/Wechatpay.php b/Block/Info/Wechatpay.php
new file mode 100755
index 0000000..7be5bf9
--- /dev/null
+++ b/Block/Info/Wechatpay.php
@@ -0,0 +1,98 @@
+novalnetRequestHelper = $novalnetRequestHelper;
+ $this->serializer = $serializer;
+ parent::__construct($context, $data);
+ }
+
+ /**
+ * Set template for Pdf
+ *
+ * @return string
+ */
+ public function toPdf()
+ {
+ $this->setTemplate('Novalnet_Payment::pdf/Wechatpay.phtml');
+ return $this->toHtml();
+ }
+
+ /**
+ * Get additional information for the payment
+ *
+ * @param string $key
+ * @return string|null
+ */
+ public function getAdditionalData($key)
+ {
+ $details = [];
+ if (!empty($this->getInfo()->getAdditionalData())) {
+ $details = $this->novalnetRequestHelper->isSerialized($this->getInfo()->getAdditionalData())
+ ? $this->serializer->unserialize($this->getInfo()->getAdditionalData())
+ : json_decode($this->getInfo()->getAdditionalData(), true);
+ }
+
+ if (is_array($details)) {
+ return (!empty($key) && isset($details[$key])) ? $details[$key] : '';
+ }
+
+ return null;
+ }
+
+ /**
+ * Get novalnet helper
+ *
+ * @return mixed
+ */
+ public function novalnetHelper()
+ {
+ return $this->novalnetRequestHelper;
+ }
+}
diff --git a/Block/Onepage/Success/Message.php b/Block/Onepage/Success/Message.php
new file mode 100755
index 0000000..4c66d5c
--- /dev/null
+++ b/Block/Onepage/Success/Message.php
@@ -0,0 +1,115 @@
+checkoutSession = $checkoutSession;
+ $this->novalnetRequestHelper = $novalnetRequestHelper;
+ $this->serializer = $serializer;
+ parent::__construct($context);
+ }
+
+ /**
+ * Return Novalnet Cashpayment additional data
+ *
+ * @return mixed
+ */
+ public function getCpAdditionalData()
+ {
+ $additionalData = false;
+ $order = $this->checkoutSession->getLastRealOrder();
+ if ($order->getId()) {
+ $payment = $order->getPayment();
+ if ($payment->getMethodInstance()->getCode() == ConfigProvider::NOVALNET_CASHPAYMENT) {
+ $additionalData = (!empty($payment->getAdditionalData())) ? json_decode($payment->getAdditionalData(), true) : [];
+ }
+ }
+
+ return $additionalData;
+ }
+
+ /**
+ * Return Novalnet Googlepay additional data
+ *
+ * @return mixed
+ */
+ public function getGpayAdditionalData()
+ {
+ $additionalData = false;
+ $order = $this->checkoutSession->getLastRealOrder();
+ if ($order->getId()) {
+ $payment = $order->getPayment();
+ if ($payment->getMethodInstance()->getCode() == ConfigProvider::NOVALNET_GOOGLEPAY) {
+ $additionalData = (!empty($payment->getAdditionalData())) ? json_decode($payment->getAdditionalData(), true) : [];
+ }
+ }
+
+ return $additionalData;
+ }
+
+ /**
+ * Return Novalnet Applepay additional data
+ *
+ * @return mixed
+ */
+ public function getApplepayAdditionalData()
+ {
+ $additionalData = false;
+ $order = $this->checkoutSession->getLastRealOrder();
+ if ($order->getId()) {
+ $payment = $order->getPayment();
+ if ($payment->getMethodInstance()->getCode() == ConfigProvider::NOVALNET_APPLEPAY) {
+ $additionalData = (!empty($payment->getAdditionalData())) ? json_decode($payment->getAdditionalData(), true) : [];
+ }
+ }
+
+ return $additionalData;
+ }
+}
diff --git a/Block/System/Config/Form/Field/CreditcardStyle.php b/Block/System/Config/Form/Field/CreditcardStyle.php
new file mode 100755
index 0000000..01888a2
--- /dev/null
+++ b/Block/System/Config/Form/Field/CreditcardStyle.php
@@ -0,0 +1,105 @@
+ 'font-family: Raleway,Helvetica Neue,Verdana,Arial,sans-serif;font-size: 13px;font-weight: 600;color: #636363;line-height: 1.5;',
+ 'standard_style_input' => 'color: #636363;font-family: Helvetica Neue,Verdana,Arial,sans-serif;font-size: 14px;',
+ 'standard_style_css' => ''
+ ];
+
+ /**
+ * Set template to itself
+ *
+ * @return $this
+ */
+ protected function _prepareLayout()
+ {
+ parent::_prepareLayout();
+ if (!$this->getTemplate()) {
+ $this->setTemplate('Novalnet_Payment::system/config/form/field/creditcardStyle.phtml');
+ }
+ return $this;
+ }
+
+ /**
+ * Remove scope label
+ *
+ * @param \Magento\Framework\Data\Form\Element\AbstractElement $element
+ * @return string
+ */
+ public function render(AbstractElement $element)
+ {
+ $element->unsScope()->unsCanUseWebsiteValue()->unsCanUseDefaultValue();
+ return parent::render($element);
+ }
+
+ /**
+ * Return element html
+ *
+ * @param \Magento\Framework\Data\Form\Element\AbstractElement $element
+ * @return string
+ */
+ protected function _getElementHtml(AbstractElement $element)
+ {
+ $this->setElements($element);
+ return $this->_toHtml();
+ }
+
+ /**
+ * Return element value
+ *
+ * @return mixed
+ */
+ public function getElement()
+ {
+ return $this->getElements();
+ }
+
+ /**
+ * Retrieve Novalnet Credit Card form style
+ *
+ * @param string $param
+ * @return string|null
+ */
+ public function getElementValue($param)
+ {
+ $values = $this->getElements()->getValue($param);
+ if (!empty($values)) {
+ return $values;
+ } elseif (isset($this->ccLocalFormConfig[$param])) {
+ return $this->ccLocalFormConfig[$param];
+ }
+
+ return '';
+ }
+}
diff --git a/Block/System/Config/Form/Field/Disabled.php b/Block/System/Config/Form/Field/Disabled.php
new file mode 100755
index 0000000..e5fadb9
--- /dev/null
+++ b/Block/System/Config/Form/Field/Disabled.php
@@ -0,0 +1,52 @@
+unsScope()->unsCanUseWebsiteValue()->unsCanUseDefaultValue();
+ return parent::render($element);
+ }
+
+ /**
+ * Return element html
+ *
+ * @param AbstractElement $element
+ * @return string
+ */
+ protected function _getElementHtml(AbstractElement $element)
+ {
+ $element->setReadonly(true);
+ return parent::_getElementHtml($element);
+ }
+}
diff --git a/Block/System/Config/Form/Field/Guaranteeforce.php b/Block/System/Config/Form/Field/Guaranteeforce.php
new file mode 100755
index 0000000..f5274b7
--- /dev/null
+++ b/Block/System/Config/Form/Field/Guaranteeforce.php
@@ -0,0 +1,51 @@
+setTemplate('Novalnet_Payment::system/config/form/field/Guaranteeforce.phtml');
+ return $this;
+ }
+
+ /**
+ * Return element html
+ *
+ * @param AbstractElement $element
+ * @return string
+ */
+ protected function _getElementHtml(AbstractElement $element)
+ {
+ return $this->_toHtml();
+ }
+}
diff --git a/Block/System/Config/Form/Field/ModuleVersion.php b/Block/System/Config/Form/Field/ModuleVersion.php
new file mode 100755
index 0000000..6cc9fd9
--- /dev/null
+++ b/Block/System/Config/Form/Field/ModuleVersion.php
@@ -0,0 +1,70 @@
+novalnetRequestHelper = $novalnetRequestHelper;
+ }
+
+ /**
+ * Returns element
+ *
+ * @param \Magento\Framework\Data\Form\Element\AbstractElement $element
+ * @return string
+ */
+ public function render(\Magento\Framework\Data\Form\Element\AbstractElement $element)
+ {
+ $element->unsScope()->unsCanUseWebsiteValue()->unsCanUseDefaultValue();
+ return parent::render($element);
+ }
+
+ /**
+ * Returns element html
+ *
+ * @param \Magento\Framework\Data\Form\Element\AbstractElement $element
+ * @return mixed
+ */
+ protected function _getElementHtml(AbstractElement $element)
+ {
+ return $this->novalnetRequestHelper->getNovalnetVersion();
+ }
+}
diff --git a/Block/System/Config/Form/Field/Notification.php b/Block/System/Config/Form/Field/Notification.php
new file mode 100755
index 0000000..7880e40
--- /dev/null
+++ b/Block/System/Config/Form/Field/Notification.php
@@ -0,0 +1,110 @@
+backendUrl = $backendUrl;
+ $this->novalnetConfig = $novalnetConfig;
+ $this->novalnetRequestHelper = $novalnetRequestHelper;
+ }
+
+ /**
+ * Set template to itself
+ *
+ * @return $this
+ */
+ protected function _prepareLayout()
+ {
+ parent::_prepareLayout();
+ if (!$this->getTemplate()) {
+ $this->setTemplate('Novalnet_Payment::system/config/form/field/AvailablePayments.phtml');
+ }
+ return $this;
+ }
+
+ /**
+ * Returns element html
+ *
+ * @param AbstractElement $element
+ * @return string
+ */
+ protected function _getElementHtml(AbstractElement $element)
+ {
+ return $this->_toHtml();
+ }
+
+ /**
+ * Activate Global configuration
+ *
+ * @return bool
+ */
+ public function activateGlobalConfiguration()
+ {
+ return !($this->novalnetConfig->getGlobalConfig('signature') &&
+ $this->novalnetConfig->getGlobalConfig('payment_access_key') &&
+ $this->novalnetRequestHelper->checkIsNumeric($this->novalnetConfig->getGlobalConfig('tariff_id')));
+ }
+
+ /**
+ * Get Global configuration URL
+ *
+ * @return string
+ */
+ public function getGlobalConfigUrl()
+ {
+ return $this->backendUrl->getUrl('*/*/*', ['_current' => true, 'section' => 'payment']);
+ }
+}
diff --git a/Block/System/Config/Form/Field/VendorAutoConfig.php b/Block/System/Config/Form/Field/VendorAutoConfig.php
new file mode 100755
index 0000000..5b29b86
--- /dev/null
+++ b/Block/System/Config/Form/Field/VendorAutoConfig.php
@@ -0,0 +1,72 @@
+getTemplate()) {
+ $this->setTemplate('Novalnet_Payment::system/config/form/field/VendorAutoConfig.phtml');
+ }
+ return $this;
+ }
+
+ /**
+ * Remove scope label
+ *
+ * @param AbstractElement $element
+ * @return string
+ */
+ public function render(AbstractElement $element)
+ {
+ $element->unsScope()->unsCanUseWebsiteValue()->unsCanUseDefaultValue();
+ return parent::render($element);
+ }
+
+ /**
+ * Return element html
+ *
+ * @param AbstractElement $element
+ * @return string
+ */
+ protected function _getElementHtml(AbstractElement $element)
+ {
+ $this->addData(
+ [
+ 'button_label' => __($element->getOriginalData('button_label')),
+ 'html_id' => $element->getHtmlId(),
+ ]
+ );
+
+ return $this->_toHtml();
+ }
+}
diff --git a/Block/System/Config/Form/Field/WebhookURL.php b/Block/System/Config/Form/Field/WebhookURL.php
new file mode 100755
index 0000000..4a95ff7
--- /dev/null
+++ b/Block/System/Config/Form/Field/WebhookURL.php
@@ -0,0 +1,170 @@
+storeManager = $storeManager;
+ $this->config = $config;
+ $this->storeManager = $context->getStoreManager();
+ $this->request = $request;
+ $this->storeId = $this->getAdminConfigStoreId();
+ }
+
+ /**
+ * Render element html
+ *
+ * @param AbstractElement $element
+ * @return string
+ */
+ public function render(\Magento\Framework\Data\Form\Element\AbstractElement $element)
+ {
+ $element->unsScope()->unsCanUseWebsiteValue()->unsCanUseDefaultValue();
+ return parent::render($element);
+ }
+
+ /**
+ * Returns storeId
+ *
+ * @return int
+ */
+ public function getAdminConfigStoreId()
+ {
+ $storeId = (int)$this->request->getParam('store', 0);
+ $websiteId = (int)$this->request->getParam('website', 0);
+
+ if ($storeId) {
+ return $storeId;
+ } elseif ($websiteId) {
+ return $this->storeManager->getWebsite($websiteId)->getDefaultStore()->getId();
+ }
+
+ return 0; // Default store
+ }
+
+ /**
+ * Returns Button html
+ *
+ * @return string
+ */
+ public function getButtonHtml()
+ {
+ $button = $this->getLayout()->createBlock(
+ \Magento\Backend\Block\Widget\Button::class
+ )->setData(
+ [
+ 'id' => 'novalnet_configure_webhooks',
+ 'label' => __('Configure'),
+ ]
+ );
+
+ return $button->toHtml();
+ }
+
+ /**
+ * Returns Ajax URL
+ *
+ * @return string
+ */
+ public function getAjaxUrl()
+ {
+ $storeBaseUrl = $this->storeManager->getStore()->getBaseUrl();
+ return str_replace('index.php/', '', $storeBaseUrl) . 'rest/V1/novalnet/config_webhook_url/';
+ }
+
+ /**
+ * Returns Webhook URL
+ *
+ * @return string
+ */
+ public function getWebHookUrl()
+ {
+ $webhookUrl = $this->config->getMerchantScriptConfig('vendor_script_url');
+ $storeBaseUrl = $this->storeManager->getStore()->getBaseUrl();
+ return !empty($webhookUrl) ? $webhookUrl : str_replace('index.php/', '', $storeBaseUrl) . 'rest/V1/novalnet/callback';
+ }
+
+ /**
+ * Returns element html
+ *
+ * @param AbstractElement $element
+ * @return string
+ */
+ protected function _getElementHtml(AbstractElement $element)
+ {
+ $this->setElements($element);
+ return $this->_toHtml();
+ }
+
+ /**
+ * Return element value
+ *
+ * @return object
+ */
+ public function getElement()
+ {
+ return $this->getElements();
+ }
+}
diff --git a/Block/VendorAutoConfig.php b/Block/VendorAutoConfig.php
new file mode 100755
index 0000000..b839f06
--- /dev/null
+++ b/Block/VendorAutoConfig.php
@@ -0,0 +1,117 @@
+scopeConfig = $context->getScopeConfig();
+ $this->_storeManager = $storeManager;
+ $this->uriParser = $uriParser;
+ }
+
+ /**
+ * Returns vendor auto config url for the Novalnet module
+ *
+ * @return string
+ */
+ public function getVendorAutoConfigUrl()
+ {
+ $baseUrl = $this->_storeManager->getStore()->getBaseUrl();
+ return str_replace('index.php/', '', $baseUrl) . 'rest/V1/novalnet/activate_product_key/';
+ }
+
+ /**
+ * Gets request section value
+ *
+ * @return string|null
+ */
+ public function getSectionParam()
+ {
+ return ($this->getRequest()->getParam('section') ? $this->getRequest()->getParam('section') : '');
+ }
+
+ /**
+ * Retrieves Store configuration values
+ *
+ * @param string $path
+ * @return string
+ */
+ public function getConfigValue($path)
+ {
+ $scope = '';
+ $id = '';
+ if ($this->getRequest()->getParam('website', 0)) {
+ $scope = \Magento\Store\Model\ScopeInterface::SCOPE_WEBSITE;
+ $id = $this->getRequest()->getParam('website', 0);
+ } elseif ($this->getRequest()->getParam('store', 0)) {
+ $scope = \Magento\Store\Model\ScopeInterface::SCOPE_STORE;
+ $id = $this->getRequest()->getParam('store', 0);
+ }
+
+ if ($scope && $id) {
+ return $this->scopeConfig->getValue($path, $scope, $id);
+ } else {
+ return $this->scopeConfig->getValue($path);
+ }
+ }
+
+ /**
+ * Returns shop host URL
+ *
+ * @return string
+ */
+ public function getShopHostName()
+ {
+ $storeBaseUrl = $this->_storeManager->getStore()->getBaseUrl();
+ $url = $this->uriParser->parse($storeBaseUrl);
+
+ return !empty($url->getHost()) ? $url->getHost() : '';
+ }
+}
diff --git a/Controller/Adminhtml/Sales/Instalment.php b/Controller/Adminhtml/Sales/Instalment.php
new file mode 100755
index 0000000..d0b9d07
--- /dev/null
+++ b/Controller/Adminhtml/Sales/Instalment.php
@@ -0,0 +1,97 @@
+layoutFactory = $layoutFactory;
+ parent::__construct(
+ $context,
+ $coreRegistry,
+ $fileFactory,
+ $translateInline,
+ $resultPageFactory,
+ $resultJsonFactory,
+ $resultLayoutFactory,
+ $resultRawFactory,
+ $orderManagement,
+ $orderRepository,
+ $logger
+ );
+ }
+
+ /**
+ * Instalment tab for Novalnet payments
+ *
+ * @return mixed
+ */
+ public function execute()
+ {
+ $this->_initOrder();
+ $layout = $this->layoutFactory->create();
+ $html = $layout->createBlock(\Novalnet\Payment\Block\Adminhtml\Sales\Order\View\Tab\Instalment::class)
+ ->toHtml();
+ $this->_translateInline->processResponseBody($html);
+ $resultRaw = $this->resultRawFactory->create();
+ $resultRaw->setContents($html);
+ return $resultRaw;
+ }
+}
diff --git a/Controller/Adminhtml/Sales/OrderCapture.php b/Controller/Adminhtml/Sales/OrderCapture.php
new file mode 100755
index 0000000..385f1cf
--- /dev/null
+++ b/Controller/Adminhtml/Sales/OrderCapture.php
@@ -0,0 +1,181 @@
+transactionStatusModel = $transactionStatusModel;
+ $this->novalnetConfig = $novalnetConfig;
+ $this->novalnetRequestHelper = $novalnetRequestHelper;
+ $this->serializer = $serializer;
+ $this->novalnetLogger = $novalnetLogger;
+ parent::__construct(
+ $context,
+ $coreRegistry,
+ $fileFactory,
+ $translateInline,
+ $resultPageFactory,
+ $resultJsonFactory,
+ $resultLayoutFactory,
+ $resultRawFactory,
+ $orderManagement,
+ $orderRepository,
+ $logger
+ );
+ }
+
+ /**
+ * Order confirmation process for Novalnet payments (Invoice)
+ *
+ * @return mixed
+ */
+ public function execute()
+ {
+ $order = $this->_initOrder();
+ $resultRedirect = $this->resultRedirectFactory->create();
+ try {
+ if ($order) {
+ $payment = $order->getPayment();
+ $storeId = $order->getStoreId();
+ $paymentMethodCode = $payment->getMethodInstance()->getCode();
+ $transactionId = preg_replace('/[^0-9]+/', '', $payment->getLastTransId());
+
+ if ($order->canInvoice() && $paymentMethodCode == ConfigProvider::NOVALNET_INVOICE) {
+ $invoice = $order->prepareInvoice();
+ $invoice->setRequestedCaptureCase(\Magento\Sales\Model\Order\Invoice::CAPTURE_ONLINE)
+ ->register();
+ $additionalData = [];
+ if (!empty($payment->getAdditionalData())) {
+ $additionalData = $this->novalnetRequestHelper->isSerialized($payment->getAdditionalData())
+ ? $this->serializer->unserialize($payment->getAdditionalData())
+ : json_decode($payment->getAdditionalData(), true);
+ }
+
+ if (!empty($additionalData['NnGuarantee'])) {
+ $state = \Magento\Sales\Model\Order\Invoice::STATE_PAID;
+ } else {
+ $state = \Magento\Sales\Model\Order\Invoice::STATE_OPEN;
+ }
+
+ $invoice->setState($state)
+ ->setTransactionId($transactionId)
+ ->save();
+
+ $transactionStatus = !empty($additionalData['NnStatus'])
+ ? $this->novalnetRequestHelper->getStatus($additionalData['NnStatus'], $order) : '';
+ $this->transactionStatusModel->loadByAttribute($order->getIncrementId(), 'order_id')
+ ->setStatus($transactionStatus)->save();
+
+ $orderStatus = $this->novalnetConfig->getPaymentConfig(
+ $paymentMethodCode,
+ 'order_status',
+ $storeId
+ );
+
+ $orderStatus = $orderStatus ? $orderStatus : \Magento\Sales\Model\Order::STATE_PROCESSING;
+ // Verifies and sets order status
+ $order->setState(\Magento\Sales\Model\Order::STATE_PROCESSING)
+ ->setStatus($orderStatus);
+ $order->save();
+
+ $this->messageManager->addSuccess(__('The invoice has been created.'));
+ $this->novalnetLogger->notice('The invoice has been created for order no: ' . $order->getIncrementId());
+ } else {
+ $this->messageManager->addError(__('The order does not allow an invoice to be created.'));
+ $this->novalnetLogger->notice('The order does not allow an invoice to be created for order no: ' . $order->getIncrementId());
+ }
+
+ $resultRedirect->setPath('sales/order/view', ['order_id' => $order->getId()]);
+ return $resultRedirect;
+ }
+ } catch (\Exception $e) {
+ $error = __('The order does not allow an invoice to be created.') . ' ' . $e->getMessage();
+ $this->messageManager->addError($error);
+ $this->novalnetLogger->error($error);
+ }
+
+ $resultRedirect->setPath('sales/order/');
+ return $resultRedirect;
+ }
+}
diff --git a/Controller/Adminhtml/Sales/Refund.php b/Controller/Adminhtml/Sales/Refund.php
new file mode 100755
index 0000000..0730e04
--- /dev/null
+++ b/Controller/Adminhtml/Sales/Refund.php
@@ -0,0 +1,209 @@
+pricingHelper = $pricingHelper;
+ $this->clientFactory = $clientFactory;
+ $this->novalnetRequestHelper = $novalnetRequestHelper;
+ $this->jsonHelper = $jsonHelper;
+ $this->serializer = $serializer;
+ $this->novalnetLogger = $novalnetLogger;
+ parent::__construct(
+ $context,
+ $coreRegistry,
+ $fileFactory,
+ $translateInline,
+ $resultPageFactory,
+ $resultJsonFactory,
+ $resultLayoutFactory,
+ $resultRawFactory,
+ $orderManagement,
+ $orderRepository,
+ $logger
+ );
+ }
+
+ /**
+ * Order refund process for Novalnet payments
+ *
+ * @return mixed
+ */
+ public function execute()
+ {
+ $refundAmount = $this->getRequest()->getParam('nn-refund-amount');
+ $refundTid = $this->getRequest()->getParam('nn-refund-tid');
+ $refundTid = $this->novalnetRequestHelper->makeValidNumber($refundTid);
+ $instalmentCancel = $this->getRequest()->getParam('nn-instalment-cancel');
+ $order = $this->_initOrder();
+ $payment = $order->getPayment();
+ $storeId = $order->getStoreId();
+ $resultRedirect = $this->resultRedirectFactory->create();
+
+ $additionalData = [];
+ if (!empty($payment->getAdditionalData())) {
+ $additionalData = $this->novalnetRequestHelper->isSerialized($payment->getAdditionalData())
+ ? $this->serializer->unserialize($payment->getAdditionalData())
+ : json_decode($payment->getAdditionalData(), true);
+ }
+
+ if (!empty($additionalData['NnZeroAmountBooking']) && !empty($additionalData['NnZeroAmountDone'])) {
+ $refundTid = $additionalData['NnZeroAmountRefTid'];
+ }
+
+ if ((!$refundAmount && !$instalmentCancel) || !$refundTid) {
+ $this->messageManager->addError(__('The Amount should be in future'));
+ $resultRedirect->setPath('sales/order/view', ['order_id' => $order->getId()]);
+ return $resultRedirect;
+ }
+
+ if ($order) {
+ if (!empty($instalmentCancel)) {
+ $this->novalnetLogger->notice('Intiated instalment cancel for Novalnet ID: ' . $refundTid);
+ $url = NNConfig::NOVALNET_INSTALMENT_CANCEL;
+ $requestData = [
+ 'instalment' => [
+ 'tid' => $refundTid,
+ ]
+ ];
+ } else {
+ $this->novalnetLogger->notice('Intiated instalment refund for Novalnet ID: ' . $refundTid);
+ $url = NNConfig::NOVALNET_REFUND_URL;
+ $requestData = [
+ 'transaction' => [
+ 'tid' => $refundTid,
+ 'amount' => $refundAmount
+ ],
+ 'custom' => ['lang' => $this->novalnetRequestHelper->getDefaultLanguage()]
+ ];
+ }
+
+ $this->clientFactory->setHeaders($this->novalnetRequestHelper->getRequestHeaders(false, $storeId));
+ $this->clientFactory->post($url, $this->jsonHelper->jsonEncode($requestData));
+ $response = new \Magento\Framework\DataObject();
+ $responseBody = ($this->clientFactory->getBody()) ? json_decode($this->clientFactory->getBody(), true) : [];
+ $response->setData($responseBody);
+
+ if ($response->getData('result/status') == 'SUCCESS') {
+ $refundKey = $this->getRequest()->getParam('nn-refund-key');
+ $newRefundTid = $response->getData('transaction/refund/tid')
+ ? $response->getData('transaction/refund/tid') : $refundTid;
+
+ if (empty($refundAmount)) {
+ $refundAmount = $response->getData('transaction/refund/amount');
+ $additionalData['InstalmentCancel'] = 1;
+ }
+ $additionalData['InstalmentDetails'][$refundKey]['Refund'][] = [
+ 'tid' => $newRefundTid,
+ 'amount' => $refundAmount / 100
+ ];
+
+ $refundAmountwithCurrency = $this->pricingHelper->currency(($refundAmount / 100), true, false);
+ $additionalData['NnRefunded'][$newRefundTid]['reftid'] = $newRefundTid;
+ $additionalData['NnRefunded'][$newRefundTid]['refamount'] = $refundAmountwithCurrency;
+ $additionalData['NnRefunded'][$newRefundTid]['reqtid'] = $refundTid;
+
+ $payment->setAdditionalData($this->jsonHelper->jsonEncode($additionalData))->save();
+ $this->messageManager->addSuccess(__('The Refund executed properly'));
+ $this->novalnetLogger->notice('The Refund executed properly for order id ' . $order->getId());
+ } elseif ($response->getData('result/status_text')) {
+ $this->messageManager->addError($response->getData('result/status_text'));
+ $this->novalnetLogger->notice('The Refund not working for order id: ' . $order->getId());
+ }
+
+ $resultRedirect->setPath('sales/order/view', ['order_id' => $order->getId()]);
+ return $resultRedirect;
+ }
+
+ $resultRedirect->setPath('sales/order/');
+ return $resultRedirect;
+ }
+}
diff --git a/Controller/Adminhtml/Sales/ZeroAmountBookingTab.php b/Controller/Adminhtml/Sales/ZeroAmountBookingTab.php
new file mode 100755
index 0000000..e98045e
--- /dev/null
+++ b/Controller/Adminhtml/Sales/ZeroAmountBookingTab.php
@@ -0,0 +1,97 @@
+layoutFactory = $layoutFactory;
+ parent::__construct(
+ $context,
+ $coreRegistry,
+ $fileFactory,
+ $translateInline,
+ $resultPageFactory,
+ $resultJsonFactory,
+ $resultLayoutFactory,
+ $resultRawFactory,
+ $orderManagement,
+ $orderRepository,
+ $logger
+ );
+ }
+
+ /**
+ * Zero Amount Booking tab for Novalnet payments
+ *
+ * @return mixed
+ */
+ public function execute()
+ {
+ $this->_initOrder();
+ $layout = $this->layoutFactory->create();
+ $html = $layout->createBlock(\Novalnet\Payment\Block\Adminhtml\Sales\Order\View\Tab\ZeroAmountBooking::class)
+ ->toHtml();
+ $this->_translateInline->processResponseBody($html);
+ $resultRaw = $this->resultRawFactory->create();
+ $resultRaw->setContents($html);
+ return $resultRaw;
+ }
+}
diff --git a/Controller/Adminhtml/Sales/ZeroAmountUpdate.php b/Controller/Adminhtml/Sales/ZeroAmountUpdate.php
new file mode 100755
index 0000000..576c8e0
--- /dev/null
+++ b/Controller/Adminhtml/Sales/ZeroAmountUpdate.php
@@ -0,0 +1,352 @@
+pricingHelper = $pricingHelper;
+ $this->clientFactory = $clientFactory;
+ $this->novalnetRequestHelper = $novalnetRequestHelper;
+ $this->jsonHelper = $jsonHelper;
+ $this->serializer = $serializer;
+ $this->novalnetLogger = $novalnetLogger;
+ $this->novalnetConfig = $novalnetConfig;
+ $this->storeManager = $storeManager;
+ $this->transactionStatusModel = $transactionStatusModel;
+ $this->invoiceSender = $invoiceSender;
+ $this->dbTransaction = $dbTransaction;
+ }
+
+ /**
+ * Zero amount booking process
+ *
+ * @return mixed
+ */
+ public function execute()
+ {
+ $order = $this->_initOrder();
+ $resultRedirect = $this->resultRedirectFactory->create();
+ ($order->getId()) ? $resultRedirect->setPath('sales/order/view', ['order_id' => $order->getId()]) : $resultRedirect->setPath('sales/order/');
+
+ try {
+ $amountToUpdate = $this->getRequest()->getParam('nn-amount-to-update');
+ $storeId = $order->getStoreId();
+ $payment = $order->getPayment();
+ $paymentMethodCode = $payment->getMethodInstance()->getCode();
+ $billingAddress = $order->getBillingAddress();
+ $billingStreet = $this->getStreet($billingAddress);
+ $shippingAddress = $order->getShippingAddress();
+ $paymentToken = $this->getPaymentToken($order->getIncrementId());
+
+ $data = [];
+
+ $data['merchant'] = [
+ 'signature' => $this->novalnetConfig->getGlobalConfig('signature', $storeId),
+ 'tariff' => $this->novalnetConfig->getGlobalConfig('tariff_id', $storeId),
+ ];
+
+ $data['customer'] = [
+ 'first_name' => $billingAddress->getFirstname(),
+ 'last_name' => $billingAddress->getLastname(),
+ 'email' => $billingAddress->getEmail(),
+ 'tel' => $billingAddress->getTelephone(),
+ 'customer_ip' => $this->novalnetRequestHelper->getRequestIp(),
+ 'customer_no' => $order->getCustomerId(),
+ ];
+
+ $data['customer']['billing'] = [
+ 'street' => $billingStreet,
+ 'city' => $billingAddress->getCity(),
+ 'zip' => $billingAddress->getPostcode(),
+ 'country_code' => $billingAddress->getCountryId(),
+ 'state' => $this->novalnetRequestHelper->getRegionNameByCode($billingAddress->getRegionCode(), $billingAddress->getCountryId())
+ ];
+
+ if (!empty($shippingAddress)) {
+ if ($billingAddress->getFirstname() == $shippingAddress->getFirstname() &&
+ $billingAddress->getLastname() == $shippingAddress->getLastname() &&
+ $billingStreet == $this->getStreet($shippingAddress) &&
+ $billingAddress->getCity() == $shippingAddress->getCity() &&
+ $billingAddress->getCountryId() ==$shippingAddress->getCountryId() &&
+ $billingAddress->getPostcode() == $shippingAddress->getPostcode()
+ ) {
+ $data['customer']['shipping']['same_as_billing'] = 1;
+ } else {
+ $data['customer']['shipping'] = [
+ 'first_name' => $shippingAddress->getFirstname(),
+ 'last_name' => $shippingAddress->getLastname(),
+ 'email' => $shippingAddress->getEmail(),
+ 'tel' => $shippingAddress->getTelephone(),
+ 'street' => $this->getStreet($shippingAddress),
+ 'city' => $shippingAddress->getCity(),
+ 'zip' => $shippingAddress->getPostcode(),
+ 'country_code' => $shippingAddress->getCountryId(),
+ 'state' => $this->novalnetRequestHelper->getRegionNameByCode($shippingAddress->getRegionCode(), $shippingAddress->getCountryId())
+ ];
+
+ if (!empty($shippingAddress->getCompany())) {
+ $data['customer']['shipping']['company'] = $shippingAddress->getCompany();
+ }
+ }
+ }
+
+ $data['transaction'] = [
+ 'payment_type' => $this->novalnetConfig->getPaymentType($paymentMethodCode),
+ 'amount' => $amountToUpdate,
+ 'currency' => $order->getBaseCurrencyCode(),
+ 'test_mode' => $this->novalnetConfig->getTestMode($paymentMethodCode),
+ 'order_no' => $order->getIncrementId(),
+ 'system_ip' => $this->novalnetRequestHelper->getServerAddr(),
+ 'system_name' => 'Magento',
+ 'system_version' => $this->novalnetRequestHelper->getMagentoVersion() . '-' . $this->novalnetRequestHelper->getNovalnetVersion(),
+ 'system_url' => $this->storeManager->getStore()->getBaseUrl(),
+ 'payment_data' => [
+ 'token' => $paymentToken
+ ]
+ ];
+
+ $data['custom'] = [
+ 'lang' => $this->novalnetRequestHelper->getDefaultLanguage(),
+ ];
+
+ $endPointURL = NNConfig::NOVALNET_PAYMENT_URL;
+ $this->clientFactory->setHeaders($this->novalnetRequestHelper->getRequestHeaders(false, $storeId));
+ $this->clientFactory->post($endPointURL, $this->jsonHelper->jsonEncode($data));
+ $response = new \Magento\Framework\DataObject();
+ $responseBody = ($this->clientFactory->getBody()) ? json_decode($this->clientFactory->getBody(), true) : [];
+ $response->setData($responseBody);
+
+ if ($response->getData('result/status') == 'SUCCESS') {
+ $zeroAmountRefTid = $response->getData('transaction/tid');
+ $updatedAmount = $this->novalnetRequestHelper->getFormattedAmount($response->getData('transaction/amount'), 'RAW');
+
+ $additionalData = [];
+ if (!empty($payment->getAdditionalData())) {
+ $additionalData = $this->novalnetRequestHelper->isSerialized($payment->getAdditionalData())
+ ? $this->serializer->unserialize($payment->getAdditionalData())
+ : json_decode($payment->getAdditionalData(), true);
+ }
+
+ $updatedAmountwithCurrency = $this->pricingHelper->currency($updatedAmount, true, false);
+ $additionalData['NnZeroAmountDone'] = 1;
+ $additionalData['NnUpdatedZeroAmount'] = $updatedAmountwithCurrency;
+ $additionalData['NnZeroAmountRefTid'] = $zeroAmountRefTid;
+ $additionalData['NnZeroAmountCapture'] = 1;
+ $payment->setAdditionalData($this->jsonHelper->jsonEncode($additionalData));
+
+ $payment->setTransactionId($zeroAmountRefTid . '-zeroamount')
+ ->setLastTransId($zeroAmountRefTid)
+ ->capture();
+
+ $orderStatus = $this->novalnetConfig->getPaymentConfig(
+ $paymentMethodCode,
+ 'order_status',
+ $storeId
+ );
+
+ if ($response->getData('transaction/status') == 'CONFIRMED') {
+ $order->setStatus($orderStatus)->save();
+ }
+
+ $invoice = current($order->getInvoiceCollection()->getItems());
+ $this->dbTransaction->create()->addObject($payment)->addObject($invoice)->addObject($order)->save();
+ $this->invoiceSender->send($invoice);
+
+ $order->addStatusHistoryComment(__('Zero Amount has been updated successfully'), false)->save();
+ $this->messageManager->addSuccess(__('Amount has been booked successfully'));
+ $this->novalnetLogger->notice('Zero Amount has been updated successfully for order id: ' . $order->getId());
+ } elseif ($response->getData('result/status_text')) {
+ $this->messageManager->addError($response->getData('result/status_text'));
+ $order->addStatusHistoryComment(__('Zero Amount update has been failed'), false)->save();
+ $this->novalnetLogger->notice('Zero Amount update has been failed for order id: ' . $order->getId());
+ }
+
+ return $resultRedirect;
+ } catch (\Exception $e) {
+ $this->messageManager->addError($e->getMessage());
+ return $resultRedirect;
+ }
+ }
+
+ /**
+ * Get Street from address
+ *
+ * @param object $address
+ * @return string
+ */
+ public function getStreet($address)
+ {
+ try {
+ if (method_exists($address, 'getStreetFull')) {
+ $street = $address->getStreetFull();
+ } else {
+ if ($address->getStreetLine1()) {
+ $street = implode(' ', [$address->getStreetLine1(), $address->getStreetLine2()]);
+ } else {
+ $street = (!empty($address->getStreet())) ? implode(' ', $address->getStreet()) : '';
+ }
+ }
+
+ return $street;
+ } catch (\Exception $e) {
+ throw $e;
+ }
+ }
+
+ /**
+ * Get payment token for the order
+ *
+ * @param mixed $orderIncrementId
+ * @return string|null
+ */
+ protected function getPaymentToken($orderIncrementId)
+ {
+ try {
+ $tokenInfo = $this->transactionStatusModel->getCollection()->addFieldToFilter('order_id', ['eq' => $orderIncrementId])->getFirstItem();
+
+ if (!empty($tokenInfo['token'])) {
+ return $tokenInfo['token'];
+ }
+
+ return null;
+ } catch (\Exception $e) {
+ throw $e;
+ }
+ }
+}
diff --git a/Controller/Redirect/Failure.php b/Controller/Redirect/Failure.php
new file mode 100755
index 0000000..beed954
--- /dev/null
+++ b/Controller/Redirect/Failure.php
@@ -0,0 +1,175 @@
+salesModel = $salesModel;
+ $this->checkoutSession = $checkoutSession;
+ $this->clientFactory = $clientFactory;
+ $this->messageManager = $messageManager;
+ $this->novalnetRequestHelper = $novalnetRequestHelper;
+ $this->jsonHelper = $jsonHelper;
+ $this->serializer = $serializer;
+ $this->novalnetConfig = $novalnetConfig;
+ $this->novalnetLogger = $novalnetLogger;
+ }
+
+ /**
+ * Handles Novalnet redirect failure process
+ *
+ * @return mixed
+ */
+ public function execute()
+ {
+ $resultRedirect = $this->resultRedirectFactory->create();
+ $checkSumResponse = $this->getRequest()->getParams();
+
+ // Loads order model by loading the Increment Id
+ $order = $this->salesModel->loadByIncrementId($checkSumResponse['order_no']);
+ $storeId = '';
+ if ($order) {
+ $storeId = $order->getStoreId();
+ }
+ $payment = $order->getPayment();
+ $lastTransId = $payment->getLastTransId();
+ if (!empty($lastTransId)) {
+ $this->novalnetLogger->notice('Callback already executed for ' . $order->getIncrementId());
+ $resultRedirect->setPath('checkout/onepage/failure');
+ return $resultRedirect;
+ }
+
+ if (isset($checkSumResponse['tid'])) {
+ $this->novalnetLogger->notice('Customer return from Novalnet to shop (Novalnet redirect failure controller). Novalnet transaction ID: ' . $checkSumResponse['tid']);
+ $this->clientFactory->setHeaders($this->novalnetRequestHelper->getRequestHeaders(false, $storeId));
+ $this->clientFactory->post(
+ NNConfig::NOVALNET_TRANSACTION_DETAIL_URL,
+ $this->jsonHelper->jsonEncode(
+ [
+ 'transaction' => ['tid' => $checkSumResponse['tid']],
+ 'custom' => ['lang' => $this->novalnetRequestHelper->getDefaultLanguage()]
+ ]
+ )
+ );
+ }
+
+ $response = new \Magento\Framework\DataObject();
+ $responseBody = ($this->clientFactory->getBody()) ? json_decode($this->clientFactory->getBody(), true) : [];
+ $response->setData($responseBody);
+
+ // Loads order model by loading the Increment Id
+ $orderId = !empty($checkSumResponse['order_no']) ? $checkSumResponse['order_no'] : $response->getData('transaction/order_no');
+ $this->novalnetLogger->notice('Get order no' . $orderId);
+ $order = $this->salesModel->loadByIncrementId($orderId);
+
+ $this->novalnetLogger->notice('Order loaded successfully ' . $order->getIncrementId());
+ $this->novalnetRequestHelper->saveCanceledOrder($response, $order);
+ $errorMessage = !empty($checkSumResponse['status_text']) ? $checkSumResponse['status_text'] : $response->getData('result/status_text');
+ $this->messageManager->addErrorMessage(__($errorMessage));
+
+ // Restore the cart items
+ if ($this->novalnetConfig->getGlobalConfig('restore_cart')) {
+ $this->novalnetRequestHelper->restoreQuote($orderId);
+ $this->novalnetLogger->notice('Successfully restored the cart items' . $order->getIncrementId());
+ $resultRedirect->setPath('checkout/cart');
+ } else {
+ $resultRedirect->setPath('checkout/onepage/failure');
+ }
+
+ return $resultRedirect;
+ }
+}
diff --git a/Controller/Redirect/Success.php b/Controller/Redirect/Success.php
new file mode 100755
index 0000000..d196ea7
--- /dev/null
+++ b/Controller/Redirect/Success.php
@@ -0,0 +1,189 @@
+salesModel = $salesModel;
+ $this->clientFactory = $clientFactory;
+ $this->checkoutSession = $checkoutSession;
+ $this->messageManager = $messageManager;
+ $this->novalnetRequestHelper = $novalnetRequestHelper;
+ $this->jsonHelper = $jsonHelper;
+ $this->novalnetConfig = $novalnetConfig;
+ $this->novalnetLogger = $novalnetLogger;
+ }
+
+ /**
+ * Handles Novalnet redirect success process
+ *
+ * @return mixed
+ */
+ public function execute()
+ {
+ $resultRedirect = $this->resultRedirectFactory->create();
+ $checkSumResponse = $this->getRequest()->getParams();
+ // Loads order model by loading the Increment Id
+ $order = $this->salesModel->loadByIncrementId($checkSumResponse['order_no']);
+ $storeId = '';
+ if ($order) {
+ $storeId = $order->getStoreId();
+ }
+ $this->novalnetLogger->notice('Customer return from Novalnet to shop (Novalnet redirect success controller). Novalnet transaction ID: ' . $checkSumResponse['tid']);
+ $payment = $order->getPayment();
+ $lastTransId = $payment->getLastTransId();
+ if (!empty($lastTransId)) {
+ $this->novalnetLogger->notice('Callback already executed for ' . $order->getIncrementId());
+ $resultRedirect->setPath('checkout/onepage/success');
+ return $resultRedirect;
+ }
+
+ $this->clientFactory->setHeaders($this->novalnetRequestHelper->getRequestHeaders(false, $storeId));
+ $this->clientFactory->post(
+ NNConfig::NOVALNET_TRANSACTION_DETAIL_URL,
+ $this->jsonHelper->jsonEncode(
+ [
+ 'transaction' => ['tid' => $checkSumResponse['tid']],
+ 'custom' => ['lang' => $this->novalnetRequestHelper->getDefaultLanguage()]
+ ]
+ )
+ );
+
+ $response = new \Magento\Framework\DataObject();
+ $responseBody = ($this->clientFactory->getBody()) ? json_decode($this->clientFactory->getBody(), true) : [];
+ $response->setData($responseBody);
+
+ // Loads order model by loading the Increment Id
+ $order = $this->salesModel->loadByIncrementId($response->getData('transaction/order_no'));
+
+ $this->novalnetLogger->notice('Order loaded successfully ' . $order->getIncrementId());
+
+ $payment = $order->getPayment();
+ $paymentMethodCode = $payment->getMethodInstance()->getCode();
+ $additionalData = (!empty($payment->getAdditionalData())) ? json_decode($payment->getAdditionalData(), true) : [];
+
+ // Checks payment hash on return
+ if (!$this->novalnetRequestHelper->checkPaymentHash($checkSumResponse, $additionalData)) {
+ if ($this->novalnetConfig->getGlobalConfig('restore_cart')) {
+ $this->novalnetRequestHelper->restoreQuote($order->getIncrementId());
+ $this->novalnetLogger->notice('Successfully restored the cart items' . $order->getIncrementId());
+ $resultRedirect->setPath('checkout/cart');
+ } else {
+ $resultRedirect->setPath('checkout/onepage/failure');
+ }
+ $errorMessage = 'While redirecting some data has been changed. The hash check failed.';
+ $this->messageManager->addErrorMessage(__($errorMessage));
+ $this->novalnetLogger->notice($errorMessage);
+
+ return $resultRedirect;
+ }
+
+ // Process in handling on redirect payment return success
+ if (!$this->novalnetRequestHelper->checkReturnedData($response, $order, $payment)) {
+ if ($this->novalnetConfig->getGlobalConfig('restore_cart')) {
+ $this->novalnetRequestHelper->restoreQuote($order->getIncrementId());
+ $this->novalnetLogger->notice('Successfully restored the cart items' . $order->getIncrementId());
+ $resultRedirect->setPath('checkout/cart');
+ } else {
+ $resultRedirect->setPath('checkout/onepage/failure');
+ }
+ $this->messageManager->addErrorMessage(__($response->getData('result/status_text')));
+ $this->novalnetLogger->notice('Failure for check returned data. The status text is: ' . $response->getData('result/status_text'));
+
+ return $resultRedirect;
+ }
+
+ // Store payment data if token exist
+ if ($response->getData('transaction/payment_data/token')) {
+ $this->novalnetRequestHelper->savePaymentToken($order, $paymentMethodCode, $response);
+ $this->novalnetLogger->notice('Stored payment data');
+ }
+
+ $resultRedirect->setPath('checkout/onepage/success');
+
+ return $resultRedirect;
+ }
+}
diff --git a/Gateway/Config/CanInitializeHandler.php b/Gateway/Config/CanInitializeHandler.php
new file mode 100755
index 0000000..3c5a8f1
--- /dev/null
+++ b/Gateway/Config/CanInitializeHandler.php
@@ -0,0 +1,61 @@
+novalnetRequestHelper = $novalnetRequestHelper;
+ }
+
+ /**
+ * Initialize Novalnet Credit Card payment only if do_redirect is 1
+ *
+ * @param array $subject
+ * @param int|null $storeId
+ * @return bool
+ */
+ public function handle(array $subject, $storeId = null)
+ {
+ $paymentDataObject = \Magento\Payment\Gateway\Helper\SubjectReader::readPayment($subject);
+ $paymentMethodCode = $paymentDataObject->getPayment()->getMethodInstance()->getCode();
+ if ($paymentMethodCode == ConfigProvider::NOVALNET_CC || $paymentMethodCode == ConfigProvider::NOVALNET_GOOGLEPAY) {
+ $methodSession = $this->novalnetRequestHelper->getMethodSession($paymentMethodCode);
+ if ($methodSession->getData($paymentMethodCode . '_do_redirect')) {
+ return true;
+ }
+ }
+
+ return false;
+ }
+}
diff --git a/Gateway/Config/OrderPlaceRedirectUrlHandler.php b/Gateway/Config/OrderPlaceRedirectUrlHandler.php
new file mode 100755
index 0000000..a7853bc
--- /dev/null
+++ b/Gateway/Config/OrderPlaceRedirectUrlHandler.php
@@ -0,0 +1,63 @@
+novalnetRequestHelper = $novalnetRequestHelper;
+ }
+
+ /**
+ * Initialize Mail for Credit Card payment only if do_rediret is 1
+ *
+ * @param array $subject
+ * @param int|null $storeId
+ * @return bool
+ */
+ public function handle(array $subject, $storeId = null)
+ {
+ $paymentDataObject = \Magento\Payment\Gateway\Helper\SubjectReader::readPayment($subject);
+ $paymentMethodCode = $paymentDataObject->getPayment()->getMethodInstance()->getCode();
+ if ($paymentMethodCode == ConfigProvider::NOVALNET_CC || $paymentMethodCode == ConfigProvider::NOVALNET_GOOGLEPAY) {
+ $methodSession = $this->novalnetRequestHelper->getMethodSession($paymentMethodCode);
+ if ($methodSession->getData($paymentMethodCode . '_do_redirect') != 0) {
+ return true;
+ } else {
+ return false;
+ }
+ }
+
+ return true;
+ }
+}
diff --git a/Gateway/Config/PaymentActionHandler.php b/Gateway/Config/PaymentActionHandler.php
new file mode 100755
index 0000000..78f3aeb
--- /dev/null
+++ b/Gateway/Config/PaymentActionHandler.php
@@ -0,0 +1,75 @@
+novalnetConfig = $novalnetConfig;
+ $this->novalnetRequestHelper = $novalnetRequestHelper;
+ }
+
+ /**
+ * Validate minimum limit for authorization
+ *
+ * @param array $subject
+ * @param int|null $storeId
+ * @return bool
+ */
+ public function handle(array $subject, $storeId = null)
+ {
+ $paymentDataObject = \Magento\Payment\Gateway\Helper\SubjectReader::readPayment($subject);
+ $orderTotalAmount = $paymentDataObject->getOrder()->getGrandTotalAmount();
+ $paymentMethodCode = $paymentDataObject->getPayment()->getMethodInstance()->getCode();
+ $paymentAction = $this->novalnetConfig->getPaymentConfig($paymentMethodCode, 'payment_action');
+ $minAuthAmount = $this->novalnetConfig->getPaymentConfig($paymentMethodCode, 'manual_checking_amount');
+
+ if ($paymentAction == AbstractMethod::ACTION_AUTHORIZE &&
+ (string) $this->novalnetRequestHelper->getFormattedAmount($orderTotalAmount) >= (string) $minAuthAmount
+ ) {
+ return AbstractMethod::ACTION_AUTHORIZE;
+ } elseif ($this->novalnetConfig->getPaymentConfig($paymentMethodCode, 'payment_action') == NNConfig::ACTION_ZERO_AMOUNT_BOOKING) {
+ return AbstractMethod::ACTION_AUTHORIZE;
+ } else {
+ return AbstractMethod::ACTION_AUTHORIZE_CAPTURE;
+ }
+ }
+}
diff --git a/Gateway/Http/Client/TransactionAuthorize.php b/Gateway/Http/Client/TransactionAuthorize.php
new file mode 100755
index 0000000..8c58c6a
--- /dev/null
+++ b/Gateway/Http/Client/TransactionAuthorize.php
@@ -0,0 +1,118 @@
+clientFactory = $clientFactory;
+ $this->novalnetConfig = $novalnetConfig;
+ $this->novalnetRequestHelper = $novalnetRequestHelper;
+ $this->jsonHelper = $jsonHelper;
+ $this->coreSession = $coreSession;
+ }
+
+ /**
+ * Send request to gateway. Returns result as ENV array
+ *
+ * @param TransferInterface $transferObject
+ * @return array
+ */
+ public function placeRequest(TransferInterface $transferObject)
+ {
+ $requestData = $transferObject->getBody();
+ if (!empty($requestData['action'])) {
+ return $requestData;
+ }
+
+ $storeId = $requestData['storeId'];
+ unset($requestData['storeId']);
+ $this->clientFactory->setHeaders($this->novalnetRequestHelper->getRequestHeaders(false, $storeId));
+ $paymentMethodCode = $this->novalnetConfig->getPaymentCodeByType($requestData['transaction']['payment_type']);
+
+ if (in_array(
+ $paymentMethodCode,
+ [
+ ConfigProvider::NOVALNET_PREPAYMENT,
+ ConfigProvider::NOVALNET_CASHPAYMENT,
+ ConfigProvider::NOVALNET_MULTIBANCO
+ ]
+ ) || $this->coreSession->getRecurringProcess()) {
+ $this->clientFactory->post(NNConfig::NOVALNET_PAYMENT_URL, $this->jsonHelper->jsonEncode($requestData));
+ } else {
+ $this->clientFactory->post(NNConfig::NOVALNET_AUTHORIZE_URL, $this->jsonHelper->jsonEncode($requestData));
+ }
+
+ $response = (!empty($this->clientFactory->getBody())) ? json_decode($this->clientFactory->getBody(), true) : [];
+
+ if (!empty($response['result']['status']) && $response['result']['status'] == 'SUCCESS') {
+ return $response;
+ } elseif (!empty($response['result']['status_text'])) {
+ throw new \Magento\Framework\Exception\LocalizedException(__($response['result']['status_text']));
+ }
+ }
+}
diff --git a/Gateway/Http/Client/TransactionCapture.php b/Gateway/Http/Client/TransactionCapture.php
new file mode 100755
index 0000000..ec0a2b4
--- /dev/null
+++ b/Gateway/Http/Client/TransactionCapture.php
@@ -0,0 +1,104 @@
+clientFactory = $clientFactory;
+ $this->novalnetRequestHelper = $novalnetRequestHelper;
+ $this->jsonHelper = $jsonHelper;
+ $this->novalnetLogger = $novalnetLogger;
+ }
+
+ /**
+ * Send request to gateway. Returns result as ENV array
+ *
+ * @param TransferInterface $transferObject
+ * @return array
+ */
+ public function placeRequest(TransferInterface $transferObject)
+ {
+ $requestData = $transferObject->getBody();
+ if (isset($requestData['action'])) {
+ return $requestData;
+ }
+
+ $storeId = $requestData['storeId'];
+ unset($requestData['storeId']);
+ $this->clientFactory->setHeaders($this->novalnetRequestHelper->getRequestHeaders(false, $storeId));
+ if (empty($requestData['transaction']['tid'])) {
+ $this->clientFactory->post(NNConfig::NOVALNET_PAYMENT_URL, $this->jsonHelper->jsonEncode($requestData));
+ } else {
+ $this->novalnetLogger->notice('Capture has been initiated for the TID: ' . $requestData['transaction']['tid']);
+ $this->clientFactory->post(NNConfig::NOVALNET_CAPTURE_URL, $this->jsonHelper->jsonEncode($requestData));
+ }
+
+ $response = (!empty($this->clientFactory->getBody())) ? json_decode($this->clientFactory->getBody(), true) : [];
+
+ if (!empty($response['result']['status']) && $response['result']['status'] == 'SUCCESS') {
+ $this->novalnetLogger->notice('The transaction has been confirmed successfully');
+ return $response;
+ } elseif (!empty($response['result']['status_text'])) {
+ $this->novalnetLogger->notice('The transaction capture not working. The status text: ' . $response['result']['status_text']);
+ throw new \Magento\Framework\Exception\LocalizedException(__($response['result']['status_text']));
+ }
+ }
+}
diff --git a/Gateway/Http/Client/TransactionInitialize.php b/Gateway/Http/Client/TransactionInitialize.php
new file mode 100755
index 0000000..7a0ff98
--- /dev/null
+++ b/Gateway/Http/Client/TransactionInitialize.php
@@ -0,0 +1,108 @@
+clientFactory = $clientFactory;
+ $this->novalnetConfig = $novalnetConfig;
+ $this->novalnetRequestHelper = $novalnetRequestHelper;
+ $this->jsonHelper = $jsonHelper;
+ $this->coreSession = $coreSession;
+ }
+
+ /**
+ * Send request to gateway. Returns result as ENV array
+ *
+ * @param TransferInterface $transferObject
+ * @return array
+ */
+ public function placeRequest(TransferInterface $transferObject)
+ {
+ $requestData = $transferObject->getBody();
+ $storeId = $requestData['storeId'];
+ unset($requestData['storeId']);
+ $this->clientFactory->setHeaders($this->novalnetRequestHelper->getRequestHeaders(false, $storeId));
+ $paymentMethodCode = $this->novalnetConfig->getPaymentCodeByType($requestData['transaction']['payment_type']);
+ $minAuthAmount = $this->novalnetConfig->getPaymentConfig($paymentMethodCode, 'manual_checking_amount');
+
+ if ($this->novalnetConfig->getPaymentConfig($paymentMethodCode, 'payment_action') == 'authorize' && ($requestData['transaction']['amount'] >= $minAuthAmount) && !$this->coreSession->getRecurringProcess()) {
+ $this->clientFactory->post(NNConfig::NOVALNET_AUTHORIZE_URL, $this->jsonHelper->jsonEncode($requestData));
+ } else {
+ $this->clientFactory->post(NNConfig::NOVALNET_PAYMENT_URL, $this->jsonHelper->jsonEncode($requestData));
+ }
+
+ $response = (!empty($this->clientFactory->getBody())) ? json_decode($this->clientFactory->getBody(), true) : [];
+
+ if (!empty($response['result']['status']) && $response['result']['status'] == 'SUCCESS') {
+ return $response;
+ } elseif (!empty($response['result']['status_text'])) {
+ throw new \Magento\Framework\Exception\LocalizedException(__($response['result']['status_text']));
+ }
+ }
+}
diff --git a/Gateway/Http/Client/TransactionRedirect.php b/Gateway/Http/Client/TransactionRedirect.php
new file mode 100755
index 0000000..d723b88
--- /dev/null
+++ b/Gateway/Http/Client/TransactionRedirect.php
@@ -0,0 +1,37 @@
+clientFactory = $clientFactory;
+ $this->novalnetRequestHelper = $novalnetRequestHelper;
+ $this->jsonHelper = $jsonHelper;
+ $this->novalnetLogger = $novalnetLogger;
+ }
+
+ /**
+ * Send request to gateway. Returns result as ENV array
+ *
+ * @param TransferInterface $transferObject
+ * @return array
+ */
+ public function placeRequest(TransferInterface $transferObject)
+ {
+ $requestData = $transferObject->getBody();
+ $storeId = $requestData['storeId'];
+ unset($requestData['storeId']);
+ $this->novalnetLogger->notice('Refund has been initiated for the TID: ' . $requestData['transaction']['tid']);
+ $this->clientFactory->setHeaders($this->novalnetRequestHelper->getRequestHeaders(false, $storeId));
+ $this->clientFactory->post(
+ NNConfig::NOVALNET_REFUND_URL,
+ $this->jsonHelper->jsonEncode($requestData)
+ );
+ $response = (!empty($this->clientFactory->getBody())) ? json_decode($this->clientFactory->getBody(), true) : [];
+
+ if (!empty($response['result']['status']) && $response['result']['status'] == 'SUCCESS') {
+ $this->novalnetLogger->notice('The refund has been successfully');
+ return $response;
+ } elseif (!empty($response['result']['status_text'])) {
+ $this->novalnetLogger->notice('The refund not working. The status text: ' . $response['result']['status_text']);
+ throw new \Magento\Framework\Exception\LocalizedException(__($response['result']['status_text']));
+ }
+ }
+}
diff --git a/Gateway/Http/Client/TransactionVoid.php b/Gateway/Http/Client/TransactionVoid.php
new file mode 100755
index 0000000..e83858d
--- /dev/null
+++ b/Gateway/Http/Client/TransactionVoid.php
@@ -0,0 +1,101 @@
+clientFactory = $clientFactory;
+ $this->novalnetRequestHelper = $novalnetRequestHelper;
+ $this->jsonHelper = $jsonHelper;
+ $this->novalnetLogger = $novalnetLogger;
+ }
+
+ /**
+ * Send request to gateway. Returns result as ENV array
+ *
+ * @param TransferInterface $transferObject
+ * @return array
+ */
+ public function placeRequest(TransferInterface $transferObject)
+ {
+ $requestData = $transferObject->getBody();
+ if (isset($requestData['action'])) {
+ return $requestData;
+ }
+ $storeId = $requestData['storeId'];
+ unset($requestData['storeId']);
+ $this->novalnetLogger->notice('Cancellation/void has been initiated for the TID: ' . $requestData['transaction']['tid']);
+ $this->clientFactory->setHeaders($this->novalnetRequestHelper->getRequestHeaders(false, $storeId));
+ $this->clientFactory->post(
+ NNConfig::NOVALNET_CANCEL_URL,
+ $this->jsonHelper->jsonEncode($requestData)
+ );
+ $response = ($this->clientFactory->getBody()) ? json_decode($this->clientFactory->getBody(), true) : [];
+
+ if (!empty($response['result']['status']) && $response['result']['status'] == 'SUCCESS') {
+ $this->novalnetLogger->notice('The transaction has been canceled successfully');
+ return $response;
+ } elseif (!empty($response['result']['status_text'])) {
+ $this->novalnetLogger->notice('The transaction cancellation not working. The status text: ' . $response['result']['status_text']);
+ throw new \Magento\Framework\Exception\LocalizedException(__($response['result']['status_text']));
+ }
+ }
+}
diff --git a/Gateway/Http/TransferFactory.php b/Gateway/Http/TransferFactory.php
new file mode 100755
index 0000000..4302342
--- /dev/null
+++ b/Gateway/Http/TransferFactory.php
@@ -0,0 +1,55 @@
+transferBuilder = $transferBuilder;
+ }
+
+ /**
+ * Builds gateway transfer object
+ *
+ * @param array $request
+ * @return TransferInterface
+ */
+ public function create(array $request)
+ {
+ return $this->transferBuilder
+ ->setBody($request)
+ ->setMethod('POST')
+ ->build();
+ }
+}
diff --git a/Gateway/Request/AbstractDataBuilder.php b/Gateway/Request/AbstractDataBuilder.php
new file mode 100755
index 0000000..718dfc7
--- /dev/null
+++ b/Gateway/Request/AbstractDataBuilder.php
@@ -0,0 +1,504 @@
+urlInterface = $urlInterface;
+ $this->storeManager = $storeManager;
+ $this->datetime = $datetime;
+ $this->authSession = $authSession;
+ $this->novalnetRequestHelper = $novalnetRequestHelper;
+ $this->novalnetConfig = $novalnetConfig;
+ $this->config = $config;
+ $this->jsonHelper = $jsonHelper;
+ $this->serializer = $serializer;
+ $this->cart = $cart;
+ }
+
+ /**
+ * Build request for Payment action
+ *
+ * @param array $buildSubject
+ * @return array
+ */
+ public function build(array $buildSubject)
+ {
+ $paymentDataObject = \Magento\Payment\Gateway\Helper\SubjectReader::readPayment($buildSubject);
+ $order = $paymentDataObject->getOrder();
+ $paymentMethodCode = $paymentDataObject->getPayment()->getMethodInstance()->getCode();
+
+ $merchantParams = $this->buildMerchantParams($order);
+ $customerParams = $this->buildCustomerParams($order, $paymentMethodCode);
+ $transactionParams = $this->buildTransactionParams($order, $paymentMethodCode);
+ $customParams = $this->buildCustomParams($paymentMethodCode);
+ $cartInfoParams = $this->buildCartInfoParams($paymentMethodCode);
+ $data = array_merge($merchantParams, $customerParams, $transactionParams, $customParams);
+ $data['storeId'] = $paymentDataObject->getPayment()->getOrder()->getStoreId();
+ $data = $this->filterStandardParameter($data);
+ $data = array_merge($data, $cartInfoParams);
+ return $data;
+ }
+
+ /**
+ * Build Merchant params
+ *
+ * @param mixed $order
+ * @return array
+ */
+ public function buildMerchantParams($order)
+ {
+ $storeId = $order->getStoreId();
+ // Build Merchant Data
+ $data['merchant'] = [
+ 'signature' => $this->novalnetConfig->getGlobalConfig('signature', $storeId),
+ 'tariff' => $this->novalnetConfig->getGlobalConfig('tariff_id', $storeId),
+ ];
+
+ return $data;
+ }
+
+ /**
+ * Build Customer params
+ *
+ * @param mixed $order
+ * @param string $paymentMethodCode
+ * @return array
+ */
+ public function buildCustomerParams($order, $paymentMethodCode)
+ {
+ $billingAddress = $order->getBillingAddress();
+ $shippingAddress = $order->getShippingAddress();
+ $billingStreet = $this->getStreet($billingAddress);
+
+ $methodSession = $this->novalnetRequestHelper->getMethodSession($paymentMethodCode);
+
+ $shopperIp = $order->getRemoteIp();
+
+ if (!$this->novalnetRequestHelper->isAdmin() && empty($shopperIp)) {
+ $shopperIp = $order->getXForwardedFor();
+ }
+ $requestIp = $this->novalnetRequestHelper->getRequestIp();
+ $data = [];
+
+ // Forming billing data
+ if ($billingAddress) {
+ $data['customer'] = [
+ 'first_name' => $billingAddress->getFirstname(),
+ 'last_name' => $billingAddress->getLastname(),
+ 'email' => $billingAddress->getEmail(),
+ 'tel' => $billingAddress->getTelephone(),
+ 'customer_ip' => ($shopperIp != $requestIp) ? $this->novalnetRequestHelper->getRequestIp() : $shopperIp,
+ 'customer_no' => $this->novalnetRequestHelper->getCustomerId(),
+ ];
+
+ $data['customer']['billing'] = [
+ 'street' => $billingStreet,
+ 'city' => $billingAddress->getCity(),
+ 'zip' => $billingAddress->getPostcode(),
+ 'country_code' => $billingAddress->getCountryId(),
+ 'state' => $this->novalnetRequestHelper->getRegionNameByCode($billingAddress->getRegionCode(), $billingAddress->getCountryId())
+ ];
+
+ if ($methodSession->getData($paymentMethodCode . '_dob')) {
+ $data['customer']['birth_date'] = $this->datetime->date(
+ 'Y-m-d',
+ $methodSession->getData($paymentMethodCode . '_dob')
+ );
+ }
+
+ if (empty($data['customer']['birth_date']) && !empty($billingAddress->getCompany())) {
+ $data['customer']['billing']['company'] = $billingAddress->getCompany();
+ }
+ }
+
+ // Forming shipping data
+ if (!empty($shippingAddress)) {
+ if ($billingAddress->getFirstname() == $shippingAddress->getFirstname() &&
+ $billingAddress->getLastname() == $shippingAddress->getLastname() &&
+ $billingStreet == $this->getStreet($shippingAddress) &&
+ $billingAddress->getCity() == $shippingAddress->getCity() &&
+ $billingAddress->getCountryId() ==$shippingAddress->getCountryId() &&
+ $billingAddress->getPostcode() == $shippingAddress->getPostcode()
+ ) {
+ $data['customer']['shipping']['same_as_billing'] = 1;
+ } else {
+ $data['customer']['shipping'] = [
+ 'first_name' => $shippingAddress->getFirstname(),
+ 'last_name' => $shippingAddress->getLastname(),
+ 'email' => $shippingAddress->getEmail(),
+ 'tel' => $shippingAddress->getTelephone(),
+ 'street' => $this->getStreet($shippingAddress),
+ 'city' => $shippingAddress->getCity(),
+ 'zip' => $shippingAddress->getPostcode(),
+ 'country_code' => $shippingAddress->getCountryId(),
+ 'state' => $this->novalnetRequestHelper->getRegionNameByCode($shippingAddress->getRegionCode(), $shippingAddress->getCountryId())
+ ];
+ if (!empty($shippingAddress->getCompany())) {
+ $data['customer']['shipping']['company'] = $shippingAddress->getCompany();
+ }
+ }
+ }
+
+ return $data;
+ }
+
+ /**
+ * Build Transaction params
+ *
+ * @param mixed $order
+ * @param string $paymentMethodCode
+ * @return array
+ */
+ public function buildTransactionParams($order, $paymentMethodCode)
+ {
+ $billingAddress = $order->getBillingAddress();
+ $methodSession = $this->novalnetRequestHelper->getMethodSession($paymentMethodCode);
+
+ $data['transaction'] = [
+ 'payment_type' => $this->novalnetConfig->getPaymentType($paymentMethodCode),
+ 'amount' => $this->novalnetRequestHelper->getFormattedAmount($order->getGrandTotalAmount()),
+ 'currency' => $order->getCurrencyCode(),
+ 'test_mode' => $this->novalnetConfig->getTestMode($paymentMethodCode),
+ 'order_no' => $order->getOrderIncrementId(),
+ 'system_ip' => $this->novalnetRequestHelper->getServerAddr(),
+ 'system_name' => 'Magento',
+ 'system_version' => $this->novalnetRequestHelper->getMagentoVersion() . '-' .
+ $this->novalnetRequestHelper->getNovalnetVersion(),
+ 'system_url' => $this->storeManager->getStore()->getBaseUrl()
+ ];
+
+ $paymentDatas = ['token', 'pan_hash', 'unique_id', 'iban', 'wallet_token', 'bic'];
+
+ foreach ($paymentDatas as $paymentData) {
+ if ($methodSession->getData($paymentMethodCode . '_' . $paymentData)) {
+ $data['transaction']['payment_data'][$paymentData] = preg_replace('/\s+/', '', $methodSession->getData($paymentMethodCode . '_' . $paymentData));
+ }
+ }
+
+ if ($this->novalnetConfig->getPaymentConfig($paymentMethodCode, 'shop_type') && $methodSession->getData($paymentMethodCode . '_create_token') && empty($methodSession->getData($paymentMethodCode . '_token'))) {
+ $data['transaction']['create_token'] = $methodSession->getData($paymentMethodCode . '_create_token');
+ }
+
+ if ($this->novalnetConfig->isZeroAmountBookingSupported($paymentMethodCode) &&
+ $this->novalnetConfig->getPaymentConfig($paymentMethodCode, 'payment_action') == NNConfig::ACTION_ZERO_AMOUNT_BOOKING
+ ) {
+ $data['transaction']['create_token'] = 1;
+ $data['transaction']['amount'] = 0;
+ }
+
+ $paymentDueDate = $this->novalnetConfig->getPaymentConfig($paymentMethodCode, 'due_date');
+ $paymentDueDate = (!empty($paymentDueDate)) ? ltrim($paymentDueDate, '0') : '';
+ if ($paymentDueDate) {
+ $data['transaction']['due_date'] = date('Y-m-d', strtotime('+' . $paymentDueDate . ' days'));
+ }
+
+ if ($methodSession->getData($paymentMethodCode . '_cycle')) {
+ $data['instalment']['cycles'] = $methodSession->getData($paymentMethodCode . '_cycle');
+ $data['instalment']['interval'] = '1m';
+ }
+
+ if ($this->novalnetConfig->isRedirectPayment($paymentMethodCode) || $methodSession->getData($paymentMethodCode . '_do_redirect')) {
+ $data['transaction']['return_url'] = $this->urlInterface->getUrl('novalnet/redirect/success', ['order_no' => $order->getOrderIncrementId()]);
+ $data['transaction']['error_return_url'] = $this->urlInterface->getUrl('novalnet/redirect/failure', ['order_no' => $order->getOrderIncrementId()]);
+ }
+
+ if ($this->novalnetConfig->getPaymentConfig($paymentMethodCode, 'enforce_3d')) {
+ $data['transaction']['enforce_3d'] = 1;
+ }
+
+ // check if Order has subscription item
+ $subscription = false;
+ foreach ($order->getItems() as $item) {
+ $additionalData = [];
+ if (!empty($item->getAdditionalData())) {
+ $additionalData = json_decode($item->getAdditionalData(), true);
+ }
+
+ if (!empty($additionalData['period_unit']) && !empty($additionalData['billing_frequency'])) {
+ $subscription = true;
+ break;
+ }
+ }
+
+ //If subscription order then set create_token default
+ if ($subscription) {
+ if (!isset($data['transaction']['create_token']) && !isset($data['transaction']['payment_data']['token'])) {
+ $data['transaction']['create_token'] = 1;
+ }
+ }
+
+ $objectManager = \Magento\Framework\App\ObjectManager::getInstance();
+ $coreSession = $objectManager->create(\Magento\Framework\Session\SessionManagerInterface::class);
+
+ if ($coreSession->getRecurringProcess()) {
+ if (in_array($paymentMethodCode, [ConfigProvider::NOVALNET_CC, ConfigProvider::NOVALNET_PAYPAL])) {
+ unset($data['transaction']['return_url']);
+ unset($data['transaction']['error_return_url']);
+ }
+ }
+
+ return $data;
+ }
+
+ /**
+ * Build Custom params
+ *
+ * @param string $paymentMethodCode
+ * @return array
+ */
+ public function buildCustomParams($paymentMethodCode)
+ {
+ $data['custom'] = [
+ 'lang' => $this->novalnetRequestHelper->getDefaultLanguage(),
+ ];
+
+ if ($this->novalnetRequestHelper->isAdmin()) {
+ $data['custom']['input1'] = 'admin_user';
+ $data['custom']['inputval1'] = $this->authSession->getUser()->getID();
+ }
+
+ if ($this->novalnetRequestHelper->getMethodSession($paymentMethodCode)->getData($paymentMethodCode . '_create_token') == '1') {
+ $data['custom']['input2'] = 'create_token';
+ $data['custom']['inputval2'] = 1;
+ }
+
+ return $data;
+ }
+
+ /**
+ * Build cart info params
+ *
+ * @param string $paymentMethodCode
+ * @return array
+ */
+ public function buildCartInfoParams($paymentMethodCode)
+ {
+ $data['cart_info'] = [];
+ if ($paymentMethodCode == ConfigProvider::NOVALNET_PAYPAL) {
+ $quote = $this->cart->getQuote();
+ $discount = $quote->getBaseSubtotal() - $quote->getBaseSubtotalWithDiscount();
+ $discount = ($discount > 0) ? $this->novalnetRequestHelper->getFormattedAmount($discount) : 0;
+ $taxAmount = !empty($quote->getTotals()['tax']->getValue()) ? $quote->getTotals()['tax']->getValue() : 0;
+ $data['cart_info'] = [
+ 'items_shipping_price' => ($quote->getShippingAddress()->getBaseShippingAmount() > 0) ? $this->novalnetRequestHelper->getFormattedAmount($quote->getShippingAddress()->getBaseShippingAmount()) : 0,
+ 'items_tax_price' => ($taxAmount > 0) ? $this->novalnetRequestHelper->getFormattedAmount($taxAmount) : 0
+ ];
+
+ $lineItems = [];
+ foreach ($quote->getAllVisibleItems() as $item) {
+ array_push($lineItems, [
+ 'category' => ($item->getTypeId() == DownloadableProduct::TYPE_DOWNLOADABLE || $item->getTypeId() == ProductType::TYPE_VIRTUAL) ? 'virtual' : 'physical',
+ 'description' => '',
+ 'name' => $item->getName(),
+ 'price' => $this->novalnetRequestHelper->getFormattedAmount($item->getPrice()),
+ 'quantity' => $item->getQty()
+ ]);
+ }
+
+ if ($discount) {
+ array_push($lineItems, [
+ 'category' => '',
+ 'description' => '',
+ 'name' => 'Discount',
+ 'price' => '-' . $discount,
+ 'quantity' => 1
+ ]);
+ }
+
+ $data['cart_info']['line_items'] = $lineItems;
+ }
+
+ return $data;
+ }
+
+ /**
+ * Build Extension params
+ *
+ * @param array $buildSubject
+ * @param string|bool $refundAction
+ * @return array
+ */
+ public function buildExtensionParams($buildSubject, $refundAction = false)
+ {
+ $paymentDataObject = \Magento\Payment\Gateway\Helper\SubjectReader::readPayment($buildSubject);
+ $additionalData = $paymentDataObject->getPayment()->getAdditionalData();
+ $storeId = $paymentDataObject->getPayment()->getOrder()->getStoreId();
+
+ if ($additionalData) {
+ $additionalData = $this->novalnetRequestHelper->isSerialized($additionalData)
+ ? $this->serializer->unserialize($additionalData)
+ : json_decode($additionalData, true);
+
+ $data['transaction'] = [
+ 'tid' => $additionalData['NnTid']
+ ];
+
+ if ($refundAction) {
+ $refundAmount = \Magento\Payment\Gateway\Helper\SubjectReader::readAmount($buildSubject);
+
+ $data['transaction']['amount'] = $this->novalnetRequestHelper->getFormattedAmount($refundAmount);
+
+ if (!empty($additionalData['NnZeroAmountBooking']) && !empty($additionalData['NnZeroAmountDone'])) {
+ $data['transaction']['tid'] = $additionalData['NnZeroAmountRefTid'];
+ }
+ }
+
+ $data['custom'] = [
+ 'lang' => $this->novalnetRequestHelper->getDefaultLanguage(),
+ 'shop_invoked' => 1
+ ];
+ $data['storeId'] = $storeId;
+ return $data;
+ }
+ }
+
+ /**
+ * Get Street from address
+ *
+ * @param object $address
+ * @return string
+ */
+ public function getStreet($address)
+ {
+ if (method_exists($address, 'getStreetFull')) {
+ $street = $address->getStreetFull();
+ } else {
+ if ($address->getStreetLine1()) {
+ $street = implode(' ', [$address->getStreetLine1(), $address->getStreetLine2()]);
+ } else {
+ $street = (!empty($address->getStreet())) ? implode(' ', $address->getStreet()) : '';
+ }
+ }
+
+ return $street;
+ }
+
+ /**
+ * Get filter standard param
+ *
+ * @param array $requestData
+ *
+ * @return array
+ */
+ protected function filterStandardParameter($requestData)
+ {
+ $excludedParams = ['test_mode', 'enforce_3d', 'amount', 'storeId'];
+
+ foreach ($requestData as $key => $value) {
+ if (is_array($value)) {
+ $requestData[$key] = $this->filterStandardParameter($requestData[$key]);
+ }
+
+ if (!in_array($key, $excludedParams) && empty($requestData[$key])) {
+ unset($requestData[$key]);
+ }
+ }
+
+ return $requestData;
+ }
+}
diff --git a/Gateway/Request/AuthorizationDataBuilder.php b/Gateway/Request/AuthorizationDataBuilder.php
new file mode 100755
index 0000000..60cebec
--- /dev/null
+++ b/Gateway/Request/AuthorizationDataBuilder.php
@@ -0,0 +1,60 @@
+getPayment();
+ $paymentMethodCode = $payment->getMethodInstance()->getCode();
+ $additionalData = [];
+ if (!empty($payment->getAdditionalData())) {
+ $additionalData = $this->novalnetRequestHelper->isSerialized($payment->getAdditionalData())
+ ? $this->serializer->unserialize($payment->getAdditionalData())
+ : json_decode($payment->getAdditionalData(), true);
+ }
+
+ if (!empty($additionalData['NnTxnSecret']) ||
+ in_array(
+ $paymentMethodCode,
+ [
+ ConfigProvider::NOVALNET_SEPA_GUARANTEE,
+ ConfigProvider::NOVALNET_INVOICE_GUARANTEE,
+ ConfigProvider::NOVALNET_SEPA_INSTALMENT,
+ ConfigProvider::NOVALNET_INVOICE_INSTALMENT
+ ]
+ )
+ ) {
+ return ['action' => 'NN_Authorize'];
+ }
+
+ return parent::build($buildSubject);
+ }
+}
diff --git a/Gateway/Request/CaptureDataBuilder.php b/Gateway/Request/CaptureDataBuilder.php
new file mode 100755
index 0000000..565973b
--- /dev/null
+++ b/Gateway/Request/CaptureDataBuilder.php
@@ -0,0 +1,73 @@
+getPayment();
+ $paymentMethodCode = $payment->getMethodInstance()->getCode();
+ $additionalData = [];
+ if (!empty($payment->getAdditionalData())) {
+ $additionalData = $this->novalnetRequestHelper->isSerialized($payment->getAdditionalData())
+ ? $this->serializer->unserialize($payment->getAdditionalData())
+ : json_decode($payment->getAdditionalData(), true);
+ }
+ $order = $payment->getOrder();
+ $transactionStatus = !empty($additionalData['NnStatus'])
+ ? $this->novalnetRequestHelper->getStatus($additionalData['NnStatus'], $order) : '';
+
+ if ($transactionStatus == 'ON_HOLD' && !empty($this->urlInterface->getCurrentUrl()) &&
+ !preg_match('/callback/i', $this->urlInterface->getCurrentUrl())
+ ) {
+ return parent::buildExtensionParams($buildSubject);
+ } elseif (!empty($this->urlInterface->getCurrentUrl()) && preg_match('/callback/i', $this->urlInterface->getCurrentUrl())) {
+ return ['action' => 'NN_Capture', 'Async' => 'callback'];
+ } elseif (!empty($additionalData['NnZeroAmountCapture']) || !empty($additionalData['NnZeroAmountBooking'])) {
+ return ['action' => 'NN_ZeroCapture'];
+ } elseif (!empty($additionalData['NnTxnSecret']) ||
+ (!empty($this->urlInterface->getCurrentUrl()) && preg_match('/callback/i', $this->urlInterface->getCurrentUrl())) ||
+ (in_array(
+ $paymentMethodCode,
+ [
+ ConfigProvider::NOVALNET_SEPA_GUARANTEE,
+ ConfigProvider::NOVALNET_INVOICE_GUARANTEE,
+ ConfigProvider::NOVALNET_SEPA_INSTALMENT,
+ ConfigProvider::NOVALNET_INVOICE_INSTALMENT
+ ]
+ ) && $transactionStatus == 'CONFIRMED')
+ ) {
+ return ['action' => 'NN_Capture'];
+ }
+
+ return parent::build($buildSubject);
+ }
+}
diff --git a/Gateway/Request/InitializeDataBuilder.php b/Gateway/Request/InitializeDataBuilder.php
new file mode 100755
index 0000000..ee8cd23
--- /dev/null
+++ b/Gateway/Request/InitializeDataBuilder.php
@@ -0,0 +1,34 @@
+getPayment();
+ $additionalData = [];
+ if (!empty($payment->getAdditionalData())) {
+ $additionalData = $this->novalnetRequestHelper->isSerialized($payment->getAdditionalData())
+ ? $this->serializer->unserialize($payment->getAdditionalData())
+ : json_decode($payment->getAdditionalData(), true);
+ }
+
+ if (!empty($additionalData['NnZeroAmountBooking'])) {
+ return ['action' => 'NN_ZeroVoid'];
+ }
+
+ return parent::buildExtensionParams($buildSubject);
+ }
+}
diff --git a/Gateway/Response/CcPaymentHandler.php b/Gateway/Response/CcPaymentHandler.php
new file mode 100755
index 0000000..d30f102
--- /dev/null
+++ b/Gateway/Response/CcPaymentHandler.php
@@ -0,0 +1,140 @@
+dateTime = $dateTime;
+ $this->novalnetRequestHelper = $novalnetRequestHelper;
+ $this->jsonHelper = $jsonHelper;
+ $this->serializer = $serializer;
+ }
+
+ /**
+ * Handles transaction authorize and capture for Credit Card payment
+ *
+ * @param array $handlingSubject
+ * @param array $paymentResponse
+ * @return void
+ */
+ public function handle(array $handlingSubject, array $paymentResponse)
+ {
+ $response = new \Magento\Framework\DataObject();
+ $response->setData($paymentResponse);
+ $paymentDataObject = \Magento\Payment\Gateway\Helper\SubjectReader::readPayment($handlingSubject);
+ $order = $paymentDataObject->getOrder();
+ $payment = $paymentDataObject->getPayment();
+ $paymentMethodCode = $payment->getMethodInstance()->getCode();
+ $additionalData = $payment->getAdditionalData()
+ ? ($this->novalnetRequestHelper->isSerialized($payment->getAdditionalData())
+ ? $this->serializer->unserialize($payment->getAdditionalData())
+ : json_decode($payment->getAdditionalData(), true)) : [];
+ $transactionStatus = !empty($additionalData['NnStatus'])
+ ? $this->novalnetRequestHelper->getStatus($additionalData['NnStatus'], $order) : '';
+
+ if ($response->getData('action') == 'NN_ZeroCapture') {
+ $payment->setIsTransactionClosed(false)
+ ->setShouldCloseParentTransaction(false);
+ } elseif (in_array($response->getData('action'), ['NN_Authorize', 'NN_Capture']) &&
+ isset($additionalData['NnTid'])
+ ) {
+ // Authorize or Capture CC3d initial transaction
+ $payment->setTransactionId($additionalData['NnTid'])
+ ->setAmount($order->getGrandTotalAmount())
+ ->setIsTransactionClosed(false)
+ ->setShouldCloseParentTransaction(false);
+
+ if ($transactionStatus == 'ON_HOLD') {
+ $payment->setTransactionId($additionalData['NnTid']);
+ }
+
+ if ($response->getData('Async') == 'callback') {
+ $payment->setTransactionId($additionalData['NnTid'] . '-capture');
+ }
+ } elseif (!empty($response->getData())) {
+ if ($response->getData('result/redirect_url')) {
+ $payment->setAdditionalData(
+ $this->jsonHelper->jsonEncode($this->novalnetRequestHelper->buildRedirectAdditionalData($response))
+ );
+ } else {
+ if ($transactionStatus == 'ON_HOLD') {
+ $additionalData['ApiProcess'] = 'capture';
+ $additionalData['ApiProcessedAt'] = $this->dateTime->date('d-m-Y H:i:s');
+ $additionalData['NnStatus'] = $response->getData('transaction/status');
+ // Capture the Authorized transaction
+ $payment->setTransactionId($response->getData('transaction/tid') . '-capture')
+ ->setAdditionalData($this->jsonHelper->jsonEncode($additionalData))
+ ->setIsTransactionClosed(false)
+ ->setShouldCloseParentTransaction(false);
+ } else {
+ // Authorize or Capture the CC transaction
+ $payment->setTransactionId($response->getData('transaction/tid'))
+ ->setAmount($order->getGrandTotalAmount())
+ ->setAdditionalData(
+ $this->jsonHelper->jsonEncode(
+ $this->novalnetRequestHelper->buildAdditionalData($response, $payment)
+ )
+ )
+ ->setIsTransactionClosed(false)
+ ->setShouldCloseParentTransaction(false);
+
+ // Store payment data if token exist
+ if ($response->getData('result/status') == 'SUCCESS' && $response->getData('transaction/payment_data/token')) {
+ $this->novalnetRequestHelper->savePaymentToken($order, $paymentMethodCode, $response);
+ }
+ }
+ }
+ }
+ }
+}
diff --git a/Gateway/Response/PaymentHandler.php b/Gateway/Response/PaymentHandler.php
new file mode 100755
index 0000000..8a7c6d4
--- /dev/null
+++ b/Gateway/Response/PaymentHandler.php
@@ -0,0 +1,286 @@
+dateTime = $dateTime;
+ $this->timeZone = $timeZone;
+ $this->transactionStatusModel = $transactionStatusModel;
+ $this->novalnetRequestHelper = $novalnetRequestHelper;
+ $this->jsonHelper = $jsonHelper;
+ $this->serializer = $serializer;
+ }
+
+ /**
+ * Handles transaction authorize and capture
+ *
+ * @param array $handlingSubject
+ * @param array $paymentResponse
+ * @return void
+ */
+ public function handle(array $handlingSubject, array $paymentResponse)
+ {
+ $response = new \Magento\Framework\DataObject();
+ $response->setData($paymentResponse);
+ $paymentDataObject = \Magento\Payment\Gateway\Helper\SubjectReader::readPayment($handlingSubject);
+ $order = $paymentDataObject->getOrder();
+ $payment = $paymentDataObject->getPayment();
+ $paymentMethodCode = $payment->getMethodInstance()->getCode();
+ $additionalData = [];
+ if (!empty($payment->getAdditionalData())) {
+ if ($this->novalnetRequestHelper->isSerialized($payment->getAdditionalData())) {
+ $additionalData = $this->serializer->unserialize($payment->getAdditionalData());
+ } else {
+ $additionalData = json_decode($payment->getAdditionalData(), true);
+ }
+ }
+
+ $transactionStatus = '';
+ if (!empty($additionalData['NnStatus'])) {
+ $transactionStatus = $this->novalnetRequestHelper->getStatus($additionalData['NnStatus'], $order);
+ }
+
+ if ($response->getData('action') == 'NN_ZeroCapture') {
+ $payment->setIsTransactionClosed(false)
+ ->setShouldCloseParentTransaction(false);
+ } elseif (in_array($response->getData('action'), ['NN_Authorize', 'NN_Capture']) &&
+ isset($additionalData['NnTid'])
+ ) {
+ // Authorize or Capture the initial redirect transaction
+ $payment->setTransactionId($additionalData['NnTid'])
+ ->setAmount($order->getGrandTotalAmount())
+ ->setIsTransactionClosed(false)
+ ->setShouldCloseParentTransaction(false);
+
+ if ($transactionStatus == 'ON_HOLD') {
+ $payment->setTransactionId($additionalData['NnTid']);
+ }
+
+ if ($response->getData('Async') == 'callback') { // Capture from Novalnet admin portal through callback
+ $payment->setTransactionId($additionalData['NnTid'] . '-capture');
+ }
+ } elseif (!empty($response->getData())) {
+ if (!empty($response->getData('result/redirect_url'))) {
+ $payment->setAdditionalData(
+ $this->jsonHelper->jsonEncode($this->novalnetRequestHelper->buildRedirectAdditionalData($response))
+ );
+ } else {
+ if ($transactionStatus == 'ON_HOLD') {
+ $additionalData = $this->handleOnHold($additionalData, $response, $paymentMethodCode);
+ // Capture the Authorized transaction
+ $payment->setTransactionId($response->getData('transaction/tid') . '-capture')
+ ->setAdditionalData($this->jsonHelper->jsonEncode($additionalData))
+ ->setIsTransactionClosed(false)
+ ->setShouldCloseParentTransaction(false);
+ // update Paypal Token information if null available
+ if ($paymentMethodCode == ConfigProvider::NOVALNET_PAYPAL) {
+ $this->savePaymentToken($response, $order);
+ }
+ } else {
+ // Authorize or Capture the transaction
+ $payment->setTransactionId($response->getData('transaction/tid'))
+ ->setAmount($order->getGrandTotalAmount())
+ ->setAdditionalData(
+ $this->jsonHelper->jsonEncode($this->novalnetRequestHelper->buildAdditionalData($response, $payment))
+ )->setIsTransactionClosed(false)
+ ->setShouldCloseParentTransaction(false);
+
+ if (in_array(
+ $paymentMethodCode,
+ [
+ ConfigProvider::NOVALNET_SEPA_GUARANTEE,
+ ConfigProvider::NOVALNET_INVOICE_GUARANTEE,
+ ConfigProvider::NOVALNET_SEPA_INSTALMENT,
+ ConfigProvider::NOVALNET_INVOICE_INSTALMENT
+ ]
+ )) {
+ $amount = $this->novalnetRequestHelper->getFormattedAmount($response->getData('transaction/amount'), 'RAW');
+ if (in_array($response->getData('transaction/status'), ['PENDING', 'ON_HOLD'])) {
+ $payment->authorize(true, $amount);
+ } elseif ($response->getData('transaction/status') == 'CONFIRMED') {
+ $payment->setTransactionId($response->getData('transaction/tid'))
+ ->setLastTransId($response->getData('transaction/tid'))
+ ->capture(null)
+ ->setAmount($amount)
+ ->setIsTransactionClosed(false)
+ ->setShouldCloseParentTransaction(false);
+ }
+ }
+ }
+ }
+ }
+
+ // Store payment data if token exist
+ if ($response->getData('result/status') == 'SUCCESS' && $response->getData('transaction/payment_data/token')) {
+ $this->novalnetRequestHelper->savePaymentToken($order, $paymentMethodCode, $response);
+ }
+ }
+
+ /**
+ * Handles save paypal payment token
+ *
+ * @param object $response
+ * @param object $order
+ * @return void
+ */
+ private function savePaymentToken($response, $order)
+ {
+ $transactionStatus = $this->transactionStatusModel->getCollection()->setPageSize(1)
+ ->addFieldToFilter('order_id', $order->getOrderIncrementId())
+ ->getFirstItem();
+ if ($transactionStatus->getId()) {
+ $tokenInfo = $transactionStatus->getTokenInfo();
+ if (!empty($tokenInfo)) {
+ $tokenInfo = json_decode($tokenInfo, true);
+ }
+ if ($response->getData('transaction/payment_data/paypal_account')) {
+ $tokenInfo['NnPaypalAccount'] = $response->getData('transaction/payment_data/paypal_account');
+ }
+ if ($response->getData('transaction/payment_data/paypal_transaction_id')) {
+ $tokenInfo['NnPaypalTransactionId'] = $response->getData('transaction/payment_data/paypal_transaction_id');
+ }
+ if (!empty($tokenInfo)) {
+ $transactionStatus->setTokenInfo($this->jsonHelper->jsonEncode($tokenInfo))->save();
+ }
+ }
+ }
+
+ /**
+ * Handles On Hold actions
+ *
+ * @param array $additionalData
+ * @param object $response
+ * @param string $paymentMethodCode
+ * @return array
+ */
+ private function handleOnHold($additionalData, $response, $paymentMethodCode)
+ {
+ $additionalData['ApiProcess'] = 'capture';
+ $additionalData['ApiProcessedAt'] = $this->dateTime->date('d-m-Y H:i:s');
+ $additionalData['NnStatus'] = $response->getData('transaction/status');
+
+ $this->transactionStatusModel->loadByAttribute($response->getData('transaction/order_no'), 'order_id')
+ ->setStatus($response->getData('transaction/status'))->save();
+
+ // Due date update for Invoice payment
+ if (in_array(
+ $paymentMethodCode,
+ [ConfigProvider::NOVALNET_INVOICE, ConfigProvider::NOVALNET_INVOICE_GUARANTEE, ConfigProvider::NOVALNET_INVOICE_INSTALMENT]
+ )) {
+ $formatDate = $this->timeZone->formatDate(
+ $response->getData('transaction/due_date'),
+ \IntlDateFormatter::LONG
+ );
+ $note = (!empty($additionalData['NnInvoiceComments'])) ? explode('|', $additionalData['NnInvoiceComments']) : [];
+ $additionalData['NnInvoiceComments'] = (!empty($note)) ? implode('|', $note) : '';
+ $additionalData['NnDueDate'] = $formatDate;
+ }
+
+ if (in_array(
+ $paymentMethodCode,
+ [
+ ConfigProvider::NOVALNET_SEPA_INSTALMENT,
+ ConfigProvider::NOVALNET_INVOICE_INSTALMENT
+ ]
+ )) {
+ $instalmentCycleAmount = $this->novalnetRequestHelper->getFormattedAmount(
+ $response->getData('instalment/cycle_amount'),
+ 'RAW'
+ );
+ $additionalData['InstallPaidAmount'] = $instalmentCycleAmount;
+ $additionalData['PaidInstall'] = $response->getData('instalment/cycles_executed');
+ $additionalData['DueInstall'] = $response->getData('instalment/pending_cycles');
+ $additionalData['NextCycle'] = $response->getData('instalment/next_cycle_date');
+ $additionalData['InstallCycleAmount'] = $instalmentCycleAmount;
+
+ if ($futureInstalmentDates = $response->getData('instalment/cycle_dates')) {
+ foreach ($futureInstalmentDates as $cycle => $futureInstalmentDate) {
+ $additionalData['InstalmentDetails'][$cycle] = [
+ 'amount' => $instalmentCycleAmount,
+ 'nextCycle' => $futureInstalmentDate ? date('Y-m-d', strtotime($futureInstalmentDate)) : '',
+ 'paidDate' => ($cycle == 1) ? date('Y-m-d') : '',
+ 'status' => ($cycle == 1) ? 'Paid' : 'Pending',
+ 'reference' => ($cycle == 1) ? $response->getData('transaction/tid') : ''
+ ];
+ }
+ }
+
+ $additionalData['InstalmentDetails'][1] = [
+ 'amount' => $instalmentCycleAmount,
+ 'nextCycle' => $response->getData('instalment/next_cycle_date'),
+ 'paidDate' => date('Y-m-d'),
+ 'status' => 'Paid',
+ 'reference' => $response->getData('transaction/tid')
+ ];
+ }
+
+ return $additionalData;
+ }
+}
diff --git a/Gateway/Response/RedirectAuthorizeHandler.php b/Gateway/Response/RedirectAuthorizeHandler.php
new file mode 100755
index 0000000..0c4775f
--- /dev/null
+++ b/Gateway/Response/RedirectAuthorizeHandler.php
@@ -0,0 +1,73 @@
+novalnetRequestHelper = $novalnetRequestHelper;
+ $this->serializer = $serializer;
+ }
+
+ /**
+ * Handles transaction authorize for Redirect payments
+ *
+ * @param array $handlingSubject
+ * @param array $response
+ * @return void
+ */
+ public function handle(array $handlingSubject, array $response)
+ {
+ $paymentDataObject = \Magento\Payment\Gateway\Helper\SubjectReader::readPayment($handlingSubject);
+ $order = $paymentDataObject->getOrder();
+ $payment = $paymentDataObject->getPayment();
+ $additionalData = [];
+ if (!empty($payment->getAdditionalData())) {
+ $additionalData = $this->novalnetRequestHelper->isSerialized($payment->getAdditionalData())
+ ? $this->serializer->unserialize($payment->getAdditionalData())
+ : json_decode($payment->getAdditionalData(), true);
+ }
+
+ // Authorize initial transaction
+ $payment->setTransactionId($additionalData['NnTid'])
+ ->setAmount($order->getGrandTotalAmount())
+ ->setIsTransactionClosed(false)
+ ->setShouldCloseParentTransaction(false);
+ }
+}
diff --git a/Gateway/Response/RefundHandler.php b/Gateway/Response/RefundHandler.php
new file mode 100755
index 0000000..eb76199
--- /dev/null
+++ b/Gateway/Response/RefundHandler.php
@@ -0,0 +1,124 @@
+pricingHelper = $pricingHelper;
+ $this->transactionStatusModel = $transactionStatusModel;
+ $this->novalnetRequestHelper = $novalnetRequestHelper;
+ $this->jsonHelper = $jsonHelper;
+ $this->serializer = $serializer;
+ }
+
+ /**
+ * Handles transaction refund
+ *
+ * @param array $handlingSubject
+ * @param array $paymentResponse
+ * @return void
+ */
+ public function handle(array $handlingSubject, array $paymentResponse)
+ {
+ $response = new \Magento\Framework\DataObject();
+ $response->setData($paymentResponse);
+ $paymentDataObject = \Magento\Payment\Gateway\Helper\SubjectReader::readPayment($handlingSubject);
+ $refundAmount = \Magento\Payment\Gateway\Helper\SubjectReader::readAmount($handlingSubject);
+
+ $payment = $paymentDataObject->getPayment();
+ $additionalData = [];
+ if (!empty($payment->getAdditionalData())) {
+ $additionalData = $this->novalnetRequestHelper->isSerialized($payment->getAdditionalData())
+ ? $this->serializer->unserialize($payment->getAdditionalData())
+ : json_decode($payment->getAdditionalData(), true);
+ }
+ $parentTid = $additionalData['NnTid'];
+ $lastTransid = !empty($payment->getLastTransId()) ? $payment->getLastTransId() : $additionalData['NnTid'];
+ if (!empty($additionalData['NnZeroAmountBooking']) && !empty($additionalData['NnZeroAmountDone'])) {
+ $parentTid = $additionalData['NnZeroAmountRefTid'];
+ $lastTransid = !empty($payment->getLastTransId()) ? $payment->getLastTransId() : $additionalData['NnZeroAmountRefTid'];
+ $lastTransid = (strpos($lastTransid, '-zeroamount') !== false) ? $this->novalnetRequestHelper->makeValidNumber($lastTransid) : $lastTransid;
+ }
+
+ $additionalData['NnStatus'] = $response->getData('transaction/status');
+ $noOfRefunds = empty($additionalData['NnRefundsOccured']) ? 1 : $additionalData['NnRefundsOccured'] + 1;
+ $additionalData['NnRefundsOccured'] = $noOfRefunds;
+
+ $refundTid = $response->getData('transaction/refund/tid') ? $response->getData('transaction/refund/tid') : (
+ (strpos($lastTransid, '-refund') !== false) ?
+ $this->novalnetRequestHelper->makeValidNumber($lastTransid) . '-refund' . $noOfRefunds
+ : $lastTransid . '-refund');
+
+ $refundAmount = $this->pricingHelper->currency($refundAmount, true, false);
+ $additionalData['NnRefunded'][$refundTid]['reftid'] = $refundTid;
+ $additionalData['NnRefunded'][$refundTid]['refamount'] = $refundAmount;
+ $additionalData['NnRefunded'][$refundTid]['reqtid'] = $parentTid;
+
+ $this->transactionStatusModel->loadByAttribute($response->getData('transaction/order_no'), 'order_id')
+ ->setStatus($response->getData('transaction/status'))->save();
+ $payment->setTransactionId($refundTid)
+ ->setLastTransId($refundTid)
+ ->setParentTransactionId($parentTid)
+ ->setAdditionalData($this->jsonHelper->jsonEncode($additionalData))
+ ->setIsTransactionClosed(true)
+ ->setShouldCloseParentTransaction(!$payment->getCreditmemo()->getInvoice()->canRefund());
+ }
+}
diff --git a/Gateway/Response/VoidHandler.php b/Gateway/Response/VoidHandler.php
new file mode 100755
index 0000000..c0042e4
--- /dev/null
+++ b/Gateway/Response/VoidHandler.php
@@ -0,0 +1,106 @@
+dateTime = $dateTime;
+ $this->transactionStatusModel = $transactionStatusModel;
+ $this->novalnetRequestHelper = $novalnetRequestHelper;
+ $this->jsonHelper = $jsonHelper;
+ $this->serializer = $serializer;
+ }
+
+ /**
+ * Handles transaction void
+ *
+ * @param array $handlingSubject
+ * @param array $paymentResponse
+ * @return void
+ */
+ public function handle(array $handlingSubject, array $paymentResponse)
+ {
+ $response = new \Magento\Framework\DataObject();
+ $response->setData($paymentResponse);
+ $paymentDataObject = \Magento\Payment\Gateway\Helper\SubjectReader::readPayment($handlingSubject);
+ $payment = $paymentDataObject->getPayment();
+ $additionalData = [];
+
+ if ($response->getData('action') !== 'NN_ZeroVoid') {
+ if (!empty($payment->getAdditionalData())) {
+ $additionalData = $this->novalnetRequestHelper->isSerialized($payment->getAdditionalData())
+ ? $this->serializer->unserialize($payment->getAdditionalData())
+ : json_decode($payment->getAdditionalData(), true);
+ }
+ $additionalData['ApiProcess'] = 'void';
+ $additionalData['ApiProcessedAt'] = $this->dateTime->date('d-m-Y H:i:s');
+ $additionalData['NnStatus'] = $response->getData('transaction/status');
+ $additionalData['NnComments'] = '' . __('Payment Failed') . ' - '
+ . $response->getData('transaction/status') . ' ';
+ $this->transactionStatusModel->loadByAttribute($response->getData('transaction/order_no'), 'order_id')
+ ->setStatus($response->getData('transaction/status'))->save();
+
+ $payment->setAdditionalData($this->jsonHelper->jsonEncode($additionalData))
+ ->setIsTransactionClosed(true)
+ ->setShouldCloseParentTransaction(true);
+ }
+ }
+}
diff --git a/Gateway/Validator/ResponseCodeValidator.php b/Gateway/Validator/ResponseCodeValidator.php
new file mode 100755
index 0000000..9bec07e
--- /dev/null
+++ b/Gateway/Validator/ResponseCodeValidator.php
@@ -0,0 +1,48 @@
+setData(SubjectReader::readResponse($validationSubject));
+ $isValid = true;
+ $msg = [];
+
+ if (empty($response->getData('action')) && $response->getData('result/status') != 'SUCCESS') {
+ $isValid = false;
+ $msg = [__($response->getData('result/status_text'))];
+ }
+
+ return $this->createResult($isValid, $msg);
+ }
+}
diff --git a/Helper/Request.php b/Helper/Request.php
new file mode 100755
index 0000000..38945c8
--- /dev/null
+++ b/Helper/Request.php
@@ -0,0 +1,1265 @@
+appState = $appState;
+ $this->pricingHelper = $pricingHelper;
+ $this->productMetadata = $productMetadata;
+ $this->moduleList = $moduleList;
+ $this->requestInterface = $requestInterface;
+ $this->resolverInterface = $resolverInterface;
+ $this->serializer = $serializer;
+ $this->jsonHelper = $jsonHelper;
+ $this->countryFactory = $countryFactory;
+ $this->customerSession = $customerSession;
+ $this->checkoutSession = $checkoutSession;
+ $this->adminCheckoutSession = $adminCheckoutSession;
+ $this->checkoutSessionFactory = $checkoutSessionFactory;
+ $this->dateTime = $dateTime;
+ $this->invoiceSender = $invoiceSender;
+ $this->orderEmailSender = $orderEmailSender;
+ $this->transactionBuilder = $transactionBuilder;
+ $this->transactionStatusModel = $transactionStatusModel;
+ $this->novalnetConfig = $novalnetConfig;
+ $this->serverAddress = $serverAddress;
+ $this->novalnetLogger = $novalnetLogger;
+ $this->directoryHelper = $directoryHelper;
+ $this->scopeConfig = $scopeConfig;
+ $this->storeManager = $storeManager;
+ $this->taxHelper = $taxHelper;
+ $this->coreSession = $coreSession;
+ $this->regionModel = $regionModel;
+ }
+
+ /**
+ * Get request headers
+ *
+ * @param string|bool $payment_access_key
+ * @param int|null $storeId
+ * @return array
+ */
+ public function getRequestHeaders($payment_access_key = false, $storeId = null)
+ {
+ if (!$payment_access_key) {
+ $payment_access_key = $this->novalnetConfig->getGlobalConfig('payment_access_key', $storeId);
+ }
+
+ $encoded_data = base64_encode($payment_access_key);
+ return [
+ 'Content-Type' => 'application/json',
+ 'Charset' => 'utf-8',
+ 'Accept' => 'application/json',
+ 'X-NN-Access-Key' => $encoded_data,
+ ];
+ }
+
+ /**
+ * Build addtional data for redirect payment
+ *
+ * @param mixed $response
+ * @return array
+ */
+ public function buildRedirectAdditionalData($response)
+ {
+ if ($response->getData('transaction/txn_secret')) {
+ $additionalData['NnRedirectURL'] = $response->getData('result/redirect_url');
+ $additionalData['NnTxnSecret'] = $response->getData('transaction/txn_secret');
+ return $additionalData;
+ }
+
+ return [];
+ }
+
+ /**
+ * Build addtional data for payment
+ *
+ * @param mixed $response
+ * @param mixed $payment
+ * @return array
+ */
+ public function buildAdditionalData($response, $payment)
+ {
+ $additionalData = [];
+ if (!empty($payment->getAdditionalData())) {
+ $additionalData = $this->isSerialized($payment->getAdditionalData())
+ ? $this->serializer->unserialize($payment->getAdditionalData())
+ : json_decode($payment->getAdditionalData(), true);
+
+ if (isset($additionalData['NnRedirectURL'])) {
+ unset($additionalData['NnRedirectURL']);
+ }
+ }
+
+ $paymentMethodCode = $this->novalnetConfig->getPaymentCodeByType($response->getData('transaction/payment_type'));
+
+ $dataToStore = ['transaction/test_mode', 'transaction/status', 'transaction/tid', 'custom/lang', 'transaction/due_date', 'transaction/partner_payment_reference', 'transaction/payment_data/cc_3d', 'transaction/checkout_js', 'transaction/checkout_token'];
+
+ foreach ($dataToStore as $responseData) {
+ if ($response->getData($responseData)) {
+ $responseDataFormatted = preg_replace('/(?:.*)\/(.*)/', ucwords('$1'), $responseData);
+ $responseDataFormatted = str_replace('_', '', ucwords($responseDataFormatted, '_'));
+ $additionalData['Nn' . $responseDataFormatted] = $response->getData($responseData);
+ }
+ }
+
+ $invoiceAmount = $this->pricingHelper->currency(
+ $this->getFormattedAmount(($response->getData('instalment/cycle_amount') ? $response->getData('instalment/cycle_amount')
+ : $response->getData('transaction/amount')), 'RAW'),
+ true,
+ false
+ );
+ $additionalData['NnAmount'] = $invoiceAmount;
+
+ if (!empty($additionalData['NnDueDate'])) {
+ $additionalData['NnDueDate'] = $this->dateTime->formatDate(
+ $additionalData['NnDueDate'],
+ \IntlDateFormatter::LONG
+ );
+ }
+
+ if ($response->getData('transaction/bank_details')) {
+ $additionalData['NnInvoiceComments'] = $this->getInvoiceComments($response);
+ }
+
+ if ($paymentMethodCode == ConfigProvider::NOVALNET_CASHPAYMENT) {
+ $additionalData['CpDueDate'] = $this->dateTime->formatDate(
+ $response->getData('transaction/due_date'),
+ \IntlDateFormatter::LONG
+ );
+
+ $cashPaymentStores = [];
+ foreach ($response->getData('transaction/nearest_stores') as $key => $cashPaymentStore) {
+ $cashPaymentStores[] = [
+ 'title' => $cashPaymentStore['store_name'],
+ 'street' => $cashPaymentStore['street'],
+ 'city' => $cashPaymentStore['city'],
+ 'zipcode' => $cashPaymentStore['zip'],
+ 'country' => $this->countryFactory->create()->loadByCode($cashPaymentStore['country_code'])
+ ->getName()
+ ];
+ }
+
+ $additionalData['CashpaymentStores'] = $cashPaymentStores;
+ }
+
+ if ($response->getData('instalment')) {
+ $instalmentCycleAmount = $this->getFormattedAmount(
+ $response->getData('instalment/cycle_amount'),
+ 'RAW'
+ );
+ $additionalData['InstallPaidAmount'] = $instalmentCycleAmount;
+ $additionalData['PaidInstall'] = $response->getData('instalment/cycles_executed');
+ $additionalData['DueInstall'] = $response->getData('instalment/pending_cycles');
+ $additionalData['NextCycle'] = $response->getData('instalment/next_cycle_date');
+ $additionalData['InstallCycleAmount'] = $instalmentCycleAmount;
+
+ if ($futureInstalmentDates = $response->getData('instalment/cycle_dates')) {
+ foreach (array_keys($futureInstalmentDates) as $cycle) {
+ $additionalData['InstalmentDetails'][$cycle] = [
+ 'amount' => $instalmentCycleAmount,
+ 'nextCycle' => !empty($futureInstalmentDates[$cycle + 1]) ? date('Y-m-d', strtotime($futureInstalmentDates[$cycle + 1])) : '',
+ 'paidDate' => ($cycle == 1) ? date('Y-m-d') : '',
+ 'status' => ($cycle == 1) ? 'Paid' : 'Pending',
+ 'reference' => ($cycle == 1) ? $response->getData('transaction/tid') : ''
+ ];
+ }
+ }
+
+ }
+
+ if ($this->novalnetConfig->isZeroAmountBookingSupported($paymentMethodCode) &&
+ $this->novalnetConfig->getPaymentConfig($paymentMethodCode, 'payment_action') == NNConfig::ACTION_ZERO_AMOUNT_BOOKING
+ ) {
+ $additionalData['NnZeroAmountBooking'] = 1;
+ }
+
+ $order = $payment->getOrder();
+ $this->saveTransactionDetails($response, $paymentMethodCode);
+
+ return $additionalData;
+ }
+
+ /**
+ * Retrieves Novalnet Invoice Comments
+ *
+ * @param mixed $response
+ * @return string
+ */
+ public function getInvoiceComments($response)
+ {
+ $invoicePaymentsNote = 'Account holder: ' . $response->getData('transaction/bank_details/account_holder');
+ $invoicePaymentsNote .= '|IBAN: ' . $response->getData('transaction/bank_details/iban');
+ $invoicePaymentsNote .= '|BIC: ' . $response->getData('transaction/bank_details/bic');
+ $invoicePaymentsNote .= '|Bank: ' . $response->getData('transaction/bank_details/bank_name')
+ . ' ' . $response->getData('transaction/bank_details/bank_place');
+
+ $invoicePaymentsNote .= '|Payment References description:';
+ if ($response->getData('instalment/cycle_amount')) {
+ $invoicePaymentsNote .= '|Payment Reference:' . $response->getData('transaction/tid');
+ } else {
+ $invoicePaymentsNote .= '|Payment reference 1:' . $response->getData('transaction/tid');
+ $invoicePaymentsNote .= '|Payment reference 2:' . $response->getData('transaction/invoice_ref');
+ }
+
+ return $invoicePaymentsNote;
+ }
+
+ /**
+ * Saves transaction details into Novalnet table
+ *
+ * @param mixed $response
+ * @param string $paymentMethodCode
+ * @return void
+ */
+ public function saveTransactionDetails($response, $paymentMethodCode)
+ {
+ $this->transactionStatusModel->setOrderId($response->getData('transaction/order_no'))
+ ->setTid($response->getData('transaction/tid'))
+ ->setStatus($response->getData('transaction/status'))
+ ->setCustomerId($this->getCustomerId())
+ ->setPaymentMethod($paymentMethodCode)
+ ->save();
+ }
+
+ /**
+ * Check payment hash for redirect payments
+ *
+ * @param array $response
+ * @param array $additionalData
+ * @return bool
+ */
+ public function checkPaymentHash($response, $additionalData)
+ {
+ $accessKey = (!empty($this->novalnetConfig->getGlobalConfig('payment_access_key'))) ? trim($this->novalnetConfig->getGlobalConfig('payment_access_key')) : '';
+ $checksumString = $response['tid'] . $additionalData['NnTxnSecret'] . $response['status']
+ . strrev($accessKey);
+ $generatedChecksum = (!empty($checksumString)) ? hash('sha256', $checksumString) : '';
+
+ if ($generatedChecksum !== $response['checksum']) {
+ return false;
+ }
+
+ return true;
+ }
+
+ /**
+ * Check return data for redirect payments and update order accordingly
+ *
+ * @param mixed $response
+ * @param mixed $order
+ * @param mixed $payment
+ * @return bool
+ */
+ public function checkReturnedData($response, $order, $payment)
+ {
+ if ($response->getData('transaction/status') == 'FAILURE') {
+ $this->saveCanceledOrder($response, $order);
+ return false;
+ }
+ $storeId = $order->getStoreId();
+ $paymentMethodCode = $payment->getMethodInstance()->getCode();
+ // Retrieves additional payment data for the order
+ $additionalData = $this->buildAdditionalData($response, $payment);
+ $amount = $this->getFormattedAmount($response->getData('transaction/amount'), 'RAW');
+ $payment->setAdditionalData($this->jsonHelper->jsonEncode($additionalData))->save();
+ $setOrderStatus = $this->novalnetConfig->getGlobalOnholdStatus($storeId);
+
+ if ($response->getData('transaction/status') == 'CONFIRMED' && empty($additionalData['NnZeroAmountBooking'])) {
+ // capture transaction
+ $payment->setTransactionId($additionalData['NnTid'])
+ ->setLastTransId($additionalData['NnTid'])
+ ->capture(null)
+ ->setAmount($amount)
+ ->setIsTransactionClosed(false)
+ ->setShouldCloseParentTransaction(false)
+ ->save();
+
+ $setOrderStatus = $this->novalnetConfig->getPaymentConfig(
+ $paymentMethodCode,
+ 'order_status',
+ $storeId
+ );
+ } else {
+ // authorize transaction
+ if (!empty($additionalData['NnZeroAmountBooking'])) {
+ $payment->authorize(true, $order->getBaseGrandTotal())->save();
+ } else {
+ $payment->authorize(true, $amount)->save();
+ }
+
+ if ($response->getData('transaction/status') == 'PENDING') {
+ $setOrderStatus = 'pending';
+ }
+ }
+
+ $order->setState(Order::STATE_PROCESSING)
+ ->setStatus($setOrderStatus)
+ ->save();
+ $order->addStatusHistoryComment(__('Customer successfully returned from Novalnet'), false)
+ ->save();
+
+ // Order Confirmation and Invoice email
+ if ($order->getCanSendNewEmailFlag()) {
+ try {
+ $this->orderEmailSender->send($order);
+ $invoice = current($order->getInvoiceCollection()->getItems());
+ if ($invoice) {
+ $this->invoiceSender->send($invoice);
+ }
+ } catch (\Exception $e) {
+ $this->_logger->critical($e);
+ $this->novalnetLogger->error($e);
+ }
+ }
+
+ //update payment token
+ $objectManager = \Magento\Framework\App\ObjectManager::getInstance();
+
+ $subscription = false;
+ if (!empty($order->getItems())) {
+ foreach ($order->getItems() as $item) {
+ $additionalData = [];
+ if (!empty($item->getAdditionalData())) {
+ $additionalData = json_decode($item->getAdditionalData(), true);
+ }
+
+ if (!empty($additionalData['period_unit']) && !empty($additionalData['billing_frequency'])) {
+ $subscription = true;
+ break;
+ }
+ }
+ if ($subscription) {
+ if (in_array($paymentMethodCode, [ConfigProvider::NOVALNET_CC, ConfigProvider::NOVALNET_PAYPAL])) {
+ $token = !empty($response->getData('transaction/payment_data/token')) ? $response->getData('transaction/payment_data/token') : '';
+ if (!empty($token)) {
+ $subscriptionModel = $objectManager->create(\Novalnet\Subscription\Model\SubscriptionDetails::class);
+ $subscriptionModel = $subscriptionModel->getCollection()->addFieldToFilter('order_id', $order->getIncrementId())->getFirstItem();
+ $subscriptionModel->setToken($token)->save();
+ }
+
+ }
+ }
+ }
+
+ return true;
+ }
+
+ /**
+ * Save canceled payment transaction
+ *
+ * @param mixed $response
+ * @param mixed $order
+ * @param string|bool $statusText
+ * @return void
+ */
+ public function saveCanceledOrder($response, $order, $statusText = false)
+ {
+ $payment = $order->getPayment();
+ // Get payment transaction status message
+ $statusMessage = ($statusText)
+ ? $statusText : $response->getData('result/status_text');
+
+ $additionalData = $payment->getAdditionalData() ? ($this->isSerialized($payment->getAdditionalData())
+ ? $this->serializer->unserialize($payment->getAdditionalData())
+ : json_decode($payment->getAdditionalData(), true)) : [];
+
+ $nnAmount = $this->pricingHelper->currency(
+ $this->getFormattedAmount(($response->getData('instalment/cycle_amount') ? $response->getData('instalment/cycle_amount')
+ : $response->getData('transaction/amount')), 'RAW'),
+ true,
+ false
+ );
+
+ $additionalData['NnTid'] = $response->getData('transaction/tid');
+ $additionalData['NnStatus'] = $response->getData('transaction/status');
+ $additionalData['NnTestMode'] = $response->getData('transaction/test_mode');
+ $additionalData['NnAmount'] = $nnAmount;
+ $additionalData['NnComments'] = '' . __('Payment Failed') . ' - '
+ . $statusMessage . ' ';
+ $payment->setLastTransId($additionalData['NnTid'])
+ ->setAdditionalData($this->jsonHelper->jsonEncode($additionalData))
+ ->save();
+
+ // UnHold and Cancel the order with the cancel text
+ if ($order->canUnhold()) {
+ $order->unhold();
+ }
+
+ //Cancel subscription if exist
+ $paymentMethodCode = $payment->getMethodInstance()->getCode();
+ $subscription = false;
+ $objectManager = \Magento\Framework\App\ObjectManager::getInstance();
+ if (!empty($order->getItems())) {
+ foreach ($order->getItems() as $item) {
+ $additionalData = (!empty($item->getAdditionalData())) ? json_decode($item->getAdditionalData(), true) : [];
+ if (!empty($additionalData['period_unit']) && !empty($additionalData['billing_frequency'])) {
+ $subscription = true;
+ break;
+ }
+ }
+ }
+ if ($subscription) {
+ if (in_array($paymentMethodCode, [ConfigProvider::NOVALNET_CC, ConfigProvider::NOVALNET_PAYPAL])) {
+ $subscriptionModel = $objectManager->create(\Novalnet\Subscription\Model\SubscriptionItems::class);
+ $subscriptionitems = $subscriptionModel->getCollection()->addFieldToFilter('order_id', $order->getIncrementId());
+ if (!empty($subscriptionitems)) {
+ foreach ($subscriptionitems as $subscriptionitem) {
+ $subscriptionitem->setState('CANCELED')->save();
+ }
+ }
+ }
+ }
+
+ $order->registerCancellation($statusMessage)->save();
+ }
+
+ /**
+ * Save payment token
+ *
+ * @param mixed $order
+ * @param string $paymentMethodCode
+ * @param mixed $response
+ * @return void
+ */
+ public function savePaymentToken($order, $paymentMethodCode, $response)
+ {
+ if ($this->novalnetConfig->isOneClickPayment($paymentMethodCode)) {
+ if (strpos($paymentMethodCode, ConfigProvider::NOVALNET_SEPA) !== false) {
+ $paymentMethodCode = ConfigProvider::NOVALNET_SEPA;
+ }
+ $transactionStatusCollection = $this->transactionStatusModel->getCollection()
+ ->setPageSize(2)
+ ->setOrder('id', 'DESC')
+ ->addFieldToFilter('token', ['null' => false])
+ ->addFieldToFilter('customer_id', $order->getCustomerId())
+ ->addFieldToFilter('payment_method', ['like' => $paymentMethodCode . '%']);
+ // Override the old token if two tokens already exist
+ if ($transactionStatusCollection->count() >= 2) {
+ $this->transactionStatusModel->setEntityId($transactionStatusCollection->getFirstItem()->getId());
+ }
+
+ $responseTokens = ['transaction/payment_data/card_brand', 'transaction/payment_data/card_holder', 'transaction/payment_data/card_expiry_month', 'transaction/payment_data/card_expiry_year', 'transaction/payment_data/card_number', 'transaction/payment_data/iban', 'transaction/payment_data/account_holder', 'transaction/payment_data/paypal_account', 'transaction/payment_data/paypal_transaction_id'];
+
+ foreach ($responseTokens as $responseToken) {
+ if ($response->getData($responseToken)) {
+ $responseTokenFormatted = preg_replace('/(?:transaction\/payment_data)\/(.*)/', ucwords('$1'), $responseToken);
+ $responseTokenFormatted = str_replace('_', '', ucwords($responseTokenFormatted, '_'));
+ $tokenInfo['Nn' . $responseTokenFormatted] = $response->getData($responseToken);
+ }
+ }
+
+ $this->transactionStatusModel->setToken($response->getData('transaction/payment_data/token'));
+ if (!empty($tokenInfo) && $response->getData('custom/create_token') == '1') {
+ $this->transactionStatusModel->setTokenInfo($this->jsonHelper->jsonEncode($tokenInfo));
+ }
+ $this->transactionStatusModel->save();
+ }
+ }
+
+ /**
+ * Restore cart items
+ *
+ * @param string $orderId
+ * @return void
+ */
+ public function restoreQuote($orderId)
+ {
+ $this->checkoutSession->restoreQuote();
+ $this->checkoutSession->setLastRealOrderId($orderId);
+ }
+
+ /**
+ * Retrieve Magento version
+ *
+ * @return string
+ */
+ public function getMagentoVersion()
+ {
+ return $this->productMetadata->getVersion();
+ }
+
+ /**
+ * Retrieve Novalnet version
+ *
+ * @return int
+ */
+ public function getNovalnetVersion()
+ {
+ return $this->moduleList->getOne('Novalnet_Payment')['setup_version'];
+ }
+
+ /**
+ * Get shop default language
+ *
+ * @return string
+ */
+ public function getDefaultLanguage()
+ {
+ $defaultLocale = (!empty($this->resolverInterface->getDefaultLocale())) ? explode('_', $this->resolverInterface->getDefaultLocale()) : [];
+ return (is_array($defaultLocale) && !empty($defaultLocale)) ? $defaultLocale[0] : 'en';
+ }
+
+ /**
+ * Retrieves customer session model
+ *
+ * @return mixed
+ */
+ public function getCustomerSession()
+ {
+ return $this->customerSession;
+ }
+
+ /**
+ * Retrieve customer id from current session
+ *
+ * @return int|string
+ */
+ public function getCustomerId()
+ {
+ if ($this->coreSession->getRecurringProcess()) {
+ return $this->coreSession->getCustomerId();
+ }
+
+ if ($this->customerSession->isLoggedIn()) {
+ return $this->customerSession->getCustomer()->getId();
+ } elseif ($this->isAdmin()) {
+ $adminSession = $this->getAdminCheckoutSession();
+ return $adminSession->getCustomerId() ? $adminSession->getCustomerId() : 'guest';
+ } else {
+ return 'guest';
+ }
+ }
+
+ /**
+ * Check if the payment area is admin
+ *
+ * @return boolean
+ */
+ public function isAdmin()
+ {
+ return (bool)($this->appState->getAreaCode() == \Magento\Backend\App\Area\FrontNameResolver::AREA_CODE);
+ }
+
+ /**
+ * Retrieves admin checkout session model
+ *
+ * @return mixed
+ */
+ public function getAdminCheckoutSession()
+ {
+ return $this->adminCheckoutSession;
+ }
+
+ /**
+ * Retrieves Order Amount
+ *
+ * @return int
+ */
+ public function getAmount()
+ {
+ $quote = (!$this->isAdmin())
+ ? $this->checkoutSession->getQuote()
+ : $this->adminCheckoutSession->getQuote();
+ return $this->getFormattedAmount($quote->getGrandTotal());
+ }
+
+ /**
+ * Retrieves Retrieves Billing Address from checkout session model
+ *
+ * @return array
+ */
+ public function getBillingAddress()
+ {
+ $quote = (!$this->isAdmin())
+ ? $this->checkoutSession->getQuote()
+ : $this->adminCheckoutSession->getQuote();
+ $billingAddress = $quote->getBillingAddress();
+ $firstName = ($billingAddress->getFirstname())
+ ? $billingAddress->getFirstname()
+ : (($quote->getCustomerFirstname())
+ ? $quote->getCustomerFirstname()
+ : "");
+ $lastName = ($billingAddress->getLastname())
+ ? $billingAddress->getLastname()
+ : (($quote->getCustomerLastname())
+ ? $quote->getCustomerLastname()
+ : "");
+ $billing = ['firstname' => $firstName,
+ 'lastname' => $lastName,
+ 'street' => $billingAddress->getStreet(),
+ 'city' => $billingAddress->getCity(),
+ 'country_id' => $billingAddress->getCountryId(),
+ 'email' => $billingAddress->getEmail(),
+ 'postcode' => $billingAddress->getPostcode(),
+ ];
+ return $billing;
+ }
+
+ /**
+ * Retrieves Shipping Address from checkout session model
+ *
+ * @return array
+ */
+ public function getShippingAddress()
+ {
+ $quote = (!$this->isAdmin())
+ ? $this->checkoutSession->getQuote()
+ : $this->adminCheckoutSession->getQuote();
+ $shippingAddress = $quote->getShippingAddress();
+ $firstName = ($shippingAddress->getFirstname())
+ ? $shippingAddress->getFirstname()
+ : (($quote->getCustomerFirstname())
+ ? $quote->getCustomerFirstname()
+ : "");
+ $lastName = ($shippingAddress->getLastname())
+ ? $shippingAddress->getLastname()
+ : (($quote->getCustomerLastname())
+ ? $quote->getCustomerLastname()
+ : "");
+ $shipping = ['firstname' => $firstName,
+ 'lastname' => $lastName,
+ 'street' => $shippingAddress->getStreet(),
+ 'city' => $shippingAddress->getCity(),
+ 'country_id' => $shippingAddress->getCountryId(),
+ 'email' => $shippingAddress->getEmail(),
+ 'postcode' => $shippingAddress->getPostcode(),
+ 'same_as_billing' => $shippingAddress->getSameAsBilling(),
+ ];
+ return $shipping;
+ }
+
+ /**
+ * Retrieves account holder name from the billing address
+ *
+ * @return string
+ */
+ public function getAccountHolder()
+ {
+ $quote = (!$this->isAdmin())
+ ? $this->checkoutSession->getQuote()
+ : $this->adminCheckoutSession->getQuote();
+ $billingAddress = $quote->getBillingAddress();
+
+ if ($billingAddress->getFirstname() && $billingAddress->getLastname()) {
+ return $billingAddress->getFirstname() .' '. $billingAddress->getLastname();
+ } elseif ($quote->getCustomerFirstname() && $quote->getCustomerLastname()) {
+ return $quote->getCustomerFirstname() .' '. $quote->getCustomerLastname();
+ } else {
+ return '';
+ }
+ }
+
+ /**
+ * Retrieves Company from the billing address
+ *
+ * @return string
+ */
+ public function getCustomerCompany()
+ {
+ $billingaddress = (!$this->isAdmin())
+ ? $this->checkoutSession->getQuote()->getBillingAddress()
+ : $this->adminCheckoutSession->getQuote()->getBillingAddress();
+
+ return $billingaddress->getCompany();
+ }
+
+ /**
+ * Get IP address from request
+ *
+ * @return mixed
+ */
+ public function getRequestIp()
+ {
+ $serverVariables = $this->requestInterface->getServer();
+ $remoteAddrHeaders = ['HTTP_X_FORWARDED_HOST', 'HTTP_CLIENT_IP', 'HTTP_X_REAL_IP', 'HTTP_X_FORWARDED_FOR', 'HTTP_X_FORWARDED',
+ 'HTTP_X_CLUSTER_CLIENT_IP', 'HTTP_FORWARDED_FOR', 'HTTP_FORWARDED', 'REMOTE_ADDR'];
+
+ foreach ($remoteAddrHeaders as $header) {
+ if (property_exists($serverVariables, $header) === true) {
+ if (in_array($header, ['HTTP_X_FORWARDED_HOST', 'HTTP_X_FORWARDED_FOR'])) {
+ $forwardedIps = (!empty($serverVariables[$header])) ? explode(",", $serverVariables[$header]) : [];
+ $serverVariables[$header] = trim(end($forwardedIps));
+ }
+
+ return $serverVariables[$header];
+ }
+ }
+ }
+
+ /**
+ * Get Server IP address
+ *
+ * @return mixed
+ */
+ public function getServerAddr()
+ {
+ return $this->serverAddress->getServerAddress();
+ }
+
+ /**
+ * Get the formated amount in cents/euro
+ *
+ * @param mixed $amount
+ * @param string $type
+ * @return mixed
+ */
+ public function getFormattedAmount($amount, $type = 'CENT')
+ {
+ if (!empty($amount)) {
+ return ($type == 'RAW') ? number_format($amount / 100, 2, '.', '') : round($amount, 2) * 100;
+ }
+
+ return null;
+ }
+
+ /**
+ * Get the Amount with symbol
+ *
+ * @param mixed $amount
+ * @param int $storeId
+ * @return float|string
+ */
+ public function getAmountWithSymbol($amount, $storeId)
+ {
+ return $this->pricingHelper->currencyByStore($amount, $storeId);
+ }
+
+ /**
+ * Get payment method session
+ *
+ * @param string $paymentMethodCode
+ * @param bool $unset
+ * @return mixed
+ */
+ public function getMethodSession($paymentMethodCode, $unset = false)
+ {
+ $checkoutSession = $this->checkoutSessionFactory->create();
+ if (!$checkoutSession->hasData($paymentMethodCode) || $unset) {
+ $checkoutSession->setData($paymentMethodCode, new \Magento\Framework\DataObject([]));
+ }
+
+ return $checkoutSession->getData($paymentMethodCode);
+ }
+
+ /**
+ * Replace strings from the tid passed
+ *
+ * @param mixed $tid
+ * @return mixed
+ */
+ public function makeValidNumber($tid)
+ {
+ return preg_replace('/[^0-9]+/', '', $tid);
+ }
+
+ /**
+ * Check the value is numeric
+ *
+ * @param mixed $value
+ * @return bool
+ */
+ public function checkIsNumeric($value)
+ {
+ if (!empty($value)) {
+ return (bool) preg_match('/^\d+$/', $value);
+ }
+
+ return false;
+ }
+
+ /**
+ * Check whether string is serialized
+ *
+ * @param mixed $data
+ * @return boolean
+ */
+ public function isSerialized($data)
+ {
+ if (!empty($data)) {
+ $data = trim($data);
+ if ($data == 'N;') {
+ return true;
+ }
+
+ $lastChar = substr($data, -1);
+ if (!is_string($data) || strlen($data) < 4 || $data[1] !== ':'
+ || ($lastChar !== ';' && $lastChar !== '}')) {
+ return false;
+ }
+
+ $token = $data[0];
+ switch ($token) {
+ case 's':
+ if (substr($data, -2, 1) !== '"') {
+ return false;
+ }
+
+ // no break
+ case 'a':
+ case 'O':
+ return (bool) preg_match("/^{$token}:[0-9]+:/s", $data);
+ case 'b':
+ case 'i':
+ case 'd':
+ return (bool) preg_match("/^{$token}:[0-9.E-]+;$/", $data);
+ }
+ }
+
+ return false;
+ }
+
+ /**
+ * Get proper Status Text
+ *
+ * @param mixed $status
+ * @param mixed $order
+ * @return string
+ */
+ public function getStatus($status, $order)
+ {
+ if ($this->checkIsNumeric($status) == true) {
+ if (in_array($status, $this->onholdStatus)) {
+ $status = 'ON_HOLD';
+ } elseif (in_array($status, $this->pendingStatus)) {
+ $status = 'PENDING';
+ } elseif ($status == '100') {
+ $payment = $order->getPayment();
+ $paymentCode = $payment->getMethodInstance()->getCode();
+ if (in_array(
+ $paymentCode,
+ [
+ ConfigProvider::NOVALNET_INVOICE,
+ ConfigProvider::NOVALNET_PREPAYMENT,
+ ConfigProvider::NOVALNET_CASHPAYMENT
+ ]
+ )) {
+ $invoice_id = '';
+ $invoice = [];
+ foreach ($order->getInvoiceCollection() as $invoice) {
+ $invoice_id = $invoice->getIncrementId();
+ $invoice = $invoice->getData();
+ }
+ if (!empty($invoice_id) && (in_array($paymentCode, [ConfigProvider::NOVALNET_PREPAYMENT, ConfigProvider::NOVALNET_CASHPAYMENT])
+ || ($paymentCode == ConfigProvider::NOVALNET_INVOICE && $invoice['state'] == 2))) {
+ $status = 'CONFIRMED';
+ } else {
+ $status = 'PENDING';
+ }
+ } else {
+ $status = 'CONFIRMED';
+ }
+ } elseif ($status == '103') {
+ $status = 'DEACTIVATED';
+ } else {
+ $status = 'FAILURE';
+ }
+ }
+
+ return $status;
+ }
+
+ /**
+ * Validate Customer Company param
+ *
+ * @param string $paymentMethod
+ * @return boolean
+ */
+ public function validateCompany($paymentMethod)
+ {
+ $company = $this->getCustomerCompany();
+ if (!empty($company) && $this->novalnetConfig->getPaymentConfig($paymentMethod, 'allow_b2b_customer')) {
+ if (preg_match('/^(?:\d+|(?:)\.?|[^a-zA-Z0-9]+|[a-zA-Z]{1})$|^(herr|frau|jahr|mr|miss|mrs|others|andere|anrede|salutation|null|none|keine|company|firma|no|na|n\/a|test|private|privat)$/i', $company)) {
+ return true;
+ } else {
+ return false;
+ }
+ }
+ return true;
+ }
+
+ /**
+ * Get Country Code
+ *
+ * @param int $store
+ * @return string
+ */
+ public function getCountryCode($store = null)
+ {
+ return $this->directoryHelper->getDefaultCountry($store);
+ }
+
+ /**
+ * Get express checkout Enabled pages
+ *
+ * @param string $page
+ * @return array
+ */
+ public function isPageEnabledForExpressCheckout($page)
+ {
+ $isApplePayEnabled = $this->novalnetConfig->getPaymentConfig(ConfigProvider::NOVALNET_APPLEPAY, 'active');
+ $applePayEnabledPages = $this->novalnetConfig->getPaymentConfig(ConfigProvider::NOVALNET_APPLEPAY, 'enabled_pages');
+ $applePayEnabledPages = (!empty($applePayEnabledPages)) ? explode(',', $applePayEnabledPages) : [];
+
+ $isGooglePayEnabled = $this->novalnetConfig->getPaymentConfig(ConfigProvider::NOVALNET_GOOGLEPAY, 'active');
+ $googlePayEnabledPages = $this->novalnetConfig->getPaymentConfig(ConfigProvider::NOVALNET_GOOGLEPAY, 'enabled_pages');
+ $googlePayEnabledPages = (!empty($googlePayEnabledPages)) ? explode(',', $googlePayEnabledPages) : [];
+
+ return [
+ ConfigProvider::NOVALNET_APPLEPAY => (bool) ($isApplePayEnabled && $this->validateBasicParams() && in_array($page, $applePayEnabledPages) && $this->canUseForGuestCheckout()),
+ ConfigProvider::NOVALNET_GOOGLEPAY => (bool) ($isGooglePayEnabled && $this->validateBasicParams() && in_array($page, $googlePayEnabledPages) && $this->canUseForGuestCheckout())
+ ];
+ }
+
+ /**
+ * Validate Novalnet basic params
+ *
+ * @return bool
+ */
+ public function validateBasicParams()
+ {
+ return ($this->novalnetConfig->getGlobalConfig('signature') &&
+ $this->novalnetConfig->getGlobalConfig('payment_access_key') &&
+ $this->checkIsNumeric($this->novalnetConfig->getGlobalConfig('tariff_id')));
+ }
+
+ /**
+ * Can payment used for guest checkout
+ *
+ * @return bool
+ */
+ public function canUseForGuestCheckout()
+ {
+ if ($this->getCustomerSession()->isLoggedIn()) {
+ return true;
+ };
+
+ return $this->scopeConfig->getValue(
+ 'checkout/options/guest_checkout',
+ \Magento\Store\Model\ScopeInterface::SCOPE_STORE,
+ $this->storeManager->getStore()->getId()
+ );
+ }
+
+ /**
+ * Get Configuration
+ *
+ * @param string $field
+ * @return mixed
+ */
+ public function getSystemConfig($field)
+ {
+ return $this->scopeConfig->getValue(
+ $field,
+ \Magento\Store\Model\ScopeInterface::SCOPE_STORE,
+ $this->storeManager->getStore()->getId()
+ );
+ }
+
+ /**
+ * Get Payment sheet Configuration values
+ *
+ * @return array
+ */
+ public function paymentSheetConfigurations()
+ {
+ return [
+ ConfigProvider::NOVALNET_APPLEPAY => [
+ 'btnType' => $this->novalnetConfig->getPaymentConfig(ConfigProvider::NOVALNET_APPLEPAY, 'button_style'),
+ 'btnTheme' => $this->novalnetConfig->getPaymentConfig(ConfigProvider::NOVALNET_APPLEPAY, 'button_theme'),
+ 'btnHeight' => $this->novalnetConfig->getPaymentConfig(ConfigProvider::NOVALNET_APPLEPAY, 'button_height'),
+ 'btnRadius' => $this->novalnetConfig->getPaymentConfig(ConfigProvider::NOVALNET_APPLEPAY, 'button_corner_radius'),
+ 'sellerName' => $this->novalnetConfig->getPaymentConfig(ConfigProvider::NOVALNET_APPLEPAY, 'seller_name'),
+ 'environment' => ($this->novalnetConfig->getTestMode(ConfigProvider::NOVALNET_APPLEPAY, $this->storeManager->getStore()->getId())) ? 'SANDBOX' : 'PRODUCTION'
+ ],
+ ConfigProvider::NOVALNET_GOOGLEPAY => [
+ 'btnType' => $this->novalnetConfig->getPaymentConfig(ConfigProvider::NOVALNET_GOOGLEPAY, 'button_type'),
+ 'btnTheme' => $this->novalnetConfig->getPaymentConfig(ConfigProvider::NOVALNET_GOOGLEPAY, 'button_theme'),
+ 'btnHeight' => $this->novalnetConfig->getPaymentConfig(ConfigProvider::NOVALNET_GOOGLEPAY, 'button_height'),
+ 'sellerName' => $this->novalnetConfig->getPaymentConfig(ConfigProvider::NOVALNET_GOOGLEPAY, 'seller_name'),
+ 'environment' => ($this->novalnetConfig->getTestMode(ConfigProvider::NOVALNET_GOOGLEPAY, $this->storeManager->getStore()->getId())) ? 'SANDBOX' : 'PRODUCTION',
+ 'partnerId' => $this->novalnetConfig->getPaymentConfig(ConfigProvider::NOVALNET_GOOGLEPAY, 'merchant_id'),
+ 'enforce3d' => ($this->novalnetConfig->getPaymentConfig(ConfigProvider::NOVALNET_GOOGLEPAY, 'enforce_3d')) ? $this->novalnetConfig->getPaymentConfig(ConfigProvider::NOVALNET_GOOGLEPAY, 'enforce_3d') : 0
+ ],
+ 'countryCode' => $this->getCountryCode(),
+ 'currencyCode' => $this->storeManager->getStore()->getBaseCurrencyCode(),
+ 'langCode' => $this->getLanguageCodeForPaymentSheet(),
+ 'clientKey' => $this->novalnetConfig->getGlobalConfig('client_key')
+ ];
+ }
+
+ /**
+ * To get formatted language code for payment sheet
+ *
+ * @return string
+ */
+ public function getLanguageCodeForPaymentSheet()
+ {
+ $defaultLocale = (!empty($this->resolverInterface->getDefaultLocale())) ? explode('_', $this->resolverInterface->getDefaultLocale()) : [];
+ return (is_array($defaultLocale) && !empty($defaultLocale[0]) && !empty($defaultLocale[1])) ? $defaultLocale[0] . '-' . $defaultLocale[1] : 'en-US';
+ }
+
+ /**
+ * Get tax calculation settings and set apple pay amount type
+ *
+ * @return bool
+ */
+ public function isAmountPendingForExpressCheckout()
+ {
+ return ($this->taxHelper->getTaxBasedOn() == 'billing') ? true : false;
+ }
+
+ /**
+ * Get region name by code
+ *
+ * @param string $regionCode
+ * @param string $countryCode
+ * @return string
+ */
+ public function getRegionNameByCode($regionCode, $countryCode)
+ {
+ try {
+ $regionName = $this->regionModel->loadByCode($regionCode, $countryCode)->getName();
+
+ if (!empty($regionName)) {
+ return $regionName;
+ }
+
+ return $regionCode;
+ } catch (\Exception $e) {
+ return $regionCode;
+ }
+ }
+}
diff --git a/LICENSE.txt b/LICENSE.txt
new file mode 100755
index 0000000..2731214
--- /dev/null
+++ b/LICENSE.txt
@@ -0,0 +1,52 @@
+Freeware-Lizenzvereinbarung
+
+Deutsch:
+
+Präambel:
+Die nachfolgende Vereinbarung regelt die Rechte und die Haftung zwischen Ihnen (im Folgenden „Partner“) und der Novalnet AG (im Folgenden „Novalnet“) in Bezug auf die von Novalnet kostenlos bereitgestellten Softwarelösungen zur Anbindung von eCommerce-Systemen an die Payment Plattform von Novalnet. Von dieser Regelung ausdrücklich nicht betroffen sind die Leistungen, die Novalnet gemäß dem zwischen den Parteien geschlossenen Dienstleistungsvertrag gegenüber dem Partner erbringt. Mit der Installation und der Benutzung der Software bestätigen Sie automatisch, dass Sie diese Freeware-Lizenzvereinbarung gelesen haben und mit ihr einverstanden sind. Wenn Sie als Partner mit diesen Bedingungen nicht einverstanden sind, installieren und nutzen Sie die Software nicht.
+
+Lizenz:
+Für die von Novalnet unentgeltlich bereitgestellten Payment Module sowie alle weiteren Module, die Novalnet anderweitig veröffentlicht, räumt Novalnet ein zeitlich auf die Dauer des zwischen den Parteien geschlossenen Dienstleistungsvertrages begrenztes, nicht ausschließliches, unentgeltliches Nutzungsrecht ein. Die Lizenzvereinbarung berechtigt Sie, die Software auf einem oder mehreren Rechnern zu installieren und zu nutzen. Die Lizenz für die Software ist kostenlos. Der Partner verpflichtet sich, die Payment Module und/oder Teile der Module ausschließlich für die Nutzung der von Novalnet gemäß dem Vertrag bereitgestellten Leistungen zu nutzen. Der Partner hat keinen Anspruch auf technische Unterstützung irgendwelcher Art. Novalnet ist insbesondere nicht verpflichtet, eine Wartung oder Überarbeitung der Software zu gewährleisten.
+
+Copyright:
+Alle Rechtsansprüche, Besitzrechte und geistigen Eigentumsrechte an und auf die Software sowie alle Kopien davon und jede damit im Zusammenhang stehende Dokumentation sind Eigentum von Novalnet (www.novalnet.de). Alle Rechte sind vorbehalten. Novalnet behält sich rechtliche Schritte im Falle einer Verletzung dieser Lizenzvereinbarung vor.
+
+Gewährleistung und Haftung:
+Die Payment Module werden ausdrücklich „so wie sie sind“ zur Verfügung gestellt. Für die fehlerfreie Funktion der Payment Module und/oder Teile der Payment Module übernimmt Novalnet keine Gewähr. Ebenso übernimmt Novalnet keine Haftung für Schäden und/oder Folgeschäden, die mittelbar oder unmittelbar mit dem Gebrauch und/oder der Nutzung der von Novalnet unentgeltlich zur Verfügung gestellten Payment Module in Verbindung gebracht werden können, es sei denn, dass der Schaden auf Vorsatz oder auf grobe Fahrlässigkeit beruht. Von diesem Haftungsausschluss nicht umfasst sind Schäden aus der Verletzung von Leib, Leben oder der Gesundheit.
+
+Rechtsansprüche und salvatorische Klausel:
+Es gilt das Recht der Bundesrepublik Deutschland. Gerichtsstand ist München. Sollte eine gegenwärtige oder zukünftige Bestimmung der Vereinbarung ganz oder teilweise aus anderen Gründen als den §§ 305-310 des Bürgerlichen Gesetzbuchs (BGB) unwirksam/nichtig oder nicht durchführbar sein oder werden, so wird hiervon die Gültigkeit der übrigen Bestimmungen des Vereinbarung nicht berührt. Die Parteien werden die unwirksame/nichtige oder nicht durchführbare Bestimmung durch eine wirksame ersetzen, die in ihrem rechtlichen und wirtschaftlichen Gehalt der unwirksamen/nichtigen oder nicht durchführbaren Bestimmung und dem Gesamtzweck der Vereinbarung entspricht. Das gleiche gilt, wenn sich nach Abschluss der Vereinbarung eine ergänzungsbedürftige Lücke ergibt. Die Bestimmung des § 139 BGB (Teilnichtigkeit) wird ausdrücklich ausgeschlossen.
+
+Sollten Sie weitere Informationen benötigen, steht Ihnen der Technik-Service der Novalnet AG gerne zur Verfügung:
+
+Novalnet AG
+Tel.: +49 89 9230683-19
+Fax: +49 89 9230683-11
+E-Mail: technic@novalnet.de
+
+
+English:
+
+Preamble:
+The following agreement governs the rights and responsibilities between you (the "Partner") and the Novalnet AG ("Novalnet") in relation to the cost-free software solutions Service and Support provided by Novalnet, by connecting your e-commerce systems to the payment platform of Novalnet. Services, which Novalnet offers in accordance with a service contract to its partners, are not affected explicitly by this agreement. From this particular agreement, is not explicitly affected the services Novalnet under the contract between the parties to the service contract partners are providing. By installing and using the software, you automatically confirm that you have read this freeware license agreement and agree with it. If you do not agree to these conditions, as a partner, please do not install and use the software.
+
+License:
+For the payment module provided by Novalnet for each individual version, Novalnet grants a limited, non-exclusive, right of use for a service agreement concluded between the parties. The license agreement authorises you to install and use the software on one or more computers. The Partner undertakes to use the Payment Modules and / or parts of the Modules exclusively for the use of the services provided by Novalnet in accordance with the Agreement. The Partner is not entitled to technical support of any kind whatsoever. In particular, Novalnet is not obliged to ensure the maintenance, repair or revision of the Software.
+
+Copyright:
+All title, ownership rights and intellectual property rights to and from the Software, as well as all copies of the software, and any related documentation, are the property of Novalnet (www.novalnet.de). All rights are reserved. Novalnet reserves legal measures in case of a breach of this Agreement.
+
+Guarantee and Liability:
+Novalnet shall only be liable to the extent that Novalnet, its legal representatives, employees and / or vicarious agents are guilty of intentional or gross negligent conduct. The liability is however limited to the foreseeable losses that are typical of the contract, of which Novalnet would have to be typically reckoned with given the known circumstances at the time the contract was concluded.
+
+The limitation of liability does not apply to the extent of breach of essential contractual obligations by Novalnet, its vicarious agents, employees and / or legal representatives. Cardinal contractual obligations refer to those obligations that one contracting party has to grant to the other contracting party in accordance with the sense and purpose of the agreement or whose fulfilment is essential for the due and proper implementation of the contract in the first place and the observance of which the other contracting party can regularly rely upon. In this case, liability is however is limited to the damage that is typically predictable at the time of conclusion of the contract. In a statutorily prescribed no-fault liability- in particular any potential liability under the Product Liability Act or due to legal guarantee liability - shall remain unaffected by the above limitations of liability. The same applies to the liability of Novalnet in the case of negligent injury to life, body or health.
+
+Legal claims and severability clause:
+The laws of the Federal Republic of Germany will be applicable. The place for court of law or going to court will be Munich. Should any present or future provision of the Agreement, in whole or in part, become invalid, for reasons other than the § § 305-310 of the Civil Code (BGB), the validity of the remaining provisions of the agreement will not be affected. The parties shall replace the ineffective, invalid or unenforceable provision by a valid one that will be void in its legal and economic substance, of the ineffective or not feasible provision, and also in compliance with the overall purpose of the agreement. The same applies, if after the conclusion of the agreement, there are gaps or loopholes found in the agreement. The provision of § 139 BGB (severability) is totally excluded.
+
+If you need further information, kindly contact our Technical service Team:
+
+Novalnet AG
+Tel.: +49 89 9230683-19
+Fax: +49 89 9230683-11
+E-Mail: technic@novalnet.de
diff --git a/Logger/Handler/NovalnetDebug.php b/Logger/Handler/NovalnetDebug.php
new file mode 100755
index 0000000..6eca371
--- /dev/null
+++ b/Logger/Handler/NovalnetDebug.php
@@ -0,0 +1,37 @@
+request = $request;
+ $this->scopeConfig = $scopeConfig;
+ $this->novalnetConfig = $novalnetConfig;
+ }
+
+ /**
+ * Options getter (Active Payment methods)
+ *
+ * @return array
+ */
+ public function toOptionArray()
+ {
+ $methods = [];
+ $activePayment = false;
+ $storeId = (int) $this->request->getParam('store');
+ $websiteId = (int) $this->request->getParam('website');
+ $scope = \Magento\Store\Model\ScopeInterface::SCOPE_STORE;
+ $scopeValue = null;
+
+ if ($storeId) {
+ $scopeValue = $storeId;
+ }
+
+ if ($websiteId) {
+ $scope = \Magento\Store\Model\ScopeInterface::SCOPE_WEBSITE;
+ $scopeValue = $websiteId;
+ }
+
+ foreach ($this->novalnetConfig->getPaymentMethodCodes() as $paymentCode) {
+ $paymentActive = $this->scopeConfig->getValue('payment/' . $paymentCode . '/active', $scope, $scopeValue);
+
+ if ($paymentActive == true) {
+ $paymentTitle = $this->scopeConfig->getValue(
+ 'payment/' . $paymentCode . '/title',
+ $scope,
+ $scopeValue
+ );
+ $methods[$paymentCode] = ['value' => $paymentCode, 'label' => $paymentTitle];
+ $activePayment = true;
+ }
+ }
+
+ if (!$activePayment) {
+ $methods[$paymentCode] = ['value' => '', 'label' => __('No active payment method for this store')];
+ }
+
+ return $methods;
+ }
+}
diff --git a/Model/Adminhtml/Source/ApplepayButtonStyle.php b/Model/Adminhtml/Source/ApplepayButtonStyle.php
new file mode 100755
index 0000000..2fbbf74
--- /dev/null
+++ b/Model/Adminhtml/Source/ApplepayButtonStyle.php
@@ -0,0 +1,85 @@
+ 'plain',
+ 'label' => __('Default')
+ ],
+ [
+ 'value' => 'buy',
+ 'label' => __('Buy')
+ ],
+ [
+ 'value' => 'donate',
+ 'label' => __('Donate')
+ ],
+ [
+ 'value' => 'book',
+ 'label' => __('Book')
+ ],
+ [
+ 'value' => 'contribute',
+ 'label' => __('Contribute')
+ ],
+ [
+ 'value' => 'check-out',
+ 'label' => __('Check out')
+ ],
+ [
+ 'value' => 'order',
+ 'label' => __('Order')
+ ],
+ [
+ 'value' => 'subscribe',
+ 'label' => __('Subscribe')
+ ],
+ [
+ 'value' => 'tip',
+ 'label' => __('Tip')
+ ],
+ [
+ 'value' => 'rent',
+ 'label' => __('Rent')
+ ],
+ [
+ 'value' => 'reload',
+ 'label' => __('Reload')
+ ],
+ [
+ 'value' => 'support',
+ 'label' => __('Support')
+ ],
+ ];
+ }
+}
diff --git a/Model/Adminhtml/Source/ApplepayButtonTheme.php b/Model/Adminhtml/Source/ApplepayButtonTheme.php
new file mode 100755
index 0000000..9e16419
--- /dev/null
+++ b/Model/Adminhtml/Source/ApplepayButtonTheme.php
@@ -0,0 +1,49 @@
+ 'black',
+ 'label' => __('Dark')
+ ],
+ [
+ 'value' => 'white',
+ 'label' => __('Light')
+ ],
+ [
+ 'value' => 'white-outline',
+ 'label' => __('Light-Outline')
+ ],
+ ];
+ }
+}
diff --git a/Model/Adminhtml/Source/ApplepayEnabledPages.php b/Model/Adminhtml/Source/ApplepayEnabledPages.php
new file mode 100755
index 0000000..3a50e64
--- /dev/null
+++ b/Model/Adminhtml/Source/ApplepayEnabledPages.php
@@ -0,0 +1,53 @@
+ 'shopping_cart_page',
+ 'label' => __('Shopping cart page')
+ ],
+ [
+ 'value' => 'mini_cart_page',
+ 'label' => __('Mini cart page')
+ ],
+ [
+ 'value' => 'product_page',
+ 'label' => __('Product page')
+ ],
+ [
+ 'value' => 'guest_checkout_page',
+ 'label' => __('Guest checkout page')
+ ],
+ ];
+ }
+}
diff --git a/Model/Adminhtml/Source/CcCardTypes.php b/Model/Adminhtml/Source/CcCardTypes.php
new file mode 100755
index 0000000..1357951
--- /dev/null
+++ b/Model/Adminhtml/Source/CcCardTypes.php
@@ -0,0 +1,77 @@
+ 'VI',
+ 'label' => __('Visa')
+ ],
+ [
+ 'value' => 'MC',
+ 'label' => __('MasterCard')
+ ],
+ [
+ 'value' => 'AE',
+ 'label' => __('American Express')
+ ],
+ [
+ 'value' => 'MA',
+ 'label' => __('Maestro')
+ ],
+ [
+ 'value' => 'CI',
+ 'label' => __('Cartasi')
+ ],
+ [
+ 'value' => 'UP',
+ 'label' => __('Union Pay')
+ ],
+ [
+ 'value' => 'DC',
+ 'label' => __('Discover')
+ ],
+ [
+ 'value' => 'DI',
+ 'label' => __('Diners')
+ ],
+ [
+ 'value' => 'JCB',
+ 'label' => __('Jcb')
+ ],
+ [
+ 'value' => 'CB',
+ 'label' => __('Carte Bleue')
+ ],
+ ];
+ }
+}
diff --git a/Model/Adminhtml/Source/CustomerGroups.php b/Model/Adminhtml/Source/CustomerGroups.php
new file mode 100755
index 0000000..d57aee1
--- /dev/null
+++ b/Model/Adminhtml/Source/CustomerGroups.php
@@ -0,0 +1,46 @@
+customerGroupColl = $customerGroupColl;
+ }
+
+ /**
+ * Options getter (Customer Groups)
+ *
+ * @return array
+ */
+ public function toOptionArray()
+ {
+ return $this->customerGroupColl->toOptionArray();
+ }
+}
diff --git a/Model/Adminhtml/Source/GooglepayButtonTheme.php b/Model/Adminhtml/Source/GooglepayButtonTheme.php
new file mode 100755
index 0000000..8d23404
--- /dev/null
+++ b/Model/Adminhtml/Source/GooglepayButtonTheme.php
@@ -0,0 +1,46 @@
+ 'default',
+ 'label' => __('Default')
+ ],
+ [
+ 'value' => 'black',
+ 'label' => __('Black')
+ ],
+ [
+ 'value' => 'white',
+ 'label' => __('White')
+ ]
+ ];
+ }
+}
diff --git a/Model/Adminhtml/Source/GooglepayButtonType.php b/Model/Adminhtml/Source/GooglepayButtonType.php
new file mode 100755
index 0000000..7bdddc7
--- /dev/null
+++ b/Model/Adminhtml/Source/GooglepayButtonType.php
@@ -0,0 +1,66 @@
+ 'book',
+ 'label' => __('Book')
+ ],
+ [
+ 'value' => 'buy',
+ 'label' => __('Buy')
+ ],
+ [
+ 'value' => 'checkout',
+ 'label' => __('Checkout')
+ ],
+ [
+ 'value' => 'donate',
+ 'label' => __('Donate')
+ ],
+ [
+ 'value' => 'order',
+ 'label' => __('Order')
+ ],
+ [
+ 'value' => 'pay',
+ 'label' => __('Pay')
+ ],
+ [
+ 'value' => 'plain',
+ 'label' => __('Plain')
+ ],
+ [
+ 'value' => 'subscribe',
+ 'label' => __('Subscribe')
+ ]
+ ];
+ }
+}
diff --git a/Model/Adminhtml/Source/GooglepayEnabledPages.php b/Model/Adminhtml/Source/GooglepayEnabledPages.php
new file mode 100755
index 0000000..d96a9af
--- /dev/null
+++ b/Model/Adminhtml/Source/GooglepayEnabledPages.php
@@ -0,0 +1,53 @@
+ 'shopping_cart_page',
+ 'label' => __('Shopping cart page')
+ ],
+ [
+ 'value' => 'mini_cart_page',
+ 'label' => __('Mini cart page')
+ ],
+ [
+ 'value' => 'product_page',
+ 'label' => __('Product page')
+ ],
+ [
+ 'value' => 'guest_checkout_page',
+ 'label' => __('Guest checkout page')
+ ],
+ ];
+ }
+}
diff --git a/Model/Adminhtml/Source/InstalmentCycles.php b/Model/Adminhtml/Source/InstalmentCycles.php
new file mode 100755
index 0000000..090a3c1
--- /dev/null
+++ b/Model/Adminhtml/Source/InstalmentCycles.php
@@ -0,0 +1,51 @@
+ 2 . __(' cycles'),
+ 3 => 3 . __(' cycles'),
+ 4 => 4 . __(' cycles'),
+ 6 => 6 . __(' cycles'),
+ 8 => 8 . __(' cycles'),
+ 9 => 9 . __(' cycles'),
+ 10 => 10 . __(' cycles'),
+ 12 => 12 . __(' cycles'),
+ 15 => 15 . __(' cycles'),
+ 18 => 18 . __(' cycles'),
+ 24 => 24 . __(' cycles')
+ ];
+
+ foreach ($allCycles as $key => $value) {
+ $methods[$key] = ['value' => $key, 'label' => $value];
+ }
+
+ return $methods;
+ }
+}
diff --git a/Model/Adminhtml/Source/PaymentAction.php b/Model/Adminhtml/Source/PaymentAction.php
new file mode 100755
index 0000000..ab75690
--- /dev/null
+++ b/Model/Adminhtml/Source/PaymentAction.php
@@ -0,0 +1,44 @@
+ AbstractMethod::ACTION_AUTHORIZE,
+ 'label' => __('Authorize')
+ ],
+ [
+ 'value' => AbstractMethod::ACTION_AUTHORIZE_CAPTURE,
+ 'label' => __('Capture')
+ ]
+ ];
+ }
+}
diff --git a/Model/Adminhtml/Source/PaymentActionWithZeroAmount.php b/Model/Adminhtml/Source/PaymentActionWithZeroAmount.php
new file mode 100755
index 0000000..af13566
--- /dev/null
+++ b/Model/Adminhtml/Source/PaymentActionWithZeroAmount.php
@@ -0,0 +1,49 @@
+ AbstractMethod::ACTION_AUTHORIZE,
+ 'label' => __('Authorize')
+ ],
+ [
+ 'value' => AbstractMethod::ACTION_AUTHORIZE_CAPTURE,
+ 'label' => __('Capture')
+ ],
+ [
+ 'value' => NNConfig::ACTION_ZERO_AMOUNT_BOOKING,
+ 'label' => __('Authorize with zero amount')
+ ]
+ ];
+ }
+}
diff --git a/Model/Callback.php b/Model/Callback.php
new file mode 100755
index 0000000..4059c85
--- /dev/null
+++ b/Model/Callback.php
@@ -0,0 +1,63 @@
+_init(\Novalnet\Payment\Model\ResourceModel\Callback::class);
+ }
+
+ /**
+ * Load order callback status by order id
+ *
+ * @param mixed $orderId
+ * @return mixed
+ */
+ public function loadLogByOrderId($orderId)
+ {
+ $this->load($orderId, 'order_id');
+ return $this;
+ }
+}
diff --git a/Model/NNConfig.php b/Model/NNConfig.php
new file mode 100755
index 0000000..9e672f9
--- /dev/null
+++ b/Model/NNConfig.php
@@ -0,0 +1,324 @@
+ 'DIRECT_DEBIT_SEPA',
+ ConfigProvider::NOVALNET_CC => 'CREDITCARD',
+ ConfigProvider::NOVALNET_APPLEPAY => 'APPLEPAY',
+ ConfigProvider::NOVALNET_GOOGLEPAY => 'GOOGLEPAY',
+ ConfigProvider::NOVALNET_INVOICE => 'INVOICE',
+ ConfigProvider::NOVALNET_PREPAYMENT => 'PREPAYMENT',
+ ConfigProvider::NOVALNET_INVOICE_GUARANTEE => 'GUARANTEED_INVOICE',
+ ConfigProvider::NOVALNET_SEPA_GUARANTEE => 'GUARANTEED_DIRECT_DEBIT_SEPA',
+ ConfigProvider::NOVALNET_INVOICE_INSTALMENT => 'INSTALMENT_INVOICE',
+ ConfigProvider::NOVALNET_SEPA_INSTALMENT => 'INSTALMENT_DIRECT_DEBIT_SEPA',
+ ConfigProvider::NOVALNET_IDEAL => 'IDEAL',
+ ConfigProvider::NOVALNET_BANKTRANSFER => 'ONLINE_TRANSFER',
+ ConfigProvider::NOVALNET_ONLINEBANKTRANSFER => 'ONLINE_BANK_TRANSFER',
+ ConfigProvider::NOVALNET_GIROPAY => 'GIROPAY',
+ ConfigProvider::NOVALNET_CASHPAYMENT => 'CASHPAYMENT',
+ ConfigProvider::NOVALNET_PRZELEWY => 'PRZELEWY24',
+ ConfigProvider::NOVALNET_EPS => 'EPS',
+ ConfigProvider::NOVALNET_PAYPAL => 'PAYPAL',
+ ConfigProvider::NOVALNET_POSTFINANCE_CARD => 'POSTFINANCE_CARD',
+ ConfigProvider::NOVALNET_POSTFINANCE => 'POSTFINANCE',
+ ConfigProvider::NOVALNET_BANCONTACT => 'BANCONTACT',
+ ConfigProvider::NOVALNET_MULTIBANCO => 'MULTIBANCO',
+ ConfigProvider::NOVALNET_ALIPAY => 'ALIPAY',
+ ConfigProvider::NOVALNET_WECHATPAY => 'WECHATPAY',
+ ConfigProvider::NOVALNET_TRUSTLY => 'TRUSTLY',
+ ConfigProvider::NOVALNET_BLIK => 'BLIK'
+ ];
+
+ /**
+ * @var array
+ */
+ public $oneClickPayments = [
+ ConfigProvider::NOVALNET_CC,
+ ConfigProvider::NOVALNET_SEPA,
+ ConfigProvider::NOVALNET_SEPA_GUARANTEE,
+ ConfigProvider::NOVALNET_SEPA_INSTALMENT,
+ ConfigProvider::NOVALNET_PAYPAL,
+ ];
+
+ /**
+ * @var array
+ */
+ protected $zeroAmountPayments = [
+ ConfigProvider::NOVALNET_CC,
+ ConfigProvider::NOVALNET_SEPA
+ ];
+
+ /**
+ * @var array
+ */
+ protected $redirectPayments = [
+ ConfigProvider::NOVALNET_PAYPAL,
+ ConfigProvider::NOVALNET_BANKTRANSFER,
+ ConfigProvider::NOVALNET_ONLINEBANKTRANSFER,
+ ConfigProvider::NOVALNET_IDEAL,
+ ConfigProvider::NOVALNET_BANCONTACT,
+ ConfigProvider::NOVALNET_EPS,
+ ConfigProvider::NOVALNET_GIROPAY,
+ ConfigProvider::NOVALNET_PRZELEWY,
+ ConfigProvider::NOVALNET_POSTFINANCE_CARD,
+ ConfigProvider::NOVALNET_POSTFINANCE,
+ ConfigProvider::NOVALNET_ALIPAY,
+ ConfigProvider::NOVALNET_WECHATPAY,
+ ConfigProvider::NOVALNET_TRUSTLY,
+ ConfigProvider::NOVALNET_BLIK,
+ ];
+
+ /**
+ * @var array
+ */
+ public $subscriptionSupportedPayments = [
+ ConfigProvider::NOVALNET_SEPA,
+ ConfigProvider::NOVALNET_CC,
+ ConfigProvider::NOVALNET_INVOICE,
+ ConfigProvider::NOVALNET_PREPAYMENT,
+ ConfigProvider::NOVALNET_INVOICE_GUARANTEE,
+ ConfigProvider::NOVALNET_SEPA_GUARANTEE,
+ ConfigProvider::NOVALNET_PAYPAL
+ ];
+
+ /**
+ * @var array
+ */
+ protected $allowedCountry = [ 'AT', 'DE', 'CH' ];
+
+ /**
+ * @var \Magento\Framework\App\Config\ScopeConfigInterface
+ */
+ protected $scopeConfig;
+
+ /**
+ * @param \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig
+ */
+ public function __construct(
+ \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig
+ ) {
+ $this->scopeConfig = $scopeConfig;
+ }
+
+ /**
+ * Get Payment methods
+ *
+ * @return array
+ */
+ public function getPaymentMethodCodes()
+ {
+ return array_keys($this->paymentTypes);
+ }
+
+ /**
+ * Get Payment Type by method code
+ *
+ * @param string $code
+ * @return string
+ */
+ public function getPaymentType($code)
+ {
+ return $this->paymentTypes[$code];
+ }
+
+ /**
+ * Get Payment method code by Type
+ *
+ * @param string $paymentType
+ * @return mixed
+ */
+ public function getPaymentCodeByType($paymentType)
+ {
+ return array_search($paymentType, $this->paymentTypes);
+ }
+
+ /**
+ * Check is one click Payment method by code
+ *
+ * @param string $code
+ * @return bool
+ */
+ public function isOneClickPayment($code)
+ {
+ return (bool) (in_array($code, $this->oneClickPayments));
+ }
+
+ /**
+ * Check is zero amount booking supported
+ *
+ * @param string $code
+ * @return bool
+ */
+ public function isZeroAmountBookingSupported($code)
+ {
+ return (bool) (in_array($code, $this->zeroAmountPayments));
+ }
+
+ /**
+ * Check is one Subscription Supported Payment method by code
+ *
+ * @param string $code
+ * @return bool
+ */
+ public function isSubscriptionSupported($code)
+ {
+ return (bool) (in_array($code, $this->subscriptionSupportedPayments));
+ }
+
+ /**
+ * Check is redirect Payment method by code
+ *
+ * @param string $code
+ * @return bool
+ */
+ public function isRedirectPayment($code)
+ {
+ return (bool) (in_array($code, $this->redirectPayments));
+ }
+
+ /**
+ * Check Allowed country
+ *
+ * @param string $county
+ * @param bool $b2b
+ * @return bool
+ */
+ public function isAllowedCountry($county, $b2b = false)
+ {
+ if ($b2b) {
+ $allowedCountryB2B = $this->scopeConfig->getValue(
+ 'general/country/eu_countries',
+ \Magento\Store\Model\ScopeInterface::SCOPE_STORE
+ );
+ $allowedCountryB2B = (!empty($allowedCountryB2B)) ? explode(",", $allowedCountryB2B) : [];
+ array_push($allowedCountryB2B, 'CH');
+ }
+
+ return (bool) (($b2b && in_array($county, $allowedCountryB2B)) || in_array($county, $this->allowedCountry));
+ }
+
+ /**
+ * Get Novalnet Global Configuration values
+ *
+ * @param string $field
+ * @param int|null $storeId
+ * @return string
+ */
+ public function getGlobalConfig($field, $storeId = null)
+ {
+ return $this->scopeConfig->getValue(
+ 'payment/novalnet/' . $field,
+ \Magento\Store\Model\ScopeInterface::SCOPE_STORE,
+ $storeId
+ );
+ }
+
+ /**
+ * Get Novalnet Global on-hold status
+ *
+ * @param int|null $storeId
+ * @return string
+ */
+ public function getGlobalOnholdStatus($storeId = null)
+ {
+ return $this->scopeConfig->getValue(
+ 'novalnet_global/novalnet/onhold_status',
+ \Magento\Store\Model\ScopeInterface::SCOPE_STORE,
+ $storeId
+ );
+ }
+
+ /**
+ * Get Novalnet Global Merchant Script Configuration values
+ *
+ * @param string $field
+ * @param int $storeId
+ * @return string
+ */
+ public function getMerchantScriptConfig($field, $storeId = null)
+ {
+ return $this->scopeConfig->getValue(
+ 'payment/merchant_script/' . $field,
+ \Magento\Store\Model\ScopeInterface::SCOPE_STORE,
+ $storeId
+ );
+ }
+
+ /**
+ * Get Novalnet Payment Configuration values
+ *
+ * @param string $code
+ * @param string $field
+ * @param int $storeId
+ * @return string
+ */
+ public function getPaymentConfig($code, $field, $storeId = null)
+ {
+ return $this->scopeConfig->getValue(
+ 'payment/' . $code . '/' . $field,
+ \Magento\Store\Model\ScopeInterface::SCOPE_STORE,
+ $storeId
+ );
+ }
+
+ /**
+ * Get Novalnet Payment Test Mode
+ *
+ * @param string $paymentMethodCode
+ * @param int $storeId
+ * @return int
+ */
+ public function getTestMode($paymentMethodCode, $storeId = null)
+ {
+ if ($paymentMethodCode) {
+ $livePaymentMethods = $this->scopeConfig->getValue(
+ 'payment/novalnet/live_mode',
+ \Magento\Store\Model\ScopeInterface::SCOPE_STORE,
+ $storeId
+ );
+
+ $livePaymentMethods = (!empty($livePaymentMethods)) ? explode(',', $livePaymentMethods) : [];
+
+ return (in_array($paymentMethodCode, $livePaymentMethods) === false) ? 1 : 0;
+ }
+
+ return 1;
+ }
+}
diff --git a/Model/NNRepository.php b/Model/NNRepository.php
new file mode 100755
index 0000000..a1a4fd8
--- /dev/null
+++ b/Model/NNRepository.php
@@ -0,0 +1,2545 @@
+ [
+ 'type',
+ 'checksum',
+ 'tid'
+ ],
+ 'merchant' => [
+ 'vendor',
+ 'project'
+ ],
+ 'transaction' => [
+ 'tid',
+ 'payment_type',
+ 'status',
+ ],
+ 'result' => [
+ 'status'
+ ],
+ ];
+
+ /**
+ * @var mixed
+ */
+ private $response;
+
+ /**
+ * @var mixed
+ */
+ private $order;
+
+ /**
+ * @var array
+ */
+ private $eventData;
+
+ /**
+ * @var string
+ */
+ private $eventType;
+
+ /**
+ * @var int
+ */
+ private $eventTid;
+
+ /**
+ * @var int
+ */
+ private $parentTid;
+
+ /**
+ * @var \Magento\Sales\Model\Order
+ */
+ private $salesOrderModel;
+
+ /**
+ * @var \Magento\Framework\UrlInterface
+ */
+ private $urlInterface;
+
+ /**
+ * @var \Magento\Framework\App\RequestInterface
+ */
+ private $requestInterface;
+
+ /**
+ * @var \Magento\Sales\Model\Order\Payment\Transaction
+ */
+ private $transactionModel;
+
+ /**
+ * @var \Magento\Framework\Pricing\Helper\Data
+ */
+ private $pricingHelper;
+
+ /**
+ * @var \Magento\Framework\Stdlib\DateTime\DateTime
+ */
+ private $dateTime;
+
+ /**
+ * @var \Magento\Store\Model\StoreManagerInterface
+ */
+ private $storeManager;
+
+ /**
+ * @var \Magento\Framework\Stdlib\DateTime\TimezoneInterface
+ */
+ private $timeZone;
+
+ /**
+ * @var \Magento\Framework\App\Config\ScopeConfigInterface
+ */
+ private $scopeConfig;
+
+ /**
+ * @var \Magento\Framework\Mail\Template\TransportBuilder
+ */
+ private $transportBuilder;
+
+ /**
+ * @var \Magento\Framework\Translate\Inline\StateInterface
+ */
+ private $inlineTranslation;
+
+ /**
+ * @var \Magento\Sales\Model\Order\Email\Sender\OrderSender
+ */
+ private $orderEmailSender;
+
+ /**
+ * @var \Magento\Sales\Model\Order\Address\Renderer
+ */
+ private $salesOrderAddressRenderer;
+
+ /**
+ * @var \Magento\Payment\Helper\Data
+ */
+ private $paymentHelper;
+
+ /**
+ * @var \Magento\Framework\HTTP\Client\Curl
+ */
+ private $clientFactory;
+
+ /**
+ * @var \Magento\Sales\Model\Order\CreditmemoFactory
+ */
+ private $creditMemoFacory;
+
+ /**
+ * @var \Magento\Sales\Model\Service\CreditmemoService
+ */
+ private $creditmemoService;
+
+ /**
+ * @var \Novalnet\Payment\Model\Callback
+ */
+ private $callbackModel;
+
+ /**
+ * @var \Novalnet\Payment\Model\TransactionStatus
+ */
+ private $transactionStatusModel;
+
+ /**
+ * @var \Novalnet\Payment\Helper\Request
+ */
+ private $novalnetRequestHelper;
+
+ /**
+ * @var \Novalnet\Payment\Model\NNConfig
+ */
+ private $novalnetConfig;
+
+ /**
+ * @var \Magento\Quote\Model\QuoteIdMaskFactory
+ */
+ private $quoteIdMaskFactory;
+
+ /**
+ * @var \Magento\Checkout\Model\Session
+ */
+ private $checkoutSession;
+
+ /**
+ * @var \Magento\Customer\Model\Session
+ */
+ private $customerSession;
+
+ /**
+ * @var mixed
+ */
+ private $additionalMessage;
+
+ /**
+ * @var mixed
+ */
+ private $callbackMessage;
+
+ /**
+ * @var \Magento\Framework\Json\Helper\Data
+ */
+ private $jsonHelper;
+
+ /**
+ * @var \Magento\Framework\Serialize\Serializer\Serialize
+ */
+ private $serializer;
+
+ /**
+ * @var \Novalnet\Payment\Logger\NovalnetLogger
+ */
+ private $novalnetLogger;
+
+ /**
+ * @var \Magento\Sales\Model\Order\Email\Sender\InvoiceSender
+ */
+ private $invoiceSender;
+
+ /**
+ * @var \Magento\Sales\Controller\Adminhtml\Order\CreditmemoLoader
+ */
+ private $creditmemoLoader;
+
+ /**
+ * @var \Magento\Framework\Event\ManagerInterface
+ */
+ private $eventManager;
+
+ /**
+ * @var \Magento\Checkout\Model\Cart
+ */
+ private $cart;
+
+ /**
+ * @var \Magento\Checkout\Helper\Data
+ */
+ private $checkoutHelper;
+
+ /**
+ * @var \Magento\Quote\Api\Data\EstimateAddressInterfaceFactory
+ */
+ private $estimatedAddressFactory;
+
+ /**
+ * @var \Magento\Quote\Api\ShippingMethodManagementInterface
+ */
+ private $shippingMethodManager;
+
+ /**
+ * @var \Magento\Quote\Api\CartManagementInterface
+ */
+ private $quoteManagement;
+
+ /**
+ * @var \Magento\Catalog\Api\ProductRepositoryInterface
+ */
+ private $productRepository;
+
+ /**
+ * @var \Magento\Framework\Pricing\PriceCurrencyInterface
+ */
+ private $priceCurrency;
+
+ /**
+ * @var \Magento\Tax\Helper\Data
+ */
+ private $taxHelper;
+
+ /**
+ * @var \Magento\Directory\Model\CountryFactory
+ */
+ private $countryFactory;
+
+ /**
+ * @var \Magento\Catalog\Model\ProductFactory
+ */
+ private $productFactory;
+
+ /**
+ * @var \Magento\Tax\Api\TaxCalculationInterface
+ */
+ private $taxCalculation;
+
+ /**
+ * @var \Zend\Uri\Uri
+ */
+ private $zendUri;
+
+ /**
+ * @var \Magento\Directory\Model\Currency
+ */
+ private $currencyModel;
+
+ /**
+ * @var string
+ */
+ private $currentTime;
+
+ /**
+ * @var mixed
+ */
+ private $orderNo;
+
+ /**
+ * @var mixed
+ */
+ private $testMode;
+
+ /**
+ * @var mixed
+ */
+ private $emailBody;
+
+ /**
+ * @var mixed
+ */
+ private $storeId;
+
+ /**
+ * @var string
+ */
+ private $paymentAccessKey;
+
+ /**
+ * @var mixed
+ */
+ private $payment;
+
+ /**
+ * @var string
+ */
+ private $code;
+
+ /**
+ * @var mixed
+ */
+ private $paymentTxnId;
+
+ /**
+ * @var string
+ */
+ private $currency;
+
+ /**
+ * @var string
+ */
+ private $emailFromAddr;
+
+ /**
+ * @var string
+ */
+ private $emailFromName;
+
+ /**
+ * @var string
+ */
+ private $emailToName;
+
+ /**
+ * @var string
+ */
+ private $emailToAddr;
+
+ /**
+ * @var string
+ */
+ private $emailSubject;
+
+ /**
+ * @var string
+ */
+ private $storeFrontendName;
+
+ /**
+ * @param \Magento\Sales\Model\Order $salesOrderModel
+ * @param \Magento\Framework\UrlInterface $urlInterface
+ * @param \Magento\Framework\App\RequestInterface $requestInterface
+ * @param \Magento\Sales\Model\Order\Payment\Transaction $transactionModel
+ * @param \Magento\Framework\Pricing\Helper\Data $pricingHelper
+ * @param \Magento\Framework\Stdlib\DateTime\DateTime $dateTime
+ * @param \Magento\Store\Model\StoreManagerInterface $storeManager
+ * @param \Magento\Quote\Model\QuoteIdMaskFactory $quoteIdMaskFactory
+ * @param \Magento\Framework\Stdlib\DateTime\TimezoneInterface $timeZone
+ * @param \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig
+ * @param \Magento\Framework\Mail\Template\TransportBuilder $transportBuilder
+ * @param \Magento\Framework\Translate\Inline\StateInterface $inlineTranslation
+ * @param \Magento\Sales\Model\Order\Email\Sender\OrderSender $orderEmailSender
+ * @param \Magento\Sales\Model\Order\Address\Renderer $salesOrderAddressRenderer
+ * @param \Magento\Payment\Helper\Data $paymentHelper
+ * @param \Magento\Checkout\Model\Session $checkoutSession
+ * @param \Magento\Customer\Model\Session $customerSession
+ * @param \Magento\Framework\HTTP\Client\Curl $clientFactory
+ * @param \Magento\Sales\Model\Order\CreditmemoFactory $creditMemoFacory
+ * @param \Magento\Sales\Model\Service\CreditmemoService $creditmemoService
+ * @param \Novalnet\Payment\Model\Callback $callbackModel
+ * @param \Novalnet\Payment\Model\TransactionStatus $transactionStatusModel
+ * @param \Novalnet\Payment\Helper\Request $novalnetRequestHelper
+ * @param \Magento\Framework\Json\Helper\Data $jsonHelper
+ * @param \Magento\Framework\Serialize\Serializer\Serialize $serializer
+ * @param \Novalnet\Payment\Model\NNConfig $novalnetConfig
+ * @param \Novalnet\Payment\Logger\NovalnetLogger $novalnetLogger
+ * @param \Magento\Sales\Model\Order\Email\Sender\InvoiceSender $invoiceSender
+ * @param \Magento\Sales\Controller\Adminhtml\Order\CreditmemoLoader $creditmemoLoader
+ * @param \Magento\Framework\Event\ManagerInterface $eventManager
+ * @param \Magento\Checkout\Model\Cart $cart
+ * @param \Magento\Checkout\Helper\Data $checkoutHelper
+ * @param \Magento\Quote\Api\Data\EstimateAddressInterfaceFactory $estimatedAddressFactory
+ * @param \Magento\Quote\Api\ShippingMethodManagementInterface $shippingMethodManager
+ * @param \Magento\Quote\Api\CartManagementInterface $quoteManagement
+ * @param \Magento\Catalog\Api\ProductRepositoryInterface $productRepository
+ * @param \Magento\Framework\Pricing\PriceCurrencyInterface $priceCurrency
+ * @param \Magento\Tax\Helper\Data $taxHelper
+ * @param \Magento\Directory\Model\CountryFactory $countryFactory
+ * @param \Magento\Catalog\Model\ProductFactory $productFactory
+ * @param \Magento\Tax\Api\TaxCalculationInterface $taxCalculation
+ * @param \Zend\Uri\Uri $zendUri
+ * @param \Magento\Directory\Model\Currency $currencyModel
+ */
+ public function __construct(
+ Order $salesOrderModel,
+ \Magento\Framework\UrlInterface $urlInterface,
+ \Magento\Framework\App\RequestInterface $requestInterface,
+ \Magento\Sales\Model\Order\Payment\Transaction $transactionModel,
+ \Magento\Framework\Pricing\Helper\Data $pricingHelper,
+ \Magento\Framework\Stdlib\DateTime\DateTime $dateTime,
+ \Magento\Store\Model\StoreManagerInterface $storeManager,
+ \Magento\Quote\Model\QuoteIdMaskFactory $quoteIdMaskFactory,
+ \Magento\Framework\Stdlib\DateTime\TimezoneInterface $timeZone,
+ \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig,
+ \Magento\Framework\Mail\Template\TransportBuilder $transportBuilder,
+ \Magento\Framework\Translate\Inline\StateInterface $inlineTranslation,
+ \Magento\Sales\Model\Order\Email\Sender\OrderSender $orderEmailSender,
+ \Magento\Sales\Model\Order\Address\Renderer $salesOrderAddressRenderer,
+ \Magento\Payment\Helper\Data $paymentHelper,
+ \Magento\Checkout\Model\Session $checkoutSession,
+ \Magento\Customer\Model\Session $customerSession,
+ \Magento\Framework\HTTP\Client\Curl $clientFactory,
+ \Magento\Sales\Model\Order\CreditmemoFactory $creditMemoFacory,
+ \Magento\Sales\Model\Service\CreditmemoService $creditmemoService,
+ \Novalnet\Payment\Model\Callback $callbackModel,
+ \Novalnet\Payment\Model\TransactionStatus $transactionStatusModel,
+ \Novalnet\Payment\Helper\Request $novalnetRequestHelper,
+ \Magento\Framework\Json\Helper\Data $jsonHelper,
+ \Magento\Framework\Serialize\Serializer\Serialize $serializer,
+ \Novalnet\Payment\Model\NNConfig $novalnetConfig,
+ \Novalnet\Payment\Logger\NovalnetLogger $novalnetLogger,
+ \Magento\Sales\Model\Order\Email\Sender\InvoiceSender $invoiceSender,
+ \Magento\Sales\Controller\Adminhtml\Order\CreditmemoLoader $creditmemoLoader,
+ \Magento\Framework\Event\ManagerInterface $eventManager,
+ \Magento\Checkout\Model\Cart $cart,
+ \Magento\Checkout\Helper\Data $checkoutHelper,
+ \Magento\Quote\Api\Data\EstimateAddressInterfaceFactory $estimatedAddressFactory,
+ \Magento\Quote\Api\ShippingMethodManagementInterface $shippingMethodManager,
+ \Magento\Quote\Api\CartManagementInterface $quoteManagement,
+ \Magento\Catalog\Api\ProductRepositoryInterface $productRepository,
+ \Magento\Framework\Pricing\PriceCurrencyInterface $priceCurrency,
+ \Magento\Tax\Helper\Data $taxHelper,
+ \Magento\Directory\Model\CountryFactory $countryFactory,
+ \Magento\Catalog\Model\ProductFactory $productFactory,
+ \Magento\Tax\Api\TaxCalculationInterface $taxCalculation,
+ \Zend\Uri\Uri $zendUri,
+ \Magento\Directory\Model\Currency $currencyModel
+ ) {
+ $this->salesOrderModel = $salesOrderModel;
+ $this->urlInterface = $urlInterface;
+ $this->requestInterface = $requestInterface;
+ $this->transactionModel = $transactionModel;
+ $this->pricingHelper = $pricingHelper;
+ $this->dateTime = $dateTime;
+ $this->storeManager = $storeManager;
+ $this->quoteIdMaskFactory = $quoteIdMaskFactory;
+ $this->timeZone = $timeZone;
+ $this->scopeConfig = $scopeConfig;
+ $this->transportBuilder = $transportBuilder;
+ $this->inlineTranslation = $inlineTranslation;
+ $this->orderEmailSender = $orderEmailSender;
+ $this->paymentHelper = $paymentHelper;
+ $this->salesOrderAddressRenderer = $salesOrderAddressRenderer;
+ $this->checkoutSession = $checkoutSession;
+ $this->customerSession = $customerSession;
+ $this->clientFactory = $clientFactory;
+ $this->creditMemoFacory = $creditMemoFacory;
+ $this->creditmemoService = $creditmemoService;
+ $this->callbackModel = $callbackModel;
+ $this->transactionStatusModel = $transactionStatusModel;
+ $this->novalnetRequestHelper = $novalnetRequestHelper;
+ $this->jsonHelper = $jsonHelper;
+ $this->serializer = $serializer;
+ $this->novalnetConfig = $novalnetConfig;
+ $this->novalnetLogger = $novalnetLogger;
+ $this->invoiceSender = $invoiceSender;
+ $this->creditmemoLoader = $creditmemoLoader;
+ $this->eventManager = $eventManager;
+ $this->cart = $cart;
+ $this->checkoutHelper = $checkoutHelper;
+ $this->estimatedAddressFactory = $estimatedAddressFactory;
+ $this->shippingMethodManager = $shippingMethodManager;
+ $this->quoteManagement = $quoteManagement;
+ $this->productRepository = $productRepository;
+ $this->priceCurrency = $priceCurrency;
+ $this->taxHelper = $taxHelper;
+ $this->countryFactory = $countryFactory;
+ $this->productFactory = $productFactory;
+ $this->taxCalculation = $taxCalculation;
+ $this->zendUri = $zendUri;
+ $this->currencyModel = $currencyModel;
+ }
+
+ /**
+ * Novalnet product activation key auto config
+ *
+ * @api
+ * @param string $signature
+ * @param string $payment_access_key
+ * @return string
+ */
+ public function activateProductKey($signature, $payment_access_key)
+ {
+ $data['merchant'] = ['signature' => $signature];
+ $data['custom'] = ['lang' => $this->novalnetRequestHelper->getDefaultLanguage()];
+ $this->clientFactory->setHeaders(
+ $this->novalnetRequestHelper->getRequestHeaders($payment_access_key)
+ );
+ $this->clientFactory->post(NNConfig::NOVALNET_MERCHANT_DETAIL_URL, $this->jsonHelper->jsonEncode($data));
+ $response = (!empty($this->clientFactory->getBody())) ? json_decode($this->clientFactory->getBody(), true) : [];
+
+ return $this->clientFactory->getBody();
+ }
+
+ /**
+ * Novalnet Webhook URL configuration
+ *
+ * @api
+ * @param string $signature
+ * @param string $payment_access_key
+ * @return string
+ */
+ public function configWebhookUrl($signature, $payment_access_key)
+ {
+ $webhook_url = $this->requestInterface->getParam('webhookurl');
+ if (filter_var($webhook_url, FILTER_VALIDATE_URL) === false) {
+ $data['result'] = ['status' => 'failure', 'status_text' => __('Please enter valid URL')];
+ return $this->jsonHelper->jsonEncode($data);
+ }
+ $data['merchant'] = ['signature' => $signature];
+ $data['custom'] = ['lang' => $this->novalnetRequestHelper->getDefaultLanguage()];
+ $data['webhook'] = ['url' => $webhook_url];
+ $this->clientFactory->setHeaders(
+ $this->novalnetRequestHelper->getRequestHeaders($payment_access_key)
+ );
+ $this->clientFactory->post(NNConfig::NOVALNET_WEBHOOK_CONFIG_URL, $this->jsonHelper->jsonEncode($data));
+ $response = (!empty($this->clientFactory->getBody())) ? json_decode($this->clientFactory->getBody(), true) : [];
+
+ return $this->clientFactory->getBody();
+ }
+
+ /**
+ * Get redirect URL
+ *
+ * @api
+ * @param string[] $data
+ * @return string
+ */
+ public function getRedirectURL($data)
+ {
+ $quoteId = $data['quote_id'];
+ $this->novalnetLogger->notice('Redirect from checkout to redirect_url webapi');
+ if (!$this->customerSession->isLoggedIn()) {
+ $quoteMaskData = $this->quoteIdMaskFactory->create()->load($quoteId, 'masked_id');
+ $quoteId = $quoteMaskData->getQuoteId();
+ }
+
+ $this->novalnetLogger->notice('quote_id retrieved ' . $quoteId);
+
+ // Loads session quote from checkout
+ $sessionQuoteId = $this->checkoutSession->getLastQuoteId();
+ $orderId = $this->checkoutSession->getLastOrderId();
+
+ $this->novalnetLogger->notice('order_id retrieved ' . $orderId);
+
+ if ($quoteId != $sessionQuoteId) {
+ $orderId = $this->salesOrderModel->getCollection()->addFieldToFilter('quote_id', $quoteId)
+ ->getFirstItem()->getId();
+ }
+
+ $order = $this->salesOrderModel->load($orderId);
+
+ $this->novalnetLogger->notice('Order loaded successfully ' . $order->getIncrementId());
+ $payment = $order->getPayment();
+ $additionalData = (!empty($payment->getAdditionalData())) ? json_decode($payment->getAdditionalData(), true) : [];
+
+ if (!empty($additionalData['NnRedirectURL'])) {
+ // set the order status to pending_payment before redirect to novalnet
+ $order->setState(Order::STATE_PENDING_PAYMENT)
+ ->setStatus(Order::STATE_PENDING_PAYMENT)
+ ->save();
+ $order->addStatusHistoryComment(__('Customer was redirected to Novalnet'))
+ ->save();
+
+ $this->novalnetLogger->notice('Order status and comments updated successfully');
+
+ return $additionalData['NnRedirectURL'];
+ } else {
+ return $this->urlInterface->getUrl('checkout/cart');
+ }
+ }
+
+ /**
+ * Remove Novalnet payment token
+ *
+ * @api
+ * @param int $transactionRowId
+ * @return bool
+ */
+ public function removeToken($transactionRowId)
+ {
+ $transactionStatus = $this->transactionStatusModel->load($transactionRowId);
+ if ($transactionStatus->getTokenInfo()) {
+ $transactionStatus->setTokenInfo(null)->save();
+ return true;
+ }
+
+ return false;
+ }
+
+ /**
+ * Get Instalment payment options
+ *
+ * @api
+ * @param string $code
+ * @param float $total
+ * @return string
+ */
+ public function getInstalmentOptions($code, $total)
+ {
+ $instalmentCycles = $this->novalnetConfig->getPaymentConfig($code, 'instalment_cycles');
+ $instalmentCycles = (!empty($instalmentCycles)) ? explode(',', $instalmentCycles) : [];
+ $storeId = $this->storeManager->getStore()->getId();
+ $allCycles = [];
+ $i =1;
+ foreach ($instalmentCycles as $cycle) {
+ if (($total/$cycle) >= 9.99) {
+ $formattedAmount = strip_tags($this->novalnetRequestHelper->getAmountWithSymbol(sprintf('%0.2f', $total / $cycle), $storeId));
+ $allCycles[$i] = ['instalment_key' => $cycle.' X ' . $formattedAmount . '(' .(__(' per month'). ')'), 'instalment_value' => $cycle];
+ $i++;
+ }
+ }
+ return $this->jsonHelper->jsonEncode($allCycles);
+ }
+
+ /**
+ * Get Instalment payment cycle details
+ *
+ * @api
+ * @param float $amount
+ * @param int $period
+ * @return string
+ */
+ public function getInstalmentCycleAmount($amount, $period)
+ {
+ $cycleAmount = sprintf('%0.2f', $amount / $period);
+ $splitedAmount = $cycleAmount * ( $period - 1 );
+ $lastCycle = (sprintf('%0.2f', $amount - $splitedAmount) * 100)/100;
+ $data = ['cycle_amount' => $cycleAmount, 'last_cycle' => $lastCycle, 'amount' => $amount];
+ return $this->jsonHelper->jsonEncode($data);
+ }
+
+ /**
+ * Novalnet payment callback
+ *
+ * @api
+ * @return string
+ */
+ public function callback()
+ {
+ if ($this->assignGlobalParams()) {
+ if ($this->eventType == 'PAYMENT') {
+ if (empty($this->paymentTxnId)) {
+ $this->handleCommunicationFailure();
+ } else {
+ $this->displayMessage('Novalnet Callback executed. The Transaction ID already existed');
+ }
+ } elseif ($this->eventType == 'TRANSACTION_CAPTURE') {
+ $this->transactionCapture();
+ } elseif ($this->eventType == 'TRANSACTION_CANCEL') {
+ $this->transactionCancellation();
+ } elseif ($this->eventType == 'TRANSACTION_REFUND') {
+ $this->refundProcess();
+ } elseif ($this->eventType == 'TRANSACTION_UPDATE') {
+ $this->transactionUpdate();
+ } elseif ($this->eventType == 'CREDIT') {
+ $this->creditProcess();
+ } elseif ($this->eventType == 'INSTALMENT') {
+ $this->instalmentProcess();
+ } elseif ($this->eventType == 'INSTALMENT_CANCEL') {
+ $this->instalmentCancelProcess();
+ } elseif (in_array($this->eventType, ['CHARGEBACK', 'RETURN_DEBIT', 'REVERSAL'])) {
+ $this->chargebackProcess();
+ } elseif (in_array($this->eventType, ['PAYMENT_REMINDER_1', 'PAYMENT_REMINDER_2'])) {
+ $this->paymentReminderProcess();
+ } elseif ($this->eventType == 'SUBMISSION_TO_COLLECTION_AGENCY') {
+ $this->collectionProcess();
+ } else {
+ $this->displayMessage("The webhook notification has been received for the unhandled EVENT type($this->eventType)");
+ }
+ }
+
+ return $this->additionalMessage . $this->callbackMessage;
+ }
+
+ /**
+ * Assign Global params for callback process
+ *
+ * @return boolean
+ */
+ private function assignGlobalParams()
+ {
+ try {
+ $this->eventData = (!empty($this->requestInterface->getContent())) ? json_decode($this->requestInterface->getContent(), true) : [];
+ } catch (\Exception $e) {
+ $this->novalnetLogger->error("Received data is not in the JSON format $e");
+ $this->displayMessage("Received data is not in the JSON format $e");
+ }
+
+ // Get callback setting params (from shop admin)
+ $this->testMode = $this->novalnetConfig->getMerchantScriptConfig('test_mode');
+ $this->emailBody = '';
+
+ // Check whether the IP address is authorized
+ if (!$this->checkIP()) {
+ return false;
+ }
+
+ if (empty($this->eventData)) {
+ $this->displayMessage('No params passed over!');
+ return false;
+ }
+
+ $this->response = new DataObject();
+ $this->response->setData($this->eventData); // Assign response params to object data
+
+ // Set Event data
+ $this->eventType = $this->response->getData('event/type');
+ $this->parentTid = !empty($this->response->getData('event/parent_tid'))
+ ? $this->response->getData('event/parent_tid') : $this->response->getData('event/tid');
+ $this->eventTid = $this->response->getData('event/tid');
+ $this->orderNo = $this->response->getData('transaction/order_no');
+ $this->order = $this->getOrder();
+ if ($this->order === false) {
+ return false;
+ }
+ $this->currentTime = $this->dateTime->date('d-m-Y H:i:s');
+ $this->storeId = $this->order->getStoreId(); // Get order store id
+
+ $this->paymentAccessKey = $this->novalnetConfig->getGlobalConfig('payment_access_key', $this->storeId);
+ $this->payment = $this->order->getPayment(); // Get payment object
+ $this->code = $this->payment->getMethodInstance()->getCode(); // Get payment method code
+ $this->paymentTxnId = $this->payment->getLastTransId(); // Get payment last transaction id
+ $this->currency = $this->order->getOrderCurrencyCode(); // Get order currency
+ if (!$this->validateEventData()) {
+ return false;
+ }
+
+ return true;
+ }
+
+ /**
+ * Check whether the ip address is authorised
+ *
+ * @return boolean
+ */
+ private function checkIP()
+ {
+ // Authenticating the server request based on IP.
+ $requestReceivedIp = $this->novalnetRequestHelper->getRequestIp();
+ $novalnetHostIp = gethostbyname('pay-nn.de');
+
+ if (!empty($novalnetHostIp) && !empty($requestReceivedIp)) {
+ if ($novalnetHostIp !== $requestReceivedIp && !$this->testMode) {
+ $this->displayMessage(
+ __('Unauthorised access from the IP [ %1 ]', $requestReceivedIp)
+ );
+
+ return false;
+ }
+ } else {
+ $this->displayMessage('Unauthorised access from the IP');
+ return false;
+ }
+
+ return true;
+ }
+
+ /**
+ * Validate required parameter from the server request
+ *
+ * @return bool
+ */
+ private function validateEventData()
+ {
+ foreach ($this->mandatoryParams as $category => $parameters) {
+ if (empty($this->response->getData($category))) {
+ // Could be a possible manipulation in the notification data
+ $this->displayMessage('Required parameter category(' . $category . ') not received');
+
+ return false;
+ } else {
+ foreach ($parameters as $parameter) {
+ if (empty($this->response->getData($category .'/'. $parameter))) {
+ // Could be a possible manipulation in the notification data
+ $this->displayMessage(
+ 'Required parameter(' . $parameter . ') in the category(' . $category . ') not received'
+ );
+
+ return false;
+ }
+ }
+ }
+ }
+
+ // Validate the received checksum.
+ if (!$this->validateChecksum()) {
+ return false;
+ }
+
+ // Validate TID's from the event data
+ if (!empty($this->parentTid) && !preg_match('/^\d{17}$/', $this->parentTid)
+ ) {
+ $this->displayMessage(
+ 'Invalid TID[' . $this->parentTid
+ . '] for Order :' . $this->response->getData('transaction/order_no')
+ );
+
+ return false;
+ } elseif (!empty($this->eventTid) && !preg_match('/^\d{17}$/', $this->eventTid)) {
+ $this->displayMessage(
+ 'Invalid TID[' . $this->eventTid
+ . '] for Order :' . $this->response->getData('transaction/order_no')
+ );
+
+ return false;
+ }
+
+ return true;
+ }
+
+ /**
+ * Validate checksum in response
+ *
+ * @return bool
+ */
+ private function validateChecksum()
+ {
+ $checksumString = $this->response->getData('event/tid') . $this->response->getData('event/type')
+ . $this->response->getData('result/status');
+
+ if (isset($this->response->getData('transaction')['amount'])) {
+ $checksumString .= $this->response->getData('transaction/amount');
+ }
+
+ if ($this->response->getData('transaction/currency')) {
+ $checksumString .= $this->response->getData('transaction/currency');
+ }
+
+ $accessKey = trim($this->paymentAccessKey);
+ if (!empty($accessKey)) {
+ $checksumString .= strrev($accessKey);
+ }
+
+ $generatedChecksum = hash('sha256', $checksumString);
+ if ($generatedChecksum !== $this->response->getData('event/checksum')) {
+ $this->displayMessage('While notifying some data has been changed. The hash check failed');
+
+ return false;
+ }
+
+ return true;
+ }
+
+ /**
+ * Get order reference.
+ *
+ * @return mixed
+ */
+ private function getOrder()
+ {
+ if ($this->orderNo) {
+ $order = $this->salesOrderModel->loadByIncrementId($this->orderNo);
+ }
+
+ if (!isset($order) || empty($order->getIncrementId())) {
+ $orderCollection = $this->transactionModel->getCollection()->addFieldToFilter('txn_id', $this->parentTid);
+ if (!empty($orderCollection)) {
+ $order = $orderCollection->getFirstItem()->getOrder();
+ }
+ }
+
+ if (empty($order) || empty($order->getIncrementId())) {
+ $this->displayMessage('Required (Transaction ID) not Found!');
+ return false;
+ }
+
+ return $order;
+ }
+
+ /**
+ * Complete the order in-case response failure from Novalnet server
+ *
+ * @return bool
+ */
+ private function handleCommunicationFailure()
+ {
+ if ($this->novalnetConfig->getPaymentType($this->code) != $this->response->getData('transaction/payment_type')) {
+ $this->displayMessage(
+ 'Novalnet callback received. Payment type ( ' . $this->response->getData('transaction/payment_type')
+ . ' ) is not matched with ' . $this->code . '!'
+ );
+ return false;
+ }
+ // Unhold order if it is being held
+ if ($this->order->canUnhold()) {
+ $this->order->unhold()->save();
+ }
+
+ // update and save the payment additional data
+ $additionalData = $this->novalnetRequestHelper->buildAdditionalData($this->response, $this->payment);
+ $this->payment->setAdditionalData($this->jsonHelper->jsonEncode($additionalData))->save();
+
+ $amount = $this->novalnetRequestHelper->getFormattedAmount(
+ $this->response->getData('transaction/amount'),
+ 'RAW'
+ );
+
+ // Set order status based on Novalnet transaction status
+ if ($this->response->getData('result/status') == 'SUCCESS' &&
+ in_array($this->response->getData('transaction/status'), ['PENDING', 'ON_HOLD', 'CONFIRMED'])
+ ) {
+ if ($this->order->canInvoice() && $this->response->getData('transaction/status') == 'CONFIRMED') {
+ // capture transaction
+ $this->payment->setTransactionId($additionalData['NnTid'])
+ ->setLastTransId($additionalData['NnTid'])
+ ->capture(null)
+ ->setAmount($amount)
+ ->setIsTransactionClosed(false)
+ ->setShouldCloseParentTransaction(false)
+ ->save();
+ } else {
+ // authorize transaction
+ $this->payment->authorize(true, $amount)->save();
+ }
+
+ $orderStatus = $this->getOrderStatus();
+ $this->order->setState(Order::STATE_PROCESSING)
+ ->addStatusToHistory($orderStatus, __('Customer successfully returned from Novalnet'))
+ ->save();
+ if (!empty($this->response->getData('transaction/payment_data/token'))) {
+ $this->novalnetRequestHelper->savePaymentToken($this->order, $this->code, $this->response);
+ }
+
+ // Order email
+ if ($this->order->getCanSendNewEmailFlag()) {
+ try {
+ $this->orderEmailSender->send($this->order);
+ $invoice = current($this->order->getInvoiceCollection()->getItems());
+ if ($invoice) {
+ $this->invoiceSender->send($invoice);
+ }
+ } catch (\Exception $e) {
+ $this->novalnetLogger->error($e);
+ }
+ }
+ } else {
+ // Cancel the order based on Novalnet transaction status
+ $this->novalnetRequestHelper->saveCanceledOrder($this->response, $this->order);
+ $this->displayMessage('Payment cancelled for the transaction ' . $this->eventTid);
+ }
+
+ $this->displayMessage('Novalnet Callback Script executed successfully on ' . $this->currentTime);
+ }
+
+ /**
+ * Log callback transaction information
+ *
+ * @param \Novalnet\Payment\Model\Callback $callbackModel
+ * @param float $amount
+ * @param string $orderNo
+ * @return void
+ */
+ private function logCallbackInfo($callbackModel, $amount, $orderNo)
+ {
+ // Get the original/parent transaction id
+ $callbackModel->setOrderId($orderNo)
+ ->setCallbackAmount($amount)
+ ->setReferenceTid($this->eventTid)
+ ->setCallbackTid($this->parentTid)
+ ->setCallbackDatetime($this->currentTime)
+ ->save();
+ }
+
+ /**
+ * Get payment order status for CREDIT Event
+ *
+ * @return void
+ */
+ private function getOrderStatusforCreditEvent()
+ {
+ if ($this->response->getData('transaction/status') == 'CONFIRMED') {
+ $orderStatus = $this->novalnetConfig->getPaymentConfig($this->code, 'order_status_after_payment', $this->storeId);
+ }
+
+ $orderStatus = !empty($orderStatus) ? $orderStatus : Order::STATE_PROCESSING;
+ $orderState = Order::STATE_PROCESSING;
+ $this->order->setState(
+ $orderState,
+ true,
+ __('Novalnet webhook set status (%1) for Order ID = %2', $orderState, $this->orderNo)
+ );
+ $this->order->addStatusToHistory(
+ $orderStatus,
+ __('Novalnet webhook added order status %1', $orderStatus)
+ );
+ $this->order->save();
+ }
+
+ /**
+ * Get payment order status
+ *
+ * @return string
+ */
+ private function getOrderStatus()
+ {
+ $orderStatus = 'pending';
+ if ($this->response->getData('transaction/status') == 'ON_HOLD') {
+ $orderStatus = $this->novalnetConfig->getGlobalOnholdStatus($this->storeId);
+ } elseif ($this->response->getData('transaction/status') == 'CONFIRMED' || $this->response->getData('transaction/status') == 'PENDING' && !$this->novalnetConfig->isRedirectPayment($this->code)
+ && !in_array(
+ $this->code,
+ [
+ ConfigProvider::NOVALNET_INVOICE_INSTALMENT,
+ ConfigProvider::NOVALNET_SEPA_INSTALMENT,
+ ConfigProvider::NOVALNET_SEPA_GUARANTEE,
+ ConfigProvider::NOVALNET_INVOICE_GUARANTEE
+ ]
+ )
+ ) {
+ $orderStatus = $this->novalnetConfig->getPaymentConfig($this->code, 'order_status', $this->storeId);
+ }
+
+ return !empty($orderStatus) ? $orderStatus : Order::STATE_PROCESSING;
+ }
+
+ /**
+ * Show callback process transaction comments
+ *
+ * @param string $text
+ * @param boolean $pullOut
+ * @return void
+ */
+ private function displayMessage($text, $pullOut = true)
+ {
+ if ($pullOut === false) {
+ $this->additionalMessage = $text;
+ } else {
+ $this->callbackMessage = $text;
+ }
+
+ $this->novalnetLogger->notice($text);
+ }
+
+ /**
+ * Send callback notification E-mail
+ *
+ * @return bool
+ */
+ private function sendCallbackMail()
+ {
+ // Get email configuration settings
+ $this->getEmailConfig();
+
+ if ($this->emailBody && $this->emailFromAddr && $this->emailToAddr) {
+ if (!$this->sendEmailMagento()) {
+ $this->displayMessage('Mailing failed!' . ' ', false);
+ return false;
+ }
+ }
+ }
+
+ /**
+ * Get email config
+ *
+ * @return void
+ */
+ private function getEmailConfig()
+ {
+ $this->storeFrontendName = $this->storeManager->getStore()->getFrontendName();
+ $this->emailFromAddr = $this->getConfigValue('trans_email/ident_general/email');
+ $this->emailFromName = $this->getConfigValue('trans_email/ident_general/name');
+ $this->emailToAddr = $this->novalnetConfig->getMerchantScriptConfig('mail_to_addr');
+ $this->emailToName = 'store admin'; // Adapt for your need
+ $this->emailSubject = 'Novalnet Callback Script Access Report - ' . $this->storeFrontendName;
+ }
+
+ /**
+ * Send callback notification E-mail (with callback template)
+ *
+ * @return boolean
+ */
+ private function sendEmailMagento()
+ {
+ try {
+ $emailToAddrs = str_replace(' ', '', $this->emailToAddr);
+ $emailToAddrs = (!empty($emailToAddrs)) ? explode(',', $emailToAddrs) : [];
+ $templateVars = [
+ 'fromName' => $this->emailFromName,
+ 'fromEmail' => $this->emailFromAddr,
+ 'toName' => $this->emailToName,
+ 'toEmail' => $this->emailToAddr,
+ 'subject' => $this->emailSubject
+ ];
+
+ if (!empty($this->emailBody) &&
+ is_object($this->emailBody) &&
+ $this->emailBody instanceof \Magento\Framework\Phrase
+ ) {
+ $templateVars['body'] = $this->emailBody->render();
+ } else {
+ $templateVars['body'] = $this->emailBody;
+ }
+
+ $from = ['email' => $this->emailFromAddr, 'name' => $this->emailFromName];
+ $this->inlineTranslation->suspend();
+
+ $storeId = $this->storeManager->getStore()->getId();
+ $templateOptions = [
+ 'area' => \Magento\Framework\App\Area::AREA_FRONTEND,
+ 'store' => $storeId
+ ];
+ $transport = $this->transportBuilder->setTemplateIdentifier(
+ 'novalnet_callback_email_template',
+ \Magento\Store\Model\ScopeInterface::SCOPE_STORE
+ )->setTemplateOptions($templateOptions)
+ ->setTemplateVars($templateVars)
+ ->setFrom($from)
+ ->addTo($emailToAddrs)
+ ->getTransport();
+
+ $transport->sendMessage();
+ $this->inlineTranslation->resume();
+ $this->displayMessage(__FUNCTION__ . ': Sending Email succeeded! ', false);
+ } catch (\Exception $e) {
+ $this->novalnetLogger->error("Email sending failed: $e");
+ $this->displayMessage('Email sending failed: ', false);
+ return false;
+ }
+
+ return true;
+ }
+
+ /**
+ * Retrieves Novalnet configuration values
+ *
+ * @param string $path
+ * @return string
+ */
+ private function getConfigValue($path)
+ {
+ return $this->scopeConfig->getValue($path, \Magento\Store\Model\ScopeInterface::SCOPE_STORE);
+ }
+
+ /**
+ * Capture transaction
+ *
+ * @return void
+ */
+ private function transactionCapture()
+ {
+ $invoiceDuedate = $this->response->getData('transaction/due_date');
+ $additionalData = [];
+ if (!empty($this->payment->getAdditionalData())) {
+ $additionalData = $this->novalnetRequestHelper->isSerialized($this->payment->getAdditionalData())
+ ? $this->serializer->unserialize($this->payment->getAdditionalData())
+ : json_decode($this->payment->getAdditionalData(), true);
+ }
+
+ $transactionStatus = !empty($additionalData['NnStatus'])
+ ? $this->novalnetRequestHelper->getStatus($additionalData['NnStatus'], $this->order) : '';
+
+ if ($this->order->canInvoice() &&
+ in_array($transactionStatus, ['ON_HOLD', 'PENDING'])
+ ) {
+ if ($invoiceDuedate && $this->response->getData('result/status') == 'SUCCESS') {
+ $formatDate = $this->timeZone->formatDate($invoiceDuedate, \IntlDateFormatter::LONG);
+ if (isset($additionalData['NnInvoiceComments'])) {
+ $note = (!empty($additionalData['NnInvoiceComments'])) ? explode('|', $additionalData['NnInvoiceComments']) : [];
+ $additionalData['NnInvoiceComments'] = (!empty($note)) ? implode('|', $note) : '';
+ $additionalData['NnDueDate'] = $formatDate;
+ }
+ if ($this->code == ConfigProvider::NOVALNET_CASHPAYMENT) {
+ $additionalData['CpDueDate'] = $formatDate;
+ }
+ $additionalData['dueDateUpdateAt'] = $this->dateTime->date('d-m-Y H:i:s');
+ $this->payment->setAdditionalData($this->jsonHelper->jsonEncode($additionalData))->save();
+ }
+
+ $this->emailBody = $message = __(
+ 'The transaction has been confirmed on %1',
+ $this->currentTime
+ );
+ $additionalData['NnStatus'] = $this->response->getData('transaction/status');
+ $additionalData['NnComments'] = empty($additionalData['NnComments']) ?
+ ' '. $message . ' ' : $additionalData['NnComments'] . ' ' . $message . ' ';
+
+ if (in_array(
+ $this->payment->getMethod(),
+ [ConfigProvider::NOVALNET_INVOICE_INSTALMENT, ConfigProvider::NOVALNET_SEPA_INSTALMENT]
+ )) {
+ $additionalData = $this->getInstalmentAdditionalData($additionalData);
+ }
+
+ $transactionStatus = $this->transactionStatusModel->loadByAttribute($this->parentTid, 'tid');
+ $transactionStatus->setStatus($additionalData['NnStatus'])->save();
+ // Capture the Authorized transaction
+ $this->payment->setAdditionalData($this->jsonHelper->jsonEncode($additionalData))
+ ->capture(null)->save();
+
+ $orderStatus = $this->getOrderStatus();
+ $this->order->setState(Order::STATE_PROCESSING)
+ ->addStatusToHistory($orderStatus, 'The transaction has been confirmed')
+ ->save();
+ $invoice = current($this->order->getInvoiceCollection()->getItems());
+ if ($invoice) {
+ $this->invoiceSender->send($invoice);
+ }
+ } else {
+ // transaction already captured or transaction not been authorized.
+ $message = 'Order already captured.';
+ }
+
+ $this->sendCallbackMail();
+ $this->displayMessage($message);
+ }
+
+ /**
+ * Get Instalment payment Additional data
+ *
+ * @param array $additionalData
+ * @return array $additionalData
+ */
+ private function getInstalmentAdditionalData($additionalData)
+ {
+ $additionalData['PaidInstall'] = $this->response->getData('instalment/cycles_executed');
+ $additionalData['DueInstall'] = $this->response->getData('instalment/pending_cycles');
+ $additionalData['NextCycle'] = $this->response->getData('instalment/next_cycle_date');
+ if ($futureInstalmentDates = $this->response->getData('instalment/cycle_dates')) {
+ foreach (array_keys($futureInstalmentDates) as $cycle) {
+ $additionalData['InstalmentDetails'][$cycle] = ['amount' => $additionalData['InstallPaidAmount'],
+ 'nextCycle' => !empty($futureInstalmentDates[$cycle + 1]) ? date('Y-m-d', strtotime($futureInstalmentDates[$cycle + 1])) : '',
+ 'paidDate' => ($cycle == 1) ? date('Y-m-d') : '',
+ 'status' => ($cycle == 1) ? 'Paid' : 'Pending',
+ 'reference' => ($cycle == 1) ? $this->response->getData('transaction/tid') : ''];
+ }
+ }
+ return $additionalData;
+ }
+
+ /**
+ * Check transaction cancellation
+ *
+ * @return void
+ */
+ private function transactionCancellation()
+ {
+ $transactionStatus = $this->transactionStatusModel->loadByAttribute($this->parentTid, 'tid');
+
+ $this->novalnetRequestHelper->saveCanceledOrder($this->response, $this->order, $this->response->getData('transaction/status'));
+ $this->emailBody = $message = __(
+ 'The transaction has been canceled on %1',
+ $this->currentTime
+ );
+
+ $additionalData = [];
+ if (!empty($this->payment->getAdditionalData())) {
+ $additionalData = $this->novalnetRequestHelper->isSerialized($this->payment->getAdditionalData())
+ ? $this->serializer->unserialize($this->payment->getAdditionalData())
+ : json_decode($this->payment->getAdditionalData(), true);
+ }
+
+ $additionalData['NnComments'] = empty($additionalData['NnComments'])
+ ? ' ' . $message : $additionalData['NnComments'] . ' ' . $message;
+ $additionalData['NnStatus'] = $this->response->getData('transaction/status');
+ $transactionStatus->setStatus($additionalData['NnStatus'])->save();
+ $this->payment->setAdditionalData($this->jsonHelper->jsonEncode($additionalData))->save();
+ $this->sendCallbackMail();
+ $this->displayMessage($message);
+ }
+
+ /**
+ * Handle payment refund/bookback process
+ *
+ * @return void
+ */
+ private function refundProcess()
+ {
+ $refundTid = empty($this->response->getData('transaction/refund/tid'))
+ ? $this->response->getData('transaction/tid') : $this->response->getData('transaction/refund/tid');
+ $refundAmount = empty($this->response->getData('transaction/refund/amount'))
+ ? $this->response->getData('transaction/amount') : $this->response->getData('transaction/refund/amount');
+ $this->emailBody = $message = __(
+ 'Refund has been initiated for the TID: %1 with the amount %2. New TID:%3',
+ $this->parentTid,
+ $this->novalnetRequestHelper->getFormattedAmount($refundAmount, 'RAW') . ' ' . $this->currency,
+ $refundTid
+ );
+ $shopInvoked = !empty($this->response->getData('custom/shop_invoked'))
+ ? $this->response->getData('custom/shop_invoked') : 0;
+
+ if (!$shopInvoked) {
+ $additionalData = [];
+ if (!empty($this->payment->getAdditionalData())) {
+ $additionalData = $this->novalnetRequestHelper->isSerialized($this->payment->getAdditionalData())
+ ? $this->serializer->unserialize($this->payment->getAdditionalData())
+ : json_decode($this->payment->getAdditionalData(), true);
+ }
+
+ $additionalData['NnComments'] = empty($additionalData['NnComments']) ? ' ' . $message :
+ $additionalData['NnComments'] . ' ' . $message;
+ $this->payment->setAdditionalData($this->jsonHelper->jsonEncode($additionalData))->save();
+ }
+
+ if ($this->order->getState() != Order::STATE_CLOSED && $this->order->canCreditmemo() && !$shopInvoked) {
+ $refundData = [];
+ $grandTotal = $this->novalnetRequestHelper->getFormattedAmount($this->order->getGrandTotal());
+ $totalRefunded = $this->novalnetRequestHelper->getFormattedAmount($this->order->getTotalOnlineRefunded());
+ $totalRefundNow = $totalRefunded + $refundAmount;
+ if ($totalRefunded >= $grandTotal || $refundAmount >= $grandTotal) {
+ $adjustmentNegative = $grandTotal - $refundAmount;
+ $refundData['adjustment_negative'] = $this->novalnetRequestHelper->getFormattedAmount($adjustmentNegative, 'RAW');
+ $creditmemo = $this->creditMemoFacory->createByOrder($this->order, $refundData);
+ $this->creditmemoService->refund($creditmemo);
+ } elseif ($totalRefunded < $grandTotal && $totalRefundNow <= $grandTotal) {
+ $refundData['adjustment_positive'] = ($this->novalnetRequestHelper->getFormattedAmount($refundAmount, 'RAW'));
+ $itemToCredit = [];
+ foreach ($this->order->getAllItems() as $item) {
+ $itemToCredit[$item->getId()] = ['qty'=> 0];
+ }
+ $refundData['adjustment_negative'] = 0;
+ $refundData['shipping_amount'] = 0;
+ $refundData['items'] = $itemToCredit;
+ $this->creditmemoLoader->setOrderId($this->order->getId()); //pass order id
+ $this->creditmemoLoader->setCreditmemo($refundData);
+ $creditmemo = $this->creditmemoLoader->load();
+ $this->creditmemoService->refund($creditmemo);
+ }
+ }
+
+ $this->sendCallbackMail();
+ $this->displayMessage($message);
+ }
+
+ /**
+ * Handle transaction update
+ *
+ * @return void
+ */
+ private function transactionUpdate()
+ {
+ $invoiceDuedate = $this->response->getData('transaction/due_date');
+ $transactionPaymentType = $this->response->getData('transaction/payment_type');
+ $transaction = $this->transactionStatusModel->loadByAttribute($this->parentTid, 'tid');
+ $message = "Novalnet callback received for the unhandled transaction type($transactionPaymentType) for $this->eventType EVENT";
+ $additionalData = [];
+ if (!empty($this->payment->getAdditionalData())) {
+ $additionalData = $this->novalnetRequestHelper->isSerialized($this->payment->getAdditionalData())
+ ? $this->serializer->unserialize($this->payment->getAdditionalData())
+ : json_decode($this->payment->getAdditionalData(), true);
+ }
+ $transactionStatus = $this->novalnetRequestHelper->getStatus($transaction->getStatus(), $this->order);
+
+ if ($invoiceDuedate && $this->response->getData('result/status') == 'SUCCESS') {
+ $formatDate = $this->timeZone->formatDate($invoiceDuedate, \IntlDateFormatter::LONG);
+ $nnAmount = $this->pricingHelper->currency(
+ $this->novalnetRequestHelper->getFormattedAmount(($this->response->getData('instalment/cycle_amount') ? $this->response->getData('instalment/cycle_amount')
+ : $this->response->getData('transaction/amount')), 'RAW'),
+ true,
+ false
+ );
+ $additionalData['NnAmount'] = $nnAmount;
+ $this->emailBody = $message = __(
+ 'The transaction has been updated with amount %1 and due date with %2',
+ $additionalData['NnAmount'],
+ $formatDate
+ );
+ if (isset($additionalData['NnInvoiceComments'])) {
+ $note = (!empty($additionalData['NnInvoiceComments'])) ? explode('|', $additionalData['NnInvoiceComments']) : [];
+ $additionalData['NnInvoiceComments'] = (!empty($note)) ? implode('|', $note) : '';
+ $additionalData['NnDueDate'] = $formatDate;
+ }
+ if ($this->code == ConfigProvider::NOVALNET_CASHPAYMENT) {
+ $additionalData['CpDueDate'] = $formatDate;
+ $this->emailBody = $message = __(
+ 'The transaction has been updated with amount %1 and slip expiry date with %2',
+ $additionalData['NnAmount'],
+ $formatDate
+ );
+ }
+ $additionalData['dueDateUpdateAt'] = $this->dateTime->date('d-m-Y H:i:s');
+ $this->payment->setAdditionalData($this->jsonHelper->jsonEncode($additionalData))->save();
+ }
+
+ if ($transactionStatus == 'PENDING') {
+ if ($this->response->getData('transaction/status') == 'ON_HOLD') {
+ $orderStatus = $this->novalnetConfig->getGlobalOnholdStatus($this->storeId);
+ $this->emailBody = $message = __(
+ 'The transaction status has been changed from pending to on hold for the TID: %1 on %2.',
+ $this->parentTid,
+ $this->currentTime
+ );
+ $additionalData['NnStatus'] = $this->response->getData('transaction/status');
+ $additionalData['NnComments'] = empty($additionalData['NnComments']) ?
+ ' ' . $message . ' ' : $additionalData['NnComments'] . ' ' . $message . ' ';
+ $this->payment->setAdditionalData($this->jsonHelper->jsonEncode($additionalData))->save();
+ } elseif ($this->response->getData('transaction/status') == 'CONFIRMED') {
+ if (in_array(
+ $this->payment->getMethod(),
+ [ConfigProvider::NOVALNET_INVOICE_INSTALMENT, ConfigProvider::NOVALNET_SEPA_INSTALMENT]
+ )) {
+ $additionalData = $this->getInstalmentAdditionalData($additionalData);
+ }
+ $this->emailBody = $message = __(
+ 'Transaction updated successfully for the TID: %1 with the amount %2 on %3',
+ $this->eventTid,
+ $amount = $this->novalnetRequestHelper->getFormattedAmount(
+ $this->response->getData('transaction/amount'),
+ 'RAW'
+ ).' '.$this->currency,
+ $this->currentTime
+ );
+
+ $additionalData['NnStatus'] = $this->response->getData('transaction/status');
+ $additionalData['NnComments'] = empty($additionalData['NnComments']) ?
+ ' ' . $message . ' ' : $additionalData['NnComments'] . ' ' . $message . ' ';
+ $this->payment->setAdditionalData($this->jsonHelper->jsonEncode($additionalData))->save();
+ $this->payment->setTransactionId($this->parentTid . '-capture')
+ ->setIsTransactionClosed(true)
+ ->capture(null)->save();
+ $orderStatus = $this->novalnetConfig->getPaymentConfig($this->code, 'order_status', $this->storeId);
+ }
+
+ $transaction->setStatus($this->response->getData('transaction/status'))->save();
+ if (!empty($orderStatus)) {
+ $this->order->setState(Order::STATE_PROCESSING)
+ ->setStatus($orderStatus)
+ ->save();
+ }
+ $invoice = current($this->order->getInvoiceCollection()->getItems());
+ if ($invoice && $this->response->getData('transaction/status') == 'CONFIRMED') {
+ $this->invoiceSender->send($invoice);
+ }
+ } elseif ($transactionStatus == 'ON_HOLD' && $this->response->getData('transaction/status') == 'ON_HOLD' &&
+ in_array($this->code, [ConfigProvider::NOVALNET_SEPA, ConfigProvider::NOVALNET_SEPA_GUARANTEE, ConfigProvider::NOVALNET_INVOICE_GUARANTEE, ConfigProvider::NOVALNET_PREPAYMENT])) {
+ $this->emailBody = $message = __(
+ 'Transaction updated successfully for the TID: %1 with the amount %2 on %3',
+ $this->eventTid,
+ $amount = $this->novalnetRequestHelper->getFormattedAmount(
+ $this->response->getData('transaction/amount'),
+ 'RAW'
+ ).' '.$this->currency,
+ $this->currentTime
+ );
+ $additionalData['NnComments'] = empty($additionalData['NnComments']) ?
+ ' ' . $message . ' ' : $additionalData['NnComments'] . ' ' . $message . ' ';
+ $this->payment->setAdditionalData($this->jsonHelper->jsonEncode($additionalData))->save();
+ }
+
+ $this->sendCallbackMail();
+ $this->displayMessage($message);
+ }
+
+ /**
+ * Handle payment credit process
+ *
+ * @return void
+ */
+ private function creditProcess()
+ {
+ $transactionPaymentType = $this->response->getData('transaction/payment_type');
+ $message = "Novalnet callback received for the unhandled transaction type($transactionPaymentType) for $this->eventType EVENT";
+ $amount = $this->novalnetRequestHelper->getFormattedAmount(
+ $this->response->getData('transaction/amount'),
+ 'RAW'
+ );
+
+ if (in_array(
+ $transactionPaymentType,
+ ['INVOICE_CREDIT', 'ONLINE_TRANSFER_CREDIT', 'CASHPAYMENT_CREDIT', 'MULTIBANCO_CREDIT']
+ )) {
+ $additionalData = [];
+ if (!empty($this->payment->getAdditionalData())) {
+ $additionalData = $this->novalnetRequestHelper->isSerialized($this->payment->getAdditionalData())
+ ? $this->serializer->unserialize($this->payment->getAdditionalData())
+ : json_decode($this->payment->getAdditionalData(), true);
+ }
+ $updatedAmount = str_replace(',', '.', $this->currencyModel->format($additionalData['NnAmount'], ['display' => \Magento\Framework\Currency::NO_SYMBOL], false));
+ $updatedAmount = $this->novalnetRequestHelper->getFormattedAmount($updatedAmount);
+ // Loads callback model using the Increment ID
+ $callbackInfo = $this->callbackModel->loadLogByOrderId($this->orderNo);
+ $transactionStatus = $this->transactionStatusModel->loadByAttribute($this->parentTid, 'tid');
+ $totalAmount = $this->response->getData('transaction/amount') + $callbackInfo->getCallbackAmount();
+ // Get original order amount
+ $grandTotal = $this->novalnetRequestHelper->getFormattedAmount($this->order->getGrandTotal());
+ $totalAmountRefunded = $this->novalnetRequestHelper->getFormattedAmount($this->order->getTotalRefunded());
+ // Log callback data for reference
+ $this->logCallbackInfo($callbackInfo, $totalAmount, $this->orderNo);
+ $message = __(
+ 'Credit has been successfully received for the TID: %1 with amount %2 on %3. Please refer PAID order details in our Novalnet Admin Portal for the TID: %4',
+ $this->parentTid,
+ $amount . ' ' . $this->currency,
+ $this->currentTime,
+ $this->eventTid
+ );
+
+ $additionalData['NnStatus'] = ($this->response->getData('transaction/status'))
+ ? $this->response->getData('transaction/status') : '';
+ $transactionStatus->setStatus($this->response->getData('transaction/status'))->save();
+ $currentGrandTotal = 0;
+ if ($totalAmountRefunded) {
+ $currentGrandTotal = $grandTotal - $totalAmountRefunded;
+ if ($totalAmount >= $currentGrandTotal) {
+ $additionalData['NnPaid'] = 1;
+ }
+ } elseif ($totalAmount >= $grandTotal) {
+ $additionalData['NnPaid'] = 1;
+ }
+ if (($totalAmount < $grandTotal) ||
+ $transactionPaymentType == 'ONLINE_TRANSFER_CREDIT'
+ ) {
+ if ($transactionPaymentType == 'ONLINE_TRANSFER_CREDIT' && ($totalAmount > $grandTotal)) {
+ $message = $message . ' ' . __(
+ 'Credit has been successfully received for the TID: %1 with amount %2 on %3. Please refer PAID order details in our Novalnet Admin Portal for the TID: %4',
+ $this->parentTid,
+ $amount . ' ' . $this->currency,
+ $this->currentTime,
+ $this->eventTid
+ );
+ }
+
+ $this->emailBody = $message;
+ $additionalData['NnComments'] = empty($additionalData['NnComments'])
+ ? ' ' . $message
+ : $additionalData['NnComments'] . ' ' . $message;
+ $this->payment->setAdditionalData($this->jsonHelper->jsonEncode($additionalData))->save();
+ if ($totalAmountRefunded) {
+ if (($totalAmount >= $currentGrandTotal)) {
+ $this->getOrderStatusforCreditEvent(); // Set order status
+ }
+ } elseif ($updatedAmount) {
+ if (($totalAmount >= $updatedAmount)) {
+ $this->getOrderStatusforCreditEvent(); // Set order status
+ }
+ }
+ } elseif ($this->order->canInvoice()) {
+ $this->emailBody = $message;
+ $additionalData['NnComments'] = empty($additionalData['NnComments'])
+ ? ' ' . $message
+ : $additionalData['NnComments'] . ' ' . $message;
+ $this->payment->setAdditionalData($this->jsonHelper->jsonEncode($additionalData))->save();
+ // Save payment information with invoice for Novalnet successful transaction
+ $this->payment->setTransactionId($this->parentTid . '-capture')
+ ->setIsTransactionClosed(true)
+ ->capture(null)->save();
+ $this->order->save();
+ $this->order->setPayment($this->payment)->save();
+ $invoice = $this->order->getInvoiceCollection()->getFirstItem();
+ if ($invoice) {
+ $this->invoiceSender->send($invoice);
+ }
+ $this->getOrderStatusforCreditEvent(); // Set order status
+ } elseif ($this->payment->getAdditionalInformation($this->code . '_callbackSuccess') != 1) {
+ $this->emailBody = $message;
+ $additionalData['NnComments'] = empty($additionalData['NnComments']) ? ' ' . $message
+ : $additionalData['NnComments'] . ' ' . $message;
+ $this->payment->setAdditionalInformation($this->code
+ . '_callbackSuccess', 1);
+ $this->payment->setAdditionalData($this->jsonHelper->jsonEncode($additionalData))->save();
+ $orderStatus = $this->getOrderStatusforCreditEvent(); // Set order status
+ $this->order->setPayment($this->payment)->save();
+
+ $invoice = $this->order->getInvoiceCollection()->getFirstItem();
+ $invoice->setState(\Magento\Sales\Model\Order\Invoice::STATE_PAID);
+ $invoice->save();
+ } else {
+ $message = 'Callback Script executed already. Refer Order :' . $this->orderNo;
+ }
+ } else {
+ $message = __(
+ 'Credit has been successfully received for the TID: %1 with amount %2 on %3. Please refer PAID order details in our Novalnet Admin Portal for the TID: %4',
+ $this->parentTid,
+ $amount . ' ' . $this->currency,
+ $this->currentTime,
+ $this->eventTid
+ );
+ $additionalData = [];
+ if (!empty($this->payment->getAdditionalData())) {
+ $additionalData = $this->novalnetRequestHelper->isSerialized($this->payment->getAdditionalData())
+ ? $this->serializer->unserialize($this->payment->getAdditionalData())
+ : json_decode($this->payment->getAdditionalData(), true);
+ }
+ $this->emailBody = $message;
+ $additionalData['NnComments'] = empty($additionalData['NnComments']) ? ' ' . $message
+ : $additionalData['NnComments'] . ' ' . $message;
+ $this->payment->setAdditionalData($this->jsonHelper->jsonEncode($additionalData))->save();
+ }
+
+ $this->sendCallbackMail();
+ $this->displayMessage($message);
+ }
+
+ /**
+ * Handle payment INSTALMENT process
+ *
+ * @return void
+ */
+ private function instalmentProcess()
+ {
+ $additionalData = [];
+ if (!empty($this->payment->getAdditionalData())) {
+ $additionalData = $this->novalnetRequestHelper->isSerialized($this->payment->getAdditionalData())
+ ? $this->serializer->unserialize($this->payment->getAdditionalData())
+ : json_decode($this->payment->getAdditionalData(), true);
+ }
+
+ $additionalData['NnTid'] = $this->response->getData('transaction/tid');
+ $instalmentTransactionAmount = $this->novalnetRequestHelper->getFormattedAmount(
+ $this->response->getData('instalment/cycle_amount'),
+ 'RAW'
+ );
+ $paidAmount = $additionalData['InstallPaidAmount'] + $instalmentTransactionAmount;
+ $additionalData['InstallPaidAmount'] = $paidAmount;
+ $additionalData['PaidInstall'] = $this->response->getData('instalment/cycles_executed');
+ $additionalData['DueInstall'] = $this->response->getData('instalment/pending_cycles');
+ $additionalData['NextCycle'] = $this->response->getData('instalment/next_cycle_date');
+ if ($this->response->getData('instalment/prepaid')) {
+ $additionalData['prepaid'] = $this->response->getData('instalment/prepaid');
+ } else {
+ if (isset($additionalData['prepaid'])) {
+ unset($additionalData['prepaid']);
+ }
+ }
+ $additionalData['InstallCycleAmount'] = $instalmentTransactionAmount;
+ $additionalData['NnAmount'] = $this->pricingHelper->currencyByStore($instalmentTransactionAmount, $this->order->getStore()->getStoreId(), true, false);
+
+ if ($this->response->getData('transaction/payment_type') == 'INSTALMENT_INVOICE') {
+ $note = (!empty($additionalData['NnInvoiceComments'])) ? explode('|', $additionalData['NnInvoiceComments']) : [];
+ if ($this->response->getData('transaction/due_date')) {
+ $formatDate = $this->timeZone->formatDate(
+ $this->response->getData('transaction/due_date'),
+ \IntlDateFormatter::LONG
+ );
+ $additionalData['NnDueDate'] = $formatDate;
+ }
+
+ $note[5] = 'InvoiceAmount:' . $this->pricingHelper->currencyByStore(
+ $instalmentTransactionAmount,
+ $this->order->getStore()->getStoreId(),
+ true,
+ false
+ );
+
+ $note[6] = 'Payment Reference:' . $this->response->getData('transaction/tid');
+ if (isset($note[7])) {
+ unset($note[7]);
+ }
+ $additionalData['NnInvoiceComments'] = (!empty($note)) ? implode('|', $note) : '';
+ }
+
+ $additionalData['InstalmentDetails'][$this->response->getData('instalment/cycles_executed')] = [
+ 'amount' => $instalmentTransactionAmount,
+ 'nextCycle' => $this->response->getData('instalment/next_cycle_date'),
+ 'paidDate' => date('Y-m-d'),
+ 'status' => 'Paid',
+ 'reference' => $this->response->getData('transaction/tid')
+ ];
+ $this->payment->setAdditionalData($this->jsonHelper->jsonEncode($additionalData))->save();
+
+ // Send instalment email to end customer
+ if (!$this->novalnetConfig->getGlobalConfig('instalment_mail', $this->storeId)) {
+ $this->sendInstalmentmail();
+ }
+
+ $this->displayMessage('Novalnet Callbackscript received. Instalment payment executed properly');
+ }
+
+ /**
+ * Handle payment INSTALMENT process
+ *
+ * @return void
+ */
+ private function instalmentCancelProcess()
+ {
+ $this->emailBody = $message = __(
+ 'Instalment has been cancelled for the TID %1 on %2',
+ $this->parentTid,
+ $this->currentTime
+ );
+
+ $additionalData = (!empty($this->payment->getAdditionalData())) ? ($this->novalnetRequestHelper->isSerialized($this->payment->getAdditionalData())
+ ? $this->serializer->unserialize($this->payment->getAdditionalData())
+ : json_decode($this->payment->getAdditionalData(), true)) : [] ;
+
+ $additionalData['NnComments'] = empty($additionalData['NnComments']) ? ' ' . $message :
+ $additionalData['NnComments'] . ' ' . $message;
+ $additionalData['InstalmentCancel'] = 1;
+ $this->payment->setAdditionalData($this->jsonHelper->jsonEncode($additionalData))->save();
+ $this->order->setState(Order::STATE_CLOSED)->setStatus(Order::STATE_CLOSED)->save();
+
+ $this->sendCallbackMail();
+ $this->displayMessage($message);
+ }
+
+ /**
+ * Send Instalment mail
+ *
+ * @return mixed
+ */
+ private function sendInstalmentmail()
+ {
+ $this->getEmailConfig();
+ $from = ['email' => $this->emailFromAddr, 'name' => $this->emailFromName];
+ $additionalData = $this->order->getPayment()->getAdditionalData();
+ if (!empty($additionalData)) {
+ $additionalData = $this->novalnetRequestHelper->isSerialized($additionalData)
+ ? $this->serializer->unserialize($additionalData)
+ : json_decode($additionalData, true);
+ }
+
+ $templateVars = [
+ 'order' => $this->order,
+ 'orderNo' => $this->orderNo,
+ 'storeName' => $this->storeFrontendName,
+ 'order_id' => $this->order->getId(),
+ 'customer_name' => $this->order->getCustomerName(),
+ 'cycleAmount' => $this->novalnetRequestHelper->getFormattedAmount($this->response->getData('instalment/cycle_amount'), 'RAW'),
+ 'currency' => $this->currency,
+ 'formattedShippingAddress' => !empty($this->order->getShippingAddress()) ? $this->salesOrderAddressRenderer->format($this->order->getShippingAddress(), 'html') : '',
+ 'formattedBillingAddress' => $this->salesOrderAddressRenderer->format($this->order->getBillingAddress(), 'html'),
+ 'store' => $this->order->getStore(),
+ 'payment_html' => $this->paymentHelper->getInfoBlockHtml(
+ $this->order->getPayment(),
+ $this->order->getStore()->getStoreId()
+ ),
+ 'sepaPayment' => ((!isset($additionalData['prepaid']) || empty($additionalData['prepaid'])) && ($this->response->getData('transaction/payment_type') == 'INSTALMENT_DIRECT_DEBIT_SEPA')) ? 1 : ""
+ ];
+
+ try {
+ $this->inlineTranslation->suspend();
+ $templateOptions = [
+ 'area' => \Magento\Framework\App\Area::AREA_FRONTEND,
+ 'store' => $this->order->getStore()->getStoreId()
+ ];
+
+ $transport = $this->transportBuilder->setTemplateIdentifier(
+ 'novalnet_callback_instalment_email_template',
+ \Magento\Store\Model\ScopeInterface::SCOPE_STORE
+ )->setTemplateOptions($templateOptions)
+ ->setTemplateVars($templateVars)
+ ->setFrom($from)
+ ->addTo($this->order->getCustomerEmail())
+ ->getTransport();
+
+ $transport->sendMessage();
+ $this->inlineTranslation->resume();
+ $this->displayMessage(__FUNCTION__ . ': Sending Email succeeded!'.' ', false);
+ } catch (\Exception $e) {
+ $this->novalnetLogger->error("Email sending failed: $e");
+ $this->displayMessage('Email sending failed: ', false);
+ return false;
+ }
+ }
+
+ /**
+ * Handle payment CHARGEBACK/RETURN_DEBIT/REVERSAL process
+ *
+ * @return void
+ */
+ private function chargebackProcess()
+ {
+ // Update callback comments for Chargebacks
+ $this->emailBody = $message = __(
+ 'Chargeback executed successfully for the TID: %1 amount: %2 on %3. The subsequent TID: %4',
+ $this->parentTid,
+ $this->novalnetRequestHelper->getFormattedAmount(
+ $this->response->getData('transaction/amount'),
+ 'RAW'
+ ) . ' ' . $this->currency,
+ $this->currentTime,
+ $this->response->getData('transaction/tid')
+ );
+
+ $additionalData = [];
+ if (!empty($this->payment->getAdditionalData())) {
+ $additionalData = $this->novalnetRequestHelper->isSerialized($this->payment->getAdditionalData())
+ ? $this->serializer->unserialize($this->payment->getAdditionalData())
+ : json_decode($this->payment->getAdditionalData(), true);
+ }
+
+ $additionalData['NnComments'] = empty($additionalData['NnComments']) ? ' ' . $message :
+ $additionalData['NnComments'] . ' ' . $message;
+ $this->payment->setAdditionalData($this->jsonHelper->jsonEncode($additionalData))->save();
+
+ $this->sendCallbackMail();
+ $this->displayMessage($message);
+ }
+
+ /**
+ * Handle payment reminder process
+ *
+ * @return void
+ */
+ private function paymentReminderProcess()
+ {
+ $reminderCount = explode('_', $this->response->getData('event/type'));
+ $reminderCount = end($reminderCount);
+ $this->emailBody = $message = __(
+ 'Payment Reminder %1 has been sent to the customer.',
+ $reminderCount
+ );
+
+ $additionalData = [];
+ if (!empty($this->payment->getAdditionalData())) {
+ $additionalData = $this->novalnetRequestHelper->isSerialized($this->payment->getAdditionalData())
+ ? $this->serializer->unserialize($this->payment->getAdditionalData())
+ : json_decode($this->payment->getAdditionalData(), true);
+ }
+
+ $additionalData['NnComments'] = empty($additionalData['NnComments']) ? ' ' . $message :
+ $additionalData['NnComments'] . ' ' . $message;
+ $this->payment->setAdditionalData($this->jsonHelper->jsonEncode($additionalData))->save();
+
+ $this->sendCallbackMail();
+ $this->displayMessage($message);
+ }
+
+ /**
+ * Handle collection process
+ *
+ * @return void
+ */
+ private function collectionProcess()
+ {
+ $this->emailBody = $message = __(
+ 'The transaction has been submitted to the collection agency. Collection Reference: %1',
+ $this->response->getData('collection/reference')
+ );
+
+ $additionalData = [];
+ if (!empty($this->payment->getAdditionalData())) {
+ $additionalData = $this->novalnetRequestHelper->isSerialized($this->payment->getAdditionalData())
+ ? $this->serializer->unserialize($this->payment->getAdditionalData())
+ : json_decode($this->payment->getAdditionalData(), true);
+ }
+
+ $additionalData['NnComments'] = empty($additionalData['NnComments']) ? ' ' . $message :
+ $additionalData['NnComments'] . ' ' . $message;
+ $this->payment->setAdditionalData($this->jsonHelper->jsonEncode($additionalData))->save();
+
+ $this->sendCallbackMail();
+ $this->displayMessage($message);
+ }
+
+ /**
+ * Get Cart Contents
+ *
+ * @api
+ * @return string
+ */
+ public function getCart()
+ {
+ $quote = $this->cart->getQuote();
+
+ try {
+ $result = $this->getCartItems($quote);
+ return $this->jsonHelper->jsonEncode($result);
+ } catch (\Exception $e) {
+ throw new CouldNotSaveException(__($e->getMessage()), $e);
+ }
+ }
+
+ /**
+ * Get express checkout request params for Product page
+ *
+ * @api
+ * @param string[] $data
+ * @return string
+ */
+ public function getProductPageParams($data)
+ {
+ $product = $this->loadProductById($data['product_id']);
+
+ if (!$product || !$product->getId()) {
+ return [];
+ }
+
+ $quote = $this->cart->getQuote();
+ $updateRequired = true;
+ if ($quote->getItemsCount()) {
+ $items = $quote->getAllVisibleItems();
+ foreach ($items as $item) {
+ if ($item->getProduct()->getId() == $product->getId()) {
+ $updateRequired = false;
+ }
+ }
+ }
+
+ $params = $this->getCartItems($quote, 'product_page');
+ $amount = $params['total']['amount'];
+ $items = $params['displayItems'];
+
+ if ($updateRequired) {
+ $shouldInclTax = $this->shouldCartPriceInclTax($quote->getStore());
+ $price = $this->getProductDataPrice(
+ $product,
+ $product->getFinalPrice(),
+ $shouldInclTax,
+ $quote->getCustomerId(),
+ $quote->getStore()->getStoreId()
+ );
+
+ $productTotal = $this->novalnetRequestHelper->getFormattedAmount($price);
+ $productTotal = ($productTotal) ? $productTotal : 0;
+ $amount += $productTotal;
+
+ $productLabel = $product->getName();
+ $formattedPrice = $this->priceCurrency->format($price, false);
+ $productLabel .= sprintf(' (%s x %s)', '1', $formattedPrice);
+
+ $items[] = [
+ 'label' => $productLabel,
+ 'type' => 'SUBTOTAL',
+ 'amount' => (string) $productTotal
+ ];
+ }
+
+ $result = [
+ 'total' => [
+ 'amount' => (string) $amount
+ ],
+ 'displayItems' => $items,
+ 'isEnabled' => $params['isEnabled'],
+ 'is_pending' => $params['is_pending'],
+ 'sheetConfig' => $params['sheetConfig'],
+ 'isVirtual' => ($quote->getItemsCount()) ? $quote->getIsVirtual() : null
+ ];
+
+ return $this->jsonHelper->jsonEncode($result);
+ }
+
+ /**
+ * Add to Cart
+ *
+ * @api
+ * @param string $data
+ * @return string
+ */
+ public function addToCart($data)
+ {
+ try {
+ $this->zendUri->setQuery($data);
+ $productInfo = $this->zendUri->getQueryAsArray();
+ $productId = $productInfo['product'];
+ $relatedProduct = $productInfo['related_product'];
+
+ if (isset($productInfo['qty'])) {
+ $filter = new \Magento\Framework\Filter\LocalizedToNormalized(
+ ['locale' => $this->novalnetRequestHelper->getDefaultLanguage()]
+ );
+ $productInfo['qty'] = $filter->filter($productInfo['qty']);
+ }
+
+ $quote = $this->cart->getQuote();
+
+ $storeId = $this->storeManager->getStore()->getId();
+ $product = $this->productRepository->getById($productId, false, $storeId);
+ $isNewItem = true;
+
+ foreach ($quote->getAllItems() as $item) {
+ if ($item->getProductId() == $productId) {
+ // update existing item in cart
+ $item = $this->cart->updateItem($item->getId(), $productInfo);
+ if ($item->getHasError()) {
+ throw new LocalizedException(__($item->getMessage()));
+ }
+
+ $isNewItem = false;
+ break;
+ }
+ }
+
+ if ($isNewItem) {
+ // add new item to cart
+ $item = $this->cart->addProduct($product, $productInfo);
+ if ($item->getHasError()) {
+ throw new LocalizedException(__($item->getMessage()));
+ }
+
+ if (!empty($relatedProduct)) {
+ $this->cart->addProductsByIds(explode(',', $relatedProduct));
+ }
+ }
+
+ $this->cart->save();
+ $quote->setTotalsCollectedFlag(false)->collectTotals()->save();
+
+ return $this->jsonHelper->jsonEncode([]);
+
+ } catch (\Exception $e) {
+ throw new CouldNotSaveException(__($e->getMessage()), $e);
+ }
+ }
+
+ /**
+ * Estimate Shipping by Address
+ *
+ * @api
+ * @param string[] $address
+ * @return string
+ */
+ public function estimateShippingMethod($address)
+ {
+ try {
+ $quote = $this->cart->getQuote();
+ $needConversion = ($this->storeManager->getStore()->getCurrentCurrencyCode() == $this->storeManager->getStore()->getBaseCurrencyCode()) ? false : true;
+ $methods = [];
+
+ if (!$quote->isVirtual()) {
+ $shippingAddress = $quote->getShippingAddress()
+ ->addData($this->getFormattedAddress($address))
+ ->save();
+
+ $estimatedAddress = $this->estimatedAddressFactory->create()
+ ->setCountryId($shippingAddress->getCountryId())
+ ->setPostcode($shippingAddress->getPostcode())
+ ->setRegion((string) $shippingAddress->getRegion())
+ ->setRegionId($shippingAddress->getRegionId());
+
+ $availableShippingMethods = $this->shippingMethodManager->estimateByAddress($quote->getId(), $estimatedAddress);
+ $shouldInclTax = $this->shouldCartPriceInclTax($quote->getStore());
+
+ if ($availableShippingMethods) {
+ foreach ($availableShippingMethods as $rate) {
+ if ($rate->getErrorMessage()) {
+ continue;
+ }
+
+ $methodRate = $shouldInclTax ? $rate->getPriceInclTax() : $rate->getPriceExclTax();
+ $methodRate = ($methodRate && $needConversion) ? $methodRate / $quote->getBaseToQuoteRate() : $methodRate;
+ array_push($methods, [
+ 'label' => $rate->getCarrierTitle() . ' - ' . $rate->getMethodTitle(),
+ 'amount' => (string) ($methodRate > 0) ? $this->novalnetRequestHelper->getFormattedAmount($methodRate) : $methodRate,
+ 'identifier' => $rate->getCarrierCode() . '_' . $rate->getMethodCode()
+ ]);
+ }
+ }
+
+ if ($methods) {
+ $shippingAddress->setShippingMethod($methods[0]['identifier'])->setCollectShippingRates(true);
+ }
+ }
+
+ $quote->collectTotals();
+ $result = $this->getCartItems($quote);
+ $result['methods'] = $methods;
+ return $this->jsonHelper->jsonEncode($result);
+ } catch (\Exception $e) {
+ throw new CouldNotSaveException(__($e->getMessage()), $e);
+ }
+ }
+
+ /**
+ * Apply shipping method and calculate totals
+ *
+ * @api
+ * @param string[] $shippingMethod
+ * @return string
+ */
+ public function applyShippingMethod($shippingMethod)
+ {
+ $quote = $this->cart->getQuote();
+ try {
+ if (!$quote->isVirtual()) {
+ $shippingAddress = $quote->getShippingAddress();
+ $quote->setShippingAddress($shippingAddress);
+ $quote->getShippingAddress()->setCollectShippingRates(true)->setShippingMethod($shippingMethod['identifier']);
+ $quote->setTotalsCollectedFlag(false)->collectTotals()->save();
+ }
+
+ return $this->jsonHelper->jsonEncode(
+ $this->getCartItems($quote)
+ );
+ } catch (\Exception $e) {
+ throw new CouldNotSaveException(__($e->getMessage()), $e);
+ }
+ }
+
+ /**
+ * Get Cart items
+ *
+ * @param \Magento\Quote\Model\Quote $quote
+ * @param string $page
+ * @return array
+ */
+ public function getCartItems($quote, $page = 'mini_cart_page')
+ {
+ $currency = $quote->getBaseCurrencyCode();
+ if (empty($currency)) {
+ $currency = $quote->getStore()->getBaseCurrencyCode();
+ }
+ $discount = $quote->getBaseSubtotal() - $quote->getBaseSubtotalWithDiscount();
+ $needConversion = ($this->storeManager->getStore()->getCurrentCurrencyCode() == $this->storeManager->getStore()->getBaseCurrencyCode()) ? false : true;
+ $taxAmount = $quote->getTotals()['tax']->getValue();
+ $shouldInclTax = $this->shouldCartPriceInclTax($quote->getStore());
+ $displayItems = [];
+ $items = $quote->getAllVisibleItems();
+ $getQuoteFormat = $quote->getIsVirtual();
+ foreach ($items as $item) {
+
+ if ($item->getParentItem()) {
+ continue;
+ }
+
+ $rowTotal = $shouldInclTax ? $item->getBaseRowTotalInclTax() : $item->getBaseRowTotal();
+ $rowTotal = $this->novalnetRequestHelper->getFormattedAmount($rowTotal);
+ $rowTotal = ($rowTotal) ? $rowTotal : 0;
+
+ $price = $shouldInclTax ? $item->getBasePriceInclTax() : $item->getBasePrice();
+
+ $label = $item->getName();
+ if ($item->getQty() > 0) {
+ $formattedPrice = $this->priceCurrency->format($price, false, PriceCurrencyInterface::DEFAULT_PRECISION, null, $currency);
+ $label .= sprintf(' (%s x %s)', $item->getQty(), $formattedPrice);
+ }
+
+ $displayItems[] = [
+ 'label' => $label,
+ 'type' => 'SUBTOTAL',
+ 'amount' => (string) $rowTotal
+ ];
+ }
+
+ if ($discount) {
+ $displayItems[] = [
+ 'label' => __('Discount'),
+ 'type' => 'SUBTOTAL',
+ 'amount' => (string) '-' . $this->novalnetRequestHelper->getFormattedAmount($discount)
+ ];
+ }
+
+ if ($taxAmount) {
+ $taxAmount = $needConversion ? $this->deltaRounding($taxAmount / $quote->getBaseToQuoteRate()) : $taxAmount;
+ $displayItems[] = [
+ 'label' => __('Tax'),
+ 'type' => 'SUBTOTAL',
+ 'amount' => (string) $this->novalnetRequestHelper->getFormattedAmount($taxAmount)
+ ];
+ }
+
+ if ($quote->getItemsCount() && !$quote->getIsVirtual()) {
+ $shippingAmount = $quote->getShippingAmount();
+ if ($shippingAmount && $needConversion) {
+ $shippingAmount = $shippingAmount / $quote->getBaseToQuoteRate();
+ }
+
+ if ($shippingAmount !== null) {
+ $displayItems[] = [
+ 'label' => (!empty($quote->getShippingDescription())) ? $quote->getShippingDescription() : __('Shipping'),
+ 'type' => 'SUBTOTAL',
+ 'amount' => (string) ($shippingAmount > 0) ? $this->novalnetRequestHelper->getFormattedAmount($shippingAmount) : $shippingAmount
+ ];
+ }
+ }
+
+ $baseGrandTotal = $this->novalnetRequestHelper->getFormattedAmount($quote->getBaseGrandTotal());
+ $baseGrandTotal = ($baseGrandTotal) ? $baseGrandTotal : 0;
+ return [
+ 'currency' => (!empty($currency)) ? strtoupper($currency) : '',
+ 'total' => [
+ 'amount' => (string) $baseGrandTotal
+ ],
+ 'displayItems' => $displayItems,
+ 'isVirtual' => $getQuoteFormat,
+ 'isEnabled' => $this->novalnetRequestHelper->isPageEnabledForExpressCheckout($page),
+ 'is_pending' => $this->novalnetRequestHelper->isAmountPendingForExpressCheckout(),
+ 'sheetConfig' => $this->novalnetRequestHelper->paymentSheetConfigurations()
+ ];
+ }
+
+ /**
+ * Place Order
+ *
+ * @api
+ * @param string[] $paymentData
+ * @param string[] $billingAddress
+ * @param string[] $shippingAddress
+ * @param string[] $shippingMethod
+ * @param bool $isPaymentPage
+ * @return string
+ */
+ public function placeOrder($paymentData, $billingAddress, $shippingAddress = [], $shippingMethod = [], $isPaymentPage = false)
+ {
+ try {
+ $quote = $this->cart->getQuote();
+ $quote->reserveOrderId()->save();
+ $walletToken = $paymentData['token'];
+ $paymentMethodCode = $paymentData['methodCode'];
+
+ if (empty($billingAddress['email']) && !empty($shippingAddress['email'])) {
+ $billingAddress['email'] = $shippingAddress['email'];
+ }
+
+ if (empty($billingAddress['phoneNumber']) && !empty($shippingAddress['phoneNumber'])) {
+ $billingAddress['phoneNumber'] = $shippingAddress['phoneNumber'];
+ }
+
+ // set billing address
+ $quote->getBillingAddress()->addData($this->getFormattedAddress($billingAddress));
+
+ if (!$isPaymentPage && !$quote->isVirtual()) {
+
+ if (empty($shippingAddress['email']) && !empty($billingAddress['email'])) {
+ $shippingAddress['email'] = $billingAddress['email'];
+ }
+
+ if (empty($shippingAddress['phoneNumber']) && !empty($billingAddress['phoneNumber'])) {
+ $shippingAddress['phoneNumber'] = $billingAddress['phoneNumber'];
+ }
+
+ $shippingIdentifier = $shippingMethod['identifier'];
+
+ // set shipping address and shipping method
+ $quote->getShippingAddress()
+ ->addData($this->getFormattedAddress($shippingAddress))
+ ->setShippingMethod($shippingIdentifier)
+ ->setCollectShippingRates(true);
+ }
+
+ $quote->setTotalsCollectedFlag(false)->collectTotals();
+ $this->storeManager->setCurrentStore($quote->getStoreId());
+
+ if (!$this->customerSession->isLoggedIn()) {
+ $quote->setCheckoutMethod(Onepage::METHOD_GUEST)
+ ->setCustomerId(null)
+ ->setCustomerEmail($billingAddress['email'])
+ ->setCustomerIsGuest(true)
+ ->setCustomerGroupId(GroupInterface::NOT_LOGGED_IN_ID);
+
+ //set customer name for guest user (account information)
+ if ($quote->getCustomerFirstname() === null && $quote->getCustomerLastname() === null) {
+ $quote->setCustomerFirstname($quote->getBillingAddress()->getFirstname())
+ ->setCustomerLastname($quote->getBillingAddress()->getLastname());
+ if ($quote->getBillingAddress()->getMiddlename() === null) {
+ $quote->setCustomerMiddlename($quote->getBillingAddress()->getMiddlename());
+ }
+ }
+ } else {
+ $quote->setCheckoutMethod(Onepage::METHOD_CUSTOMER);
+ }
+
+ $transactionData = [
+ 'method' => $paymentMethodCode,
+ 'additional_data' => [
+ $paymentMethodCode . '_wallet_token' => $walletToken
+ ]
+ ];
+
+ if (!empty($paymentData['doRedirect'])) {
+ $transactionData['additional_data'][$paymentMethodCode . '_do_redirect'] = $paymentData['doRedirect'];
+ }
+
+ //set payment additional data
+ $quote->getPayment()->importData($transactionData);
+
+ $quote->collectTotals()->save();
+
+ $this->eventManager->dispatch(
+ 'checkout_submit_before',
+ ['quote' => $quote]
+ );
+
+ //submit current quote to place order
+ $order = $this->quoteManagement->submit($quote);
+
+ $payment = $order->getPayment();
+ $additionalData = (!empty($payment->getAdditionalData())) ? $this->jsonHelper->jsonDecode($payment->getAdditionalData(), true) : [];
+
+ if ($paymentMethodCode == ConfigProvider::NOVALNET_GOOGLEPAY) {
+ $additionalData['NnGpaysuccesstext'] = " (" . $paymentData['cardBrand'] . " **** ". $paymentData['lastFour'] .")";
+ } elseif ($paymentMethodCode == ConfigProvider::NOVALNET_APPLEPAY) {
+ $additionalData['NnApplepaysuccesstext'] = " (" . $paymentData['cardBrand'] . " **** ". $paymentData['lastFour'] .")";
+ }
+
+ $payment->setAdditionalData($this->jsonHelper->jsonEncode($additionalData))->save();
+
+ if (!$order || !$order->getId()) {
+ throw new LocalizedException(
+ __('A server error stopped your order from being placed. Please try to place your order again.')
+ );
+ } else {
+ $this->eventManager->dispatch(
+ 'checkout_type_onepage_save_order_after',
+ ['order' => $order, 'quote' => $quote]
+ );
+
+ $this->checkoutSession->setLastQuoteId($quote->getId())
+ ->setLastSuccessQuoteId($quote->getId())
+ ->setLastOrderId($order->getId())
+ ->setLastRealOrderId($order->getIncrementId())
+ ->setLastOrderStatus($order->getStatus());
+ }
+
+ $this->eventManager->dispatch(
+ 'checkout_submit_all_after',
+ [
+ 'order' => $order,
+ 'quote' => $quote
+ ]
+ );
+
+ $redirectURL = $this->urlInterface->getUrl('checkout/onepage/success');
+ if (!empty($additionalData['NnRedirectURL'])) {
+ $order->setState(Order::STATE_PENDING_PAYMENT)
+ ->setStatus(Order::STATE_PENDING_PAYMENT)
+ ->save();
+ $order->addStatusHistoryComment(__('Customer was redirected to Novalnet'))
+ ->save();
+
+ $this->novalnetLogger->notice('Order status and comments updated successfully');
+ $redirectURL = $additionalData['NnRedirectURL'];
+ }
+
+ return $this->jsonHelper->jsonEncode([
+ 'redirectUrl' => $redirectURL
+ ]);
+
+ } catch (\Exception $e) {
+ throw new CouldNotSaveException(__($e->getMessage()), $e);
+ }
+ }
+
+ /**
+ * Format Tax Amount to Magento Rounding
+ *
+ * @param float $amount
+ * @return double
+ */
+ public function deltaRounding($amount)
+ {
+ $temp = 0;
+ $deltaValue = 0.000001;
+ $sum = $amount + $deltaValue;
+ $rounded = $this->priceCurrency->round($sum, 2);
+ $temp = $rounded - $sum;
+
+ return $this->priceCurrency->round($amount - $temp, 2);
+ }
+
+ /**
+ * Get Quote
+ *
+ * @return \Magento\Quote\Model\Quote
+ */
+ public function getQuote()
+ {
+ $quote = $this->checkoutHelper->getCheckout()->getQuote();
+ if (!$quote->getId()) {
+ $objectManager = \Magento\Framework\App\ObjectManager::getInstance();
+ $quote = $objectManager->create(\Magento\Checkout\Model\Session::class)->getQuote();
+ }
+
+ return $quote;
+ }
+
+ /**
+ * Should Cart Price Include Tax
+ *
+ * @param null|int|string|Store $store
+ * @return bool
+ */
+ public function shouldCartPriceInclTax($store = null)
+ {
+ if ($this->taxHelper->displayCartBothPrices($store)) {
+ return true;
+ } elseif ($this->taxHelper->displayCartPriceInclTax($store)) {
+ return true;
+ }
+
+ return false;
+ }
+
+ /**
+ * Get Formatted shipping Address
+ *
+ * @param array $info
+ * @return array
+ */
+ public function getFormattedAddress($info)
+ {
+ $regionName = (!empty($info['administrativeArea'])) ? $info['administrativeArea'] : $info['locality'];
+ $countryName = (!empty($info['countryCode'])) ? $info['countryCode'] : '';
+ $regionId = $this->getRegionIdByName($regionName, $countryName);
+
+ return [
+ 'firstname' => !empty($info['firstName']) ? $info['firstName'] : '',
+ 'lastname' => !empty($info['lastName']) ? $info['lastName'] : '',
+ 'company' => '',
+ 'email' => !empty($info['email']) ? $info['email'] : '',
+ 'street' => !empty($info['addressLines']) ? $info['addressLines'] : 'Unspecified Street',
+ 'city' => !empty($info['locality']) ? $info['locality'] : '',
+ 'region_id' => $regionId,
+ 'region' => $regionName,
+ 'postcode' => !empty($info['postalCode']) ? $info['postalCode'] : '',
+ 'country_id' => $countryName,
+ 'telephone' => !empty($info['phoneNumber']) ? $info['phoneNumber'] : 'Unspecified Telephone',
+ 'fax' => ''
+ ];
+ }
+
+ /**
+ * Get regions from country code
+ *
+ * @param mixed $countryCode
+ * @return mixed
+ */
+ public function getRegionsForCountry($countryCode)
+ {
+ $values = [];
+
+ $country = $this->countryFactory->create()->loadByCode($countryCode);
+
+ if (empty($country)) {
+ return $values;
+ }
+
+ $regions = $country->getRegions();
+
+ foreach ($regions as $region) {
+ if ($region) {
+ $values['byCode'][strtolower(trim($region->getCode()))] = $region->getId();
+ $values['byName'][strtolower(trim($region->getName()))] = $region->getId();
+ }
+ }
+
+ return $values;
+ }
+
+ /**
+ * Get Region id with region name
+ *
+ * @param mixed $regionName
+ * @param mixed $regionCountry
+ * @return string
+ */
+ public function getRegionIdByName($regionName, $regionCountry)
+ {
+ $regions = $this->getRegionsForCountry($regionCountry);
+
+ $regionName = (!empty($regionName)) ? strtolower(trim($regionName)) : '';
+
+ if (isset($regions['byName'][$regionName])) {
+ return $regions['byName'][$regionName];
+ } elseif (isset($regions['byCode'][$regionName])) {
+ return $regions['byCode'][$regionName];
+ }
+
+ return '';
+ }
+
+ /**
+ * Load product model with product id
+ *
+ * @param mixed $productId
+ * @return mixed
+ */
+ public function loadProductById($productId)
+ {
+ $model = $this->productFactory->create();
+ return $model->load($productId);
+ }
+
+ /**
+ * Get Product Price with(without) Taxes
+ *
+ * @param \Magento\Catalog\Model\Product $product
+ * @param float|null $price
+ * @param bool $inclTax
+ * @param int|null $customerId
+ * @param int|null $storeId
+ *
+ * @return float
+ */
+ public function getProductDataPrice($product, $price = null, $inclTax = false, $customerId = null, $storeId = null)
+ {
+ if (!($taxAttribute = $product->getCustomAttribute('tax_class_id'))) {
+ return $price;
+ }
+
+ if (!$price) {
+ $price = $product->getPrice();
+ }
+
+ $productRateId = $taxAttribute->getValue();
+ $rate = $this->taxCalculation->getCalculatedRate($productRateId, $customerId, $storeId);
+ if ((int) $this->scopeConfig->getValue(
+ 'tax/calculation/price_includes_tax',
+ \Magento\Store\Model\ScopeInterface::SCOPE_STORE,
+ $storeId
+ ) === 1
+ ) {
+ $priceExclTax = $price / (1 + ($rate / 100));
+ } else {
+ $priceExclTax = $price;
+ }
+
+ $priceInclTax = $priceExclTax + ($priceExclTax * ($rate / 100));
+ $productPrice = $inclTax ? $priceInclTax : $priceExclTax;
+
+ return $this->priceCurrency->round($productPrice, PriceCurrencyInterface::DEFAULT_PRECISION);
+ }
+}
diff --git a/Model/ResourceModel/Callback.php b/Model/ResourceModel/Callback.php
new file mode 100755
index 0000000..941c713
--- /dev/null
+++ b/Model/ResourceModel/Callback.php
@@ -0,0 +1,36 @@
+_init('novalnet_payment_callback', 'id');
+ }
+}
diff --git a/Model/ResourceModel/Callback/Collection.php b/Model/ResourceModel/Callback/Collection.php
new file mode 100755
index 0000000..a455c01
--- /dev/null
+++ b/Model/ResourceModel/Callback/Collection.php
@@ -0,0 +1,36 @@
+_init(
+ \Novalnet\Payment\Model\Callback::class,
+ \Novalnet\Payment\Model\ResourceModel\Callback::class
+ );
+ }
+}
diff --git a/Model/ResourceModel/TransactionStatus.php b/Model/ResourceModel/TransactionStatus.php
new file mode 100755
index 0000000..5b3d411
--- /dev/null
+++ b/Model/ResourceModel/TransactionStatus.php
@@ -0,0 +1,36 @@
+_init('novalnet_payment_transactionstatus', 'id');
+ }
+}
diff --git a/Model/ResourceModel/TransactionStatus/Collection.php b/Model/ResourceModel/TransactionStatus/Collection.php
new file mode 100755
index 0000000..cfea3d3
--- /dev/null
+++ b/Model/ResourceModel/TransactionStatus/Collection.php
@@ -0,0 +1,36 @@
+_init(
+ \Novalnet\Payment\Model\TransactionStatus::class,
+ \Novalnet\Payment\Model\ResourceModel\TransactionStatus::class
+ );
+ }
+}
diff --git a/Model/TransactionStatus.php b/Model/TransactionStatus.php
new file mode 100755
index 0000000..3c81ba7
--- /dev/null
+++ b/Model/TransactionStatus.php
@@ -0,0 +1,67 @@
+_init(\Novalnet\Payment\Model\ResourceModel\TransactionStatus::class);
+ }
+
+ /**
+ * Load order transaction status by custom attribute value. Attribute value should be unique
+ *
+ * @param int $value
+ * @param string $attribute
+ * @return mixed
+ */
+ public function loadByAttribute($value, $attribute)
+ {
+ $this->load($value, $attribute);
+ return $this;
+ }
+}
diff --git a/Model/Ui/ConfigProvider.php b/Model/Ui/ConfigProvider.php
new file mode 100755
index 0000000..bfb393e
--- /dev/null
+++ b/Model/Ui/ConfigProvider.php
@@ -0,0 +1,571 @@
+filesystem = $filesystem;
+ $this->request = $request;
+ $this->checkoutSession = $checkoutSession;
+ $this->assetRepo = $assetRepo;
+ $this->storeManager = $storeManager;
+ $this->serverAddress = $serverAddress;
+ $this->transactionStatusModel = $transactionStatusModel;
+ $this->novalnetRequestHelper = $novalnetRequestHelper;
+ $this->novalnetConfig = $novalnetConfig;
+ $this->jsonHelper = $jsonHelper;
+ $this->serializer = $serializer;
+ }
+
+ /**
+ * Retrieve assoc array of checkout configuration
+ *
+ * @return array
+ */
+ public function getConfig()
+ {
+ $novalnetCcStyles = $this->getCcStyleConfig();
+
+ return [
+ 'payment' => [
+ self::NOVALNET_CC => [
+ 'logo' => $this->getPaymentLogo(self::NOVALNET_CC),
+ 'icon' => $this->getCcAvailableTypes(self::NOVALNET_CC),
+ 'cardLogoUrl' => $this->getCardLogoUrl(),
+ 'testmode' => $this->novalnetConfig->getTestMode(self::NOVALNET_CC),
+ 'storePayment' => $this->novalnetConfig->getPaymentConfig(self::NOVALNET_CC, 'shop_type'),
+ 'instructions' => $this->novalnetConfig->getPaymentConfig(self::NOVALNET_CC, 'instructions'),
+ 'storedPayments' => $this->getOneClickToken(self::NOVALNET_CC),
+ 'tokenId' => $this->getOneClickToken(self::NOVALNET_CC, true),
+ 'iframeParams' => $this->getCcIframeParams(),
+ 'inlineForm' => $this->novalnetConfig->getPaymentConfig(self::NOVALNET_CC, 'inline_form'),
+ 'enforce_3d' => ($this->novalnetConfig->getPaymentConfig(self::NOVALNET_CC, 'enforce_3d')) ? $this->novalnetConfig->getPaymentConfig(self::NOVALNET_CC, 'enforce_3d') : 0,
+ 'labelStyle' => isset($novalnetCcStyles['standard_style_label']) ? $novalnetCcStyles['standard_style_label'] : '',
+ 'inputStyle' => isset($novalnetCcStyles['standard_style_input']) ? $novalnetCcStyles['standard_style_input'] : '',
+ 'styleText' => isset($novalnetCcStyles['standard_style_css']) ? $novalnetCcStyles['standard_style_css'] : '',
+ 'currencyCode' => $this->storeManager->getStore()->getBaseCurrencyCode(),
+ 'isZeroAmountBooking' => ($this->novalnetConfig->getPaymentConfig(self::NOVALNET_CC, 'payment_action') == NNConfig::ACTION_ZERO_AMOUNT_BOOKING) ? true : false
+ ],
+ self::NOVALNET_APPLEPAY => [
+ 'logo' => $this->getPaymentLogo(self::NOVALNET_APPLEPAY),
+ 'testmode' => $this->novalnetConfig->getTestMode(self::NOVALNET_APPLEPAY),
+ 'instructions' => $this->novalnetConfig->getPaymentConfig(self::NOVALNET_APPLEPAY, 'instructions'),
+ 'sellerName' => $this->novalnetConfig->getPaymentConfig(self::NOVALNET_APPLEPAY, 'seller_name'),
+ 'btnType' => $this->novalnetConfig->getPaymentConfig(self::NOVALNET_APPLEPAY, 'button_style'),
+ 'btnTheme' => $this->novalnetConfig->getPaymentConfig(self::NOVALNET_APPLEPAY, 'button_theme'),
+ 'btnHeight' => $this->novalnetConfig->getPaymentConfig(self::NOVALNET_APPLEPAY, 'button_height'),
+ 'btnRadius' => $this->novalnetConfig->getPaymentConfig(self::NOVALNET_APPLEPAY, 'button_corner_radius'),
+ 'langCode' => $this->novalnetRequestHelper->getLanguageCodeForPaymentSheet(),
+ 'countryCode' => $this->novalnetRequestHelper->getCountryCode(),
+ 'currencyCode' => $this->storeManager->getStore()->getBaseCurrencyCode(),
+ 'clientKey' => $this->novalnetConfig->getGlobalConfig('client_key'),
+ 'is_pending' => $this->novalnetRequestHelper->isAmountPendingForExpressCheckout(),
+ 'guest_page' => $this->novalnetRequestHelper->isPageEnabledForExpressCheckout('guest_checkout_page')
+ ],
+ self::NOVALNET_GOOGLEPAY => [
+ 'logo' => $this->getPaymentLogo(self::NOVALNET_GOOGLEPAY),
+ 'testmode' => $this->novalnetConfig->getTestMode(self::NOVALNET_GOOGLEPAY),
+ 'instructions' => $this->novalnetConfig->getPaymentConfig(self::NOVALNET_GOOGLEPAY, 'instructions'),
+ 'is_pending' => $this->novalnetRequestHelper->isAmountPendingForExpressCheckout(),
+ 'guest_page' => $this->novalnetRequestHelper->isPageEnabledForExpressCheckout('guest_checkout_page'),
+ 'sellerName' => $this->novalnetConfig->getPaymentConfig(self::NOVALNET_GOOGLEPAY, 'seller_name'),
+ 'btnType' => $this->novalnetConfig->getPaymentConfig(self::NOVALNET_GOOGLEPAY, 'button_type'),
+ 'btnTheme' => $this->novalnetConfig->getPaymentConfig(self::NOVALNET_GOOGLEPAY, 'button_theme'),
+ 'btnHeight' => $this->novalnetConfig->getPaymentConfig(self::NOVALNET_GOOGLEPAY, 'button_height'),
+ 'btnRadius' => $this->novalnetConfig->getPaymentConfig(self::NOVALNET_GOOGLEPAY, 'button_corner_radius'),
+ 'langCode' => $this->novalnetRequestHelper->getLanguageCodeForPaymentSheet(),
+ 'countryCode' => $this->novalnetRequestHelper->getCountryCode(),
+ 'currencyCode' => $this->storeManager->getStore()->getBaseCurrencyCode(),
+ 'clientKey' => $this->novalnetConfig->getGlobalConfig('client_key'),
+ 'partnerId' => $this->novalnetConfig->getPaymentConfig(self::NOVALNET_GOOGLEPAY, 'merchant_id'),
+ 'enforce3d' => ($this->novalnetConfig->getPaymentConfig(self::NOVALNET_GOOGLEPAY, 'enforce_3d')) ? $this->novalnetConfig->getPaymentConfig(self::NOVALNET_GOOGLEPAY, 'enforce_3d') : 0
+ ],
+ self::NOVALNET_SEPA => [
+ 'logo' => $this->getPaymentLogo(self::NOVALNET_SEPA),
+ 'testmode' => $this->novalnetConfig->getTestMode(self::NOVALNET_SEPA),
+ 'instructions' => $this->novalnetConfig->getPaymentConfig(self::NOVALNET_SEPA, 'instructions'),
+ 'storePayment' => $this->novalnetConfig->getPaymentConfig(self::NOVALNET_SEPA, 'shop_type'),
+ 'storedPayments' => $this->getOneClickToken(self::NOVALNET_SEPA),
+ 'tokenId' => $this->getOneClickToken(self::NOVALNET_SEPA, true),
+ 'isZeroAmountBooking' => ($this->novalnetConfig->getPaymentConfig(self::NOVALNET_SEPA, 'payment_action') == NNConfig::ACTION_ZERO_AMOUNT_BOOKING) ? true : false
+ ],
+ self::NOVALNET_INVOICE => [
+ 'logo' => $this->getPaymentLogo(self::NOVALNET_INVOICE),
+ 'testmode' => $this->novalnetConfig->getTestMode(self::NOVALNET_INVOICE),
+ 'instructions' => $this->novalnetConfig->getPaymentConfig(self::NOVALNET_INVOICE, 'instructions')
+ ],
+ self::NOVALNET_PREPAYMENT => [
+ 'logo' => $this->getPaymentLogo(self::NOVALNET_PREPAYMENT),
+ 'testmode' => $this->novalnetConfig->getTestMode(self::NOVALNET_PREPAYMENT),
+ 'instructions' => $this->novalnetConfig->getPaymentConfig(self::NOVALNET_PREPAYMENT, 'instructions'),
+ ],
+ self::NOVALNET_INVOICE_GUARANTEE => [
+ 'logo' => $this->getPaymentLogo(self::NOVALNET_INVOICE_GUARANTEE),
+ 'testmode' => $this->novalnetConfig->getTestMode(self::NOVALNET_INVOICE_GUARANTEE),
+ 'allow_b2b_customer' => $this->novalnetConfig->getPaymentConfig(
+ self::NOVALNET_INVOICE_GUARANTEE,
+ 'allow_b2b_customer'
+ ),
+ 'payment_guarantee_force' => $this->novalnetConfig->getPaymentConfig(
+ self::NOVALNET_INVOICE_GUARANTEE,
+ 'payment_guarantee_force'
+ ),
+ 'instructions' => $this->novalnetConfig->getPaymentConfig(
+ self::NOVALNET_INVOICE_GUARANTEE,
+ 'instructions'
+ ),
+ ],
+ self::NOVALNET_SEPA_GUARANTEE => [
+ 'logo' => $this->getPaymentLogo(self::NOVALNET_SEPA_GUARANTEE),
+ 'testmode' => $this->novalnetConfig->getTestMode(self::NOVALNET_SEPA_GUARANTEE),
+ 'allow_b2b_customer' => $this->novalnetConfig->getPaymentConfig(
+ self::NOVALNET_SEPA_GUARANTEE,
+ 'allow_b2b_customer'
+ ),
+ 'payment_guarantee_force' => $this->novalnetConfig->getPaymentConfig(
+ self::NOVALNET_SEPA_GUARANTEE,
+ 'payment_guarantee_force'
+ ),
+ 'instructions' => $this->novalnetConfig->getPaymentConfig(
+ self::NOVALNET_SEPA_GUARANTEE,
+ 'instructions'
+ ),
+ 'storePayment' => $this->novalnetConfig->getPaymentConfig(self::NOVALNET_SEPA_GUARANTEE, 'shop_type'),
+ 'storedPayments' => $this->getOneClickToken(self::NOVALNET_SEPA_GUARANTEE),
+ 'tokenId' => $this->getOneClickToken(self::NOVALNET_SEPA_GUARANTEE, true)
+ ],
+ self::NOVALNET_CASHPAYMENT => [
+ 'logo' => $this->getPaymentLogo(self::NOVALNET_CASHPAYMENT),
+ 'testmode' => $this->novalnetConfig->getTestMode(self::NOVALNET_CASHPAYMENT),
+ 'instructions' => $this->novalnetConfig->getPaymentConfig(self::NOVALNET_CASHPAYMENT, 'instructions'),
+ ],
+ self::NOVALNET_MULTIBANCO => [
+ 'logo' => $this->getPaymentLogo(self::NOVALNET_MULTIBANCO),
+ 'testmode' => $this->novalnetConfig->getTestMode(self::NOVALNET_MULTIBANCO),
+ 'instructions' => $this->novalnetConfig->getPaymentConfig(self::NOVALNET_MULTIBANCO, 'instructions'),
+ ],
+ self::NOVALNET_PAYPAL => [
+ 'logo' => $this->getPaymentLogo(self::NOVALNET_PAYPAL),
+ 'testmode' => $this->novalnetConfig->getTestMode(self::NOVALNET_PAYPAL),
+ 'instructions' => $this->novalnetConfig->getPaymentConfig(self::NOVALNET_PAYPAL, 'instructions'),
+ 'storePayment' => $this->novalnetConfig->getPaymentConfig(self::NOVALNET_PAYPAL, 'shop_type'),
+ 'storedPayments' => $this->getOneClickToken(self::NOVALNET_PAYPAL),
+ 'tokenId' => $this->getOneClickToken(self::NOVALNET_PAYPAL, true)
+ ],
+ self::NOVALNET_BANKTRANSFER => [
+ 'logo' => $this->getPaymentLogo(self::NOVALNET_BANKTRANSFER),
+ 'testmode' => $this->novalnetConfig->getTestMode(self::NOVALNET_BANKTRANSFER),
+ 'instructions' => $this->novalnetConfig->getPaymentConfig(self::NOVALNET_BANKTRANSFER, 'instructions'),
+ ],
+ self::NOVALNET_ONLINEBANKTRANSFER => [
+ 'logo' => $this->getPaymentLogo(self::NOVALNET_ONLINEBANKTRANSFER),
+ 'testmode' => $this->novalnetConfig->getTestMode(self::NOVALNET_ONLINEBANKTRANSFER),
+ 'instructions' => $this->novalnetConfig->getPaymentConfig(self::NOVALNET_ONLINEBANKTRANSFER, 'instructions'),
+ ],
+ self::NOVALNET_ALIPAY => [
+ 'logo' => $this->getPaymentLogo(self::NOVALNET_ALIPAY),
+ 'testmode' => $this->novalnetConfig->getTestMode(self::NOVALNET_ALIPAY),
+ 'instructions' => $this->novalnetConfig->getPaymentConfig(self::NOVALNET_ALIPAY, 'instructions'),
+ ],
+ self::NOVALNET_TRUSTLY => [
+ 'logo' => $this->getPaymentLogo(self::NOVALNET_TRUSTLY),
+ 'testmode' => $this->novalnetConfig->getTestMode(self::NOVALNET_TRUSTLY),
+ 'instructions' => $this->novalnetConfig->getPaymentConfig(self::NOVALNET_TRUSTLY, 'instructions'),
+ ],
+ self::NOVALNET_WECHATPAY => [
+ 'logo' => $this->getPaymentLogo(self::NOVALNET_WECHATPAY),
+ 'testmode' => $this->novalnetConfig->getTestMode(self::NOVALNET_WECHATPAY),
+ 'instructions' => $this->novalnetConfig->getPaymentConfig(self::NOVALNET_WECHATPAY, 'instructions'),
+ ],
+ self::NOVALNET_IDEAL => [
+ 'logo' => $this->getPaymentLogo(self::NOVALNET_IDEAL),
+ 'testmode' => $this->novalnetConfig->getTestMode(self::NOVALNET_IDEAL),
+ 'instructions' => $this->novalnetConfig->getPaymentConfig(self::NOVALNET_IDEAL, 'instructions'),
+ ],
+ self::NOVALNET_BLIK => [
+ 'logo' => $this->getPaymentLogo(self::NOVALNET_BLIK),
+ 'testmode' => $this->novalnetConfig->getTestMode(self::NOVALNET_BLIK),
+ 'instructions' => $this->novalnetConfig->getPaymentConfig(self::NOVALNET_BLIK, 'instructions')
+ ],
+ self::NOVALNET_BANCONTACT => [
+ 'logo' => $this->getPaymentLogo(self::NOVALNET_BANCONTACT),
+ 'testmode' => $this->novalnetConfig->getTestMode(self::NOVALNET_BANCONTACT),
+ 'instructions' => $this->novalnetConfig->getPaymentConfig(self::NOVALNET_BANCONTACT, 'instructions'),
+ ],
+ self::NOVALNET_EPS => [
+ 'logo' => $this->getPaymentLogo(self::NOVALNET_EPS),
+ 'testmode' => $this->novalnetConfig->getTestMode(self::NOVALNET_EPS),
+ 'instructions' => $this->novalnetConfig->getPaymentConfig(self::NOVALNET_EPS, 'instructions'),
+ ],
+ self::NOVALNET_GIROPAY => [
+ 'logo' => $this->getPaymentLogo(self::NOVALNET_GIROPAY),
+ 'testmode' => $this->novalnetConfig->getTestMode(self::NOVALNET_GIROPAY),
+ 'instructions' => $this->novalnetConfig->getPaymentConfig(self::NOVALNET_GIROPAY, 'instructions'),
+ ],
+ self::NOVALNET_PRZELEWY => [
+ 'logo' => $this->getPaymentLogo(self::NOVALNET_PRZELEWY),
+ 'testmode' => $this->novalnetConfig->getTestMode(self::NOVALNET_PRZELEWY),
+ 'instructions' => $this->novalnetConfig->getPaymentConfig(self::NOVALNET_PRZELEWY, 'instructions'),
+ ],
+ self::NOVALNET_POSTFINANCE => [
+ 'logo' => $this->getPaymentLogo(self::NOVALNET_POSTFINANCE),
+ 'testmode' => $this->novalnetConfig->getTestMode(self::NOVALNET_POSTFINANCE),
+ 'instructions' => $this->novalnetConfig->getPaymentConfig(self::NOVALNET_POSTFINANCE, 'instructions'),
+ ],
+ self::NOVALNET_POSTFINANCE_CARD => [
+ 'logo' => $this->getPaymentLogo(self::NOVALNET_POSTFINANCE_CARD),
+ 'testmode' => $this->novalnetConfig->getTestMode(self::NOVALNET_POSTFINANCE_CARD),
+ 'instructions' => $this->novalnetConfig->getPaymentConfig(self::NOVALNET_POSTFINANCE_CARD, 'instructions'),
+ ],
+ self::NOVALNET_INVOICE_INSTALMENT => [
+ 'logo' => $this->getPaymentLogo(self::NOVALNET_INVOICE_INSTALMENT),
+ 'testmode' => $this->novalnetConfig->getTestMode(self::NOVALNET_INVOICE_INSTALMENT),
+ 'allow_b2b_customer' => $this->novalnetConfig->getPaymentConfig(
+ self::NOVALNET_INVOICE_INSTALMENT,
+ 'allow_b2b_customer'
+ ),
+ 'instructions' => $this->novalnetConfig->getPaymentConfig(
+ self::NOVALNET_INVOICE_INSTALMENT,
+ 'instructions'
+ ),
+ 'instalmentCycles' => $this->novalnetConfig->getPaymentConfig(
+ self::NOVALNET_INVOICE_INSTALMENT,
+ 'instalment_cycles'
+ )
+ ],
+ self::NOVALNET_SEPA_INSTALMENT => [
+ 'logo' => $this->getPaymentLogo(self::NOVALNET_SEPA_INSTALMENT),
+ 'testmode' => $this->novalnetConfig->getTestMode(self::NOVALNET_SEPA_INSTALMENT),
+ 'allow_b2b_customer' => $this->novalnetConfig->getPaymentConfig(
+ self::NOVALNET_SEPA_INSTALMENT,
+ 'allow_b2b_customer'
+ ),
+ 'instructions' => $this->novalnetConfig->getPaymentConfig(
+ self::NOVALNET_SEPA_INSTALMENT,
+ 'instructions'
+ ),
+ 'instalmentCycles' => $this->novalnetConfig->getPaymentConfig(
+ self::NOVALNET_SEPA_INSTALMENT,
+ 'instalment_cycles'
+ ),
+ 'storePayment' => $this->novalnetConfig->getPaymentConfig(self::NOVALNET_SEPA_INSTALMENT, 'shop_type'),
+ 'storedPayments' => $this->getOneClickToken(self::NOVALNET_SEPA_INSTALMENT),
+ 'tokenId' => $this->getOneClickToken(self::NOVALNET_SEPA_INSTALMENT, true)
+ ],
+ ]
+ ];
+ }
+
+ /**
+ * Retrieve Credit Card iframe params
+ *
+ * @return array
+ */
+ public function getCcIframeParams()
+ {
+ return [
+ 'client_key' => $this->novalnetConfig->getGlobalConfig('client_key'),
+ 'lang' => $this->novalnetRequestHelper->getDefaultLanguage(),
+ 'cardHolderName' => $this->novalnetRequestHelper->getAccountHolder()
+ ];
+ }
+
+ /**
+ * Retrieve Credit Card style configuration
+ *
+ * @return array
+ */
+ public function getCcStyleConfig()
+ {
+ $ccStyleConfig = $this->novalnetConfig->getPaymentConfig(self::NOVALNET_CC, 'cc_style');
+ if (!empty($ccStyleConfig)) {
+ return $this->novalnetRequestHelper->isSerialized($ccStyleConfig)
+ ? $this->serializer->unserialize($ccStyleConfig)
+ : json_decode($ccStyleConfig, true);
+ }
+
+ return [];
+ }
+
+ /**
+ * Retrieve availables Credit Card types
+ *
+ * @param string $code
+ * @return array|bool
+ */
+ public function getCcAvailableTypes($code)
+ {
+ $availableTypes = $this->novalnetConfig->getPaymentConfig(self::NOVALNET_CC, 'cc_types');
+ $icons = [];
+ $ccIcons = [];
+
+ if ($availableTypes && $this->novalnetConfig->getGlobalConfig('enable_payment_logo')) {
+ foreach ($this->getCreditcardAssetUrl($code, $availableTypes) as $icon) {
+ $icons = [
+ 'src' => $icon,
+ 'title' => $this->novalnetConfig->getPaymentConfig(self::NOVALNET_CC, 'title')
+ ];
+ $ccIcons[] = $icons;
+ }
+
+ return $ccIcons;
+ }
+
+ return false;
+ }
+
+ /**
+ * Loads the Credit card images source asset path
+ *
+ * @param string $code
+ * @param string $availableTypes
+ * @return string|array
+ */
+ public function getCreditcardAssetUrl($code, $availableTypes)
+ {
+ $cardTypes = ['VI' => 'novalnetvisa', 'MC' => 'novalnetmastercard',
+ 'AE' => 'novalnetamex', 'MA' => 'novalnetmaestro', 'CI' => 'novalnetcartasi', 'UP' => 'novalnetunionpay',
+ 'DC' => 'novalnetdiscover', 'DI' => 'novalnetdiners', 'JCB' => 'novalnetjcb', 'CB' => 'novalnetcartebleue'];
+ $asset = [];
+ $assetUrl = [];
+ $params = ['_secure' => $this->request->isSecure()];
+ if ($availableTypes) {
+ $availableTypes = (!empty($availableTypes)) ? explode(',', $availableTypes) : [];
+ foreach ($cardTypes as $code => $value) {
+ if (in_array($code, $availableTypes)) {
+ $asset[$code] = $this->assetRepo->createAsset(
+ 'Novalnet_Payment::images/'. ($value) .'.png',
+ $params
+ );
+ $assetUrl[] = $asset[$code]->getUrl();
+ }
+ }
+ }
+
+ return $assetUrl;
+ }
+
+ /**
+ * Retrieve one click tokens
+ *
+ * @param string $paymentMethodCode
+ * @param string|bool $token
+ * @return array
+ */
+ public function getOneClickToken($paymentMethodCode, $token = false)
+ {
+ $data = [];
+ $tokenId = 'new_account';
+ $customerSession = $this->novalnetRequestHelper->getCustomerSession();
+ if ($customerSession->isLoggedIn() && $this->novalnetConfig->getPaymentConfig($paymentMethodCode, 'shop_type')) {
+ if (strpos($paymentMethodCode, self::NOVALNET_SEPA) !== false) {
+ $paymentMethodCode = self::NOVALNET_SEPA;
+ }
+ $transactionStatusCollection = $this->transactionStatusModel->getCollection()
+ ->setOrder('order_id', 'DESC')
+ ->setPageSize(3)
+ ->addFieldToFilter('token_info', ['neq' => 'NULL'])
+ ->addFieldToFilter('customer_id', $customerSession->getCustomer()->getId())
+ ->addFieldToFilter('payment_method', ['like' => $paymentMethodCode . '%']);
+
+ foreach ($transactionStatusCollection as $key => $transactionStatus) {
+ if ($transactionStatus->getTokenInfo() && !empty(json_decode($transactionStatus->getTokenInfo(), true))) {
+ $text = "";
+ if ($paymentMethodCode == self::NOVALNET_CC) {
+ $tokenInfo = json_decode($transactionStatus->getTokenInfo(), true);
+ if (empty($tokenInfo['NnCardNumber']) || empty($tokenInfo['NnCardExpiryMonth']) || empty($tokenInfo['NnCardExpiryYear'])) {
+ continue;
+ }
+
+ $text = __(
+ "ending in %1 (expires %2/%3)",
+ substr($tokenInfo['NnCardNumber'], -4),
+ sprintf("%02d", $tokenInfo['NnCardExpiryMonth']),
+ substr($tokenInfo['NnCardExpiryYear'], 2)
+ );
+ }
+
+ if ($tokenId == 'new_account') {
+ $tokenId = $transactionStatus->getToken();
+ }
+
+ $data[] = [
+ 'id' => $transactionStatus->getId(),
+ 'NnToken' => $transactionStatus->getToken(),
+ 'token_info' => json_decode($transactionStatus->getTokenInfo(), true),
+ 'text' => (!empty($text) ? $text : '')
+ ];
+
+ }
+ }
+ }
+ if ($token) {
+ return $tokenId;
+ }
+ return $data;
+ }
+
+ /**
+ * Get Payment Logo
+ *
+ * @param string $paymentMethodCode
+ * @return mixed
+ */
+ public function getPaymentLogo($paymentMethodCode)
+ {
+ $logoImageSrc = false;
+ if ($this->novalnetConfig->getGlobalConfig('enable_payment_logo') && !empty($paymentMethodCode)) {
+ $params = ['_secure' => $this->request->isSecure()];
+ $asset = $this->assetRepo->createAsset(
+ 'Novalnet_Payment::images/'. strtolower($paymentMethodCode) .'.png',
+ $params
+ );
+ $logoImageSrc = $asset->getUrl();
+ }
+
+ return $logoImageSrc;
+ }
+
+ /**
+ * Get Payment Logo
+ *
+ * @return mixed
+ */
+ public function getCardLogoUrl()
+ {
+ $logoImageSrc = false;
+ $params = ['_secure' => $this->request->isSecure()];
+ $asset = $this->assetRepo->createAsset(
+ 'Novalnet_Payment::images/',
+ $params
+ );
+ return $asset->getUrl();
+ }
+}
diff --git a/Observer/DataAssignObserver.php b/Observer/DataAssignObserver.php
new file mode 100755
index 0000000..8a0ed99
--- /dev/null
+++ b/Observer/DataAssignObserver.php
@@ -0,0 +1,406 @@
+novalnetRequestHelper = $novalnetRequestHelper;
+ $this->datetime = $datetime;
+ $this->novalnetConfig = $novalnetConfig;
+ $this->backendQuoteSession = $backendQuoteSession;
+ $this->cart = $cart;
+ $this->novalnetLogger = $novalnetLogger;
+ }
+
+ /**
+ * Get Quote
+ *
+ * @return object $quote
+ */
+ public function getCartQuote()
+ {
+ $quote = (!$this->novalnetRequestHelper->isAdmin())
+ ? $this->cart->getQuote()
+ : $this->backendQuoteSession->getQuote();
+ return $quote;
+ }
+
+ /**
+ * Execute
+ *
+ * @param Observer $observer
+ * @return void
+ */
+ public function execute(Observer $observer)
+ {
+ $method = $this->readMethodArgument($observer);
+ $paymentMethodCode = $method->getCode();
+ $this->novalnetRequestHelper->getMethodSession($paymentMethodCode, true);
+
+ $parameters = [
+ '_pan_hash', '_unique_id', '_do_redirect', '_iban', '_create_token', '_token', '_cycle', '_dob', '_wallet_token', '_bic'
+ ];
+ $this->setMethodSession($observer, $paymentMethodCode, $parameters);
+ }
+
+ /**
+ * Set method session
+ *
+ * @param \Magento\Framework\Event\Observer $observer
+ * @param string $paymentMethodCode
+ * @param array $parameters
+ * @return void
+ */
+ private function setMethodSession($observer, $paymentMethodCode, $parameters)
+ {
+ $additionalData = $this->readDataArgument($observer)->getAdditionalData();
+ $methodSession = $this->novalnetRequestHelper->getMethodSession($paymentMethodCode);
+ $this->validateGuaranteePayment($paymentMethodCode);
+ $this->validateBillingShippingAddress($paymentMethodCode);
+
+ foreach ($parameters as $parameter) {
+ if (!empty($additionalData[$paymentMethodCode . $parameter])) {
+ $methodSession->setData(
+ $paymentMethodCode . $parameter,
+ $additionalData[$paymentMethodCode . $parameter]
+ );
+ }
+ }
+
+ $forcedPayment = '';
+ $birthDate = !empty($additionalData[$paymentMethodCode . '_dob']) ? $additionalData[$paymentMethodCode . '_dob'] : '';
+
+ if (!empty($paymentMethodCode) && preg_match('/(.*)Guarantee/', $paymentMethodCode, $reassignedPaymentMethodCode)) {
+ $forcedPayment = $reassignedPaymentMethodCode[1];
+ }
+
+ // validate DOB and address - if failed proceed as force (non gurantee payment)
+ if (in_array($paymentMethodCode, [
+ ConfigProvider::NOVALNET_INVOICE_GUARANTEE,
+ ConfigProvider::NOVALNET_SEPA_GUARANTEE
+ ]) &&
+ (($birthDate && !$this->validateBirthDate($birthDate)) || !$this->checkBillingShippingAreSame() || !$this->checkGuaranteeConditions($paymentMethodCode) || !$this->validateSubscriptionConditions($paymentMethodCode))
+ ) {
+ if ($this->novalnetConfig->getPaymentConfig($paymentMethodCode, 'payment_guarantee_force') &&
+ $forcedPayment && $this->novalnetConfig->getPaymentConfig($forcedPayment, 'active')
+ ) {
+ $methodSession = $this->novalnetRequestHelper->getMethodSession($paymentMethodCode);
+ $forcedPaymentSession = $this->novalnetRequestHelper->getMethodSession($forcedPayment);
+
+ if ($forcedPayment == ConfigProvider::NOVALNET_SEPA) {
+ $forcedPaymentSession->setData($forcedPayment.'_iban', $methodSession->getData($paymentMethodCode.'_iban'));
+ $forcedPaymentSession->setData($forcedPayment.'_bic', $methodSession->getData($paymentMethodCode.'_bic'));
+ }
+
+ $forcedPaymentSession->setData($forcedPayment.'_token', $methodSession->getData($paymentMethodCode.'_token'));
+ $forcedPaymentSession->setData($forcedPayment.'_create_token', $methodSession->getData($paymentMethodCode.'_create_token'));
+ $forcedPaymentSession->setData($forcedPayment.'_dob', $methodSession->getData($paymentMethodCode.'_dob'));
+ $quote = $this->getCartQuote();
+ $quote->getPayment()->setMethod($forcedPayment);
+
+ if ($this->novalnetRequestHelper->isAdmin()) {
+ $methodSession->setData($paymentMethodCode.'_force', 1);
+ $methodSession->setData($paymentMethodCode.'_force_payment', $forcedPayment);
+ }
+
+ $this->novalnetLogger->notice("Update payment method from $paymentMethodCode to $forcedPayment");
+ } else {
+ throw new \Magento\Framework\Exception\LocalizedException(__('You need to be at least 18 years old'));
+ }
+ }
+ }
+
+ /**
+ * To check billing and shipping address are same
+ *
+ * @return boolean
+ */
+ public function checkBillingShippingAreSame()
+ {
+ $quote = $this->getCartQuote();
+ if ($quote->getIsVirtual()) {
+ return true;
+ }
+
+ $billingAddress = $quote->getBillingAddress();
+ $shipingAddress = $quote->getShippingAddress();
+ $billingStreet = $this->getStreet($billingAddress);
+ $shipingStreet = $this->getStreet($shipingAddress);
+
+ if ($billingStreet == $shipingStreet &&
+ $billingAddress->getCity() == $shipingAddress->getCity() &&
+ $billingAddress->getCountryId() ==$shipingAddress->getCountryId() &&
+ $billingAddress->getPostcode() == $shipingAddress->getPostcode()
+ ) {
+ return true;
+ }
+
+ return false;
+ }
+
+ /**
+ * To check guarantee conditions
+ *
+ * @param string $paymentMethodCode
+ * @return bool
+ */
+ public function checkGuaranteeConditions($paymentMethodCode)
+ {
+ $quote = $this->getCartQuote();
+ $orderAmount = $this->novalnetRequestHelper->getFormattedAmount($quote->getBaseGrandTotal());
+ $countryCode = (!empty($quote->getBillingAddress()->getCountryId())) ? strtoupper($quote->getBillingAddress()->getCountryId()) : ''; // Get country code
+ $b2b = (bool) $this->novalnetConfig->getPaymentConfig($paymentMethodCode, 'allow_b2b_customer');
+
+ if ($quote->getBaseCurrencyCode() != 'EUR') {
+ return false;
+ } elseif ($orderAmount < 999) {
+ return false;
+ } elseif (!$this->novalnetConfig->isAllowedCountry($countryCode, $b2b)) {
+ return false;
+ }
+
+ return true;
+ }
+
+ /**
+ * Check customer DOB is valid
+ *
+ * @param string $birthDate
+ * @return boolean
+ */
+ public function validateBirthDate($birthDate)
+ {
+ if (empty($birthDate)) {
+ return true;
+ }
+ $age = strtotime('+18 years', strtotime($birthDate));
+ $currentDate = $this->datetime->gmtTimestamp();
+ return ($currentDate < $age) ? false : true;
+ }
+
+ /**
+ * To validate billing and shipping address
+ *
+ * @param string $paymentMethodCode
+ * @return void
+ */
+ public function validateBillingShippingAddress($paymentMethodCode)
+ {
+ if (in_array($paymentMethodCode, [
+ ConfigProvider::NOVALNET_INVOICE_GUARANTEE,
+ ConfigProvider::NOVALNET_SEPA_GUARANTEE,
+ ConfigProvider::NOVALNET_SEPA_INSTALMENT,
+ ConfigProvider::NOVALNET_INVOICE_INSTALMENT
+ ])) {
+ // throw error on (non forced gurantee || instalment) address check failed
+ if (!$this->checkBillingShippingAreSame() &&
+ !$this->novalnetConfig->getPaymentConfig($paymentMethodCode, 'payment_guarantee_force') // non force
+ ) {
+ $errorPaymentName = in_array(
+ $paymentMethodCode,
+ [ConfigProvider::NOVALNET_SEPA_GUARANTEE, ConfigProvider::NOVALNET_INVOICE_GUARANTEE]
+ ) ? __('payment guarantee') : __('instalment payment');
+
+ throw new \Magento\Framework\Exception\LocalizedException(__(
+ "The payment cannot be processed, because the basic requirements for the %1 haven't been met (The shipping address must be the same as the billing address)",
+ $errorPaymentName
+ ));
+ }
+ }
+ }
+
+ /**
+ * Check Allowed Country
+ *
+ * @param string $paymentMethodCode
+ * @return mixed
+ */
+ public function validateGuaranteePayment($paymentMethodCode)
+ {
+ $objectManager = \Magento\Framework\App\ObjectManager::getInstance();
+ $coreSession = $objectManager->create(\Magento\Framework\Session\SessionManagerInterface::class);
+
+ //skip conditions for recurring order
+ if ($coreSession->getRecurringProcess()) {
+ return true;
+ }
+
+ if (in_array(
+ $paymentMethodCode,
+ [
+ ConfigProvider::NOVALNET_INVOICE_GUARANTEE,
+ ConfigProvider::NOVALNET_SEPA_GUARANTEE,
+ ConfigProvider::NOVALNET_SEPA_INSTALMENT,
+ ConfigProvider::NOVALNET_INVOICE_INSTALMENT
+ ]
+ )) {
+ $quote = $this->getCartQuote();
+ $orderAmount = $this->novalnetRequestHelper->getFormattedAmount($quote->getBaseGrandTotal());
+ $countryCode = (!empty($quote->getBillingAddress()->getCountryId())) ? strtoupper($quote->getBillingAddress()->getCountryId()) : ''; // Get country code
+ $b2b = (bool) $this->novalnetConfig->getPaymentConfig($paymentMethodCode, 'allow_b2b_customer');
+ $billingAddress = $quote->getBillingAddress();
+ $errorPaymentName = in_array(
+ $paymentMethodCode,
+ [ConfigProvider::NOVALNET_SEPA_GUARANTEE, ConfigProvider::NOVALNET_INVOICE_GUARANTEE]
+ ) ? __('payment guarantee') : __('instalment payment');
+ $errorText = '';
+ if ($quote->getBaseCurrencyCode() != 'EUR') {
+ $errorText = __('Only EUR currency allowed %1', $errorPaymentName);
+ } elseif ($orderAmount < 999) {
+ $errorText = __('Minimum order amount should be %1', $errorPaymentName);
+ } elseif (!$this->novalnetConfig->isAllowedCountry($countryCode, $b2b)) {
+ $errorText = __('Only DE, AT, CH countries allowed %1', $errorPaymentName);
+ }
+
+ if (!empty($errorText) && !$this->novalnetConfig->getPaymentConfig($paymentMethodCode, 'payment_guarantee_force')) {
+ throw new \Magento\Framework\Exception\LocalizedException(__(
+ $errorText
+ ));
+ }
+ }
+ }
+
+ /**
+ * Validate subscription conditions for Guarantee payments
+ *
+ * @param string $paymentMethodCode
+ * @return bool
+ */
+ public function validateSubscriptionConditions($paymentMethodCode)
+ {
+ if (in_array(
+ $paymentMethodCode,
+ [
+ ConfigProvider::NOVALNET_INVOICE_GUARANTEE,
+ ConfigProvider::NOVALNET_SEPA_GUARANTEE
+ ]
+ )) {
+ $objectManager = \Magento\Framework\App\ObjectManager::getInstance();
+ $coreSession = $objectManager->create(\Magento\Framework\Session\SessionManagerInterface::class);
+
+ //skip conditions for recurring order
+ if ($coreSession->getRecurringProcess()) {
+ return true;
+ }
+
+ $errorText = '';
+ $quote = $this->getCartQuote();
+ $subscription = false;
+ if (!empty($quote->getItems())) {
+ foreach ($quote->getItems() as $item) {
+ $additionalData = (!empty($item->getAdditionalData())) ? json_decode($item->getAdditionalData(), true) : [];
+ if (!empty($additionalData['period_unit']) && !empty($additionalData['billing_frequency'])) {
+ $subscription = true;
+ break;
+ }
+ }
+ }
+ if ($subscription) {
+ if ($quote->getItemsCount() > 1) {
+ $errorText = __('Multi cart not supported for this payment');
+ } elseif ($quote->getItemsCount() == 1) {
+ foreach ($quote->getAllItems() as $item) {
+ $orderAmount = $this->novalnetRequestHelper->getFormattedAmount($item->getBaseRowTotal());
+ if ($orderAmount < 999) {
+ $errorText = __('Minimum order amount should be %1', 'payment guarantee');
+ }
+ }
+ }
+ }
+
+ if (!empty($errorText) && $this->novalnetConfig->getPaymentConfig($paymentMethodCode, 'payment_guarantee_force')) {
+ return false;
+ } if (!empty($errorText)) {
+ throw new \Magento\Framework\Exception\LocalizedException(__(
+ $errorText
+ ));
+ }
+ }
+
+ return true;
+ }
+
+ /**
+ * Get Street from address
+ *
+ * @param object $address
+ * @return string
+ */
+ public function getStreet($address)
+ {
+ if (method_exists($address, 'getStreetFull')) {
+ $street = $address->getStreetFull();
+ } else {
+ $street = implode(' ', [$address->getStreetLine1(), $address->getStreetLine2()]);
+ }
+
+ return $street;
+ }
+}
diff --git a/Observer/OrderPlacebefore.php b/Observer/OrderPlacebefore.php
new file mode 100755
index 0000000..c345b75
--- /dev/null
+++ b/Observer/OrderPlacebefore.php
@@ -0,0 +1,74 @@
+novalnetRequestHelper = $novalnetRequestHelper;
+ $this->novalnetLogger = $novalnetLogger;
+ }
+
+ /**
+ * Execute
+ *
+ * @param \Magento\Framework\Event\Observer $observer
+ * @return void
+ */
+ public function execute(\Magento\Framework\Event\Observer $observer)
+ {
+ $paymentMethodCode = $observer->getOrder()->getPayment()->getMethod();
+ if (in_array(
+ $paymentMethodCode,
+ [
+ ConfigProvider::NOVALNET_INVOICE_GUARANTEE,
+ ConfigProvider::NOVALNET_SEPA_GUARANTEE
+ ]
+ ) && $this->novalnetRequestHelper->isAdmin()) {
+ $methodSession = $this->novalnetRequestHelper->getMethodSession($paymentMethodCode);
+ $forcedPayment = $methodSession->getData($paymentMethodCode.'_force_payment');
+ if ($methodSession->getData($paymentMethodCode.'_force') && $forcedPayment) {
+ //set payment methode to proceed guarantee force
+ $observer->getOrder()->getPayment()->setMethod($forcedPayment);
+ $this->novalnetLogger->notice("Update payment method from $paymentMethodCode to $forcedPayment");
+ }
+ }
+ }
+}
diff --git a/Observer/PaymentMethodIsActive.php b/Observer/PaymentMethodIsActive.php
new file mode 100755
index 0000000..ed62457
--- /dev/null
+++ b/Observer/PaymentMethodIsActive.php
@@ -0,0 +1,198 @@
+salesOrderModel = $salesOrderModel;
+ $this->novalnetConfig = $novalnetConfig;
+ $this->novalnetRequestHelper = $novalnetRequestHelper;
+ }
+
+ /**
+ * Execute
+ *
+ * @param Observer $observer
+ *
+ * @throws \GuzzleHttp\Exception\GuzzleException
+ */
+ public function execute(Observer $observer)
+ {
+ $event = $observer->getEvent();
+ $methodInstance = $event->getData('method_instance');
+ $quote = $event->getData('quote');
+ $result = $event->getData('result');
+ $paymentMethodCode = $methodInstance->getCode();
+
+ if ($quote && $result->getData('is_available') && strpos($paymentMethodCode, 'novalnet') === 0) {
+
+ $available = $this->novalnetRequestHelper->validateBasicParams()
+ && $this->validateOrdersCount($paymentMethodCode)
+ && $this->validateCustomerGroup($paymentMethodCode);
+
+ if (in_array(
+ $paymentMethodCode,
+ [
+ ConfigProvider::NOVALNET_SEPA_GUARANTEE,
+ ConfigProvider::NOVALNET_INVOICE_GUARANTEE,
+ ConfigProvider::NOVALNET_SEPA_INSTALMENT,
+ ConfigProvider::NOVALNET_INVOICE_INSTALMENT
+ ]
+ )) {
+ $orderAmount = $this->novalnetRequestHelper->getFormattedAmount($quote->getBaseGrandTotal());
+ $countryCode = (!empty($quote->getBillingAddress()->getCountryId())) ? strtoupper($quote->getBillingAddress()->getCountryId()) : ''; // Get country code
+ $b2b = (bool) $this->novalnetConfig->getPaymentConfig($paymentMethodCode, 'allow_b2b_customer');
+ $force = "";
+
+ if (in_array(
+ $paymentMethodCode,
+ [ConfigProvider::NOVALNET_SEPA_INSTALMENT, ConfigProvider::NOVALNET_INVOICE_INSTALMENT]
+ )) {
+ $allcycle = $this->novalnetConfig->getPaymentConfig($paymentMethodCode, 'instalment_cycles');
+ $allcycle = (!empty($allcycle)) ? explode(',', $allcycle) : [];
+ $orderAmount = isset($allcycle[0]) ? ($orderAmount / $allcycle[0]) : $orderAmount;
+ } else {
+ $force = $this->novalnetConfig->getPaymentConfig($paymentMethodCode, 'payment_guarantee_force');
+ }
+
+ if (!$force && ($orderAmount < 999 || $quote->getBaseCurrencyCode() != 'EUR'
+ || !$this->novalnetConfig->isAllowedCountry($countryCode, $b2b) ||
+ ($this->novalnetRequestHelper->isAdmin() && !$this->checkBillingShippingAreSame($quote)))
+ ) {
+ $available = false;
+ }
+ }
+
+ if (in_array(
+ $paymentMethodCode,
+ [
+ ConfigProvider::NOVALNET_SEPA,
+ ConfigProvider::NOVALNET_INVOICE,
+ ]
+ )) {
+ $paymentCode = (!empty($paymentMethodCode) && preg_match('/Sepa/', $paymentMethodCode)) ? ConfigProvider::NOVALNET_SEPA_GUARANTEE : ConfigProvider::NOVALNET_INVOICE_GUARANTEE;
+ $force = $this->novalnetConfig->getPaymentConfig($paymentCode, 'payment_guarantee_force');
+ $active = $this->novalnetConfig->getPaymentConfig($paymentCode, 'active');
+ if ($active && !$force) {
+ $available = false;
+ }
+ }
+
+ $result->setData('is_available', $available);
+ }
+ }
+
+ /**
+ * Check orders count by customer id
+ *
+ * @param string $paymentMethodCode
+ * @return bool
+ */
+ public function validateOrdersCount($paymentMethodCode)
+ {
+ $minOrderCount = $this->novalnetConfig->getPaymentConfig($paymentMethodCode, 'orders_count');
+ if ($minOrderCount) {
+ if ($this->novalnetRequestHelper->getCustomerSession()->isLoggedIn()) {
+ $customerId = $this->novalnetRequestHelper->getCustomerSession()->getCustomer()->getId();
+ } elseif ($this->novalnetRequestHelper->isAdmin()) {
+ $customerId = $this->novalnetRequestHelper->getAdminCheckoutSession()->getCustomerId();
+ } else {
+ return false;
+ }
+
+ // get orders by customer id
+ $ordersCount = $this->salesOrderModel->getCollection()->addFieldToFilter('customer_id', $customerId)
+ ->count();
+ return ($ordersCount >= trim($minOrderCount));
+ } else {
+ return true;
+ }
+ }
+
+ /**
+ * Check whether the payment is available for current customer group
+ *
+ * @param string $paymentMethodCode
+ * @return boolean
+ */
+ public function validateCustomerGroup($paymentMethodCode)
+ {
+ // Excluded customer groups from payment configuration
+ $excludedGroups = $this->novalnetConfig->getPaymentConfig($paymentMethodCode, 'user_group_excluded');
+ if (!$this->novalnetRequestHelper->isAdmin() && !empty($excludedGroups) && strlen($excludedGroups)) {
+ $excludedGroups = (!empty($excludedGroups)) ? explode(',', $excludedGroups) : [];
+ $customerGroupId = $this->novalnetRequestHelper->getCustomerSession()->getCustomer()->getGroupId();
+ if (!$this->novalnetRequestHelper->getCustomerSession()->isLoggedIn()) {
+ $customerGroupId = 0;
+ }
+ return !in_array($customerGroupId, $excludedGroups);
+ }
+
+ return true;
+ }
+
+ /**
+ * Check billing and shipping address are same for guarantee payments
+ *
+ * @param mixed $quote
+ * @return boolean
+ */
+ public function checkBillingShippingAreSame($quote)
+ {
+ $billingAddress = $quote->getBillingAddress();
+ $shippingAddress = !$quote->getIsVirtual() ? $quote->getShippingAddress() : '';
+ $billingStreet = (!empty($billingAddress->getStreet())) ? implode(',', $billingAddress->getStreet()) : '';
+ $shippingStreet = (!empty($shippingAddress->getStreet())) ? implode(',', $shippingAddress->getStreet()) : '';
+ return ($shippingAddress == '' || (($billingAddress->getCity() == $shippingAddress->getCity())
+ && ($billingStreet == $shippingStreet)
+ && ($billingAddress->getPostcode() == $shippingAddress->getPostcode())
+ && ($billingAddress->getCountry() == $shippingAddress->getCountry()))
+ );
+ }
+}
diff --git a/Observer/ProcessCaptureAction.php b/Observer/ProcessCaptureAction.php
new file mode 100755
index 0000000..35a55cb
--- /dev/null
+++ b/Observer/ProcessCaptureAction.php
@@ -0,0 +1,164 @@
+urlInterface = $urlInterface;
+ $this->dbTransaction = $dbTransaction;
+ $this->invoiceSender = $invoiceSender;
+ $this->logger = $logger;
+ $this->novalnetConfig = $novalnetConfig;
+ $this->novalnetRequestHelper = $novalnetRequestHelper;
+ $this->novalnetLogger = $novalnetLogger;
+ $this->serializer = $serializer;
+ }
+
+ /**
+ * Process capture Action
+ *
+ * @param \Magento\Framework\Event\Observer $observer
+ * @return mixed
+ */
+ public function execute(\Magento\Framework\Event\Observer $observer)
+ {
+ try {
+ $invoice = $observer->getEvent()->getInvoice();
+ $order = $invoice->getOrder();
+ $storeId = $order->getStoreId();
+ $paymentMethodCode = $order->getPayment()->getMethod();
+
+ if (!empty($paymentMethodCode) && preg_match('/novalnet/', $paymentMethodCode)) {
+
+ if ($paymentMethodCode == ConfigProvider::NOVALNET_INVOICE) {
+ $additionalData = [];
+ if (!empty($order->getPayment()->getAdditionalData())) {
+ $additionalData = $this->novalnetRequestHelper->isSerialized($order->getPayment()->getAdditionalData())
+ ? $this->serializer->unserialize($order->getPayment()->getAdditionalData())
+ : json_decode($order->getPayment()->getAdditionalData(), true);
+ }
+ if (!empty($additionalData['NnGuarantee'])) {
+ $state = \Magento\Sales\Model\Order\Invoice::STATE_PAID;
+ } else {
+ $state = \Magento\Sales\Model\Order\Invoice::STATE_OPEN;
+ }
+ // set Invoice state as Open
+ $invoice->setState($state);
+ }
+
+ $currentUrl = (!empty($this->urlInterface->getCurrentUrl())) ? $this->urlInterface->getCurrentUrl() : '';
+
+ if ($this->novalnetRequestHelper->isAdmin() &&
+ !preg_match('/sales_order_create/i', $currentUrl)
+ ) {
+ $captureOrderStatus = $this->novalnetConfig->getPaymentConfig(
+ $paymentMethodCode,
+ 'order_status',
+ $storeId
+ );
+ // Set capture status for Novalnet payments
+ $order->setState(\Magento\Sales\Model\Order::STATE_PROCESSING)
+ ->setStatus($captureOrderStatus)
+ ->save();
+
+ $order->addStatusHistoryComment(__('The transaction has been confirmed'), false)
+ ->save();
+ }
+
+ if ($this->novalnetRequestHelper->isAdmin() && (preg_match('/order_create/i', $currentUrl) || preg_match('/ordercapture/i', $currentUrl))) {
+ $this->dbTransaction->create()->addObject($invoice)->addObject($order)->save();
+ $shopVersion = (string) $this->novalnetRequestHelper->getMagentoVersion();
+ if (version_compare('2.4.0', $shopVersion) == 1) {
+ $this->invoiceSender->send($invoice);
+ }
+ }
+ }
+ } catch (\Exception $e) {
+ $this->logger->critical($e);
+ $this->novalnetLogger->error($e);
+ }
+
+ return $this;
+ }
+}
diff --git a/Observer/ProcessNovalnetPayment.php b/Observer/ProcessNovalnetPayment.php
new file mode 100755
index 0000000..1e0b01c
--- /dev/null
+++ b/Observer/ProcessNovalnetPayment.php
@@ -0,0 +1,160 @@
+novalnetConfig = $novalnetConfig;
+ $this->novalnetRequestHelper = $novalnetRequestHelper;
+ $this->serializer = $serializer;
+ $this->invoiceService = $invoiceService;
+ $this->transaction = $transaction;
+ $this->coreSession = $coreSession;
+ }
+
+ /**
+ * If it's redrected to checkout onepage/multishipping success page - do this
+ *
+ * @param \Magento\Framework\Event\Observer $observer
+ * @return void
+ */
+ public function execute(\Magento\Framework\Event\Observer $observer)
+ {
+ $order = $observer->getEvent()->getOrder();
+ if ($order) {
+ $storeId = $order->getStoreId();
+ $paymentMethodCode = $order->getPayment()->getMethod();
+
+ if (!empty($paymentMethodCode) && preg_match('/novalnet/', $paymentMethodCode) && $order->getPayment()->getAdditionalData()) {
+
+ // unset session data after request formation
+ $subscription = false;
+ foreach ($order->getItems() as $item) {
+ $additionalData = [];
+ if (!empty($item->getAdditionalData())) {
+ $additionalData = json_decode($item->getAdditionalData(), true);
+ }
+
+ if (!empty($additionalData['period_unit']) && !empty($additionalData['billing_frequency'])) {
+ $subscription = true;
+ break;
+ }
+ }
+ if ($subscription != true) {
+ $this->novalnetRequestHelper->getMethodSession($paymentMethodCode, true);
+ }
+ $additionalData = (!empty($order->getPayment()->getAdditionalData())) ? json_decode($order->getPayment()->getAdditionalData(), true) : [];
+ $transactionStatus = !empty($additionalData['NnStatus']) ? $additionalData['NnStatus'] : '';
+ if (!isset($additionalData['NnRedirectURL'])) {
+ $orderStatus = 'pending';
+
+ if ($transactionStatus == 'ON_HOLD' || ($this->novalnetConfig->isZeroAmountBookingSupported($paymentMethodCode) && $this->novalnetConfig->getPaymentConfig($paymentMethodCode, 'payment_action') == NNConfig::ACTION_ZERO_AMOUNT_BOOKING)) {
+ $orderStatus = $this->novalnetConfig->getGlobalOnholdStatus($storeId);
+ } elseif ($transactionStatus == 'CONFIRMED' || ($transactionStatus == 'PENDING' && in_array(
+ $paymentMethodCode,
+ [
+ ConfigProvider::NOVALNET_INVOICE,
+ ConfigProvider::NOVALNET_PREPAYMENT,
+ ConfigProvider::NOVALNET_CASHPAYMENT,
+ ConfigProvider::NOVALNET_MULTIBANCO
+ ]
+ )
+ )) {
+ $orderStatus = $this->novalnetConfig->getPaymentConfig(
+ $paymentMethodCode,
+ 'order_status',
+ $storeId
+ );
+ }
+
+ if (($paymentMethodCode == ConfigProvider::NOVALNET_PAYPAL) && $this->coreSession->getRecurringProcess() && $transactionStatus == 'CONFIRMED') {
+ $invoice = $this->invoiceService->prepareInvoice($order);
+ $invoice->setRequestedCaptureCase(\Magento\Sales\Model\Order\Invoice::CAPTURE_OFFLINE);
+ $invoice->register();
+ $invoice->save();
+ $transactionSave = $this->transaction->addObject(
+ $invoice
+ )->addObject(
+ $invoice->getOrder()
+ );
+ $transactionSave->save();
+ }
+
+ $orderStatus = $orderStatus ? $orderStatus : Order::STATE_PROCESSING;
+ // Verifies and sets order status
+ $order->setState(Order::STATE_PROCESSING)
+ ->setStatus($orderStatus);
+ $order->save();
+ }
+ }
+ }
+ }
+}
diff --git a/Observer/SavePaymentDataForRecurring.php b/Observer/SavePaymentDataForRecurring.php
new file mode 100755
index 0000000..baf503a
--- /dev/null
+++ b/Observer/SavePaymentDataForRecurring.php
@@ -0,0 +1,118 @@
+date = $date;
+ $this->jsonHelper = $jsonHelper;
+ $this->novalnetRequestHelper = $novalnetRequestHelper;
+ $this->transactionStatusModel = $transactionStatusModel;
+ }
+
+ /**
+ * Save payment data for future recurring order
+ *
+ * @param \Magento\Framework\Event\Observer $observer
+ * @return void
+ */
+ public function execute(\Magento\Framework\Event\Observer $observer)
+ {
+ $order = $observer->getOrder();
+ $paymentMethodCode = $observer->getPaymentCode();
+ if (!empty($paymentMethodCode) && preg_match('/novalnet/', $paymentMethodCode)) {
+ $token = $this->getToken($paymentMethodCode, $order->getIncrementId());
+ $profileData = $observer->getItem();
+ if (!empty($token)) {
+ $profileData->setToken($token);
+ }
+
+ //Save date of birth and company for future recurring
+ if (in_array($paymentMethodCode, [ConfigProvider::NOVALNET_INVOICE_GUARANTEE, ConfigProvider::NOVALNET_SEPA_GUARANTEE])) {
+ $methodSession = $this->novalnetRequestHelper->getMethodSession($paymentMethodCode);
+ $recurringData = [];
+ if ($methodSession->getData($paymentMethodCode . '_dob')) {
+ $recurringData['dob'] = $this->date->date(
+ 'Y-m-d',
+ $methodSession->getData($paymentMethodCode . '_dob')
+ );
+ }
+ $profileData->setAdditionalData($this->jsonHelper->jsonEncode($recurringData));
+ }
+ // unset session data after request formation
+ $this->novalnetRequestHelper->getMethodSession($paymentMethodCode, true);
+ }
+ }
+
+ /**
+ * Get Token
+ *
+ * @param string $paymentMethodCode
+ * @param int $orderId
+ * @return string
+ */
+ public function getToken($paymentMethodCode, $orderId)
+ {
+ $methodSession = $this->novalnetRequestHelper->getMethodSession($paymentMethodCode);
+ $token = $methodSession->getData($paymentMethodCode . '_token');
+ if (empty($token)) {
+ $transactionStatus = $this->transactionStatusModel->getCollection()->setPageSize(1)
+ ->addFieldToFilter('order_id', $orderId)
+ ->getFirstItem();
+ $token = $transactionStatus->getToken();
+ }
+ return $token;
+ }
+}
diff --git a/Observer/SetPaymentDataForRecurring.php b/Observer/SetPaymentDataForRecurring.php
new file mode 100755
index 0000000..5d82847
--- /dev/null
+++ b/Observer/SetPaymentDataForRecurring.php
@@ -0,0 +1,88 @@
+date = $date;
+ $this->novalnetRequestHelper = $novalnetRequestHelper;
+ $this->transactionStatusModel = $transactionStatusModel;
+ }
+
+ /**
+ * Save payment data for future recurring order
+ *
+ * @param \Magento\Framework\Event\Observer $observer
+ * @return void
+ */
+ public function execute(\Magento\Framework\Event\Observer $observer)
+ {
+ $paymentData = $observer->getPaymentData()->getData();
+ $paymentDataObject = $observer->getPaymentData();
+ $profile = $observer->getProfile();
+ $paymentCode = $observer->getPaymentCode();
+ if (in_array($paymentCode, [ConfigProvider::NOVALNET_CC, ConfigProvider::NOVALNET_SEPA ,ConfigProvider::NOVALNET_PAYPAL])) {
+ $recurringDetails = $profile->getToken();
+
+ if (!empty($profile->getToken())) {
+ $paymentData['additional_data'][$paymentCode.'_token'] = $profile->getToken();
+ }
+ } elseif (in_array($paymentCode, [ConfigProvider::NOVALNET_INVOICE_GUARANTEE, ConfigProvider::NOVALNET_SEPA_GUARANTEE])) {
+ if (!empty($profile->getAdditionalData())) {
+ $additionalData = json_decode($profile->getAdditionalData(), true);
+ if (isset($additionalData['dob'])) {
+ $paymentData['additional_data'][$paymentCode.'_dob'] = $additionalData['dob'];
+ }
+ if (!empty($profile->getToken())) {
+ $paymentData['additional_data'][$paymentCode.'_token'] = $profile->getToken();
+ }
+ }
+ }
+ $paymentDataObject->setData($paymentData);
+ }
+}
diff --git a/Observer/SetVoidStatus.php b/Observer/SetVoidStatus.php
new file mode 100755
index 0000000..b7248ed
--- /dev/null
+++ b/Observer/SetVoidStatus.php
@@ -0,0 +1,60 @@
+novalnetConfig = $novalnetConfig;
+ }
+
+ /**
+ * Set Canceled/Void status for Novalnet payments
+ *
+ * @param \Magento\Framework\Event\Observer $observer
+ * @return void
+ */
+ public function execute(\Magento\Framework\Event\Observer $observer)
+ {
+ $payment = $observer->getEvent()->getPayment();
+ if (!empty($payment->getMethodInstance()->getCode()) && preg_match('/novalnet/i', $payment->getMethodInstance()->getCode())) {
+
+ $order = $payment->getOrder();
+ $order->setState(Order::STATE_PROCESSING)
+ ->setStatus(Order::STATE_CANCELED)
+ ->save();
+ $order->addStatusHistoryComment(__('The transaction has been canceled'), false)
+ ->save();
+ }
+ }
+}
diff --git a/Observer/ShortcutButtons.php b/Observer/ShortcutButtons.php
new file mode 100755
index 0000000..0f273d3
--- /dev/null
+++ b/Observer/ShortcutButtons.php
@@ -0,0 +1,57 @@
+getEvent()->getContainer();
+
+ /** @var \Magento\Framework\View\Element\Template $shortcut */
+ $shortcut = $shortcutButtons->getLayout()->createBlock(
+ \Novalnet\Payment\Block\Checkout\Cart\Shortcut::class,
+ '',
+ []
+ );
+
+ $shortcut->setIsInCatalogProduct(
+ $observer->getEvent()->getIsCatalogProduct()
+ )->setShowOrPosition(
+ $observer->getEvent()->getOrPosition()
+ );
+
+ $shortcut->setIsShoppingCart($observer->getEvent()->getIsShoppingCart());
+
+ $shortcut->setIsCart(get_class($shortcutButtons) == \Magento\Checkout\Block\QuoteShortcutButtons::class);
+
+ $shortcutButtons->addShortcut($shortcut);
+ }
+}
diff --git a/Observer/SubscriptionSupportedPayments.php b/Observer/SubscriptionSupportedPayments.php
new file mode 100755
index 0000000..36ad55e
--- /dev/null
+++ b/Observer/SubscriptionSupportedPayments.php
@@ -0,0 +1,60 @@
+novalnetConfig = $novalnetConfig;
+ }
+
+ /**
+ * Set Subscription Supported Novalnet payments
+ *
+ * @param \Magento\Framework\Event\Observer $observer
+ * @return void
+ */
+ public function execute(\Magento\Framework\Event\Observer $observer)
+ {
+ $paymentMethods = $observer->getPaymentMethods();
+ if (!empty($paymentMethods)) {
+ $payments = $paymentMethods->getData();
+ foreach ($payments as $paymentCode => $payment) {
+ if (!empty($paymentCode) && preg_match('/novalnet/i', $paymentCode) && !$this->novalnetConfig->isSubscriptionSupported($paymentCode)) {
+ unset($payments[$paymentCode]);
+ }
+ }
+ $paymentMethods->setData($payments);
+ }
+ }
+}
diff --git a/Plugin/Checkout/LayoutProcessor.php b/Plugin/Checkout/LayoutProcessor.php
new file mode 100755
index 0000000..48689cc
--- /dev/null
+++ b/Plugin/Checkout/LayoutProcessor.php
@@ -0,0 +1,71 @@
+novalnetHelper = $novalnetHelper;
+ $this->novalnetConfig = $NNConfig;
+ }
+
+ /**
+ * After process
+ *
+ * @param \Magento\Checkout\Block\Checkout\LayoutProcessor $subject
+ * @param array $jsLayout
+ * @return mixed
+ */
+ public function afterProcess(
+ \Magento\Checkout\Block\Checkout\LayoutProcessor $subject,
+ array $jsLayout
+ ) {
+ $isEnabled = $this->novalnetHelper->isPageEnabledForExpressCheckout('guest_checkout_page');
+
+ if ($this->novalnetHelper->getCustomerSession()->isLoggedIn() || (!$isEnabled['novalnetApplepay'] && !$isEnabled['novalnetGooglepay'])) {
+ if (isset($jsLayout['components']['checkout']['children']['steps']
+ ['children']['shipping-step']['children']['novalnet-guest-checkout'])) {
+ unset($jsLayout['components']['checkout']['children']['steps']
+ ['children']['shipping-step']['children']['novalnet-guest-checkout']);
+ }
+ }
+
+ return $jsLayout;
+ }
+}
diff --git a/Setup/Patch/Data/RemoveAccessKey.php b/Setup/Patch/Data/RemoveAccessKey.php
new file mode 100755
index 0000000..c69fdc3
--- /dev/null
+++ b/Setup/Patch/Data/RemoveAccessKey.php
@@ -0,0 +1,234 @@
+collectionFactory = $collectionFactory;
+ $this->configResource = $configResource;
+ $this->resourceConfig = $resourceConfig;
+ $this->novalnetLogger = $novalnetLogger;
+ }
+
+ /**
+ * @inheritdoc
+ */
+ public function apply()
+ {
+ $novalnetGlobalConfig = [
+ 'novalnet_global/novalnet/payment_access_key',
+ 'novalnet_global/novalnet/signature',
+ 'payment/novalnet/payment_access_key',
+ 'payment/novalnet/signature'
+ ];
+
+ $novalnetMapping = [
+ 'novalnet_global/novalnet/live_mode' => 'payment/novalnet/live_mode',
+ 'novalnet_global/novalnet/enable_payment_logo' => 'payment/novalnet/enable_payment_logo',
+ 'novalnet_global/novalnet/restore_cart' => 'payment/novalnet/restore_cart',
+ 'novalnet_global/merchant_script/test_mode' => 'payment/merchant_script/test_mode',
+ 'novalnet_global/merchant_script/mail_to_addr' => 'payment/merchant_script/mail_to_addr',
+ 'payment/novalnetSepa/enable_guarantee' => 'payment/novalnetSepaGuarantee/active',
+ 'payment/novalnetSepa/sepa_duedate' => 'payment/novalnetSepa/due_date',
+ 'payment/novalnetSepaInstalment/sepa_duedate' => 'payment/novalnetSepaInstalment/due_date',
+ 'payment/novalnetInvoice/enable_guarantee' => 'payment/novalnetInvoiceGuarantee/active',
+ 'payment/novalnetInvoice/payment_duration' => 'payment/novalnetInvoice/due_date',
+ 'payment/novalnetCashpayment/payment_duration' => 'payment/novalnetCashpayment/due_date',
+ 'payment/novalnetSepa/guarantee_min_order_total' => 'payment/novalnetSepaGuarantee/min_order_total',
+ 'payment/novalnetInvoice/guarantee_min_order_total' => 'payment/novalnetInvoiceGuarantee/min_order_total',
+ 'payment/novalnetSepa/payment_guarantee_force' => 'payment/novalnetSepaGuarantee/payment_guarantee_force',
+ 'payment/novalnetSepa/active' => 'payment/novalnetSepaGuarantee/payment_guarantee_force',
+ 'payment/novalnetInvoice/payment_guarantee_force' => 'payment/novalnetInvoiceGuarantee/payment_guarantee_force',
+ 'payment/novalnetInvoice/active' => 'payment/novalnetInvoiceGuarantee/payment_guarantee_force',
+ 'payment/novalnetInvoiceInstalment/min_order_total' => 'payment/novalnetInvoiceInstalment/min_order_total',
+ 'payment/novalnetSepaInstalment/min_order_total' => 'payment/novalnetSepaInstalment/min_order_total',
+ 'payment/novalnetInvoiceInstalment/instalment_total_period' => 'payment/novalnetInvoiceInstalment/instalment_cycles',
+ 'payment/novalnetSepaInstalment/instalment_total_period' => 'payment/novalnetSepaInstalment/instalment_cycles',
+ 'payment/novalnetCc/order_status_after_payment' => 'payment/novalnetCc/order_status',
+ 'payment/novalnetPaypal/order_status_after_payment' => 'payment/novalnetPaypal/order_status',
+ 'payment/novalnetBanktransfer/order_status_after_payment' => 'payment/novalnetBanktransfer/order_status',
+ 'payment/novalnetIdeal/order_status_after_payment' => 'payment/novalnetIdeal/order_status',
+ 'payment/novalnetEps/order_status_after_payment' => 'payment/novalnetEps/order_status',
+ 'payment/novalnetGiropay/order_status_after_payment' => 'payment/novalnetGiropay/order_status',
+ 'payment/novalnetPrzelewy/order_status_after_payment' => 'payment/novalnetPrzelewy/order_status',
+ ];
+
+ //set default value for enable payment logo option
+ $this->resourceConfig->saveConfig(
+ 'payment/novalnet/enable_payment_logo',
+ 1,
+ 'default',
+ 0
+ );
+ //set default value for restore cart
+ $this->resourceConfig->saveConfig(
+ 'payment/novalnet/restore_cart',
+ 1,
+ 'default',
+ 0
+ );
+ //set default value for ip control
+ $this->resourceConfig->saveConfig(
+ 'payment/merchant_script/test_mode',
+ 0,
+ 'default',
+ 0
+ );
+
+ $novalnetConfigurations = $this->collectionFactory->create()->addFieldToFilter('path', [
+ ['like' => '%novalnet_global%'],
+ ['like' => '%novalnetInvoice%'],
+ ['like' => '%novalnetSepa%'],
+ ['like' => '%novalnetCashpayment%'],
+ ['like' => '%order_status_after_payment'],
+ ['like' => '%paymentaction'],
+ ]);
+
+ foreach ($novalnetConfigurations as $config) {
+ if (in_array($config->getPath(), $novalnetGlobalConfig)) {
+ //Remove payment access key and signature
+ $this->configResource->delete($config);
+ $this->novalnetLogger->notice('Removed Novalnet global configuration. The config path: ' . $config->getPath());
+ } elseif (isset($novalnetMapping[$config->getPath()])) {
+ $value = $config->getValue();
+ //update guarantee min order total into EUR
+ if (!empty($config->getPath()) && preg_match('/guarantee_min_order_total/', $config->getPath()) && !empty($config->getValue())) {
+ $value = $this->getFormattedAmount(
+ $config->getValue(),
+ 'RAW'
+ );
+ } elseif (!empty($config->getPath()) && preg_match('/guarantee_min_order_total/', $config->getPath()) && empty($config->getValue())) {
+ $value = $this->getFormattedAmount(
+ 999,
+ 'RAW'
+ );
+ }
+
+ //update min order total for Instalment payments
+ if (!empty($config->getPath()) && preg_match('/Instalment\/min_order_total/', $config->getPath())) {
+ $value = '19.98';
+ }
+
+ //update Guarantee Force configuration
+ if (!empty($config->getPath()) && preg_match('/payment_guarantee_force/', $config->getPath())) {
+ $value = 0;
+ }
+
+ $this->resourceConfig->saveConfig(
+ $novalnetMapping[$config->getPath()],
+ $value,
+ $config->getScope(),
+ $config->getScopeId()
+ );
+ $this->novalnetLogger->notice(
+ 'Update Novalnet payment config path & value. Old path: ' . $config->getPath() .
+ ' New path: ' . $novalnetMapping[$config->getPath()] . ' Values is: ' . $value
+ );
+ } else {
+ //update payment_action configuration
+ if (!empty($config->getPath()) && preg_match('/novalnet/', $config->getPath()) && preg_match('/paymentaction/', $config->getPath())) {
+ $path = preg_replace('/paymentaction/i', 'payment_action', $config->getPath());
+ if ($config->getValue() == 1) {
+ $value = AbstractMethod::ACTION_AUTHORIZE;
+ } else {
+ $value = AbstractMethod::ACTION_AUTHORIZE_CAPTURE;
+ }
+ $this->resourceConfig->saveConfig(
+ $path,
+ $value,
+ $config->getScope(),
+ $config->getScopeId()
+ );
+ $this->novalnetLogger->notice(
+ 'Update Novalnet payment config path & value. Old path: ' . $config->getPath() .
+ ' New path: ' . $path . ' Values is: ' . $value
+ );
+ }
+ }
+ }
+ }
+
+ /**
+ * @inheritdoc
+ */
+ public static function getDependencies()
+ {
+ return [];
+ }
+
+ /**
+ * @inheritdoc
+ */
+ public function getAliases()
+ {
+ return [];
+ }
+
+ /**
+ * Get the formated amount in cents/euro
+ *
+ * @param mixed $amount
+ * @param string $type
+ * @return mixed
+ */
+ public function getFormattedAmount($amount, $type = 'CENT')
+ {
+ if (!empty($amount)) {
+ return ($type == 'RAW') ? number_format($amount / 100, 2, '.', '') : round($amount, 2) * 100;
+ }
+
+ return null;
+ }
+}
diff --git a/composer.json b/composer.json
new file mode 100755
index 0000000..b9ae91e
--- /dev/null
+++ b/composer.json
@@ -0,0 +1,16 @@
+{
+ "name": "novalnet/module-payment",
+ "description": "Demonstrates integration with payment gateway",
+ "type": "magento2-module",
+ "version": "12.4.5",
+ "license": [
+ "OSL-3.0",
+ "AFL-3.0"
+ ],
+ "autoload": {
+ "files": [ "registration.php" ],
+ "psr-4": {
+ "Novalnet\\Payment\\": ""
+ }
+ }
+}
diff --git a/etc/adminhtml/di.xml b/etc/adminhtml/di.xml
new file mode 100755
index 0000000..b0692a2
--- /dev/null
+++ b/etc/adminhtml/di.xml
@@ -0,0 +1,26 @@
+
+
+
+
+
+
+
diff --git a/etc/adminhtml/routes.xml b/etc/adminhtml/routes.xml
new file mode 100755
index 0000000..f29ea22
--- /dev/null
+++ b/etc/adminhtml/routes.xml
@@ -0,0 +1,28 @@
+
+
+
+
+
+
+
+
+
diff --git a/etc/adminhtml/system.xml b/etc/adminhtml/system.xml
new file mode 100755
index 0000000..42357dc
--- /dev/null
+++ b/etc/adminhtml/system.xml
@@ -0,0 +1,65 @@
+
+
+
+
+
+
+ Secured and trusted means of accepting all payment methods supported worldwide. Novalnet provides the most convenient way to increase your sales and deliver seamless checkout experience for your customers.
]]>
+ novalnet-section
+ Magento\Paypal\Block\Adminhtml\System\Config\Fieldset\Payment
+
+
+
+ novalnet-payment-section
+ Payments
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/etc/adminhtml/system/novalnet_alipay.xml b/etc/adminhtml/system/novalnet_alipay.xml
new file mode 100755
index 0000000..6fcc8e4
--- /dev/null
+++ b/etc/adminhtml/system/novalnet_alipay.xml
@@ -0,0 +1,90 @@
+
+
+
+
+ Alipay
+
+ Display payment method
+ Magento\Config\Model\Config\Source\Yesno
+ payment/novalnetAlipay/active
+
+
+ Novalnet Title
+ payment/novalnetAlipay/title
+
+
+ Define a sorting order
+ This payment method will be sorted among others (in the ascending order) as per the given sort number
+ validate-number
+ validate-length maximum-length-5
+ payment/novalnetAlipay/sort_order
+
+
+ Completed order status
+ Status to be used for successful orders
+ Magento\Sales\Model\Config\Source\Order\Status
+ payment/novalnetAlipay/order_status
+
+
+ Notification for the buyer
+ The entered text will be displayed on the checkout page
+ validate-no-html-tags
+ payment/novalnetAlipay/instructions
+
+
+ User Group Excluded
+ 1
+ Novalnet\Payment\Model\Adminhtml\Source\CustomerGroups
+ payment/novalnetAlipay/user_group_excluded
+
+
+ Payment from Applicable Countries
+ Magento\Payment\Model\Config\Source\Allspecificcountries
+ payment/novalnetAlipay/allowspecific
+
+
+ Payment from Specific Countries
+ Magento\Directory\Model\Config\Source\Country
+ payment/novalnetAlipay/specificcountry
+
+
+ Minimum Order Total
+ validate-number validate-zero-or-greater validate-length maximum-length-15
+ payment/novalnetAlipay/min_order_total
+
+
+ Maximum Order Total
+ validate-number validate-zero-or-greater validate-length maximum-length-15
+ payment/novalnetAlipay/max_order_total
+
+
+ Minimum Orders Count
+ validate-number validate-zero-or-greater validate-length maximum-length-5
+ Default: '0' for disabled check | Minimum count of orders (in the past) needed for the customer to use this payment method
+ payment/novalnetAlipay/orders_count
+
+
+
diff --git a/etc/adminhtml/system/novalnet_applepay.xml b/etc/adminhtml/system/novalnet_applepay.xml
new file mode 100755
index 0000000..b17cd62
--- /dev/null
+++ b/etc/adminhtml/system/novalnet_applepay.xml
@@ -0,0 +1,109 @@
+
+
+
+
+ Apple Pay
+ Your customers can checkout using Apple Pay from any page in your web store
+
+ Display payment method
+ Magento\Config\Model\Config\Source\Yesno
+ payment/novalnetApplepay/active
+
+
+ Novalnet Title
+ payment/novalnetApplepay/title
+
+
+ Define a sorting order
+ This payment method will be sorted among others (in the ascending order) as per the given sort number
+ validate-length maximum-length-5
+ validate-number
+ payment/novalnetApplepay/sort_order
+
+
+ Business name
+ The business name is rendered in the Apple Pay payment sheet, and this text will appear as PAY 'BUSINESS NAME' so that the customer knows where he is paying to.
+ payment/novalnetApplepay/seller_name
+
+
+ Payment Action
+ Choose whether or not the payment should be charged immediately. Capture completes the transaction by transferring the funds from buyer account to merchant account. Authorize verifies payment details and reserves funds to capture it later, giving time for the merchant to decide on the order.
+ Novalnet\Payment\Model\Adminhtml\Source\PaymentAction
+ payment/novalnetApplepay/payment_action
+
+
+ Minimum transaction amount for authorization
+ validate-greater-than-zero validate-digits validate-length maximum-length-15
+ payment/novalnetApplepay/manual_checking_amount
+
+ authorize
+
+
+
+ Completed order status
+ Status to be used for successful orders
+ Magento\Sales\Model\Config\Source\Order\Status
+ payment/novalnetApplepay/order_status
+
+
+ Notification for the buyer
+ The entered text will be displayed on the checkout page
+ validate-no-html-tags
+ payment/novalnetApplepay/instructions
+
+
+ Button Design
+ Magento\Config\Block\System\Config\Form\Fieldset
+
+ Button Type
+ Novalnet\Payment\Model\Adminhtml\Source\ApplepayButtonStyle
+ payment/novalnetApplepay/button_style
+
+
+ Button Theme
+ Novalnet\Payment\Model\Adminhtml\Source\ApplepayButtonTheme
+ payment/novalnetApplepay/button_theme
+
+
+ Button Height
+ Range from 30 to 64 pixels
+ payment/novalnetApplepay/button_height
+ validate-digits validate-digits-range digits-range-30-64
+
+
+ Button Corner Radius
+ Range from 0 to 10 pixels
+ payment/novalnetApplepay/button_corner_radius
+ validate-digits validate-digits-range digits-range-0-10
+
+
+ Display the Apple Pay button on
+ 1
+ The selected pages will display the Apple pay button to pay instantly as an express checkout option
+ Novalnet\Payment\Model\Adminhtml\Source\ApplepayEnabledPages
+ payment/novalnetApplepay/enabled_pages
+
+
+
+
diff --git a/etc/adminhtml/system/novalnet_bancontact.xml b/etc/adminhtml/system/novalnet_bancontact.xml
new file mode 100755
index 0000000..55905a0
--- /dev/null
+++ b/etc/adminhtml/system/novalnet_bancontact.xml
@@ -0,0 +1,90 @@
+
+
+
+
+ Bancontact
+
+ Display payment method
+ Magento\Config\Model\Config\Source\Yesno
+ payment/novalnetBancontact/active
+
+
+ Novalnet Title
+ payment/novalnetBancontact/title
+
+
+ Define a sorting order
+ This payment method will be sorted among others (in the ascending order) as per the given sort number
+ validate-length maximum-length-5
+ validate-number
+ payment/novalnetBancontact/sort_order
+
+
+ Completed order status
+ Status to be used for successful orders
+ Magento\Sales\Model\Config\Source\Order\Status
+ payment/novalnetBancontact/order_status
+
+
+ Notification for the buyer
+ The entered text will be displayed on the checkout page
+ validate-no-html-tags
+ payment/novalnetBancontact/instructions
+
+
+ User Group Excluded
+ 1
+ Novalnet\Payment\Model\Adminhtml\Source\CustomerGroups
+ payment/novalnetBancontact/user_group_excluded
+
+
+ Payment from Applicable Countries
+ Magento\Payment\Model\Config\Source\Allspecificcountries
+ payment/novalnetBancontact/allowspecific
+
+
+ Payment from Specific Countries
+ Magento\Directory\Model\Config\Source\Country
+ payment/novalnetBancontact/specificcountry
+
+
+ Minimum Order Total
+ validate-number validate-zero-or-greater validate-length maximum-length-15
+ payment/novalnetBancontact/min_order_total
+
+
+ Maximum Order Total
+ validate-number validate-zero-or-greater validate-length maximum-length-15
+ payment/novalnetBancontact/max_order_total
+
+
+ Minimum Orders Count
+ validate-number validate-zero-or-greater validate-length maximum-length-5
+ Default: '0' for disabled check | Minimum count of orders (in the past) needed for the customer to use this payment method
+ payment/novalnetBancontact/orders_count
+
+
+
diff --git a/etc/adminhtml/system/novalnet_banktransfer.xml b/etc/adminhtml/system/novalnet_banktransfer.xml
new file mode 100755
index 0000000..162041f
--- /dev/null
+++ b/etc/adminhtml/system/novalnet_banktransfer.xml
@@ -0,0 +1,90 @@
+
+
+
+
+ Sofort
+
+ Display payment method
+ Magento\Config\Model\Config\Source\Yesno
+ payment/novalnetBanktransfer/active
+
+
+ Novalnet Title
+ payment/novalnetBanktransfer/title
+
+
+ Define a sorting order
+ This payment method will be sorted among others (in the ascending order) as per the given sort number
+ validate-number
+ validate-length maximum-length-5
+ payment/novalnetBanktransfer/sort_order
+
+
+ Completed order status
+ Status to be used for successful orders
+ Magento\Sales\Model\Config\Source\Order\Status
+ payment/novalnetBanktransfer/order_status
+
+
+ Notification for the buyer
+ The entered text will be displayed on the checkout page
+ validate-no-html-tags
+ payment/novalnetBanktransfer/instructions
+
+
+ User Group Excluded
+ 1
+ Novalnet\Payment\Model\Adminhtml\Source\CustomerGroups
+ payment/novalnetBanktransfer/user_group_excluded
+
+
+ Payment from Applicable Countries
+ Magento\Payment\Model\Config\Source\Allspecificcountries
+ payment/novalnetBanktransfer/allowspecific
+
+
+ Payment from Specific Countries
+ Magento\Directory\Model\Config\Source\Country
+ payment/novalnetBanktransfer/specificcountry
+
+
+ Minimum Order Total
+ validate-number validate-zero-or-greater validate-length maximum-length-15
+ payment/novalnetBanktransfer/min_order_total
+
+
+ Maximum Order Total
+ validate-number validate-zero-or-greater validate-length maximum-length-15
+ payment/novalnetBanktransfer/max_order_total
+
+
+ Minimum Orders Count
+ validate-number validate-zero-or-greater validate-length maximum-length-5
+ Default: '0' for disabled check | Minimum count of orders (in the past) needed for the customer to use this payment method
+ payment/novalnetBanktransfer/orders_count
+
+
+
diff --git a/etc/adminhtml/system/novalnet_blik.xml b/etc/adminhtml/system/novalnet_blik.xml
new file mode 100755
index 0000000..bc0822c
--- /dev/null
+++ b/etc/adminhtml/system/novalnet_blik.xml
@@ -0,0 +1,90 @@
+
+
+
+
+ Blik
+
+ Display payment method
+ Magento\Config\Model\Config\Source\Yesno
+ payment/novalnetBlik/active
+
+
+ Novalnet Title
+ payment/novalnetBlik/title
+
+
+ Define a sorting order
+ This payment method will be sorted among others (in the ascending order) as per the given sort number
+ validate-length maximum-length-5
+ validate-number
+ payment/novalnetBlik/sort_order
+
+
+ Completed order status
+ Status to be used for successful orders
+ Magento\Sales\Model\Config\Source\Order\Status
+ payment/novalnetBlik/order_status
+
+
+ Notification for the buyer
+ The entered text will be displayed on the checkout page
+ validate-no-html-tags
+ payment/novalnetBlik/instructions
+
+
+ User Group Excluded
+ 1
+ Novalnet\Payment\Model\Adminhtml\Source\CustomerGroups
+ payment/novalnetBlik/user_group_excluded
+
+
+ Payment from Applicable Countries
+ Magento\Payment\Model\Config\Source\Allspecificcountries
+ payment/novalnetBlik/allowspecific
+
+
+ Payment from Specific Countries
+ Magento\Directory\Model\Config\Source\Country
+ payment/novalnetBlik/specificcountry
+
+
+ Minimum Order Total
+ validate-number validate-zero-or-greater validate-length maximum-length-15
+ payment/novalnetBlik/min_order_total
+
+
+ Maximum Order Total
+ validate-number validate-zero-or-greater validate-length maximum-length-15
+ payment/novalnetBlik/max_order_total
+
+
+ Minimum Orders Count
+ validate-number validate-zero-or-greater validate-length maximum-length-5
+ Default: '0' for disabled check | Minimum count of orders (in the past) needed for the customer to use this payment method
+ payment/novalnetBlik/orders_count
+
+
+
diff --git a/etc/adminhtml/system/novalnet_cashpayment.xml b/etc/adminhtml/system/novalnet_cashpayment.xml
new file mode 100755
index 0000000..3b1a4e0
--- /dev/null
+++ b/etc/adminhtml/system/novalnet_cashpayment.xml
@@ -0,0 +1,101 @@
+
+
+
+
+ Barzahlen/viacash
+
+ Display payment method
+ Magento\Config\Model\Config\Source\Yesno
+ payment/novalnetCashpayment/active
+
+
+ Novalnet Title
+ payment/novalnetCashpayment/title
+
+
+ Define a sorting order
+ This payment method will be sorted among others (in the ascending order) as per the given sort number
+ validate-length maximum-length-5
+ validate-number
+ payment/novalnetCashpayment/sort_order
+
+
+ Slip expiry date (in days)
+ Enter the number of days to pay the amount at store near you. If the field is empty, 14 days will be set as default.
+ validate-digits
+ payment/novalnetCashpayment/due_date
+
+
+ Completed order status
+ Status to be used for successful orders
+ Magento\Sales\Model\Config\Source\Order\Status
+ payment/novalnetCashpayment/order_status
+
+
+ Webhook order status
+ Magento\Sales\Model\Config\Source\Order\Status
+ payment/novalnetCashpayment/order_status_after_payment
+
+
+ Notification for the buyer
+ The entered text will be displayed on the checkout page
+ validate-no-html-tags
+ payment/novalnetCashpayment/instructions
+
+
+ User Group Excluded
+ 1
+ Novalnet\Payment\Model\Adminhtml\Source\CustomerGroups
+ payment/novalnetCashpayment/user_group_excluded
+
+
+ Payment from Applicable Countries
+ Magento\Payment\Model\Config\Source\Allspecificcountries
+ payment/novalnetCashpayment/allowspecific
+
+
+ Payment from Specific Countries
+ Magento\Directory\Model\Config\Source\Country
+ payment/novalnetCashpayment/specificcountry
+
+
+ Minimum Order Total
+ validate-number validate-zero-or-greater validate-length maximum-length-15
+ payment/novalnetCashpayment/min_order_total
+
+
+ Maximum Order Total
+ validate-number validate-zero-or-greater validate-length maximum-length-15
+ payment/novalnetCashpayment/max_order_total
+
+
+ Minimum Orders Count
+ validate-number validate-zero-or-greater validate-length maximum-length-5
+ Default: '0' for disabled check | Minimum count of orders (in the past) needed for the customer to use this payment method
+ payment/novalnetCashpayment/orders_count
+
+
+
diff --git a/etc/adminhtml/system/novalnet_cc.xml b/etc/adminhtml/system/novalnet_cc.xml
new file mode 100755
index 0000000..3a12f93
--- /dev/null
+++ b/etc/adminhtml/system/novalnet_cc.xml
@@ -0,0 +1,135 @@
+
+
+
+
+ Credit/Debit Cards
+
+ Display payment method
+ Magento\Config\Model\Config\Source\Yesno
+ payment/novalnetCc/active
+
+
+ Novalnet Title
+ payment/novalnetCc/title
+
+
+ Define a sorting order
+ This payment method will be sorted among others (in the ascending order) as per the given sort number
+ validate-length maximum-length-5
+ validate-number
+ payment/novalnetCc/sort_order
+
+
+ Enforce 3D secure payment outside EU
+ By enabling this option, all payments from cards issued outside the EU will be authenticated via 3DS 2.0 SCA.
+ Magento\Config\Model\Config\Source\Yesno
+ payment/novalnetCc/enforce_3d
+
+
+ Payment Action
+ Choose whether or not the payment should be charged immediately. Capture completes the transaction by transferring the funds from buyer account to merchant account. Authorize verifies payment details and reserves funds to capture it later, giving time for the merchant to decide on the order.
+ Novalnet\Payment\Model\Adminhtml\Source\PaymentActionWithZeroAmount
+ payment/novalnetCc/payment_action
+
+
+ Minimum transaction amount for authorization
+ validate-greater-than-zero validate-digits validate-length maximum-length-15
+ payment/novalnetCc/manual_checking_amount
+
+ authorize
+
+
+
+ One-click shopping
+ Payment details stored during the checkout process can be used for future payments
+ Magento\Config\Model\Config\Source\Yesno
+ payment/novalnetCc/shop_type
+
+
+ Completed order status
+ Status to be used for successful orders
+ Magento\Sales\Model\Config\Source\Order\Status
+ payment/novalnetCc/order_status
+
+
+ Display inline credit card form
+ Magento\Config\Model\Config\Source\Yesno
+
+ payment/novalnetCc/inline_form
+
+
+ Form appearance
+ Novalnet\Payment\Block\System\Config\Form\Field\CreditcardStyle
+ Magento\Config\Model\Config\Backend\Serialized
+ payment/novalnetCc/cc_style
+
+
+ Display Credit/Debit card logos
+ 1
+ The selected card logos will be displayed on the checkout page
+ Novalnet\Payment\Model\Adminhtml\Source\CcCardTypes
+ payment/novalnetCc/cc_types
+
+
+ Notification for the buyer
+ The entered text will be displayed on the checkout page
+ validate-no-html-tags
+ payment/novalnetCc/instructions
+
+
+ User Group Excluded
+ 1
+ Novalnet\Payment\Model\Adminhtml\Source\CustomerGroups
+ payment/novalnetCc/user_group_excluded
+
+
+ Payment from Applicable Countries
+ Magento\Payment\Model\Config\Source\Allspecificcountries
+ payment/novalnetCc/allowspecific
+
+
+ Payment from Specific Countries
+ Magento\Directory\Model\Config\Source\Country
+ payment/novalnetCc/specificcountry
+
+
+ Minimum Order Total
+ validate-number validate-zero-or-greater validate-length maximum-length-15
+ payment/novalnetCc/min_order_total
+
+
+ Maximum Order Total
+ validate-number validate-zero-or-greater validate-length maximum-length-15
+ payment/novalnetCc/max_order_total
+
+
+ Minimum Orders Count
+ validate-number validate-zero-or-greater validate-length maximum-length-5
+ Default: '0' for disabled check | Minimum count of orders (in the past) needed for the customer to use this payment method
+ payment/novalnetCc/orders_count
+
+
+
diff --git a/etc/adminhtml/system/novalnet_documentation.xml b/etc/adminhtml/system/novalnet_documentation.xml
new file mode 100755
index 0000000..4842201
--- /dev/null
+++ b/etc/adminhtml/system/novalnet_documentation.xml
@@ -0,0 +1,33 @@
+
+
+
+
+ Documentation
+ Novalnet Admin Portal using your merchant account. To get a merchant account, mail to sales@novalnet.de or call +49 (089) 923068320]]>
+
+ Novalnet\Payment\Block\System\Config\Form\Field\ModuleVersion
+ Module version
+ payment/novalnet/version
+
+
+
diff --git a/etc/adminhtml/system/novalnet_eps.xml b/etc/adminhtml/system/novalnet_eps.xml
new file mode 100755
index 0000000..0f836d7
--- /dev/null
+++ b/etc/adminhtml/system/novalnet_eps.xml
@@ -0,0 +1,90 @@
+
+
+
+
+ Eps
+
+ Display payment method
+ Magento\Config\Model\Config\Source\Yesno
+ payment/novalnetEps/active
+
+
+ Novalnet Title
+ payment/novalnetEps/title
+
+
+ Define a sorting order
+ This payment method will be sorted among others (in the ascending order) as per the given sort number
+ validate-length maximum-length-5
+ validate-number
+ payment/novalnetEps/sort_order
+
+
+ Completed order status
+ Status to be used for successful orders
+ Magento\Sales\Model\Config\Source\Order\Status
+ payment/novalnetEps/order_status
+
+
+ Notification for the buyer
+ The entered text will be displayed on the checkout page
+ validate-no-html-tags
+ payment/novalnetEps/instructions
+
+
+ User Group Excluded
+ 1
+ Novalnet\Payment\Model\Adminhtml\Source\CustomerGroups
+ payment/novalnetEps/user_group_excluded
+
+
+ Payment from Applicable Countries
+ Magento\Payment\Model\Config\Source\Allspecificcountries
+ payment/novalnetEps/allowspecific
+
+
+ Payment from Specific Countries
+ Magento\Directory\Model\Config\Source\Country
+ payment/novalnetEps/specificcountry
+
+
+ Minimum Order Total
+ validate-number validate-zero-or-greater validate-length maximum-length-15
+ payment/novalnetEps/min_order_total
+
+
+ Maximum Order Total
+ validate-number validate-zero-or-greater validate-length maximum-length-15
+ payment/novalnetEps/max_order_total
+
+
+ Minimum Orders Count
+ validate-number validate-zero-or-greater validate-length maximum-length-5
+ Default: '0' for disabled check | Minimum count of orders (in the past) needed for the customer to use this payment method
+ payment/novalnetEps/orders_count
+
+
+
diff --git a/etc/adminhtml/system/novalnet_giropay.xml b/etc/adminhtml/system/novalnet_giropay.xml
new file mode 100755
index 0000000..5f5a7d4
--- /dev/null
+++ b/etc/adminhtml/system/novalnet_giropay.xml
@@ -0,0 +1,90 @@
+
+
+
+
+ Giropay
+
+ Display payment method
+ Magento\Config\Model\Config\Source\Yesno
+ payment/novalnetGiropay/active
+
+
+ Novalnet Title
+ payment/novalnetGiropay/title
+
+
+ Define a sorting order
+ This payment method will be sorted among others (in the ascending order) as per the given sort number
+ validate-length maximum-length-5
+ validate-number
+ payment/novalnetGiropay/sort_order
+
+
+ Completed order status
+ Status to be used for successful orders
+ Magento\Sales\Model\Config\Source\Order\Status
+ payment/novalnetGiropay/order_status
+
+
+ Notification for the buyer
+ The entered text will be displayed on the checkout page
+ validate-no-html-tags
+ payment/novalnetGiropay/instructions
+
+
+ User Group Excluded
+ 1
+ Novalnet\Payment\Model\Adminhtml\Source\CustomerGroups
+ payment/novalnetGiropay/user_group_excluded
+
+
+ Payment from Applicable Countries
+ Magento\Payment\Model\Config\Source\Allspecificcountries
+ payment/novalnetGiropay/allowspecific
+
+
+ Payment from Specific Countries
+ Magento\Directory\Model\Config\Source\Country
+ payment/novalnetGiropay/specificcountry
+
+
+ Minimum Order Total
+ validate-number validate-zero-or-greater validate-length maximum-length-15
+ payment/novalnetGiropay/min_order_total
+
+
+ Maximum Order Total
+ validate-number validate-zero-or-greater validate-length maximum-length-15
+ payment/novalnetGiropay/max_order_total
+
+
+ Minimum Orders Count
+ validate-number validate-zero-or-greater validate-length maximum-length-5
+ Default: '0' for disabled check | Minimum count of orders (in the past) needed for the customer to use this payment method
+ payment/novalnetGiropay/orders_count
+
+
+
diff --git a/etc/adminhtml/system/novalnet_global_config.xml b/etc/adminhtml/system/novalnet_global_config.xml
new file mode 100755
index 0000000..8649b9d
--- /dev/null
+++ b/etc/adminhtml/system/novalnet_global_config.xml
@@ -0,0 +1,104 @@
+
+
+
+
+ Configuration
+
+ Product Activation Key
+ payment/novalnet/signature
+
+
+ Payment Access Key
+ payment/novalnet/payment_access_key
+
+
+ Activate
+ Novalnet\Payment\Block\System\Config\Form\Field\VendorAutoConfig
+ payment/novalnet/vendor_config
+ Novalnet Admin Portal: Projects > Choose your project > API credentials > API Signature (Product activation key)]]>
+
+
+ Client Key
+ payment/novalnet/client_key
+ Novalnet\Payment\Block\System\Config\Form\Field\Disabled
+
+
+ Select Tariff ID
+ payment/novalnet/tariff_id
+ Select a Tariff ID to match the preferred tariff plan you created at the Novalnet Admin Portal for this project
+
+
+ Enable Live Mode
+ Selected payment methods will be in Live Mode
+ Novalnet\Payment\Model\Adminhtml\Source\Activemethods
+ 1
+ payment/novalnet/live_mode
+
+
+ Display payment method logo
+ The payment method logo will be displayed on the checkout page
+ Magento\Config\Model\Config\Source\Yesno
+ payment/novalnet/enable_payment_logo
+
+
+ Products remain in the shopping cart after cancelled payment
+ Magento\Config\Model\Config\Source\Yesno
+ payment/novalnet/restore_cart
+
+
+ Deactivate Instalment Renewal Notification E-mail to end-customer
+ Magento\Config\Model\Config\Source\Yesno
+ payment/novalnet/instalment_mail
+
+
+ On-hold order status
+ Status to be used for on-hold orders until the transaction is confirmed or canceled
+ Magento\Sales\Model\Config\Source\Order\Status
+ novalnet_global/novalnet/onhold_status
+
+
+ Notification / Webhook URL Setup
+ {Shop_url/rest/V1/novalnet/callback} in below Notification / Webhook URL field and click on Configure button to receive notification about transactions.]]>
+
+
+ Notification / Webhook URL is required to keep the merchant’s database/system synchronized with the Novalnet account (e.g. delivery status). Refer the Installation Guide for more information
+ Novalnet\Payment\Block\System\Config\Form\Field\WebhookURL
+ validate-url validate-no-html-tags
+ payment/merchant_script/vendor_script_url
+
+
+ Allow manual testing of the Notification / Webhook URL
+ Enable this to test the Novalnet Notification / Webhook URL manually. Disable this before setting your shop live to block unauthorized calls from external parties
+ Magento\Config\Model\Config\Source\Yesno
+ payment/merchant_script/test_mode
+
+
+ Send e-mail to
+ validate-no-html-tags validate-email
+ Notification / Webhook URL execution messages will be sent to this e-mail
+ payment/merchant_script/mail_to_addr
+
+
+
+
+
diff --git a/etc/adminhtml/system/novalnet_googlepay.xml b/etc/adminhtml/system/novalnet_googlepay.xml
new file mode 100755
index 0000000..073e900
--- /dev/null
+++ b/etc/adminhtml/system/novalnet_googlepay.xml
@@ -0,0 +1,119 @@
+
+
+
+
+ Google Pay
+ Your customers can checkout using Google Pay from any page in your web store
+
+ Display payment method
+ Magento\Config\Model\Config\Source\Yesno
+ payment/novalnetGooglepay/active
+
+
+ Novalnet Title
+ payment/novalnetGooglepay/title
+
+
+ Define a sorting order
+ This payment method will be sorted among others (in the ascending order) as per the given sort number
+ validate-length maximum-length-5
+ validate-number
+ payment/novalnetGooglepay/sort_order
+
+
+ Enforce 3D secure payment outside EU
+ By enabling this option, all payments from cards issued outside the EU will be authenticated via 3DS 2.0 SCA.
+ Magento\Config\Model\Config\Source\Yesno
+ payment/novalnetGooglepay/enforce_3d
+
+
+ Business name
+ The business name is rendered in the Google Pay payment sheet, and this text will appear as PAY 'BUSINESS NAME' so that the customer knows where he is paying to.
+ payment/novalnetGooglepay/seller_name
+
+
+ Google Merchant ID
+ required-entry
+ Google Pay and Wallet Console. See Request production access for more information about the approval process and obtaining a Google merchant identifier. The registration also involves submitting the integration with sufficient screen-shots, so collect this information by enabling the payment method in test mode. To suppress the validation of this field while saving the configuration, use this test identifier BCR2DN4XXXTN7FSI for testing and submission of your integration to Google.]]>
+ payment/novalnetGooglepay/merchant_id
+
+ 1
+
+
+
+ Payment Action
+ Choose whether or not the payment should be charged immediately. Capture completes the transaction by transferring the funds from buyer account to merchant account. Authorize verifies payment details and reserves funds to capture it later, giving time for the merchant to decide on the order.
+ Novalnet\Payment\Model\Adminhtml\Source\PaymentAction
+ payment/novalnetGooglepay/payment_action
+
+
+ Minimum transaction amount for authorization
+ validate-greater-than-zero validate-digits validate-length maximum-length-15
+ payment/novalnetGooglepay/manual_checking_amount
+
+ authorize
+
+
+
+ Completed order status
+ Status to be used for successful orders
+ Magento\Sales\Model\Config\Source\Order\Status
+ payment/novalnetGooglepay/order_status
+
+
+ Notification for the buyer
+ The entered text will be displayed on the checkout page
+ validate-no-html-tags
+ payment/novalnetGooglepay/instructions
+
+
+ Button Design
+ Magento\Config\Block\System\Config\Form\Fieldset
+
+ Button Type
+ Novalnet\Payment\Model\Adminhtml\Source\GooglepayButtonType
+ payment/novalnetGooglepay/button_type
+
+
+ Button Theme
+ Novalnet\Payment\Model\Adminhtml\Source\GooglepayButtonTheme
+ payment/novalnetGooglepay/button_theme
+
+
+ Button Height
+ Range from 40 to 100 pixels
+ payment/novalnetGooglepay/button_height
+ validate-digits validate-digits-range digits-range-40-100
+
+
+ Display the Google Pay button on
+ 1
+ The selected pages will display the Google Pay button to pay instantly as an express checkout option
+ Novalnet\Payment\Model\Adminhtml\Source\GooglepayEnabledPages
+ payment/novalnetGooglepay/enabled_pages
+
+
+
+
+
diff --git a/etc/adminhtml/system/novalnet_ideal.xml b/etc/adminhtml/system/novalnet_ideal.xml
new file mode 100755
index 0000000..a1867ba
--- /dev/null
+++ b/etc/adminhtml/system/novalnet_ideal.xml
@@ -0,0 +1,90 @@
+
+
+
+
+ iDEAL
+
+ Display payment method
+ Magento\Config\Model\Config\Source\Yesno
+ payment/novalnetIdeal/active
+
+
+ Novalnet Title
+ payment/novalnetIdeal/title
+
+
+ Define a sorting order
+ This payment method will be sorted among others (in the ascending order) as per the given sort number
+ validate-length maximum-length-5
+ validate-number
+ payment/novalnetIdeal/sort_order
+
+
+ Completed order status
+ Status to be used for successful orders
+ Magento\Sales\Model\Config\Source\Order\Status
+ payment/novalnetIdeal/order_status
+
+
+ Notification for the buyer
+ The entered text will be displayed on the checkout page
+ validate-no-html-tags
+ payment/novalnetIdeal/instructions
+
+
+ User Group Excluded
+ 1
+ Novalnet\Payment\Model\Adminhtml\Source\CustomerGroups
+ payment/novalnetIdeal/user_group_excluded
+
+
+ Payment from Applicable Countries
+ Magento\Payment\Model\Config\Source\Allspecificcountries
+ payment/novalnetIdeal/allowspecific
+
+
+ Payment from Specific Countries
+ Magento\Directory\Model\Config\Source\Country
+ payment/novalnetIdeal/specificcountry
+
+
+ Minimum Order Total
+ validate-number validate-zero-or-greater validate-length maximum-length-15
+ payment/novalnetIdeal/min_order_total
+
+
+ Maximum Order Total
+ validate-number validate-zero-or-greater validate-length maximum-length-15
+ payment/novalnetIdeal/max_order_total
+
+
+ Minimum Orders Count
+ validate-number validate-zero-or-greater validate-length maximum-length-5
+ Default: '0' for disabled check | Minimum count of orders (in the past) needed for the customer to use this payment method
+ payment/novalnetIdeal/orders_count
+
+
+
diff --git a/etc/adminhtml/system/novalnet_invoice.xml b/etc/adminhtml/system/novalnet_invoice.xml
new file mode 100755
index 0000000..e92aa80
--- /dev/null
+++ b/etc/adminhtml/system/novalnet_invoice.xml
@@ -0,0 +1,115 @@
+
+
+
+
+ Invoice
+
+ Display payment method
+ Magento\Config\Model\Config\Source\Yesno
+ payment/novalnetInvoice/active
+
+
+ Novalnet Title
+ payment/novalnetInvoice/title
+
+
+ Define a sorting order
+ This payment method will be sorted among others (in the ascending order) as per the given sort number
+ validate-length maximum-length-5
+ validate-number
+ payment/novalnetInvoice/sort_order
+
+
+ Payment due date (in days)
+ Enter the number of days to transfer the payment amount to Novalnet (must be greater than 7 days). In case if the field is empty, 14 days will be set as due date by default
+ validate-digits validate-greater-than-zero validate-digits-range digits-range-7-999999999
+ payment/novalnetInvoice/due_date
+
+
+ Payment Action
+ Choose whether or not the payment should be charged immediately. Capture completes the transaction by transferring the funds from buyer account to merchant account. Authorize verifies payment details and reserves funds to capture it later, giving time for the merchant to decide on the order.
+ Novalnet\Payment\Model\Adminhtml\Source\PaymentAction
+ payment/novalnetInvoice/payment_action
+
+
+ Minimum transaction amount for authorization
+ validate-greater-than-zero validate-digits validate-length maximum-length-15
+ payment/novalnetInvoice/manual_checking_amount
+
+ authorize
+
+
+
+ Completed order status
+ Status to be used for successful orders
+ Magento\Sales\Model\Config\Source\Order\Status
+ payment/novalnetInvoice/order_status
+
+
+ Webhook order status
+ Magento\Sales\Model\Config\Source\Order\Status
+ payment/novalnetInvoice/order_status_after_payment
+
+
+ Notification for the buyer
+ The entered text will be displayed on the checkout page
+ validate-no-html-tags
+ payment/novalnetInvoice/instructions
+
+
+ User Group Excluded
+ 1
+ Novalnet\Payment\Model\Adminhtml\Source\CustomerGroups
+ payment/novalnetInvoice/user_group_excluded
+
+
+ Payment from Applicable Countries
+ Magento\Payment\Model\Config\Source\Allspecificcountries
+ payment/novalnetInvoice/allowspecific
+
+
+ Payment from Specific Countries
+ Magento\Directory\Model\Config\Source\Country
+ payment/novalnetInvoice/specificcountry
+
+
+ Minimum Order Total
+ validate-number validate-zero-or-greater validate-length maximum-length-15
+ payment/novalnetInvoice/min_order_total
+
+
+ Maximum Order Total
+ validate-number validate-zero-or-greater validate-length maximum-length-15
+ payment/novalnetInvoice/max_order_total
+
+
+ Minimum Orders Count
+ validate-number validate-zero-or-greater validate-length maximum-length-5
+ Default: '0' for disabled check | Minimum count of orders (in the past) needed for the customer to use this payment method
+ payment/novalnetInvoice/orders_count
+
+
+
diff --git a/etc/adminhtml/system/novalnet_invoice_guarantee.xml b/etc/adminhtml/system/novalnet_invoice_guarantee.xml
new file mode 100755
index 0000000..2a83110
--- /dev/null
+++ b/etc/adminhtml/system/novalnet_invoice_guarantee.xml
@@ -0,0 +1,125 @@
+
+
+
+
+ Invoice with payment guarantee
+ Basic requirements for payment guarantee Allowed B2C countries: DE, AT, CH Allowed B2B countries: European Union Allowed currency: EUR Minimum order amount: 9.99 EUR or more Age limit: 18 years or more The billing address must be the same as the shipping address ]]>
+
+ Display payment method
+ Magento\Config\Model\Config\Source\Yesno
+ payment/novalnetInvoiceGuarantee/active
+
+
+ Novalnet Title
+ payment/novalnetInvoiceGuarantee/title
+
+
+ Define a sorting order
+ This payment method will be sorted among others (in the ascending order) as per the given sort number
+ validate-length maximum-length-5
+ validate-number
+ payment/novalnetInvoiceGuarantee/sort_order
+
+
+ Payment Action
+ Choose whether or not the payment should be charged immediately. Capture completes the transaction by transferring the funds from buyer account to merchant account. Authorize verifies payment details and reserves funds to capture it later, giving time for the merchant to decide on the order.
+ Novalnet\Payment\Model\Adminhtml\Source\PaymentAction
+ payment/novalnetInvoiceGuarantee/payment_action
+
+
+ Minimum transaction amount for authorization
+ validate-greater-than-zero validate-digits validate-length maximum-length-15
+ payment/novalnetInvoiceGuarantee/manual_checking_amount
+
+ authorize
+
+
+
+ Completed order status
+ Status to be used for successful orders
+ Magento\Sales\Model\Config\Source\Order\Status
+ payment/novalnetInvoiceGuarantee/order_status
+
+
+ Novalnet\Payment\Block\System\Config\Form\Field\Guaranteeforce
+
+
+ Force non-guarantee payment
+ Even if payment guarantee is enabled, payments will still be processed as non-guarantee payments if the payment guarantee requirements are not met. Review the requirements under 'Enable Payment Guarantee' in the Installation Guide.
+ Magento\Config\Model\Config\Source\Yesno
+ validate-invoiceguarantee-force
+ payment/novalnetInvoiceGuarantee/payment_guarantee_force
+
+
+ Allow B2B Customers
+ Allow B2B customers to place order
+ Magento\Config\Model\Config\Source\Yesno
+ payment/novalnetInvoiceGuarantee/allow_b2b_customer
+
+
+ Notification for the buyer
+ The entered text will be displayed on the checkout page
+ validate-no-html-tags
+ payment/novalnetInvoiceGuarantee/instructions
+
+
+ User Group Excluded
+ 1
+ Novalnet\Payment\Model\Adminhtml\Source\CustomerGroups
+ payment/novalnetInvoiceGuarantee/user_group_excluded
+
+
+ Payment from Applicable Countries
+ Magento\Payment\Model\Config\Source\Allspecificcountries
+ payment/novalnetInvoiceGuarantee/allowspecific
+
+
+ Payment from Specific Countries
+ Magento\Directory\Model\Config\Source\Country
+ payment/novalnetInvoiceGuarantee/specificcountry
+
+
+ Minimum Order Total
+ Minimum order amount: 9.99 EUR or more
+ validate-number validate-novalnet-guarantee-order-total validate-length maximum-length-15
+ payment/novalnetInvoiceGuarantee/min_order_total
+
+ 1
+
+
+
+ Maximum Order Total
+ validate-number validate-zero-or-greater validate-length maximum-length-15
+ payment/novalnetInvoiceGuarantee/max_order_total
+
+
+ Minimum Orders Count
+ validate-number validate-zero-or-greater validate-length maximum-length-5
+ Default: '0' for disabled check | Minimum count of orders (in the past) needed for the customer to use this payment method
+ payment/novalnetInvoiceGuarantee/orders_count
+
+
+
diff --git a/etc/adminhtml/system/novalnet_invoice_instalment.xml b/etc/adminhtml/system/novalnet_invoice_instalment.xml
new file mode 100755
index 0000000..c6edefc
--- /dev/null
+++ b/etc/adminhtml/system/novalnet_invoice_instalment.xml
@@ -0,0 +1,125 @@
+
+
+
+
+ Instalment by Invoice
+ Basic requirements for the instalment payment Allowed B2C countries: DE, AT, CH Allowed B2B countries: European Union Allowed currency: EUR Minimum order amount: 19.98 EUR or more Please note that the instalment cycle amount has to be a minimum of 9.99 EUR and the instalment cycles which do not meet this criteria will not be displayed in the instalment plan Age limit: 18 years or more The billing address must be the same as the shipping address ]]>
+
+ Display payment method
+ Magento\Config\Model\Config\Source\Yesno
+ payment/novalnetInvoiceInstalment/active
+
+
+ Novalnet Title
+ payment/novalnetInvoiceInstalment/title
+
+
+ Define a sorting order
+ This payment method will be sorted among others (in the ascending order) as per the given sort number
+ validate-length maximum-length-5
+ validate-number
+ payment/novalnetInvoiceInstalment/sort_order
+
+
+ Instalment cycles
+ Select the various instalment cycles that can be availed in the instalment plan
+ Novalnet\Payment\Model\Adminhtml\Source\InstalmentCycles
+ validate-select
+ payment/novalnetInvoiceInstalment/instalment_cycles
+
+ 1
+
+
+
+ Payment Action
+ Choose whether or not the payment should be charged immediately. Capture completes the transaction by transferring the funds from buyer account to merchant account. Authorize verifies payment details and reserves funds to capture it later, giving time for the merchant to decide on the order.
+ Novalnet\Payment\Model\Adminhtml\Source\PaymentAction
+ payment/novalnetInvoiceInstalment/payment_action
+
+
+ Minimum transaction amount for authorization
+ validate-greater-than-zero validate-digits validate-length maximum-length-15
+ payment/novalnetInvoiceInstalment/manual_checking_amount
+
+ authorize
+
+
+
+ Completed order status
+ Status to be used for successful orders
+ Magento\Sales\Model\Config\Source\Order\Status
+ payment/novalnetInvoiceInstalment/order_status
+
+
+ Allow B2B Customers
+ Allow B2B customers to place order
+ Magento\Config\Model\Config\Source\Yesno
+ payment/novalnetInvoiceInstalment/allow_b2b_customer
+
+
+ Notification for the buyer
+ The entered text will be displayed on the checkout page
+ validate-no-html-tags
+ payment/novalnetInvoiceInstalment/instructions
+
+
+ User Group Excluded
+ 1
+ Novalnet\Payment\Model\Adminhtml\Source\CustomerGroups
+ payment/novalnetInvoiceInstalment/user_group_excluded
+
+
+ Payment from Applicable Countries
+ Magento\Payment\Model\Config\Source\Allspecificcountries
+ payment/novalnetInvoiceInstalment/allowspecific
+
+
+ Payment from Specific Countries
+ Magento\Directory\Model\Config\Source\Country
+ payment/novalnetInvoiceInstalment/specificcountry
+
+
+ Minimum Order Total
+ Minimum order amount: 19.98 EUR or more
+ validate-number validate-novalnet-instalment-order-total validate-length maximum-length-15
+ payment/novalnetInvoiceInstalment/min_order_total
+
+ 1
+
+
+
+ Maximum Order Total
+ validate-number validate-zero-or-greater validate-length maximum-length-15
+ payment/novalnetInvoiceInstalment/max_order_total
+
+
+ Minimum Orders Count
+ validate-number validate-zero-or-greater validate-length maximum-length-5
+ Default: '0' for disabled check | Minimum count of orders (in the past) needed for the customer to use this payment method
+ payment/novalnetInvoiceInstalment/orders_count
+
+
+
diff --git a/etc/adminhtml/system/novalnet_multibanco.xml b/etc/adminhtml/system/novalnet_multibanco.xml
new file mode 100755
index 0000000..53c1e3c
--- /dev/null
+++ b/etc/adminhtml/system/novalnet_multibanco.xml
@@ -0,0 +1,95 @@
+
+
+
+
+ Multibanco
+
+ Display payment method
+ Magento\Config\Model\Config\Source\Yesno
+ payment/novalnetMultibanco/active
+
+
+ Novalnet Title
+ payment/novalnetMultibanco/title
+
+
+ Define a sorting order
+ This payment method will be sorted among others (in the ascending order) as per the given sort number
+ validate-length maximum-length-5
+ validate-number
+ payment/novalnetMultibanco/sort_order
+
+
+ Completed order status
+ Status to be used for successful orders
+ Magento\Sales\Model\Config\Source\Order\Status
+ payment/novalnetMultibanco/order_status
+
+
+ Webhook order status
+ Magento\Sales\Model\Config\Source\Order\Status
+ payment/novalnetMultibanco/order_status_after_payment
+
+
+ Notification for the buyer
+ The entered text will be displayed on the checkout page
+ validate-no-html-tags
+ payment/novalnetMultibanco/instructions
+
+
+ User Group Excluded
+ 1
+ Novalnet\Payment\Model\Adminhtml\Source\CustomerGroups
+ payment/novalnetMultibanco/user_group_excluded
+
+
+ Payment from Applicable Countries
+ Magento\Payment\Model\Config\Source\Allspecificcountries
+ payment/novalnetMultibanco/allowspecific
+
+
+ Payment from Specific Countries
+ Magento\Directory\Model\Config\Source\Country
+ payment/novalnetMultibanco/specificcountry
+
+
+ Minimum Order Total
+ validate-number validate-zero-or-greater validate-length maximum-length-15
+ payment/novalnetMultibanco/min_order_total
+
+
+ Maximum Order Total
+ validate-number validate-zero-or-greater validate-length maximum-length-15
+ payment/novalnetMultibanco/max_order_total
+
+
+ Minimum Orders Count
+ validate-number validate-zero-or-greater validate-length maximum-length-5
+ Default: '0' for disabled check | Minimum count of orders (in the past) needed for the customer to use this payment method
+ payment/novalnetMultibanco/orders_count
+
+
+
diff --git a/etc/adminhtml/system/novalnet_online_banktransfer.xml b/etc/adminhtml/system/novalnet_online_banktransfer.xml
new file mode 100755
index 0000000..65fc680
--- /dev/null
+++ b/etc/adminhtml/system/novalnet_online_banktransfer.xml
@@ -0,0 +1,90 @@
+
+
+
+
+ Online bank transfer
+
+ Display payment method
+ Magento\Config\Model\Config\Source\Yesno
+ payment/novalnetOnlineBanktransfer/active
+
+
+ Novalnet Title
+ payment/novalnetOnlineBanktransfer/title
+
+
+ Define a sorting order
+ This payment method will be sorted among others (in the ascending order) as per the given sort number
+ validate-number
+ validate-length maximum-length-5
+ payment/novalnetOnlineBanktransfer/sort_order
+
+
+ Completed order status
+ Status to be used for successful orders
+ Magento\Sales\Model\Config\Source\Order\Status
+ payment/novalnetOnlineBanktransfer/order_status
+
+
+ Notification for the buyer
+ The entered text will be displayed on the checkout page
+ validate-no-html-tags
+ payment/novalnetOnlineBanktransfer/instructions
+
+
+ User Group Excluded
+ 1
+ Novalnet\Payment\Model\Adminhtml\Source\CustomerGroups
+ payment/novalnetOnlineBanktransfer/user_group_excluded
+
+
+ Payment from Applicable Countries
+ Magento\Payment\Model\Config\Source\Allspecificcountries
+ payment/novalnetOnlineBanktransfer/allowspecific
+
+
+ Payment from Specific Countries
+ Magento\Directory\Model\Config\Source\Country
+ payment/novalnetOnlineBanktransfer/specificcountry
+
+
+ Minimum Order Total
+ validate-number validate-zero-or-greater validate-length maximum-length-15
+ payment/novalnetOnlineBanktransfer/min_order_total
+
+
+ Maximum Order Total
+ validate-number validate-zero-or-greater validate-length maximum-length-15
+ payment/novalnetOnlineBanktransfer/max_order_total
+
+
+ Minimum Orders Count
+ validate-number validate-zero-or-greater validate-length maximum-length-5
+ Default: '0' for disabled check | Minimum count of orders (in the past) needed for the customer to use this payment method
+ payment/novalnetOnlineBanktransfer/orders_count
+
+
+
diff --git a/etc/adminhtml/system/novalnet_payment_notice.xml b/etc/adminhtml/system/novalnet_payment_notice.xml
new file mode 100755
index 0000000..5e916eb
--- /dev/null
+++ b/etc/adminhtml/system/novalnet_payment_notice.xml
@@ -0,0 +1,27 @@
+
+
+
+
+ Novalnet\Payment\Block\System\Config\Form\Field\Notification
+
+
diff --git a/etc/adminhtml/system/novalnet_paypal.xml b/etc/adminhtml/system/novalnet_paypal.xml
new file mode 100755
index 0000000..547e47a
--- /dev/null
+++ b/etc/adminhtml/system/novalnet_paypal.xml
@@ -0,0 +1,112 @@
+
+
+
+
+ PayPal
+ Novalnet Admin Portal > PROJECT > 'Project' Information > Payment Methods > Paypal > Configure.]]>
+
+ Display payment method
+ Magento\Config\Model\Config\Source\Yesno
+ payment/novalnetPaypal/active
+
+
+ Novalnet Title
+ payment/novalnetPaypal/title
+
+
+ Define a sorting order
+ This payment method will be sorted among others (in the ascending order) as per the given sort number
+ validate-length maximum-length-5
+ validate-number
+ payment/novalnetPaypal/sort_order
+
+
+ Payment Action
+ Choose whether or not the payment should be charged immediately. Capture completes the transaction by transferring the funds from buyer account to merchant account. Authorize verifies payment details and reserves funds to capture it later, giving time for the merchant to decide on the order.
+ Novalnet\Payment\Model\Adminhtml\Source\PaymentAction
+ payment/novalnetPaypal/payment_action
+
+
+ Minimum transaction amount for authorization
+ validate-greater-than-zero validate-digits validate-length maximum-length-15
+ payment/novalnetPaypal/manual_checking_amount
+
+ authorize
+
+
+
+ One-click shopping
+ Payment details stored during the checkout process can be used for future payments
+ In order to use this option you must have billing agreement option enabled in your PayPal account. Please contact your account manager at PayPal.
+ Magento\Config\Model\Config\Source\Yesno
+ payment/novalnetPaypal/shop_type
+
+
+ Completed order status
+ Status to be used for successful orders
+ Magento\Sales\Model\Config\Source\Order\Status
+ payment/novalnetPaypal/order_status
+
+
+ Notification for the buyer
+ The entered text will be displayed on the checkout page
+ validate-no-html-tags
+ payment/novalnetPaypal/instructions
+
+
+ User Group Excluded
+ 1
+ Novalnet\Payment\Model\Adminhtml\Source\CustomerGroups
+ payment/novalnetPaypal/user_group_excluded
+
+
+ Payment from Applicable Countries
+ Magento\Payment\Model\Config\Source\Allspecificcountries
+ payment/novalnetPaypal/allowspecific
+
+
+ Payment from Specific Countries
+ Magento\Directory\Model\Config\Source\Country
+ payment/novalnetPaypal/specificcountry
+
+
+ Minimum Order Total
+ validate-number validate-zero-or-greater validate-length maximum-length-15
+ payment/novalnetPaypal/min_order_total
+
+
+ Maximum Order Total
+ validate-number validate-zero-or-greater validate-length maximum-length-15
+ payment/novalnetPaypal/max_order_total
+
+
+ Minimum Orders Count
+ validate-number validate-zero-or-greater validate-length maximum-length-5
+ Default: '0' for disabled check | Minimum count of orders (in the past) needed for the customer to use this payment method
+ payment/novalnetPaypal/orders_count
+
+
+
diff --git a/etc/adminhtml/system/novalnet_postfinance.xml b/etc/adminhtml/system/novalnet_postfinance.xml
new file mode 100755
index 0000000..5a1e067
--- /dev/null
+++ b/etc/adminhtml/system/novalnet_postfinance.xml
@@ -0,0 +1,90 @@
+
+
+
+
+ PostFinance E-Finance
+
+ Display payment method
+ Magento\Config\Model\Config\Source\Yesno
+ payment/novalnetPostFinance/active
+
+
+ Novalnet Title
+ payment/novalnetPostFinance/title
+
+
+ Define a sorting order
+ This payment method will be sorted among others (in the ascending order) as per the given sort number
+ validate-length maximum-length-5
+ validate-number
+ payment/novalnetPostFinance/sort_order
+
+
+ Completed order status
+ Status to be used for successful orders
+ Magento\Sales\Model\Config\Source\Order\Status
+ payment/novalnetPostFinance/order_status
+
+
+ Notification for the buyer
+ The entered text will be displayed on the checkout page
+ validate-no-html-tags
+ payment/novalnetPostFinance/instructions
+
+
+ User Group Excluded
+ 1
+ Novalnet\Payment\Model\Adminhtml\Source\CustomerGroups
+ payment/novalnetPostFinance/user_group_excluded
+
+
+ Payment from Applicable Countries
+ Magento\Payment\Model\Config\Source\Allspecificcountries
+ payment/novalnetPostFinance/allowspecific
+
+
+ Payment from Specific Countries
+ Magento\Directory\Model\Config\Source\Country
+ payment/novalnetPostFinance/specificcountry
+
+
+ Minimum Order Total
+ validate-number validate-zero-or-greater validate-length maximum-length-15
+ payment/novalnetPostFinance/min_order_total
+
+
+ Maximum Order Total
+ validate-number validate-zero-or-greater validate-length maximum-length-15
+ payment/novalnetPostFinance/max_order_total
+
+
+ Minimum Orders Count
+ validate-number validate-zero-or-greater validate-length maximum-length-5
+ Default: '0' for disabled check | Minimum count of orders (in the past) needed for the customer to use this payment method
+ payment/novalnetPostFinance/orders_count
+
+
+
diff --git a/etc/adminhtml/system/novalnet_postfinance_card.xml b/etc/adminhtml/system/novalnet_postfinance_card.xml
new file mode 100755
index 0000000..678b45b
--- /dev/null
+++ b/etc/adminhtml/system/novalnet_postfinance_card.xml
@@ -0,0 +1,90 @@
+
+
+
+
+ PostFinance Card
+
+ Display payment method
+ Magento\Config\Model\Config\Source\Yesno
+ payment/novalnetPostFinanceCard/active
+
+
+ Novalnet Title
+ payment/novalnetPostFinanceCard/title
+
+
+ Define a sorting order
+ This payment method will be sorted among others (in the ascending order) as per the given sort number
+ validate-length maximum-length-5
+ validate-number
+ payment/novalnetPostFinanceCard/sort_order
+
+
+ Completed order status
+ Status to be used for successful orders
+ Magento\Sales\Model\Config\Source\Order\Status
+ payment/novalnetPostFinanceCard/order_status
+
+
+ Notification for the buyer
+ The entered text will be displayed on the checkout page
+ validate-no-html-tags
+ payment/novalnetPostFinanceCard/instructions
+
+
+ User Group Excluded
+ 1
+ Novalnet\Payment\Model\Adminhtml\Source\CustomerGroups
+ payment/novalnetPostFinanceCard/user_group_excluded
+
+
+ Payment from Applicable Countries
+ Magento\Payment\Model\Config\Source\Allspecificcountries
+ payment/novalnetPostFinanceCard/allowspecific
+
+
+ Payment from Specific Countries
+ Magento\Directory\Model\Config\Source\Country
+ payment/novalnetPostFinanceCard/specificcountry
+
+
+ Minimum Order Total
+ validate-number validate-zero-or-greater validate-length maximum-length-15
+ payment/novalnetPostFinanceCard/min_order_total
+
+
+ Maximum Order Total
+ validate-number validate-zero-or-greater validate-length maximum-length-15
+ payment/novalnetPostFinanceCard/max_order_total
+
+
+ Minimum Orders Count
+ validate-number validate-zero-or-greater validate-length maximum-length-5
+ Default: '0' for disabled check | Minimum count of orders (in the past) needed for the customer to use this payment method
+ payment/novalnetPostFinanceCard/orders_count
+
+
+
diff --git a/etc/adminhtml/system/novalnet_prepayment.xml b/etc/adminhtml/system/novalnet_prepayment.xml
new file mode 100755
index 0000000..1831ee7
--- /dev/null
+++ b/etc/adminhtml/system/novalnet_prepayment.xml
@@ -0,0 +1,101 @@
+
+
+
+
+ Prepayment
+
+ Display payment method
+ Magento\Config\Model\Config\Source\Yesno
+ payment/novalnetPrepayment/active
+
+
+ Novalnet Title
+ payment/novalnetPrepayment/title
+
+
+ Define a sorting order
+ This payment method will be sorted among others (in the ascending order) as per the given sort number
+ validate-length maximum-length-5
+ validate-number
+ payment/novalnetPrepayment/sort_order
+
+
+ Payment due date (in days)
+ Enter the number of days after which the payment should be processed (must be between 7 and 28 days)
+ validate-digits validate-greater-than-zero validate-digits-range digits-range-7-28
+ payment/novalnetPrepayment/due_date
+
+
+ Completed order status
+ Status to be used for successful orders
+ Magento\Sales\Model\Config\Source\Order\Status
+ payment/novalnetPrepayment/order_status
+
+
+ Webhook order status
+ Magento\Sales\Model\Config\Source\Order\Status
+ payment/novalnetPrepayment/order_status_after_payment
+
+
+ Notification for the buyer
+ The entered text will be displayed on the checkout page
+ validate-no-html-tags
+ payment/novalnetPrepayment/instructions
+
+
+ User Group Excluded
+ 1
+ Novalnet\Payment\Model\Adminhtml\Source\CustomerGroups
+ payment/novalnetPrepayment/user_group_excluded
+
+
+ Payment from Applicable Countries
+ Magento\Payment\Model\Config\Source\Allspecificcountries
+ payment/novalnetPrepayment/allowspecific
+
+
+ Payment from Specific Countries
+ Magento\Directory\Model\Config\Source\Country
+ payment/novalnetPrepayment/specificcountry
+
+
+ Minimum Order Total
+ validate-number validate-zero-or-greater validate-length maximum-length-15
+ payment/novalnetPrepayment/min_order_total
+
+
+ Maximum Order Total
+ validate-number validate-zero-or-greater validate-length maximum-length-15
+ payment/novalnetPrepayment/max_order_total
+
+
+ Minimum Orders Count
+ validate-number validate-zero-or-greater validate-length maximum-length-5
+ Default: '0' for disabled check | Minimum count of orders (in the past) needed for the customer to use this payment method
+ payment/novalnetPrepayment/orders_count
+
+
+
diff --git a/etc/adminhtml/system/novalnet_przelewy.xml b/etc/adminhtml/system/novalnet_przelewy.xml
new file mode 100755
index 0000000..0cdbf36
--- /dev/null
+++ b/etc/adminhtml/system/novalnet_przelewy.xml
@@ -0,0 +1,90 @@
+
+
+
+
+ Przelewy24
+
+ Display payment method
+ Magento\Config\Model\Config\Source\Yesno
+ payment/novalnetPrzelewy/active
+
+
+ Novalnet Title
+ payment/novalnetPrzelewy/title
+
+
+ Define a sorting order
+ This payment method will be sorted among others (in the ascending order) as per the given sort number
+ validate-length maximum-length-5
+ validate-number
+ payment/novalnetPrzelewy/sort_order
+
+
+ Completed order status
+ Status to be used for successful orders
+ Magento\Sales\Model\Config\Source\Order\Status
+ payment/novalnetPrzelewy/order_status
+
+
+ Notification for the buyer
+ The entered text will be displayed on the checkout page
+ validate-no-html-tags
+ payment/novalnetPrzelewy/instructions
+
+
+ User Group Excluded
+ 1
+ Novalnet\Payment\Model\Adminhtml\Source\CustomerGroups
+ payment/novalnetPrzelewy/user_group_excluded
+
+
+ Payment from Applicable Countries
+ Magento\Payment\Model\Config\Source\Allspecificcountries
+ payment/novalnetPrzelewy/allowspecific
+
+
+ Payment from Specific Countries
+ Magento\Directory\Model\Config\Source\Country
+ payment/novalnetPrzelewy/specificcountry
+
+
+ Minimum Order Total
+ validate-number validate-zero-or-greater validate-length maximum-length-15
+ payment/novalnetPrzelewy/min_order_total
+
+
+ Maximum Order Total
+ validate-number validate-zero-or-greater validate-length maximum-length-15
+ payment/novalnetPrzelewy/max_order_total
+
+
+ Minimum Orders Count
+ validate-number validate-zero-or-greater validate-length maximum-length-5
+ Default: '0' for disabled check | Minimum count of orders (in the past) needed for the customer to use this payment method
+ payment/novalnetPrzelewy/orders_count
+
+
+
diff --git a/etc/adminhtml/system/novalnet_sepa.xml b/etc/adminhtml/system/novalnet_sepa.xml
new file mode 100755
index 0000000..44ee995
--- /dev/null
+++ b/etc/adminhtml/system/novalnet_sepa.xml
@@ -0,0 +1,116 @@
+
+
+
+
+ Direct Debit SEPA
+
+ Display payment method
+ Magento\Config\Model\Config\Source\Yesno
+ payment/novalnetSepa/active
+
+
+ Novalnet Title
+ payment/novalnetSepa/title
+
+
+ Define a sorting order
+ This payment method will be sorted among others (in the ascending order) as per the given sort number
+ validate-length maximum-length-5
+ validate-number
+ payment/novalnetSepa/sort_order
+
+
+ Payment due date (in days)
+ Enter the number of days after which the payment should be processed (must be between 2 and 14 days)
+ validate-digits validate-greater-than-zero validate-digits-range digits-range-2-14
+ payment/novalnetSepa/due_date
+
+
+ Payment Action
+ Choose whether or not the payment should be charged immediately. Capture completes the transaction by transferring the funds from buyer account to merchant account. Authorize verifies payment details and reserves funds to capture it later, giving time for the merchant to decide on the order.
+ Novalnet\Payment\Model\Adminhtml\Source\PaymentActionWithZeroAmount
+ payment/novalnetSepa/payment_action
+
+
+ Minimum transaction amount for authorization
+ validate-greater-than-zero validate-digits validate-length maximum-length-15
+ payment/novalnetSepa/manual_checking_amount
+
+ authorize
+
+
+
+ One-click shopping
+ Payment details stored during the checkout process can be used for future payments
+ Magento\Config\Model\Config\Source\Yesno
+ payment/novalnetSepa/shop_type
+
+
+ Completed order status
+ Status to be used for successful orders
+ Magento\Sales\Model\Config\Source\Order\Status
+ payment/novalnetSepa/order_status
+
+
+ Notification for the buyer
+ The entered text will be displayed on the checkout page
+ validate-no-html-tags
+ payment/novalnetSepa/instructions
+
+
+ User Group Excluded
+ 1
+ Novalnet\Payment\Model\Adminhtml\Source\CustomerGroups
+ payment/novalnetSepa/user_group_excluded
+
+
+ Payment from Applicable Countries
+ Magento\Payment\Model\Config\Source\Allspecificcountries
+ payment/novalnetSepa/allowspecific
+
+
+ Payment from Specific Countries
+ Magento\Directory\Model\Config\Source\Country
+ payment/novalnetSepa/specificcountry
+
+
+ Minimum Order Total
+ validate-number validate-zero-or-greater validate-length maximum-length-15
+ payment/novalnetSepa/min_order_total
+
+
+ Maximum Order Total
+ validate-number validate-zero-or-greater validate-length maximum-length-15
+ payment/novalnetSepa/max_order_total
+
+
+ Minimum Orders Count
+ validate-number validate-zero-or-greater validate-length maximum-length-5
+ Default: '0' for disabled check | Minimum count of orders (in the past) needed for the customer to use this payment method
+ payment/novalnetSepa/orders_count
+
+
+
diff --git a/etc/adminhtml/system/novalnet_sepa_guarantee.xml b/etc/adminhtml/system/novalnet_sepa_guarantee.xml
new file mode 100755
index 0000000..7365e3e
--- /dev/null
+++ b/etc/adminhtml/system/novalnet_sepa_guarantee.xml
@@ -0,0 +1,134 @@
+
+
+
+
+ Direct Debit SEPA with payment guarantee
+ Basic requirements for payment guarantee Allowed B2C countries: DE, AT, CH Allowed B2B countries: European Union Allowed currency: EUR Minimum order amount: 9.99 EUR or more Age limit: 18 years or more The billing address must be the same as the shipping address ]]>
+
+ Display payment method
+ Magento\Config\Model\Config\Source\Yesno
+ payment/novalnetSepaGuarantee/active
+
+
+ Novalnet Title
+ payment/novalnetSepaGuarantee/title
+
+
+ Define a sorting order
+ This payment method will be sorted among others (in the ascending order) as per the given sort number
+ validate-length maximum-length-5
+ validate-number
+ payment/novalnetSepaGuarantee/sort_order
+
+
+ Payment due date (in days)
+ Enter the number of days after which the payment should be processed (must be between 2 and 14 days)
+ validate-digits validate-greater-than-zero validate-digits-range digits-range-2-14
+ payment/novalnetSepaGuarantee/due_date
+
+
+ Payment Action
+ Choose whether or not the payment should be charged immediately. Capture completes the transaction by transferring the funds from buyer account to merchant account. Authorize verifies payment details and reserves funds to capture it later, giving time for the merchant to decide on the order.
+ Novalnet\Payment\Model\Adminhtml\Source\PaymentAction
+ payment/novalnetSepaGuarantee/payment_action
+
+
+ Minimum transaction amount for authorization
+ validate-greater-than-zero validate-digits validate-length maximum-length-15
+ payment/novalnetSepaGuarantee/manual_checking_amount
+
+ authorize
+
+
+
+ One-click shopping
+ Payment details stored during the checkout process can be used for future payments
+ Magento\Config\Model\Config\Source\Yesno
+ payment/novalnetSepaGuarantee/shop_type
+
+
+ Completed order status
+ Status to be used for successful orders
+ Magento\Sales\Model\Config\Source\Order\Status
+ payment/novalnetSepaGuarantee/order_status
+
+
+ Force non-guarantee payment
+ Even if payment guarantee is enabled, payments will still be processed as non-guarantee payments if the payment guarantee requirements are not met. Review the requirements under 'Enable Payment Guarantee' in the Installation Guide.
+ Magento\Config\Model\Config\Source\Yesno
+ validate-sepaguarantee-force
+ payment/novalnetSepaGuarantee/payment_guarantee_force
+
+
+ Allow B2B Customers
+ Allow B2B customers to place order
+ Magento\Config\Model\Config\Source\Yesno
+ payment/novalnetSepaGuarantee/allow_b2b_customer
+
+
+ Notification for the buyer
+ The entered text will be displayed on the checkout page
+ validate-no-html-tags
+ payment/novalnetSepaGuarantee/instructions
+
+
+ User Group Excluded
+ 1
+ Novalnet\Payment\Model\Adminhtml\Source\CustomerGroups
+ payment/novalnetSepaGuarantee/user_group_excluded
+
+
+ Payment from Applicable Countries
+ Magento\Payment\Model\Config\Source\Allspecificcountries
+ payment/novalnetSepaGuarantee/allowspecific
+
+
+ Payment from Specific Countries
+ Magento\Directory\Model\Config\Source\Country
+ payment/novalnetSepaGuarantee/specificcountry
+
+
+ Minimum Order Total
+ Minimum order amount: 9.99 EUR or more
+ validate-number validate-novalnet-guarantee-order-total validate-length maximum-length-15
+ payment/novalnetSepaGuarantee/min_order_total
+
+ 1
+
+
+
+ Maximum Order Total
+ validate-number validate-zero-or-greater validate-length maximum-length-15
+ payment/novalnetSepaGuarantee/max_order_total
+
+
+ Minimum Orders Count
+ validate-number validate-zero-or-greater validate-length maximum-length-5
+ Default: '0' for disabled check | Minimum count of orders (in the past) needed for the customer to use this payment method
+ payment/novalnetSepaGuarantee/orders_count
+
+
+
diff --git a/etc/adminhtml/system/novalnet_sepa_instalment.xml b/etc/adminhtml/system/novalnet_sepa_instalment.xml
new file mode 100755
index 0000000..e6eb887
--- /dev/null
+++ b/etc/adminhtml/system/novalnet_sepa_instalment.xml
@@ -0,0 +1,137 @@
+
+
+
+
+ Instalment by Direct Debit SEPA
+ Basic requirements for the instalment payment Allowed B2C countries: DE, AT, CH Allowed B2B countries: European Union Allowed currency: EUR Minimum order amount: 19.98 EUR or more Please note that the instalment cycle amount has to be a minimum of 9.99 EUR and the instalment cycles which do not meet this criteria will not be displayed in the instalment plan Age limit: 18 years or more The billing address must be the same as the shipping address ]]>
+
+ Display payment method
+ Magento\Config\Model\Config\Source\Yesno
+ payment/novalnetSepaInstalment/active
+
+
+ Novalnet Title
+ payment/novalnetSepaInstalment/title
+
+
+ Define a sorting order
+ This payment method will be sorted among others (in the ascending order) as per the given sort number
+ validate-length maximum-length-5
+ validate-number
+ payment/novalnetSepaInstalment/sort_order
+
+
+ Payment due date (in days)
+ Enter the number of days after which the payment should be processed (must be between 2 and 14 days)
+ validate-digits validate-greater-than-zero validate-digits-range digits-range-2-14
+ payment/novalnetSepaInstalment/due_date
+
+
+ Instalment cycles
+ Select the various instalment cycles that can be availed in the instalment plan
+ Novalnet\Payment\Model\Adminhtml\Source\InstalmentCycles
+ validate-select
+ payment/novalnetSepaInstalment/instalment_cycles
+
+ 1
+
+
+
+ Payment Action
+ Choose whether or not the payment should be charged immediately. Capture completes the transaction by transferring the funds from buyer account to merchant account. Authorize verifies payment details and reserves funds to capture it later, giving time for the merchant to decide on the order.
+ Novalnet\Payment\Model\Adminhtml\Source\PaymentAction
+ payment/novalnetSepaInstalment/payment_action
+
+
+ Minimum transaction amount for authorization
+ validate-greater-than-zero validate-digits validate-length maximum-length-15
+ payment/novalnetSepaInstalment/manual_checking_amount
+
+ authorize
+
+
+
+ One-click shopping
+ Payment details stored during the checkout process can be used for future payments
+ Magento\Config\Model\Config\Source\Yesno
+ payment/novalnetSepaInstalment/shop_type
+
+
+ Completed order status
+ Status to be used for successful orders
+ Magento\Sales\Model\Config\Source\Order\Status
+ payment/novalnetSepaInstalment/order_status
+
+
+ Allow B2B Customers
+ Allow B2B customers to place order
+ Magento\Config\Model\Config\Source\Yesno
+ payment/novalnetSepaInstalment/allow_b2b_customer
+
+
+ Notification for the buyer
+ The entered text will be displayed on the checkout page
+ validate-no-html-tags
+ payment/novalnetSepaInstalment/instructions
+
+
+ User Group Excluded
+ 1
+ Novalnet\Payment\Model\Adminhtml\Source\CustomerGroups
+ payment/novalnetSepaInstalment/user_group_excluded
+
+
+ Payment from Applicable Countries
+ Magento\Payment\Model\Config\Source\Allspecificcountries
+ payment/novalnetSepaInstalment/allowspecific
+
+
+ Payment from Specific Countries
+ Magento\Directory\Model\Config\Source\Country
+ payment/novalnetSepaInstalment/specificcountry
+
+
+ Minimum Order Total
+ Minimum order amount: 19.98 EUR or more
+ validate-number validate-novalnet-instalment-order-total validate-length maximum-length-15
+ payment/novalnetSepaInstalment/min_order_total
+
+ 1
+
+
+
+ Maximum Order Total
+ validate-number validate-zero-or-greater validate-length maximum-length-15
+ payment/novalnetSepaInstalment/max_order_total
+
+
+ Minimum Orders Count
+ validate-number validate-zero-or-greater validate-length maximum-length-5
+ Default: '0' for disabled check | Minimum count of orders (in the past) needed for the customer to use this payment method
+ payment/novalnetSepaInstalment/orders_count
+
+
+
diff --git a/etc/adminhtml/system/novalnet_trustly.xml b/etc/adminhtml/system/novalnet_trustly.xml
new file mode 100755
index 0000000..5a43a4b
--- /dev/null
+++ b/etc/adminhtml/system/novalnet_trustly.xml
@@ -0,0 +1,90 @@
+
+
+
+
+ Trustly
+
+ Display payment method
+ Magento\Config\Model\Config\Source\Yesno
+ payment/novalnetTrustly/active
+
+
+ Novalnet Title
+ payment/novalnetTrustly/title
+
+
+ Define a sorting order
+ This payment method will be sorted among others (in the ascending order) as per the given sort number
+ validate-number
+ validate-length maximum-length-5
+ payment/novalnetTrustly/sort_order
+
+
+ Completed order status
+ Status to be used for successful orders
+ Magento\Sales\Model\Config\Source\Order\Status
+ payment/novalnetTrustly/order_status
+
+
+ Notification for the buyer
+ The entered text will be displayed on the checkout page
+ validate-no-html-tags
+ payment/novalnetTrustly/instructions
+
+
+ User Group Excluded
+ 1
+ Novalnet\Payment\Model\Adminhtml\Source\CustomerGroups
+ payment/novalnetTrustly/user_group_excluded
+
+
+ Payment from Applicable Countries
+ Magento\Payment\Model\Config\Source\Allspecificcountries
+ payment/novalnetTrustly/allowspecific
+
+
+ Payment from Specific Countries
+ Magento\Directory\Model\Config\Source\Country
+ payment/novalnetTrustly/specificcountry
+
+
+ Minimum Order Total
+ validate-number validate-zero-or-greater validate-length maximum-length-15
+ payment/novalnetTrustly/min_order_total
+
+
+ Maximum Order Total
+ validate-number validate-zero-or-greater validate-length maximum-length-15
+ payment/novalnetTrustly/max_order_total
+
+
+ Minimum Orders Count
+ validate-number validate-zero-or-greater validate-length maximum-length-5
+ Default: '0' for disabled check | Minimum count of orders (in the past) needed for the customer to use this payment method
+ payment/novalnetTrustly/orders_count
+
+
+
diff --git a/etc/adminhtml/system/novalnet_wechatpay.xml b/etc/adminhtml/system/novalnet_wechatpay.xml
new file mode 100755
index 0000000..ad8e9ff
--- /dev/null
+++ b/etc/adminhtml/system/novalnet_wechatpay.xml
@@ -0,0 +1,90 @@
+
+
+
+
+ WeChat Pay
+
+ Display payment method
+ Magento\Config\Model\Config\Source\Yesno
+ payment/novalnetWechatpay/active
+
+
+ Novalnet Title
+ payment/novalnetWechatpay/title
+
+
+ Define a sorting order
+ This payment method will be sorted among others (in the ascending order) as per the given sort number
+ validate-number
+ validate-length maximum-length-5
+ payment/novalnetWechatpay/sort_order
+
+
+ Completed order status
+ Status to be used for successful orders
+ Magento\Sales\Model\Config\Source\Order\Status
+ payment/novalnetWechatpay/order_status
+
+
+ Notification for the buyer
+ The entered text will be displayed on the checkout page
+ validate-no-html-tags
+ payment/novalnetWechatpay/instructions
+
+
+ User Group Excluded
+ 1
+ Novalnet\Payment\Model\Adminhtml\Source\CustomerGroups
+ payment/novalnetWechatpay/user_group_excluded
+
+
+ Payment from Applicable Countries
+ Magento\Payment\Model\Config\Source\Allspecificcountries
+ payment/novalnetWechatpay/allowspecific
+
+
+ Payment from Specific Countries
+ Magento\Directory\Model\Config\Source\Country
+ payment/novalnetWechatpay/specificcountry
+
+
+ Minimum Order Total
+ validate-number validate-zero-or-greater validate-length maximum-length-15
+ payment/novalnetWechatpay/min_order_total
+
+
+ Maximum Order Total
+ validate-number validate-zero-or-greater validate-length maximum-length-15
+ payment/novalnetWechatpay/max_order_total
+
+
+ Minimum Orders Count
+ validate-number validate-zero-or-greater validate-length maximum-length-5
+ Default: '0' for disabled check | Minimum count of orders (in the past) needed for the customer to use this payment method
+ payment/novalnetWechatpay/orders_count
+
+
+
diff --git a/etc/config.xml b/etc/config.xml
new file mode 100755
index 0000000..ed95e49
--- /dev/null
+++ b/etc/config.xml
@@ -0,0 +1,538 @@
+
+
+
+
+
+
+ holded
+
+
+
+
+ 0
+ SEPA-Lastschrift
+ 1
+ authorize_capture
+ 1
+ processing
+ 0
+ NovalnetSepaFacade
+ 1
+ 1
+ 1
+ 1
+ 1
+ 1
+ 1
+ 1
+ 1
+
+
+ 0
+ Kredit-/Debitkarte
+ 2
+ VI,MC,AE,MA,CI,UP,DC,DI,JCB,CB
+ authorize_capture
+ 1
+ 1
+ processing
+ 0
+ NovalnetCcFacade
+ 1
+ 1
+ 1
+ 1
+ 1
+ 1
+ 1
+ 1
+ 1
+ 1
+ 1
+
+
+ 0
+ Apple Pay
+ 3
+ processing
+ 0
+ shopping_cart_page,mini_cart_page,product_page,guest_checkout_page
+ apple-pay-button-text-buy
+ apple-pay-button-black-with-text
+ 50
+ 0
+ authorize_capture
+ NovalnetApplepayFacade
+ 1
+ 1
+ 1
+ 1
+ 1
+ 1
+ 1
+ 1
+ 1
+
+
+ 0
+ Google Pay
+ 4
+ processing
+ 0
+ shopping_cart_page,mini_cart_page,product_page,guest_checkout_page
+ buy
+ black
+ 50
+ authorize_capture
+ NovalnetGooglepayFacade
+ 1
+ 1
+ 1
+ 1
+ 1
+ 1
+ 1
+ 1
+ 1
+ 1
+
+
+ 0
+ Kauf auf Rechnung
+ 5
+ authorize_capture
+ processing
+ complete
+ 0
+ NovalnetInvoiceFacade
+ 1
+ 1
+ 1
+ 1
+ 1
+ 1
+ 1
+ 1
+ 1
+
+
+ 0
+ Vorkasse
+ 6
+ authorize
+ pending
+ processing
+ 0
+ NovalnetPrepaymentFacade
+ 1
+ 1
+ 1
+ 1
+ 1
+ 1
+ 1
+ 1
+ 1
+
+
+ 0
+ Rechnung mit Zahlungsgarantie
+ 7
+ 1
+ 0
+ authorize_capture
+ processing
+ 0
+ 9.99
+ NovalnetInvoiceGuaranteeFacade
+ 1
+ 1
+ 1
+ 1
+ 1
+ 1
+ 1
+ 1
+ 1
+ 1
+
+
+ 0
+ SEPA-Lastschrift mit Zahlungsgarantie
+ 8
+ 1
+ 0
+ authorize_capture
+ 1
+ processing
+ 0
+ 9.99
+ NovalnetSepaGuaranteeFacade
+ 1
+ 1
+ 1
+ 1
+ 1
+ 1
+ 1
+ 1
+ 1
+ 1
+
+
+ 0
+ Ratenzahlung per Rechnung
+ 9
+ 2,3,4,6,8,9,10,12
+ 1
+ authorize_capture
+ processing
+ 0
+ 19.98
+ NovalnetInvoiceInstalmentFacade
+ 1
+ 1
+ 1
+ 1
+ 1
+ 1
+ 1
+ 1
+ 1
+ 1
+
+
+ 0
+ Ratenzahlung per SEPA-Lastschrift
+ 10
+ 2,3,4,6,8,9,10,12
+ 1
+ authorize_capture
+ 1
+ processing
+ 0
+ 19.98
+ NovalnetSepaInstalmentFacade
+ 1
+ 1
+ 1
+ 1
+ 1
+ 1
+ 1
+ 1
+ 1
+ 1
+
+
+ 0
+ iDEAL
+ 11
+ processing
+ 0
+ NovalnetIdealFacade
+ 1
+ 1
+ 1
+ 1
+ 1
+ 1
+ 1
+ 1
+ 1
+ 1
+
+
+ 0
+ Sofortüberweisung
+ 12
+ processing
+ 0
+ NovalnetBanktransferFacade
+ 1
+ 1
+ 1
+ 1
+ 1
+ 1
+ 1
+ 1
+ 1
+ 1
+
+
+ 0
+ giropay
+ 13
+ processing
+ 0
+ NovalnetGiropayFacade
+ 1
+ 1
+ 1
+ 1
+ 1
+ 1
+ 1
+ 1
+ 1
+ 1
+
+
+ 0
+ Barzahlen/viacash
+ 14
+ authorize
+ pending
+ processing
+ 0
+ NovalnetCashpaymentFacade
+ 1
+ 1
+ 1
+ 1
+ 1
+ 1
+ 1
+ 1
+ 1
+
+
+ 0
+ Przelewy24
+ 15
+ processing
+ 0
+ NovalnetPrzelewyFacade
+ 1
+ 1
+ 1
+ 1
+ 1
+ 1
+ 1
+ 1
+ 1
+ 1
+
+
+ 0
+ eps
+ 16
+ processing
+ 0
+ NovalnetEpsFacade
+ 1
+ 1
+ 1
+ 1
+ 1
+ 1
+ 1
+ 1
+ 1
+ 1
+
+
+ 0
+ PayPal
+ 17
+ authorize_capture
+ 0
+ processing
+ 0
+ NovalnetPaypalFacade
+ 1
+ 1
+ 1
+ 1
+ 1
+ 1
+ 1
+ 1
+ 1
+ 1
+
+
+ 0
+ PostFinance Card
+ 18
+ processing
+ 0
+ NovalnetPostFinanceCardFacade
+ 1
+ 1
+ 1
+ 1
+ 1
+ 1
+ 1
+ 1
+ 1
+ 1
+
+
+ 0
+ PostFinance E-Finance
+ 19
+ processing
+ 0
+ NovalnetPostFinanceFacade
+ 1
+ 1
+ 1
+ 1
+ 1
+ 1
+ 1
+ 1
+ 1
+ 1
+
+
+ 0
+ Bancontact
+ 20
+ processing
+ 0
+ NovalnetBancontactFacade
+ 1
+ 1
+ 1
+ 1
+ 1
+ 1
+ 1
+ 1
+ 1
+ 1
+
+
+ 0
+ Multibanco
+ 21
+ authorize
+ processing
+ complete
+ 0
+ NovalnetMultibancoFacade
+ 1
+ 1
+ 1
+ 1
+ 1
+ 1
+ 1
+
+
+ 0
+ Onlineüberweisung
+ 22
+ processing
+ 0
+ NovalnetOnlineBanktransferFacade
+ 1
+ 1
+ 1
+ 1
+ 1
+ 1
+ 1
+ 1
+ 1
+ 1
+
+
+ 0
+ Alipay
+ 23
+ processing
+ 0
+ NovalnetAlipayFacade
+ 1
+ 1
+ 1
+ 1
+ 1
+ 1
+ 1
+ 1
+ 1
+ 1
+
+
+ 0
+ WeChat Pay
+ 24
+ processing
+ 0
+ NovalnetWechatpayFacade
+ 1
+ 1
+ 1
+ 1
+ 1
+ 1
+ 1
+ 1
+ 1
+ 1
+
+
+ 0
+ Trustly
+ 25
+ processing
+ 0
+ NovalnetTrustlyFacade
+ 1
+ 1
+ 1
+ 1
+ 1
+ 1
+ 1
+ 1
+ 1
+ 1
+
+
+ 0
+ Blik
+ 11
+ processing
+ 0
+ NovalnetBlikFacade
+ 1
+ 1
+ 1
+ 1
+ 1
+ 1
+ 1
+ 1
+ 1
+ 1
+
+
+
+
diff --git a/etc/csp_whitelist.xml b/etc/csp_whitelist.xml
new file mode 100755
index 0000000..27c53f7
--- /dev/null
+++ b/etc/csp_whitelist.xml
@@ -0,0 +1,39 @@
+
+
+
+
+
+
+ secure.novalnet.de
+ customers.barzahlen.de
+ customers-sandbox.barzahlen.de
+
+
+
+
+ cdn.novalnet.de
+ cdn.barzahlen.de
+
+
+
+
diff --git a/etc/db_schema.xml b/etc/db_schema.xml
new file mode 100755
index 0000000..1efcc63
--- /dev/null
+++ b/etc/db_schema.xml
@@ -0,0 +1,58 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/etc/di.xml b/etc/di.xml
new file mode 100755
index 0000000..3457eb5
--- /dev/null
+++ b/etc/di.xml
@@ -0,0 +1,2250 @@
+
+
+
+
+
+
+
+ \Novalnet\Payment\Model\Ui\ConfigProvider::NOVALNET_CC
+ Novalnet\Payment\Block\Form\Cc
+ Novalnet\Payment\Block\Info\Cc
+ NovalnetCcValueHandlerPool
+ NovalnetCcValidatorPool
+ NovalnetCcCommandPool
+
+
+
+
+
+ \Novalnet\Payment\Model\Ui\ConfigProvider::NOVALNET_CC
+
+
+
+
+
+
+ - NovalnetCcInitializeCommand
+ - NovalnetCcAuthorizeCommand
+ - NovalnetCcCaptureCommand
+ - NovalnetRefundCommand
+ - NovalnetVoidCommand
+ - NovalnetVoidCommand
+
+
+
+
+
+
+ Novalnet\Payment\Gateway\Request\InitializeDataBuilder
+ Novalnet\Payment\Gateway\Response\CcPaymentHandler
+ Novalnet\Payment\Gateway\Http\TransferFactory
+ Novalnet\Payment\Gateway\Validator\ResponseCodeValidator
+ Novalnet\Payment\Gateway\Http\Client\TransactionInitialize
+
+
+
+
+
+ NovalnetCcConfig
+
+
+
+
+
+ Novalnet\Payment\Gateway\Request\AuthorizationDataBuilder
+ Novalnet\Payment\Gateway\Response\CcPaymentHandler
+ Novalnet\Payment\Gateway\Http\TransferFactory
+ Novalnet\Payment\Gateway\Validator\ResponseCodeValidator
+ Novalnet\Payment\Gateway\Http\Client\TransactionAuthorize
+
+
+
+
+
+ NovalnetCcConfig
+
+
+
+
+
+ Novalnet\Payment\Gateway\Request\CaptureDataBuilder
+ Novalnet\Payment\Gateway\Response\CcPaymentHandler
+ Novalnet\Payment\Gateway\Http\TransferFactory
+ Novalnet\Payment\Gateway\Validator\ResponseCodeValidator
+ Novalnet\Payment\Gateway\Http\Client\TransactionCapture
+
+
+
+
+
+ NovalnetCcConfig
+
+
+
+
+
+ NovalnetCcConfig
+
+
+
+
+
+ NovalnetCcConfig
+
+
+
+
+
+
+ - NovalnetCcConfigValueHandler
+ - Novalnet\Payment\Gateway\Config\CanInitializeHandler
+ - Novalnet\Payment\Gateway\Config\PaymentActionHandler
+ - Novalnet\Payment\Gateway\Config\OrderPlaceRedirectUrlHandler
+
+
+
+
+
+ NovalnetCcConfig
+
+
+
+
+
+
+ - NovalnetCcCountryValidator
+
+
+
+
+
+ NovalnetCcConfig
+
+
+
+
+
+
+ \Novalnet\Payment\Model\Ui\ConfigProvider::NOVALNET_APPLEPAY
+ Novalnet\Payment\Block\Form\Applepay
+ Novalnet\Payment\Block\Info\Applepay
+ NovalnetApplepayValueHandlerPool
+ NovalnetApplepayValidatorPool
+ NovalnetApplepayCommandPool
+
+
+
+
+
+ \Novalnet\Payment\Model\Ui\ConfigProvider::NOVALNET_APPLEPAY
+
+
+
+
+
+
+ - NovalnetApplepayInitializeCommand
+ - NovalnetApplepayAuthorizeCommand
+ - NovalnetApplepayCaptureCommand
+ - NovalnetRefundCommand
+ - NovalnetVoidCommand
+ - NovalnetVoidCommand
+
+
+
+
+
+
+ Novalnet\Payment\Gateway\Request\InitializeDataBuilder
+ Novalnet\Payment\Gateway\Response\CcPaymentHandler
+ Novalnet\Payment\Gateway\Http\TransferFactory
+ Novalnet\Payment\Gateway\Validator\ResponseCodeValidator
+ Novalnet\Payment\Gateway\Http\Client\TransactionInitialize
+
+
+
+
+
+ NovalnetApplepayConfig
+
+
+
+
+
+ Novalnet\Payment\Gateway\Request\AuthorizationDataBuilder
+ Novalnet\Payment\Gateway\Response\CcPaymentHandler
+ Novalnet\Payment\Gateway\Http\TransferFactory
+ Novalnet\Payment\Gateway\Validator\ResponseCodeValidator
+ Novalnet\Payment\Gateway\Http\Client\TransactionAuthorize
+
+
+
+
+
+ NovalnetApplepayConfig
+
+
+
+
+
+ Novalnet\Payment\Gateway\Request\CaptureDataBuilder
+ Novalnet\Payment\Gateway\Response\CcPaymentHandler
+ Novalnet\Payment\Gateway\Http\TransferFactory
+ Novalnet\Payment\Gateway\Validator\ResponseCodeValidator
+ Novalnet\Payment\Gateway\Http\Client\TransactionCapture
+
+
+
+
+
+ NovalnetApplepayConfig
+
+
+
+
+
+ NovalnetApplepayConfig
+
+
+
+
+
+ NovalnetApplepayConfig
+
+
+
+
+
+
+ - NovalnetApplepayConfigValueHandler
+ - Novalnet\Payment\Gateway\Config\CanInitializeHandler
+ - Novalnet\Payment\Gateway\Config\PaymentActionHandler
+
+
+
+
+
+ NovalnetApplepayConfig
+
+
+
+
+
+
+ - NovalnetApplepayCountryValidator
+
+
+
+
+
+ NovalnetApplepayConfig
+
+
+
+
+
+
+ \Novalnet\Payment\Model\Ui\ConfigProvider::NOVALNET_GOOGLEPAY
+ Novalnet\Payment\Block\Form\Googlepay
+ Novalnet\Payment\Block\Info\Googlepay
+ NovalnetGooglepayValueHandlerPool
+ NovalnetGooglepayValidatorPool
+ NovalnetGooglepayCommandPool
+
+
+
+
+
+ \Novalnet\Payment\Model\Ui\ConfigProvider::NOVALNET_GOOGLEPAY
+
+
+
+
+
+
+ - NovalnetGooglepayInitializeCommand
+ - NovalnetGooglepayAuthorizeCommand
+ - NovalnetGooglepayCaptureCommand
+ - NovalnetRefundCommand
+ - NovalnetVoidCommand
+ - NovalnetVoidCommand
+
+
+
+
+
+
+ Novalnet\Payment\Gateway\Request\InitializeDataBuilder
+ Novalnet\Payment\Gateway\Response\CcPaymentHandler
+ Novalnet\Payment\Gateway\Http\TransferFactory
+ Novalnet\Payment\Gateway\Validator\ResponseCodeValidator
+ Novalnet\Payment\Gateway\Http\Client\TransactionInitialize
+
+
+
+
+
+ NovalnetGooglepayConfig
+
+
+
+
+
+ Novalnet\Payment\Gateway\Request\AuthorizationDataBuilder
+ Novalnet\Payment\Gateway\Response\CcPaymentHandler
+ Novalnet\Payment\Gateway\Http\TransferFactory
+ Novalnet\Payment\Gateway\Validator\ResponseCodeValidator
+ Novalnet\Payment\Gateway\Http\Client\TransactionAuthorize
+
+
+
+
+
+ NovalnetGooglepayConfig
+
+
+
+
+
+ Novalnet\Payment\Gateway\Request\CaptureDataBuilder
+ Novalnet\Payment\Gateway\Response\CcPaymentHandler
+ Novalnet\Payment\Gateway\Http\TransferFactory
+ Novalnet\Payment\Gateway\Validator\ResponseCodeValidator
+ Novalnet\Payment\Gateway\Http\Client\TransactionCapture
+
+
+
+
+
+ NovalnetGooglepayConfig
+
+
+
+
+
+ NovalnetGooglepayConfig
+
+
+
+
+
+ NovalnetGooglepayConfig
+
+
+
+
+
+
+ - NovalnetGooglepayConfigValueHandler
+ - Novalnet\Payment\Gateway\Config\CanInitializeHandler
+ - Novalnet\Payment\Gateway\Config\PaymentActionHandler
+
+
+
+
+
+ NovalnetGooglepayConfig
+
+
+
+
+
+
+ - NovalnetGooglepayCountryValidator
+
+
+
+
+
+ NovalnetGooglepayConfig
+
+
+
+
+
+
+ \Novalnet\Payment\Model\Ui\ConfigProvider::NOVALNET_SEPA
+ Novalnet\Payment\Block\Form\Sepa
+ Novalnet\Payment\Block\Info\Sepa
+ NovalnetSepaValueHandlerPool
+ NovalnetSepaValidatorPool
+ NovalnetDirectPaymentCommandPool
+
+
+
+
+
+ \Novalnet\Payment\Model\Ui\ConfigProvider::NOVALNET_SEPA
+
+
+
+
+
+ NovalnetSepaConfig
+
+
+
+
+
+ NovalnetSepaConfig
+
+
+
+
+
+ NovalnetSepaConfig
+
+
+
+
+
+ NovalnetSepaConfig
+
+
+
+
+
+
+ - NovalnetSepaConfigValueHandler
+ - Novalnet\Payment\Gateway\Config\PaymentActionHandler
+
+
+
+
+
+ NovalnetSepaConfig
+
+
+
+
+
+
+ - NovalnetSepaCountryValidator
+
+
+
+
+
+ NovalnetSepaConfig
+
+
+
+
+
+
+ \Novalnet\Payment\Model\Ui\ConfigProvider::NOVALNET_INVOICE
+ Novalnet\Payment\Block\Form\Invoice
+ Novalnet\Payment\Block\Info\Invoice
+ NovalnetInvoiceValueHandlerPool
+ NovalnetInvoiceValidatorPool
+ NovalnetDirectPaymentCommandPool
+
+
+
+
+
+ \Novalnet\Payment\Model\Ui\ConfigProvider::NOVALNET_INVOICE
+
+
+
+
+
+ NovalnetInvoiceConfig
+
+
+
+
+
+ NovalnetInvoiceConfig
+
+
+
+
+
+ NovalnetInvoiceConfig
+
+
+
+
+
+ NovalnetInvoiceConfig
+
+
+
+
+
+
+ - NovalnetInvoiceConfigValueHandler
+ - Novalnet\Payment\Gateway\Config\PaymentActionHandler
+
+
+
+
+
+ NovalnetInvoiceConfig
+
+
+
+
+
+
+ - NovalnetInvoiceCountryValidator
+
+
+
+
+
+ NovalnetInvoiceConfig
+
+
+
+
+
+
+ \Novalnet\Payment\Model\Ui\ConfigProvider::NOVALNET_INVOICE_GUARANTEE
+ Novalnet\Payment\Block\Form\InvoiceGuarantee
+ Novalnet\Payment\Block\Info\InvoiceGuarantee
+ NovalnetInvoiceGuaranteeValueHandlerPool
+ NovalnetInvoiceGuaranteeValidatorPool
+ NovalnetInvoiceGuaranteeCommandPool
+
+
+
+
+
+ \Novalnet\Payment\Model\Ui\ConfigProvider::NOVALNET_INVOICE_GUARANTEE
+
+
+
+
+
+
+ - NovalnetInitializeCommand
+ - NovalnetDirectPaymentAuthorizeCommand
+ - NovalnetCaptureCommand
+ - NovalnetRefundCommand
+ - NovalnetVoidCommand
+ - NovalnetVoidCommand
+
+
+
+
+
+
+ Novalnet\Payment\Gateway\Request\InitializeDataBuilder
+ Novalnet\Payment\Gateway\Response\CcPaymentHandler
+ Novalnet\Payment\Gateway\Http\TransferFactory
+ Novalnet\Payment\Gateway\Validator\ResponseCodeValidator
+ Novalnet\Payment\Gateway\Http\Client\TransactionInitialize
+
+
+
+
+
+ NovalnetInvoiceGuaranteeConfig
+
+
+
+
+
+ NovalnetInvoiceGuaranteeConfig
+
+
+
+
+
+ NovalnetInvoiceGuaranteeConfig
+
+
+
+
+
+ NovalnetInvoiceGuaranteeConfig
+
+
+
+
+
+ NovalnetInvoiceGuaranteeConfig
+
+
+
+
+
+
+ - NovalnetInvoiceGuaranteeConfigValueHandler
+ - Novalnet\Payment\Gateway\Config\PaymentActionHandler
+
+
+
+
+
+ NovalnetInvoiceGuaranteeConfig
+
+
+
+
+
+
+ - NovalnetInvoiceGuaranteeCountryValidator
+
+
+
+
+
+ NovalnetInvoiceGuaranteeConfig
+
+
+
+
+
+
+ \Novalnet\Payment\Model\Ui\ConfigProvider::NOVALNET_SEPA_GUARANTEE
+ Novalnet\Payment\Block\Form\SepaGuarantee
+ Novalnet\Payment\Block\Info\SepaGuarantee
+ NovalnetSepaGuaranteeValueHandlerPool
+ NovalnetSepaGuaranteeValidatorPool
+ NovalnetSepaGuaranteeCommandPool
+
+
+
+
+
+ \Novalnet\Payment\Model\Ui\ConfigProvider::NOVALNET_SEPA_GUARANTEE
+
+
+
+
+
+
+ - NovalnetInitializeCommand
+ - NovalnetDirectPaymentAuthorizeCommand
+ - NovalnetCaptureCommand
+ - NovalnetRefundCommand
+ - NovalnetVoidCommand
+ - NovalnetVoidCommand
+
+
+
+
+
+
+ Novalnet\Payment\Gateway\Request\InitializeDataBuilder
+ Novalnet\Payment\Gateway\Response\CcPaymentHandler
+ Novalnet\Payment\Gateway\Http\TransferFactory
+ Novalnet\Payment\Gateway\Validator\ResponseCodeValidator
+ Novalnet\Payment\Gateway\Http\Client\TransactionInitialize
+
+
+
+
+
+ NovalnetSepaGuaranteeConfig
+
+
+
+
+
+ NovalnetSepaGuaranteeConfig
+
+
+
+
+
+ NovalnetSepaGuaranteeConfig
+
+
+
+
+
+ NovalnetSepaGuaranteeConfig
+
+
+
+
+
+ NovalnetSepaGuaranteeConfig
+
+
+
+
+
+
+ - NovalnetSepaGuaranteeConfigValueHandler
+ - Novalnet\Payment\Gateway\Config\PaymentActionHandler
+
+
+
+
+
+ NovalnetSepaGuaranteeConfig
+
+
+
+
+
+
+ - NovalnetSepaGuaranteeCountryValidator
+
+
+
+
+
+ NovalnetSepaGuaranteeConfig
+
+
+
+
+
+
+ \Novalnet\Payment\Model\Ui\ConfigProvider::NOVALNET_PREPAYMENT
+ Novalnet\Payment\Block\Form\Prepayment
+ Novalnet\Payment\Block\Info\Prepayment
+ NovalnetPrepaymentValueHandlerPool
+ NovalnetPrepaymentValidatorPool
+ NovalnetDirectPaymentCommandPool
+
+
+
+
+
+ \Novalnet\Payment\Model\Ui\ConfigProvider::NOVALNET_PREPAYMENT
+
+
+
+
+
+ NovalnetPrepaymentConfig
+
+
+
+
+
+ NovalnetPrepaymentConfig
+
+
+
+
+
+ NovalnetPrepaymentConfig
+
+
+
+
+
+ NovalnetPrepaymentConfig
+
+
+
+
+
+
+ - NovalnetPrepaymentConfigValueHandler
+ - Novalnet\Payment\Gateway\Config\PaymentActionHandler
+
+
+
+
+
+ NovalnetPrepaymentConfig
+
+
+
+
+
+
+ - NovalnetPrepaymentCountryValidator
+
+
+
+
+
+ NovalnetPrepaymentConfig
+
+
+
+
+
+
+ \Novalnet\Payment\Model\Ui\ConfigProvider::NOVALNET_CASHPAYMENT
+ Novalnet\Payment\Block\Form\Cashpayment
+ Novalnet\Payment\Block\Info\Cashpayment
+ NovalnetCashpaymentValueHandlerPool
+ NovalnetCashpaymentValidatorPool
+ NovalnetDirectPaymentCommandPool
+
+
+
+
+
+ \Novalnet\Payment\Model\Ui\ConfigProvider::NOVALNET_CASHPAYMENT
+
+
+
+
+
+ NovalnetCashpaymentConfig
+
+
+
+
+
+ NovalnetCashpaymentConfig
+
+
+
+
+
+ NovalnetCashpaymentConfig
+
+
+
+
+
+ NovalnetCashpaymentConfig
+
+
+
+
+
+
+ - NovalnetCashpaymentConfigValueHandler
+ - Novalnet\Payment\Gateway\Config\PaymentActionHandler
+
+
+
+
+
+ NovalnetCashpaymentConfig
+
+
+
+
+
+
+ - NovalnetCashpaymentCountryValidator
+
+
+
+
+
+ NovalnetCashpaymentConfig
+
+
+
+
+
+
+ \Novalnet\Payment\Model\Ui\ConfigProvider::NOVALNET_MULTIBANCO
+ Novalnet\Payment\Block\Form\Multibanco
+ Novalnet\Payment\Block\Info\Multibanco
+ NovalnetMultibancoValueHandlerPool
+ NovalnetMultibancoValidatorPool
+ NovalnetDirectPaymentCommandPool
+
+
+
+
+
+ \Novalnet\Payment\Model\Ui\ConfigProvider::NOVALNET_MULTIBANCO
+
+
+
+
+
+ NovalnetMultibancoConfig
+
+
+
+
+
+
+ - NovalnetMultibancoConfigValueHandler
+ - Novalnet\Payment\Gateway\Config\PaymentActionHandler
+
+
+
+
+
+ NovalnetMultibancoConfig
+
+
+
+
+
+
+ - NovalnetMultibancoCountryValidator
+
+
+
+
+
+ NovalnetMultibancoConfig
+
+
+
+
+
+
+ \Novalnet\Payment\Model\Ui\ConfigProvider::NOVALNET_PAYPAL
+ Magento\Payment\Block\Form
+ Novalnet\Payment\Block\Info\Paypal
+ NovalnetPaypalValueHandlerPool
+ NovalnetPaypalValidatorPool
+ NovalnetRedirectPaymentCommandPool
+
+
+
+
+
+ \Novalnet\Payment\Model\Ui\ConfigProvider::NOVALNET_PAYPAL
+
+
+
+
+
+ NovalnetPaypalConfig
+
+
+
+
+
+ NovalnetPaypalConfig
+
+
+
+
+
+ NovalnetPaypalConfig
+
+
+
+
+
+ NovalnetPaypalConfig
+
+
+
+
+
+ NovalnetPaypalConfig
+
+
+
+
+
+
+ - NovalnetPaypalConfigValueHandler
+ - Novalnet\Payment\Gateway\Config\PaymentActionHandler
+
+
+
+
+
+ NovalnetPaypalConfig
+
+
+
+
+
+
+ - NovalnetPaypalCountryValidator
+
+
+
+
+
+ NovalnetPaypalConfig
+
+
+
+
+
+
+ \Novalnet\Payment\Model\Ui\ConfigProvider::NOVALNET_BANKTRANSFER
+ Magento\Payment\Block\Form
+ Novalnet\Payment\Block\Info\Banktransfer
+ NovalnetBanktransferValueHandlerPool
+ NovalnetBanktransferValidatorPool
+ NovalnetRedirectPaymentCommandPool
+
+
+
+
+
+ \Novalnet\Payment\Model\Ui\ConfigProvider::NOVALNET_BANKTRANSFER
+
+
+
+
+
+ NovalnetBanktransferConfig
+
+
+
+
+
+ NovalnetBanktransferConfig
+
+
+
+
+
+ NovalnetBanktransferConfig
+
+
+
+
+
+ NovalnetBanktransferConfig
+
+
+
+
+
+ NovalnetBanktransferConfig
+
+
+
+
+
+
+ - NovalnetBanktransferConfigValueHandler
+ - Novalnet\Payment\Gateway\Config\PaymentActionHandler
+
+
+
+
+
+ NovalnetBanktransferConfig
+
+
+
+
+
+
+ - NovalnetBanktransferCountryValidator
+
+
+
+
+
+ NovalnetBanktransferConfig
+
+
+
+
+
+
+ \Novalnet\Payment\Model\Ui\ConfigProvider::NOVALNET_ONLINEBANKTRANSFER
+ Magento\Payment\Block\Form
+ Novalnet\Payment\Block\Info\OnlineBanktransfer
+ NovalnetOnlineBanktransferValueHandlerPool
+ NovalnetOnlineBanktransferValidatorPool
+ NovalnetRedirectPaymentCommandPool
+
+
+
+
+
+ \Novalnet\Payment\Model\Ui\ConfigProvider::NOVALNET_ONLINEBANKTRANSFER
+
+
+
+
+
+ NovalnetOnlineBanktransferConfig
+
+
+
+
+
+ NovalnetOnlineBanktransferConfig
+
+
+
+
+
+ NovalnetOnlineBanktransferConfig
+
+
+
+
+
+ NovalnetOnlineBanktransferConfig
+
+
+
+
+
+ NovalnetOnlineBanktransferConfig
+
+
+
+
+
+
+ - NovalnetOnlineBanktransferConfigValueHandler
+ - Novalnet\Payment\Gateway\Config\PaymentActionHandler
+
+
+
+
+
+ NovalnetOnlineBanktransferConfig
+
+
+
+
+
+
+ - NovalnetOnlineBanktransferCountryValidator
+
+
+
+
+
+ NovalnetOnlineBanktransferConfig
+
+
+
+
+
+
+ \Novalnet\Payment\Model\Ui\ConfigProvider::NOVALNET_ALIPAY
+ Magento\Payment\Block\Form
+ Novalnet\Payment\Block\Info\Alipay
+ NovalnetAlipayValueHandlerPool
+ NovalnetAlipayValidatorPool
+ NovalnetRedirectPaymentCommandPool
+
+
+
+
+
+ \Novalnet\Payment\Model\Ui\ConfigProvider::NOVALNET_ALIPAY
+
+
+
+
+
+ NovalnetAlipayConfig
+
+
+
+
+
+ NovalnetAlipayConfig
+
+
+
+
+
+ NovalnetAlipayConfig
+
+
+
+
+
+ NovalnetAlipayConfig
+
+
+
+
+
+ NovalnetAlipayConfig
+
+
+
+
+
+
+ - NovalnetAlipayConfigValueHandler
+ - Novalnet\Payment\Gateway\Config\PaymentActionHandler
+
+
+
+
+
+ NovalnetAlipayConfig
+
+
+
+
+
+
+ - NovalnetAlipayCountryValidator
+
+
+
+
+
+ NovalnetAlipayConfig
+
+
+
+
+
+
+
+ \Novalnet\Payment\Model\Ui\ConfigProvider::NOVALNET_WECHATPAY
+ Magento\Payment\Block\Form
+ Novalnet\Payment\Block\Info\Wechatpay
+ NovalnetWechatpayValueHandlerPool
+ NovalnetWechatpayValidatorPool
+ NovalnetRedirectPaymentCommandPool
+
+
+
+
+
+ \Novalnet\Payment\Model\Ui\ConfigProvider::NOVALNET_WECHATPAY
+
+
+
+
+
+ NovalnetWechatpayConfig
+
+
+
+
+
+ NovalnetWechatpayConfig
+
+
+
+
+
+ NovalnetWechatpayConfig
+
+
+
+
+
+ NovalnetWechatpayConfig
+
+
+
+
+
+ NovalnetWechatpayConfig
+
+
+
+
+
+
+ - NovalnetWechatpayConfigValueHandler
+ - Novalnet\Payment\Gateway\Config\PaymentActionHandler
+
+
+
+
+
+ NovalnetWechatpayConfig
+
+
+
+
+
+
+ - NovalnetWechatpayCountryValidator
+
+
+
+
+
+ NovalnetWechatpayConfig
+
+
+
+
+
+
+ \Novalnet\Payment\Model\Ui\ConfigProvider::NOVALNET_TRUSTLY
+ Magento\Payment\Block\Form
+ Novalnet\Payment\Block\Info\Trustly
+ NovalnetTrustlyValueHandlerPool
+ NovalnetTrustlyValidatorPool
+ NovalnetRedirectPaymentCommandPool
+
+
+
+
+
+ \Novalnet\Payment\Model\Ui\ConfigProvider::NOVALNET_TRUSTLY
+
+
+
+
+
+ NovalnetTrustlyConfig
+
+
+
+
+
+ NovalnetTrustlyConfig
+
+
+
+
+
+ NovalnetTrustlyConfig
+
+
+
+
+
+ NovalnetTrustlyConfig
+
+
+
+
+
+ NovalnetTrustlyConfig
+
+
+
+
+
+
+ - NovalnetTrustlyConfigValueHandler
+ - Novalnet\Payment\Gateway\Config\PaymentActionHandler
+
+
+
+
+
+ NovalnetTrustlyConfig
+
+
+
+
+
+
+ - NovalnetTrustlyCountryValidator
+
+
+
+
+
+ NovalnetTrustlyConfig
+
+
+
+
+
+
+ \Novalnet\Payment\Model\Ui\ConfigProvider::NOVALNET_IDEAL
+ Magento\Payment\Block\Form
+ Novalnet\Payment\Block\Info\Ideal
+ NovalnetIdealValueHandlerPool
+ NovalnetIdealValidatorPool
+ NovalnetRedirectPaymentCommandPool
+
+
+
+
+
+ \Novalnet\Payment\Model\Ui\ConfigProvider::NOVALNET_IDEAL
+
+
+
+
+
+ NovalnetIdealConfig
+
+
+
+
+
+ NovalnetIdealConfig
+
+
+
+
+
+ NovalnetIdealConfig
+
+
+
+
+
+ NovalnetIdealConfig
+
+
+
+
+
+ NovalnetIdealConfig
+
+
+
+
+
+
+ - NovalnetIdealConfigValueHandler
+ - Novalnet\Payment\Gateway\Config\PaymentActionHandler
+
+
+
+
+
+ NovalnetIdealConfig
+
+
+
+
+
+
+ - NovalnetIdealCountryValidator
+
+
+
+
+
+ NovalnetIdealConfig
+
+
+
+
+
+
+ \Novalnet\Payment\Model\Ui\ConfigProvider::NOVALNET_BLIK
+ Magento\Payment\Block\Form
+ Novalnet\Payment\Block\Info\Blik
+ NovalnetBlikValueHandlerPool
+ NovalnetBlikValidatorPool
+ NovalnetRedirectPaymentCommandPool
+
+
+
+
+
+ \Novalnet\Payment\Model\Ui\ConfigProvider::NOVALNET_BLIK
+
+
+
+
+
+ NovalnetBlikConfig
+
+
+
+
+
+ NovalnetBlikConfig
+
+
+
+
+
+ NovalnetBlikConfig
+
+
+
+
+
+ NovalnetBlikConfig
+
+
+
+
+
+ NovalnetBlikConfig
+
+
+
+
+
+
+ - NovalnetBlikConfigValueHandler
+ - Novalnet\Payment\Gateway\Config\PaymentActionHandler
+
+
+
+
+
+ NovalnetBlikConfig
+
+
+
+
+
+
+ - NovalnetBlikCountryValidator
+
+
+
+
+
+ NovalnetBlikConfig
+
+
+
+
+
+
+ \Novalnet\Payment\Model\Ui\ConfigProvider::NOVALNET_BANCONTACT
+ Magento\Payment\Block\Form
+ Novalnet\Payment\Block\Info\Bancontact
+ NovalnetBancontactValueHandlerPool
+ NovalnetBancontactValidatorPool
+ NovalnetRedirectPaymentCommandPool
+
+
+
+
+
+ \Novalnet\Payment\Model\Ui\ConfigProvider::NOVALNET_BANCONTACT
+
+
+
+
+
+ NovalnetBancontactConfig
+
+
+
+
+
+ NovalnetBancontactConfig
+
+
+
+
+
+ NovalnetBancontactConfig
+
+
+
+
+
+ NovalnetBancontactConfig
+
+
+
+
+
+ NovalnetBancontactConfig
+
+
+
+
+
+
+ - NovalnetBancontactConfigValueHandler
+ - Novalnet\Payment\Gateway\Config\PaymentActionHandler
+
+
+
+
+
+ NovalnetBancontactConfig
+
+
+
+
+
+
+ - NovalnetBancontactCountryValidator
+
+
+
+
+
+ NovalnetBancontactConfig
+
+
+
+
+
+
+ \Novalnet\Payment\Model\Ui\ConfigProvider::NOVALNET_EPS
+ Magento\Payment\Block\Form
+ Novalnet\Payment\Block\Info\Eps
+ NovalnetEpsValueHandlerPool
+ NovalnetEpsValidatorPool
+ NovalnetRedirectPaymentCommandPool
+
+
+
+
+
+ \Novalnet\Payment\Model\Ui\ConfigProvider::NOVALNET_EPS
+
+
+
+
+
+ NovalnetEpsConfig
+
+
+
+
+
+ NovalnetEpsConfig
+
+
+
+
+
+ NovalnetEpsConfig
+
+
+
+
+
+ NovalnetEpsConfig
+
+
+
+
+
+ NovalnetEpsConfig
+
+
+
+
+
+
+ - NovalnetEpsConfigValueHandler
+ - Novalnet\Payment\Gateway\Config\PaymentActionHandler
+
+
+
+
+
+ NovalnetEpsConfig
+
+
+
+
+
+
+ - NovalnetEpsCountryValidator
+
+
+
+
+
+ NovalnetEpsConfig
+
+
+
+
+
+
+ \Novalnet\Payment\Model\Ui\ConfigProvider::NOVALNET_GIROPAY
+ Magento\Payment\Block\Form
+ Novalnet\Payment\Block\Info\Giropay
+ NovalnetGiropayValueHandlerPool
+ NovalnetGiropayValidatorPool
+ NovalnetRedirectPaymentCommandPool
+
+
+
+
+
+ \Novalnet\Payment\Model\Ui\ConfigProvider::NOVALNET_GIROPAY
+
+
+
+
+
+ NovalnetGiropayConfig
+
+
+
+
+
+ NovalnetGiropayConfig
+
+
+
+
+
+ NovalnetGiropayConfig
+
+
+
+
+
+ NovalnetGiropayConfig
+
+
+
+
+
+ NovalnetGiropayConfig
+
+
+
+
+
+
+ - NovalnetGiropayConfigValueHandler
+ - Novalnet\Payment\Gateway\Config\PaymentActionHandler
+
+
+
+
+
+ NovalnetGiropayConfig
+
+
+
+
+
+
+ - NovalnetGiropayCountryValidator
+
+
+
+
+
+ NovalnetGiropayConfig
+
+
+
+
+
+
+ \Novalnet\Payment\Model\Ui\ConfigProvider::NOVALNET_PRZELEWY
+ Magento\Payment\Block\Form
+ Novalnet\Payment\Block\Info\Przelewy
+ NovalnetPrzelewyValueHandlerPool
+ NovalnetPrzelewyValidatorPool
+ NovalnetRedirectPaymentCommandPool
+
+
+
+
+
+ \Novalnet\Payment\Model\Ui\ConfigProvider::NOVALNET_PRZELEWY
+
+
+
+
+
+ NovalnetPrzelewyConfig
+
+
+
+
+
+ NovalnetPrzelewyConfig
+
+
+
+
+
+ NovalnetPrzelewyConfig
+
+
+
+
+
+ NovalnetPrzelewyConfig
+
+
+
+
+
+ NovalnetPrzelewyConfig
+
+
+
+
+
+
+ - NovalnetPrzelewyConfigValueHandler
+ - Novalnet\Payment\Gateway\Config\PaymentActionHandler
+
+
+
+
+
+ NovalnetPrzelewyConfig
+
+
+
+
+
+
+ - NovalnetPrzelewyCountryValidator
+
+
+
+
+
+ NovalnetPrzelewyConfig
+
+
+
+
+
+
+ \Novalnet\Payment\Model\Ui\ConfigProvider::NOVALNET_POSTFINANCE
+ Magento\Payment\Block\Form
+ Novalnet\Payment\Block\Info\PostFinance
+ NovalnetPostFinanceValueHandlerPool
+ NovalnetPostFinanceValidatorPool
+ NovalnetRedirectPaymentCommandPool
+
+
+
+
+
+ \Novalnet\Payment\Model\Ui\ConfigProvider::NOVALNET_POSTFINANCE
+
+
+
+
+
+ NovalnetPostFinanceConfig
+
+
+
+
+
+ NovalnetPostFinanceConfig
+
+
+
+
+
+ NovalnetPostFinanceConfig
+
+
+
+
+
+ NovalnetPostFinanceConfig
+
+
+
+
+
+ NovalnetPostFinanceConfig
+
+
+
+
+
+
+ - NovalnetPostFinanceConfigValueHandler
+ - Novalnet\Payment\Gateway\Config\PaymentActionHandler
+
+
+
+
+
+ NovalnetPostFinanceConfig
+
+
+
+
+
+
+ - NovalnetPostFinanceCountryValidator
+
+
+
+
+
+ NovalnetPostFinanceConfig
+
+
+
+
+
+
+ \Novalnet\Payment\Model\Ui\ConfigProvider::NOVALNET_POSTFINANCE_CARD
+ Magento\Payment\Block\Form
+ Novalnet\Payment\Block\Info\PostFinanceCard
+ NovalnetPostFinanceCardValueHandlerPool
+ NovalnetPostFinanceCardValidatorPool
+ NovalnetRedirectPaymentCommandPool
+
+
+
+
+
+ \Novalnet\Payment\Model\Ui\ConfigProvider::NOVALNET_POSTFINANCE_CARD
+
+
+
+
+
+ NovalnetPostFinanceCardConfig
+
+
+
+
+
+ NovalnetPostFinanceCardConfig
+
+
+
+
+
+ NovalnetPostFinanceCardConfig
+
+
+
+
+
+ NovalnetPostFinanceCardConfig
+
+
+
+
+
+ NovalnetPostFinanceCardConfig
+
+
+
+
+
+
+ - NovalnetPostFinanceCardConfigValueHandler
+ - Novalnet\Payment\Gateway\Config\PaymentActionHandler
+
+
+
+
+
+ NovalnetPostFinanceCardConfig
+
+
+
+
+
+
+ - NovalnetPostFinanceCardCountryValidator
+
+
+
+
+
+ NovalnetPostFinanceCardConfig
+
+
+
+
+
+
+ \Novalnet\Payment\Model\Ui\ConfigProvider::NOVALNET_SEPA_INSTALMENT
+ Novalnet\Payment\Block\Form\SepaInstalment
+ Novalnet\Payment\Block\Info\SepaInstalment
+ NovalnetSepaInstalmentValueHandlerPool
+ NovalnetSepaInstalmentValidatorPool
+ NovalnetSepaInstalmentCommandPool
+
+
+
+
+
+ \Novalnet\Payment\Model\Ui\ConfigProvider::NOVALNET_SEPA_INSTALMENT
+
+
+
+
+
+
+ - NovalnetInitializeCommand
+ - NovalnetDirectPaymentAuthorizeCommand
+ - NovalnetCaptureCommand
+ - NovalnetRefundCommand
+ - NovalnetVoidCommand
+ - NovalnetVoidCommand
+
+
+
+
+
+
+ Novalnet\Payment\Gateway\Request\InitializeDataBuilder
+ Novalnet\Payment\Gateway\Response\CcPaymentHandler
+ Novalnet\Payment\Gateway\Http\TransferFactory
+ Novalnet\Payment\Gateway\Validator\ResponseCodeValidator
+ Novalnet\Payment\Gateway\Http\Client\TransactionInitialize
+
+
+
+
+
+ NovalnetSepaInstalmentConfig
+
+
+
+
+
+ NovalnetSepaInstalmentConfig
+
+
+
+
+
+ NovalnetSepaInstalmentConfig
+
+
+
+
+
+ NovalnetSepaInstalmentConfig
+
+
+
+
+
+ NovalnetSepaInstalmentConfig
+
+
+
+
+
+
+ - NovalnetSepaInstalmentConfigValueHandler
+ - Novalnet\Payment\Gateway\Config\PaymentActionHandler
+
+
+
+
+
+ NovalnetSepaInstalmentConfig
+
+
+
+
+
+
+ - NovalnetSepaInstalmentCountryValidator
+
+
+
+
+
+ NovalnetSepaInstalmentConfig
+
+
+
+
+
+ \Novalnet\Payment\Model\Ui\ConfigProvider::NOVALNET_INVOICE_INSTALMENT
+ Novalnet\Payment\Block\Form\InvoiceInstalment
+ Novalnet\Payment\Block\Info\InvoiceInstalment
+ NovalnetInvoiceInstalmentValueHandlerPool
+ NovalnetInvoiceInstalmentValidatorPool
+ NovalnetInvoiceInstalmentCommandPool
+
+
+
+
+ \Novalnet\Payment\Model\Ui\ConfigProvider::NOVALNET_INVOICE_INSTALMENT
+
+
+
+
+
+
+ - NovalnetInitializeCommand
+ - NovalnetDirectPaymentAuthorizeCommand
+ - NovalnetCaptureCommand
+ - NovalnetRefundCommand
+ - NovalnetVoidCommand
+ - NovalnetVoidCommand
+
+
+
+
+
+
+ Novalnet\Payment\Gateway\Request\InitializeDataBuilder
+ Novalnet\Payment\Gateway\Response\CcPaymentHandler
+ Novalnet\Payment\Gateway\Http\TransferFactory
+ Novalnet\Payment\Gateway\Validator\ResponseCodeValidator
+ Novalnet\Payment\Gateway\Http\Client\TransactionInitialize
+
+
+
+
+
+ NovalnetInvoiceInstalmentConfig
+
+
+
+
+
+ NovalnetInvoiceInstalmentConfig
+
+
+
+
+
+ NovalnetInvoiceInstalmentConfig
+
+
+
+
+
+ NovalnetInvoiceInstalmentConfig
+
+
+
+
+
+ NovalnetInvoiceInstalmentConfig
+
+
+
+
+
+
+ - NovalnetInvoiceInstalmentConfigValueHandler
+ - Novalnet\Payment\Gateway\Config\PaymentActionHandler
+
+
+
+
+
+ NovalnetInvoiceInstalmentConfig
+
+
+
+
+
+
+ - NovalnetInvoiceInstalmentCountryValidator
+
+
+
+
+
+ NovalnetInvoiceInstalmentConfig
+
+
+
+
+
+
+
+ - NovalnetDirectPaymentAuthorizeCommand
+ - NovalnetCaptureCommand
+ - NovalnetRefundCommand
+ - NovalnetVoidCommand
+ - NovalnetVoidCommand
+
+
+
+
+
+
+
+ - NovalnetInitializeCommand
+ - NovalnetRedirectPaymentAuthorizeCommand
+ - NovalnetCaptureCommand
+ - NovalnetRefundCommand
+ - NovalnetVoidCommand
+ - NovalnetVoidCommand
+
+
+
+
+
+
+ Novalnet\Payment\Gateway\Request\InitializeDataBuilder
+ Novalnet\Payment\Gateway\Response\PaymentHandler
+ Novalnet\Payment\Gateway\Http\TransferFactory
+ Novalnet\Payment\Gateway\Validator\ResponseCodeValidator
+ Novalnet\Payment\Gateway\Http\Client\TransactionInitialize
+
+
+
+
+
+ Novalnet\Payment\Gateway\Request\AuthorizationDataBuilder
+ Novalnet\Payment\Gateway\Response\PaymentHandler
+ Novalnet\Payment\Gateway\Http\TransferFactory
+ Novalnet\Payment\Gateway\Validator\ResponseCodeValidator
+ Novalnet\Payment\Gateway\Http\Client\TransactionAuthorize
+
+
+
+
+
+ Novalnet\Payment\Gateway\Request\RedirectAuthorizeDataBuilder
+ Novalnet\Payment\Gateway\Response\RedirectAuthorizeHandler
+ Novalnet\Payment\Gateway\Http\TransferFactory
+ Novalnet\Payment\Gateway\Http\Client\TransactionRedirect
+
+
+
+
+
+ Novalnet\Payment\Gateway\Request\CaptureDataBuilder
+ Novalnet\Payment\Gateway\Response\PaymentHandler
+ Novalnet\Payment\Gateway\Http\TransferFactory
+ Novalnet\Payment\Gateway\Validator\ResponseCodeValidator
+ Novalnet\Payment\Gateway\Http\Client\TransactionCapture
+
+
+
+
+
+ Novalnet\Payment\Gateway\Request\VoidDataBuilder
+ Novalnet\Payment\Gateway\Response\VoidHandler
+ Novalnet\Payment\Gateway\Http\TransferFactory
+ Novalnet\Payment\Gateway\Validator\ResponseCodeValidator
+ Novalnet\Payment\Gateway\Http\Client\TransactionVoid
+
+
+
+
+
+ Novalnet\Payment\Gateway\Request\RefundDataBuilder
+ Novalnet\Payment\Gateway\Response\RefundHandler
+ Novalnet\Payment\Gateway\Http\TransferFactory
+ Novalnet\Payment\Gateway\Validator\ResponseCodeValidator
+ Novalnet\Payment\Gateway\Http\Client\TransactionRefund
+
+
+
+
+
+ Magento\Framework\Filesystem\Driver\File
+
+
+
+
+ NovalnetLogger
+
+ - Novalnet\Payment\Logger\Handler\NovalnetNotice
+ - Novalnet\Payment\Logger\Handler\NovalnetDebug
+ - Novalnet\Payment\Logger\Handler\NovalnetError
+
+
+
+
diff --git a/etc/email_templates.xml b/etc/email_templates.xml
new file mode 100755
index 0000000..5713b40
--- /dev/null
+++ b/etc/email_templates.xml
@@ -0,0 +1,25 @@
+
+
+
+
+
+
diff --git a/etc/events.xml b/etc/events.xml
new file mode 100755
index 0000000..30aef51
--- /dev/null
+++ b/etc/events.xml
@@ -0,0 +1,53 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/etc/frontend/di.xml b/etc/frontend/di.xml
new file mode 100755
index 0000000..09b13cb
--- /dev/null
+++ b/etc/frontend/di.xml
@@ -0,0 +1,33 @@
+
+
+
+
+
+
+ - Novalnet\Payment\Model\Ui\ConfigProvider
+
+
+
+
+
+
+
diff --git a/etc/frontend/routes.xml b/etc/frontend/routes.xml
new file mode 100755
index 0000000..ebbffdd
--- /dev/null
+++ b/etc/frontend/routes.xml
@@ -0,0 +1,28 @@
+
+
+
+
+
+
+
+
+
diff --git a/etc/module.xml b/etc/module.xml
new file mode 100755
index 0000000..43ee342
--- /dev/null
+++ b/etc/module.xml
@@ -0,0 +1,30 @@
+
+
+
+
+
+
+
+
+
+
+
diff --git a/etc/webapi.xml b/etc/webapi.xml
new file mode 100755
index 0000000..ccfcfce
--- /dev/null
+++ b/etc/webapi.xml
@@ -0,0 +1,101 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/i18n/de_DE.csv b/i18n/de_DE.csv
new file mode 100755
index 0000000..81381f8
--- /dev/null
+++ b/i18n/de_DE.csv
@@ -0,0 +1,358 @@
+"You will be redirected to Blik. Please don’t close or refresh the browser until the payment is completed","Sie werden zu Blik weitergeleitet. Um eine erfolgreiche Zahlung zu gewährleisten, darf die Seite nicht geschlossen oder neu geladen werden, bis die Bezahlung abgeschlossen ist"
+"Your order was successfully processed using Google Pay","Ihre Bestellung wurde erfolgreich mit Google Pay durchgeführt"
+"Your order was successfully processed using Apple Pay","Ihre Bestellung wurde erfolgreich mit Apple Pay durchgeführt"
+"Business name","Name des Geschäfts"
+"Google Merchant ID","Google-Händler-ID"
+"The business name is rendered in the Google Pay payment sheet, and this text will appear as PAY 'BUSINESS NAME' so that the customer knows where he is paying to.","Der Name des Geschäfts wird in den Zahlungsbeleg von Google Pay eingefügt und der Text wird als PAY 'Name des Geschäfts' angezeigt, so dass der Endkunde weiß, an wen er zahlt."
+"Display the Google Pay button on","Google-Pay-Button anzeigen auf"
+"Display the Apple Pay button on","Apple Pay-Button anzeigen auf"
+"Please note that Google's merchant identifier is required for processing the payment method in the live environment. Google's merchant identifier is issued after registration with the Google Pay and Wallet Console . See Request production access for more information about the approval process and obtaining a Google merchant identifier. The registration also involves submitting the integration with sufficient screen-shots, so collect this information by enabling the payment method in test mode. To suppress the validation of this field while saving the configuration, use this test identifier BCR2DN4XXXTN7FSI for testing and submission of your integration to Google.","Beachten Sie bitte, dass die Händler-ID von Google für die Ausführung dieser Zahlungsart in der Live-Umgebung benötigt wird. Die Händler-ID wird nach der Registrierung bei Google Pay und der Wallet-Konsole vergeben. Siehe auch: Anfrage für Produktiv-Zugang stellen , falls Sie mehr Informationen zum Genehmigungsverfahren benötigen und dazu, wie Sie eine Google Händler-ID erhalten. Die Registrierung beinhaltet auch, dass Sie Ihre Anbindung mit ausreichenden Screenshots einreichen, deshalb sammeln Sie diese Informationen, indem Sie die Zahlungsmethode im Testmodus aktivieren. Um die Validierung dieses Feldes zu überspringen, während Sie die Konfiguration speichern, verwenden Sie diese Test-ID, BCR2DN4XXXTN7FSI , zum Testen und Einreichen Ihrer Anbindung bei Google."
+"The selected pages will display the Google Pay button to pay instantly as an express checkout option","Auf den ausgewählten Seiten wird der Google Pay-Button angezeigt um mit der Express-Checkout-Option sofort zu bezahlen."
+"The selected pages will display the Apple Pay button to pay instantly as an express checkout option","Auf den ausgewählten Seiten wird der Apple Pay-Button angezeigt um mit der Express-Checkout-Option sofort zu bezahlen."
+"Payment Reminder %1 has been sent to the customer.","Zahlungserinnerung %1 wurde an den Kunden gesendet."
+"The transaction has been submitted to the collection agency. Collection Reference: %1","Die Transaktion wurde an das Inkassobüro übergeben. Inkasso-Referenz: %1"
+"Authorize with zero amount","Mit Nullbetrag autorisieren"
+"This order processed as a zero amount booking","Diese Transaktion wird mit Nullbuchung bearbeitet"
+"Amount has been booked successfully","Der Betrag wurde erfolgreich buchen"
+"Zero Amount has been updated successfully","Der Betrag 0 wurde erfolgreich geändert"
+"Zero Amount update has been failed","Die Nullbetragsaktualisierung ist fehlgeschlagen"
+"Are you sure you want to book the order amount?","Sind Sie sich sicher, dass Sie den Bestellbetrag buchen wollen?"
+"Book transaction","Transaktion durchführen"
+"Your order has been booked with the amount of %1. Your new TID for the booked amount: %2","Ihre Bestellung wurde mit einem Betrag von %1 gebucht. Ihre neue TID für den gebuchten Betrag: %2"
+"Zero amount booking","Transaktionen mit Betrag 0"
+"This order will be processed as zero amount booking which store your payment data for further online purchases.","Diese Bestellung wird als Nullbuchung verarbeitet. Ihre Zahlungsdaten werden für zukünftige Online-Einkäufe gespeichert."
+"Transaction booking amount","Buchungsbetrag der Transaktion"
+"(in minimum unit of currency. E.g. enter 100 which is equal to 1.00)","(in der kleinsten Währungseinheit, z.B. 100 Cent = entsprechen 1.00 EUR)"
+"You will be redirected to WeChat Pay. Please don’t close or refresh the browser until the payment is completed.","Sie werden zu WeChat Pay weitergeleitet. Um eine erfolgreiche Zahlung zu gewährleisten, darf die Seite nicht geschlossen oder neu geladen werden, bis die Bezahlung abgeschlossen ist."
+"You will be redirected to Trustly. Please don’t close or refresh the browser until the payment is completed.","Sie werden zu Trustly weitergeleitet. Um eine erfolgreiche Zahlung zu gewährleisten, darf die Seite nicht geschlossen oder neu geladen werden, bis die Bezahlung abgeschlossen ist."
+"You will be redirected to Alipay. Please don’t close or refresh the browser until the payment is completed.","Sie werden zu Alipay weitergeleitet. Um eine erfolgreiche Zahlung zu gewährleisten, darf die Seite nicht geschlossen oder neu geladen werden, bis die Bezahlung abgeschlossen ist."
+"On-hold order status","On-hold-Bestellstatus"
+"Status to be used for on-hold orders until the transaction is confirmed or canceled","Wählen Sie, welcher Status für On-hold-Bestellungen verwendet wird, solange diese nicht bestätigt oder storniert worden sind"
+"The instalment amount for this cycle %cycleAmount %currency will be debited from your account in one - three business days.","Die nächste Rate in Höhe von %cycleAmount %currency wird in ein bis drei Werktagen von Ihrem Konto abgebucht."
+"Documentation","Dokumentation"
+"Deactivate Instalment Renewal Notification E-mail to end-customer","Deaktivieren Sie Ratenzahlung Erneuerung E-Mail-Benachrichtigung an den Endverbraucher"
+"Configuration","Einstellungen"
+"Instalment has been cancelled.","Ratenzahlung wurde storniert."
+"Payments","Zahlungen"
+"Product Activation Key","Produktaktivierungsschlüssel"
+"Merchant details are configured successfully. Please select the Tariff ID and click","Ihre Händlerdaten wurden erfolgreich aktualisiert. Bitte wählen Sie die Tarif-ID und klicken Sie auf "
+"button to save the configuration.",", um alle Einstellungen zu speichern."
+"Activate"," Aktivieren"
+"Enter the Novalnet Product activation key that is required for authentication and click Activate. You will find the Product activation key in the Novalnet Admin Portal : Projects > Choose your project > API credentials > API Signature (Product activation key)","Geben Sie den Novalnet-Produktaktivierungsschlüssel ein, der für die Authentifizierung erforderlich ist, und klicken Sie auf Aktivieren. Den Produktaktivierungsschlüssel finden Sie im Novalnet Admin-Portal > Projekts > Wählen Sie Ihr Projekt > API-Anmeldeinformationen > API-Signature (Aktivierungsschlüssel des Produkts)."
+"Merchant ID","Händler-ID"
+"Project ID","Projekt-ID"
+"Authentication code","Authentifizierungscode"
+"Select Tariff ID","Auswahl der Tarif-ID"
+"Select a Tariff ID to match the preferred tariff plan you created at the Novalnet Admin Portal for this project","Wählen Sie eine Tarif-ID, die dem bevorzugten Tarifplan entspricht, den Sie im Novalnet Admin-Portal für dieses Projekt erstellt haben"
+"Payment Access Key","Zahlungs-Zugriffsschlüssel"
+"Enable Live Mode","Live-Modus aktivieren"
+"Selected payment methods will be in Live Mode","Für ausgewählten Zahlungsarten wird der Live-Modus gesetzt"
+"No active payment method for this store","Für diesen Shop ist keine Zahlungsart aktiviert."
+"Display payment method logo","Zahlungslogo anzeigen"
+"The payment method logo will be displayed on the checkout page","Das Logo der Zahlungsart wird auf der Checkout-Seite angezeigt"
+"Products remain in the shopping cart after cancelled payment","Produkte im Warenkorb nach Abbruch des Zahlungsvorgangs wiederherstellen"
+"For additional configurations login to Novalnet Merchant Administration portal . To login to the Portal you need to have an account at Novalnet. If you don't have one yet, please contact sales@novalnet.de / tel. +49 (089) 923068320","Um zusätzliche Einstellungen vorzunehmen"
+"To accept PayPal transactions, configure your PayPal API info in the Novalnet Admin Portal > PROJECT > 'Project' Information > Payment Methods > Paypal > Configure.","Um PayPal-Transaktionen zu akzeptieren, konfigurieren Sie Ihre PayPal-API-Informationen im Novalnet Admin-Portal > PROJEKT > Wählen Sie Ihr Projekt > Zahlungsmethoden > Paypal > Konfigurieren"
+"Order status management for on-hold transactions","Verwaltung des Bestellstatus für ausgesetzte Zahlungen"
+"Order status for the pending payment","Bestellstatus der ausstehenden Zahlung"
+"Onhold order status","On-hold-Bestellstatus"
+"Cancellation order status","Bestellstatus für Stornierung"
+"Notification / Webhook URL Setup","Benachrichtigungs- / Webhook-URL festlegen"
+"Allow manual testing of the Notification / Webhook URL","Deaktivieren Sie die IP-Adresskontrolle (nur zu Testzwecken)"
+"For additional configurations login to Novalnet Merchant Administration portal . To login to the Portal you need to have an account at Novalnet. If you don't have one yet, please contact sales@novalnet.de / tel. +49 (089) 923068320To use the PayPal payment method please enter your PayPal API details in Novalnet Merchant Administration portal ","Aktivieren Sie diese Option, um die Novalnet-Benachrichtigungs-/Webhook-URL manuell zu testen. Deaktivieren Sie die Option, bevor Sie Ihren Shop liveschalten, um unautorisierte Zugriffe von Dritten zu blockieren."
+"E-Mail address of the recipient","E-Mail-Benachrichtigungen werden an diese E-Mail-Adresse gesendet"
+"Notification & Webhook URL","Benachrichtigungs- / Webhook-URL"
+"Notification / Webhook URL is required to keep the merchant’s database/system synchronized with the Novalnet account (e.g. delivery status). Refer the Installation Guide for more information","Eine Benachrichtigungs- / Webhook-URL ist erforderlich, um die Datenbank / das System des Händlers mit dem Novalnet-Account synchronisiert zu halten (z.B. Lieferstatus). Weitere Informationen finden Sie in der Installationsanleitung"
+"Payment Methods","Zahlungsmethode"
+"Credit/Debit Cards","Kredit-/Debitkarte"
+"Direct Debit SEPA","SEPA-Lastschrift"
+"Invoice","Kauf auf Rechnung"
+"Prepayment","Vorkasse"
+"Invoice with payment guarantee","Rechnung mit Zahlungsgarantie"
+"Direct Debit SEPA with payment guarantee","SEPA-Lastschrift mit Zahlungsgarantie"
+"Instalment by Direct Debit SEPA","Ratenzahlung per SEPA-Lastschrift"
+"Instalment by Invoice","Ratenzahlung per Rechnung"
+"PayPal","PayPal"
+"Sofort","Sofortüberweisung"
+"Online bank transfer","Onlineüberweisung"
+"iDEAL","iDEAL"
+"Eps","eps"
+"Giropay","giropay"
+"Przelewy24","Przelewy24"
+"PostFinance Card","PostFinance Card"
+"PostFinance E-Finance","PostFinance E-Finance"
+"Multibanco","Multibanco"
+"Bancontact","Bancontact"
+"Display payment method","Zahlungsart anzeigen"
+"Novalnet Title","Titel"
+"Define a sorting order","Geben Sie eine Sortierreihenfolge an"
+"This payment method will be sorted among others (in the ascending order) as per the given sort number","Die Zahlungsarten werden in Ihrem Checkout anhand der von Ihnen vorgegebenen Sortierreihenfolge angezeigt (in aufsteigender Reihenfolge)"
+"Payment logo","Logo der Zahlungsart"
+"Payment Action","Aktion für vom Besteller autorisierte Zahlungen"
+"Authorize","Zahlung autorisieren"
+"Choose whether or not the payment should be charged immediately. Capture completes the transaction by transferring the funds from buyer account to merchant account. Authorize verifies payment details and reserves funds to capture it later, giving time for the merchant to decide on the order.","Wählen Sie, ob die Zahlung sofort belastet werden soll oder nicht. Zahlung einziehen: Betrag sofort belasten. Zahlung autorisieren: Die Zahlung wird überprüft und autorisiert, aber erst zu einem späteren Zeitpunkt belastet. So haben Sie Zeit, über die Bestellung zu entscheiden."
+"Capture","Zahlung einziehen"
+"Novalnet Capture","Novalnet Erfassen"
+"Completed order status","Status für erfolgreichen Auftragsabschluss"
+"Status to be used for successful orders","Wählen Sie, welcher Status für erfolgreich abgeschlossene Bestellungen verwendet wird"
+"Payment due date (in days)","Fälligkeitsdatum (in Tagen)"
+"Enter the number of days after which the payment should be processed (must be between 2 and 14 days)","Geben Sie die Anzahl der Tage ein, nach denen der Zahlungsbetrag eingezogen werden soll (muss zwischen 2 und 14 Tagen liegen)."
+"Enter the number of days after which the payment should be processed (must be between 7 and 28 days)","Anzahl der Tage, die der Käufer Zeit hat, um den Betrag an Novalnet zu überweisen (muss zwischen 7 und 28 Tagen liegen). Wenn Sie dieses Feld leer lassen, werden standardmäßig 14 Tage als Fälligkeitsdatum festgelegt."
+"Minimum transaction amount for authorization","Mindesttransaktionsbetrag für die Autorisierung (in der kleinsten Währungseinheit, z.B. 100 Cent = entsprechen 1.00 EUR)"
+"Form appearance","Darstellung des Formulars"
+"Custom CSS Settings","Angepasste CSS-Einstellungen"
+"CSS settings for iframe form","CSS-Einstellungen für den iFrameformular"
+"NN CC Label Style","Beschriftung"
+"NN CC Input Style","Eingabe"
+"NN CC CSS text","Text für das CSS"
+"Notification for the buyer","Benachrichtigung des Käufers"
+"The entered text will be displayed on the checkout page","Der eingegebene Text wird auf der Checkout-Seite angezeigt"
+"User Group Excluded","Ausgeschlossene Benutzergruppe(n)"
+"Payment from Applicable Countries","Zahlung aus zugelassenen Ländern"
+"Payment from Specific Countries","Länderauswahl für Zahlungsmöglichkeit"
+"Minimum order amount (in minimum unit of currency. E.g. enter 100 which is equal to 1.00)","Mindestbestellbetrag (in der kleinsten Währungseinheit, z.B. 100 Cent = entsprechen 1.00 EUR)"
+"Minimum order amount: 19.98 EUR or more","Mindestbetrag der Bestellung: 19.98 EUR"
+"The minimum amount should be at least 9.99 EUR","Der Mindestbetrag sollte bei mindestens 9.99 EUR"
+"The minimum amount should be at least 19.98 EUR","Der Mindestbetrag sollte bei mindestens 19.98 EUR"
+"Minimum Order Total","Mindestwert für Gesamtbestellung"
+"Maximum Order Total","Höchstwert für Gesamtbestellung"
+"Minimum Orders Count","Mindestanzahl an bisherigen Bestellungen des Kunden"
+"Default: '0' for disabled check | Minimum count of orders (in the past) needed for the customer to use this payment method","Aktivieren Sie diese Zahlungsart für den jeweiligen Kunden nur dann, wenn er die geforderte Anzahl an früheren Bestellungen bei Ihnen überschreitet."
+"Your credit/debit card will be charged immediately after the order is completed","Ihre Karte wird nach Bestellabschluss sofort belastet"
+"Once you've submitted the order, you will receive an e-mail with account details to make payment","Sobald Sie die Bestellung absenden, erhalten Sie eine E-Mail mit den Kontodaten, um die Zahlung abzuschließen."
+"The payment will be processed in the test mode therefore amount for this transaction will not be charged","Die Zahlung wird im Testmodus durchgeführt, daher wird der Betrag für diese Transaktion nicht eingezogen."
+"Your credit card details are invalid","Ihre Kreditkartendaten sind ungültig."
+"Card holder name","Name des Karteninhabers"
+"Name on card","Name auf der Kreditkarte"
+"Card number","Kreditkartennummer"
+"XXXX XXXX XXXX XXXX","XXXX XXXX XXXX XXXX"
+"Expiry date","Ablaufdatum"
+"MM / YY","MM / YY"
+"CVC/CVV/CID","CVC/CVV/CID"
+"XXX","XXX"
+"what is this?","Was ist das?"
+"The amount will be debited from your account by Novalnet","Der Betrag wird durch Novalnet von Ihrem Konto abgebucht"
+"Account holder","Kontoinhaber"
+"IBAN","IBAN"
+"I hereby grant the mandate for the SEPA direct debit","Ich erteile hiermit das SEPA-Lastschriftmandat"
+"(electronic transmission)","(elektronische Übermittlung)"
+"and confirm that the given bank details are correct!","und bestätige, dass die Bankverbindung korrekt ist"
+"I authorise (A) Novalnet AG to send instructions to my bank to debit my account and (B) my bank to debit my account in accordance with the instructions from Novalnet AG.","Ich ermächtige den Zahlungsempfänger, Zahlungen von meinem Konto mittels Lastschrift einzuziehen. Zugleich weise ich mein Kreditinstitut an, die von dem Zahlungsempfänger auf mein Konto gezogenen Lastschriften einzulösen."
+"Creditor identifier: DE53ZZZ00000004253","Gläubiger-Identifikationsnummer: DE53ZZZ00000004253"
+"Note:","Hinweis:"
+"You are entitled to a refund from your bank under the terms and conditions of your agreement with bank. A refund must be claimed within 8 weeks starting from the date on which your account was debited.","Ich kann innerhalb von acht Wochen, beginnend mit dem Belastungsdatum, die Erstattung des belasteten Betrages verlangen. Es gelten dabei die mit meinem Kreditinstitut vereinbarten Bedingungen."
+"After the successful verification, you will be redirected to Novalnet secure order page to proceed with the payment","Sie werden auf die sichere Zahlungsseite von Novalnet weitergeleitet, um die Zahlung abzuschließen."
+"Are you sure you want to remove these account details?","Sind Sie sicher, dass Sie diese Kontodaten entfernen möchten?"
+"Are you sure you want to remove these Credit Card details?","Sind Sie sicher, dass Sie diese Kreditkartendaten entfernen möchten?"
+"Add new card details","Neue Kreditkarte hinzufügen"
+"Add new account details","Neue Kontodaten hinzufügen"
+"Save my card details for future purchases","Ich möchte meine Kartendaten für spätere Einkäufe speichern"
+"Save my account details for future purchases","Ich möchte meine Kontodaten für spätere Einkäufe speichern"
+"Save my PayPal details for future purchases","Ich möchte meine PayPal-Kontodaten für spätere Einkäufe speichern"
+"Test order","Testbestellung"
+"Novalnet Transaction ID: ","Novalnet-Transaktions-ID: "
+"Payment Failed","Zahlung fehlgeschlagen"
+"The transaction has been confirmed on %1","Die Transaktion wurde am %1 Uhr bestätigt"
+"The transaction has been canceled on %1","Die Transaktion wurde am %1 Uhr storniert"
+"Refund has been initiated for the TID:%1 with the amount %2","Die Rückerstattung für die TID %1 mit dem Betrag %2 wurde veranlasst"
+"Refund has been initiated for the TID: %1 with the amount %2. New TID:%3","Die Rückerstattung für die TID %1 mit dem Betrag %2 wurde veranlasst. Die neue TID : %3"
+"Customer was redirected to Novalnet","Besteller zu Novalnet umgeleitet"
+"Customer successfully returned from Novalnet","Der Kunde wurde erfolgreich von Novalnet zurückgeleitet."
+"The transaction has been confirmed","Die Buchung wurde bestätigt"
+"The transaction has been canceled","Die Transaktion wurde storniert"
+"While redirecting some data has been changed. The hash check failed.","Während der Umleitung wurden einige Daten geändert. Die Überprüfung des Hashes schlug fehl."
+"The transaction has been confirmed on %1","Die Buchung wurde am %1 Uhr bestätigt"
+"The transaction has been canceled on %1","Die Transaktion wurde am %1 Uhr storniert"
+"Refund/Bookback executed successfully for the TID: %1 amount: %2 on %3. The subsequent TID: %4","Rückerstattung / Bookback erfolgreich ausgeführt für die TID: %1: Betrag: %2 am %3. TID der Folgebuchung: %4"
+"The transaction status has been changed from pending to on hold for the TID: %1 on %2.","Der Status der Transaktion mit der TID: %1 wurde am %2 Uhr von ausstehend auf ausgesetzt geändert."
+"Credit has been successfully received for the TID: %1 with amount %2 on %3. Please refer PAID order details in our Novalnet Admin Portal for the TID: %4","Die Gutschrift für die TID ist erfolgreich eingegangen: %1 mit Betrag %2 am %3. Bitte entnehmen Sie die TID den Einzelheiten der Bestellung bei BEZAHLT in unserem Novalnet Adminportal: %4"
+"Chargeback executed successfully for the TID: %1 amount: %2 on %3. The subsequent TID: %4","Chargeback erfolgreich importiert für die TID: %1 Betrag: %2 am %3 Uhr. TID der Folgebuchung: %4"
+"Transaction updated successfully for the TID: %1 with the amount %2 on %3","Transaktion mit TID %1 und Betrag %2 wurde am um erfolgreich aktualisiert %3"
+"The Transaction ID already existed","The Transaction ID already existed"
+"Enter the number of days to transfer the payment amount to Novalnet (must be greater than 7 days). In case if the field is empty, 14 days will be set as due date by default","Anzahl der Tage, die der Käufer Zeit hat, um den Betrag an Novalnet zu überweisen (muss mehr als 7 Tage betragen). Wenn Sie dieses Feld leer lassen, werden standardmäßig 14 Tage als Fälligkeitsdatum festgelegt"
+"Slip expiry date (in days)","Verfallsdatum des Zahlscheins (in Tagen)"
+"Enter the number of days to pay the amount at store near you. If the field is empty, 14 days will be set as default.","Anzahl der Tage, die der Käufer Zeit hat, um den Betrag in einer Filiale zu bezahlen. Wenn Sie dieses Feld leer lassen, ist der Zahlschein standardmäßig 14 Tage lang gültig"
+"Recurring Period for the instalment cycles","Wählen Sie die zeitliche Abfolge der einzelnen Raten"
+"On choosing an appropriate recurring period, each instalment cycle will be processed based on that","Wählen Sie einen passenden Zeitraum zwischen den zu zahlenden Raten aus"
+"Select the various instalment cycles that can be availed in the instalment plan","Wählen Sie die Anzahl der Raten aus."
+"Choose your instalment plan","Wählen Sie Ihren Ratenplan"
+"Basic requirements for payment guarantee Allowed B2C countries: DE, AT, CH Allowed B2B countries: European Union Allowed currency: EUR Minimum order amount: 9.99 EUR or more Age limit: 18 years or more The billing address must be the same as the shipping address ","Grundanforderungen für die Zahlungsgarantie Erlaubte B2C-Länder: DE, AT, CH Erlaubte B2B-Länder: Europäische Union Zugelassene Währung: EUR Mindestbetrag der Bestellung: 9.99 EUR Mindestalter: 18 Jahre Rechnungsadresse und Lieferadresse müssen übereinstimmen "
+"Basic requirements for the instalment payment Allowed B2C countries: DE, AT, CH Allowed B2B countries: European Union Allowed currency: EUR Minimum order amount: 19.98 EUR or more Please note that the instalment cycle amount has to be a minimum of 9.99 EUR and the instalment cycles which do not meet this criteria will not be displayed in the instalment plan Age limit: 18 years or more The billing address must be the same as the shipping address ","Voraussetzungen für die Ratenzahlung Erlaubte B2C-Länder: DE, AT, CH Erlaubte B2B-Länder: Europäische Union Zugelassene Währung: EUR Mindestbetrag der Bestellung: 19.98 EUR Bitte beachten Sie, dass der Betrag einer Rate mindestens 9.99 EUR betragen muss und Raten, die diese Kriterien nicht erfüllen, nicht im Ratenplan angezeigt werden Mindestalter: 18 Jahre Rechnungsadresse und Lieferadresse müssen übereinstimmen "
+"Choose the financing option that best fits your needs and you will be charged based on that chosen plan","Wählen Sie die Finanzierungsoption, die Ihren Bedürfnissen am besten entspricht. Die Raten werden Ihnen entsprechend dem gewählten Ratenplan berechnet"
+"Net loan amount: ","Netto-Kreditbetrag: "
+"The payment cannot be processed, because the basic requirements for the %1 haven't been met (The shipping address must be the same as the billing address)","Die Zahlung kann nicht ausgeführt werden, weil die Voraussetzungen für die Zahlungsgarantie nicht erfüllt sind (Die Lieferadresse muss mit der Rechnungsadresse identisch sein)"
+"The date should be in future","Das Datum sollte in der Zukunft liegen."
+"The transaction has been updated with due date %1","Die Transaktion wurde aktualisiert. Neues Fälligkeitsdatum: %1"
+"The transaction has been updated with amount %1 and slip expiry date with %2","Die Transaktion wurde aktualisiert. Neuer Betrag: %1, neues Fälligkeitsdatum des Zahlscheins: %2"
+"The transaction has been updated with amount %1","Die Transaktion wurde mit dem Betrag %1"
+"The transaction has been updated with amount %1 and due date with %2","Die Transaktion wurde mit dem Betrag %1 und dem Fälligkeitsdatum %2 aktualisiert."
+"The transaction has been updated with slip expiry date %1","Die Transaktion wurde aktualisiert. Neues Fälligkeitsdatum des Zahlscheins: %1"
+"Customer was redirected to Novalnet","Besteller zu Novalnet umgeleitet"
+"Customer successfully returned from Novalnet","Der Kunde wurde erfolgreich von Novalnet zurückgeleitet."
+"While redirecting some data has been changed. The hash check failed.","Während der Umleitung wurden einige Daten geändert. Die Überprüfung des Hashes schlug fehl."
+"Payment Failed","Zahlung fehlgeschlagen"
+"On successful checkout, you will receive a payment slip/SMS to pay your online purchase at one of our retail partners (e.g. supermarket)","Nach erfolgreichem Bestellabschluss erhalten Sie einen Zahlschein bzw. eine SMS. Damit können Sie Ihre Online-Bestellung bei einem unserer Partner im Einzelhandel (z.B. Drogerie, Supermarkt etc.) bezahlen"
+"The transaction has been confirmed successfully for the TID: %1","Die Transaktion mit der TID: %1 wurde erfolgreich bestätigt"
+"Please transfer the amount to the below mentioned account details of our payment processor Novalnet","Überweisen Sie bitte den Betrag an die unten aufgeführte Bankverbindung unseres Zahlungsdienstleisters Novalnet"
+"Your order is being verified. Once confirmed, we will send you our bank details to which the order amount should be transferred. Please note that this may take up to 24 hours","Ihre Bestellung wird überprüft. Nach der Bestätigung senden wir Ihnen unsere Bankverbindung, an die Sie bitte den Gesamtbetrag der Bestellung überweisen. Bitte beachten Sie, dass dies bis zu 24 Stunden dauern kann"
+"Your order is under verification and we will soon update you with the order status. Please note that this may take upto 24 hours.","Ihre Bestellung wird derzeit überprüft. Wir werden Sie in Kürze über den Bestellstatus informieren. Bitte beachten Sie, dass dies bis zu 24 Stunden dauern kann."
+"Slip expiry date: %1", "Verfallsdatum des Zahlscheins: %1"
+"Store(s) near you:","Barzahlen-Partnerfilialen in Ihrer Nähe:"
+"Please enter the refund amount","Geben Sie bitte den erstatteten Betrag ein"
+"(in minimum unit of currency. E.g. enter 100 which is equal to 1.00)","(in der kleinsten Währungseinheit, z.B. 100 Cent = entsprechen 1.00 EUR)"
+"Change the slip expiry date","Ablaufdatum des Zahlscheins ändern"
+"Change the due date","Fälligkeitsdatum ändern"
+"Slip expiry date","Verfallsdatum des Zahlscheins"
+"Transaction due date","Fälligkeitsdatum der Transaktion"
+"Amount","Betrag"
+"Update","Aktualisieren"
+"Refund","Rückerstattung"
+"Paid","Bezahlt"
+"Pending","Ausstehend"
+"Cancel","Stornieren"
+"Reference","Verwendungszweck"
+"Are you sure you want to change the slip expiry date?","Sind Sie sicher, dass Sie das Ablaufdatum des Zahlscheins ändern wollen?"
+"Are you sure you want to change the order due date?","Sind Sie sich sicher, dass Sie den das Fälligkeitsdatum der Bestellung ändern wollen?"
+"Pay now with Barzahlen","Jetzt mit Barzahlen bezahlen"
+" Cycles / "," Raten / "
+"Every month","pro Monat"
+"Every 2 months","pro 2 Monate"
+"Every 3 months","pro 3 Monate"
+"Every 4 months","pro 4 Monate"
+"Every 6 months","pro 6 Monate"
+"Your date of birth","Geben Sie bitte Ihr Geburtsdatum ein"
+"Date of Birth","Geburtsdatum"
+"Instalment","Ratenzahlung"
+"Instalment Information"," Information zu den Raten"
+"Processed Instalments","Bezahlte Raten"
+"Due Instalments","Offene Raten"
+"Next Instalment Date","Nächste Rate fällig am"
+"Instalment Cycle Amount","Betrag jeder Rate"
+"Total paid amount","Bezahlt gesamt"
+"Total due amount","Offen gesamt"
+"Paid Instalments","Bezahlte Raten"
+"Instalment Summary","Zusammenfassung"
+"Paid Date","Bezahlt am"
+"Instalment cycles","Anzahl der Raten"
+"Instalment Amount","Ratenbetrag"
+"%s Instalment","%s Ratenzahlung"
+" per month"," pro Monat"
+" Every %1 months"," pro %1 Monate"
+"The next instalment cycle have arrived for the instalment order %orderNo placed at the %store_name, kindly refer further details below.","Für Ihre Bestellung Nr. %orderNo bei %store_name ist die nächste Rate fällig. Bitte beachten Sie weitere Details unten."
+"Day","Tag"
+"Year","Jahr"
+"Month","Monat"
+"January","Januar"
+"Feburary","Februar"
+"March","März"
+"April","April"
+"May","Mai"
+"June","Juni"
+"July","Juli"
+"August","August"
+"September","September"
+"October","Oktober"
+"November","November"
+"December","Dezember"
+"Display inline credit card form","Inline-Kreditkartenformular anzeigen"
+"Inline form: The following fields will be shown in the checkout in two lines: card holder & credit card number / expiry date / CVC","Inline-Zahlungsformular: Die folgenden Felder werden im Checkout in zwei Zeilen angezeigt: Karteninhaber & Kreditkartennummer / Ablaufdatum / CVC-Code"
+"InvoiceAmount","Betrag"
+"On successful checkout, you will receive a payment reference. Using this payment reference, you can either pay in the Multibanco ATM or through your online bank account","Nach erfolgreichem Bestellabschluss erhalten Sie eine Zahlungsreferenz. Damit können Sie entweder an einem Multibanco-Geldautomaten oder im Onlinebanking bezahlen."
+"Payment References description","Bitte verwenden Sie einen der unten angegebenen Verwendungszwecke für die Überweisung. Nur so kann Ihr Geldeingang Ihrer Bestellung zugeordnet werden"
+"Configure","konfigurieren"
+"You will receive an e-mail with the Novalnet account details to complete the payment","Sie erhalten eine E-Mail mit den Bankdaten von Novalnet, um die Zahlung abzuschließen"
+"Send e-mail to","E-Mails senden an"
+"Notification / Webhook URL execution messages will be sent to this e-mail","E-Mail-Benachrichtigungen werden an diese E-Mail-Adresse gesendet"
+"Unauthorised access from the IP [ %1 ]","Unbefugter Zugriff von der IP [%1]"
+"One-click shopping","Kauf mit einem Klick"
+"Webhook order status","Callback / Webhook Bestellstatus"
+"The Selected logos will be displayed on the checkout page","Die gewählten Kartenlogos werden auf der Checkout-Seite nicht mehr angezeigt"
+"Force non-guarantee payment","Zahlung ohne Zahlungsgarantie erzwingen"
+"Even if payment guarantee is enabled, payments will still be processed as non-guarantee payments if the payment guarantee requirements are not met. Review the requirements under 'Enable Payment Guarantee' in the Installation Guide.","Falls die Zahlungsgarantie zwar aktiviert ist, jedoch die Voraussetzungen für Zahlungsgarantie nicht erfüllt sind, wird die Zahlung ohne Zahlungsgarantie verarbeitet. Die Voraussetzungen finden Sie in der Installationsanleitung unter 'Zahlungsgarantie aktivieren'"
+"Minimum order amount: 9.99 EUR or more","Mindestbetrag der Bestellung: 9.99 EUR"
+"You will be redirected to Sofort. Please don’t close or refresh the browser until the payment is completed","Sie werden zu Sofortüberweisung weitergeleitet. Um eine erfolgreiche Zahlung zu gewährleisten, darf die Seite nicht geschlossen oder neu geladen werden, bis die Bezahlung abgeschlossen ist"
+"You will be redirected to banking page. Please don’t close or refresh the browser until the payment is completed","Sie werden auf die Banking-Seite weitergeleitet. Bitte schließen oder aktualisieren Sie den Browser nicht, bis die Zahlung abgeschlossen ist"
+"You will be redirected to giropay. Please don’t close or refresh the browser until the payment is completed","Sie werden zu giropay weitergeleitet. Um eine erfolgreiche Zahlung zu gewährleisten, darf die Seite nicht geschlossen oder neu geladen werden, bis die Bezahlung abgeschlossen ist"
+"You will be redirected to Przelewy24. Please don’t close or refresh the browser until the payment is completed","Sie werden zu Przelewy24 weitergeleitet. Um eine erfolgreiche Zahlung zu gewährleisten, darf die Seite nicht geschlossen oder neu geladen werden, bis die Bezahlung abgeschlossen ist"
+"You will be redirected to eps. Please don’t close or refresh the browser until the payment is completed","Sie werden zu eps weitergeleitet. Um eine erfolgreiche Zahlung zu gewährleisten, darf die Seite nicht geschlossen oder neu geladen werden, bis die Bezahlung abgeschlossen ist"
+"You will be redirected to PayPal. Please don’t close or refresh the browser until the payment is completed","Sie werden zu PayPal weitergeleitet. Um eine erfolgreiche Zahlung zu gewährleisten, darf die Seite nicht geschlossen oder neu geladen werden, bis die Bezahlung abgeschlossen ist"
+"You will be redirected to PostFinance. Please don’t close or refresh the browser until the payment is completed","Sie werden zu PostFinance weitergeleitet. Um eine erfolgreiche Zahlung zu gewährleisten, darf die Seite nicht geschlossen oder neu geladen werden, bis die Bezahlung abgeschlossen ist"
+"You will be redirected to Bancontact. Please don’t close or refresh the browser until the payment is completed","Sie werden zu Bancontact weitergeleitet. Um eine erfolgreiche Zahlung zu gewährleisten, darf die Seite nicht geschlossen oder neu geladen werden, bis die Bezahlung abgeschlossen ist"
+"You will be redirected to iDEAL. Please don’t close or refresh the browser until the payment is completed","Sie werden zu iDEAL weitergeleitet. Um eine erfolgreiche Zahlung zu gewährleisten, darf die Seite nicht geschlossen oder neu geladen werden, bis die Bezahlung abgeschlossen ist"
+"Are you sure you want to capture the payment?","Sind Sie sicher, dass Sie die Zahlung einziehen möchten?"
+"Are you sure you want to cancel the payment?","Sind Sie sicher, dass Sie die Zahlung stornieren wollen?"
+"Payment reference 1","Verwendungszweck 1"
+"Payment reference 2","Verwendungszweck 2"
+"Payment Reference","Zahlungsreferenz"
+"Please read the Installation Guide before you start and login to the Novalnet Admin Portal using your merchant account. To get a merchant account, mail to sales@novalnet.de or call +49 (089) 923068320","Bevor Sie beginnen, lesen Sie bitte die Installationsanleitung und melden Sie sich mit Ihrem Händlerkonto im Novalnet Admin-Portal an. Um ein Händlerkonto zu erhalten, senden Sie bitte eine E-Mail an sales@novalnet.de oder rufen Sie uns unter +49 (089) 923068320 an"
+"Allow manual testing of the Notification / Webhook URL","Manuelles Testen der Benachrichtigungs- / Webhook-URL erlauben"
+"Enable this to test the Novalnet Notification / Webhook URL manually. Disable this before setting your shop live to block unauthorized calls from external parties","Aktivieren Sie diese Option, um die Novalnet-Benachrichtigungs-/Webhook-URL manuell zu testen. Deaktivieren Sie die Option, bevor Sie Ihren Shop liveschalten, um unautorisierte Zugriffe von Dritten zu blockieren"
+"ending in %1 (expires %2/%3)","mit Endziffern %1 (gültig bis %2/%3)"
+"IBAN","IBAN"
+"Please enter a valid Product Activation Key and Payment Access key.","Bitte geben Sie den gültigen Produktaktivierungsschlüssel und Paymentzugriffsschlüssel ein."
+"Make sure the Direct Debit SEPA payment is enabled to use this option.","Stellen Sie sicher, dass Sie die Zahlungsart SEPA-Lastschrift aktiviert haben, um diese Option nutzen zu können."
+"Make sure the Invoice payment is enabled to use this option.","Stellen Sie sicher, dass Sie die Zahlungsart Rechnung aktiviert haben, um diese Option nutzen zu können."
+"Configure the valid Product Activation Key and Payment Access key to activate the payment types under Configuration settings.","Geben Sie im Menu Konfiguration den gültigen Produktaktivierungsschlüssel und Paymentzugriffsschlüssel an, um die Zahlungsarten zu aktivieren."
+"Module version","Modul-Version"
+"Display Credit/Debit card logos","Kredit-/Debitkartenlogos ausblenden"
+"The selected card logos will be displayed on the checkout page","Die gewählten Kartenlogos werden auf der Checkout-Seite nicht mehr angezeigt"
+"Allow B2B Customers","B2B-Kunden erlauben"
+"Allow B2B customers to place order","B2B-Kunden erlauben, Bestellungen aufzugeben"
+"
Secured and trusted means of accepting all payment methods supported worldwide. Novalnet provides the most convenient way to increase your sales and deliver seamless checkout experience for your customers.
","
Bieten Sie Ihren Kunden auf sichere und vertrauenswürdige Weise alle weltweit unterstützten Zahlungsarten. Mit Novalnet können Sie Ihre Verkäufe steigern und Ihren Kunden ein ansprechendes Zahlungserlebnis aus einem Guss bieten.
"
+"Novalnet webhook added order status %1","Novalnet-Webhook hat den Bestellstatus %1 übermittelt"
+"Novalnet webhook set status (%1) for Order ID = %2","Novalnet-Webhook hat den Status für Bestellnummer %2 auf %1 gesetzt"
+"Please transfer the amount of %1 to the following account on or before %2","Bitte überweisen Sie den Betrag von %1 spätestens bis zum %2 auf das folgende Konto"
+"Please transfer the amount of %1 to the following account","Bitte überweisen Sie den Betrag von %1 auf das folgende Konto"
+"Only EUR currency allowed %1","Die Zahlung kann nicht ausgeführt werden, weil die Voraussetzungen für die %1 nicht erfüllt sind (Nur EUR als Währung erlaubt)"
+"Minimum order amount should be %1","Die Zahlung kann nicht ausgeführt werden, weil die Voraussetzungen für die %1 nicht erfüllt sind (Mindestbestellwert 9.99 EUR)"
+"Only DE, AT, CH countries allowed %1","Die Zahlung kann nicht ausgeführt werden, weil die Voraussetzungen für die Zahlungsgarantie nicht erfüllt sind (nur Deutschland, Österreich oder die Schweiz sind zulässig)"
+"Please use the following payment reference details to pay the amount of %1 at a Multibanco ATM or through your internet banking.","Bitte verwenden Sie die folgende Zahlungsreferenz, um den Betrag von %1 an einem Multibanco-Geldautomaten oder über Ihr Onlinebanking zu bezahlen."
+"Partner Payment Reference: %1","Partner-Zahlungsreferenz: %1"
+"DD.MM.YYYY","TT.MM.JJJJ"
+"Instalment cancel","Raten stornier"
+"TestMode","Testmodus"
+"Card type not accepted, try using another card type","Kartentyp wird nicht akzeptiert, versuchen Sie es mit einem anderen Kartentyp"
+"In order to use this option you must have billing agreement option enabled in your PayPal account. Please contact your account manager at PayPal.","Um diese Option zu verwenden, müssen Sie die Option Billing Agreement (Zahlungsvereinbarung) in Ihrem PayPal-Konto aktiviert haben. Kontaktieren Sie dazu bitte Ihren Kundenbetreuer bei PayPal."
+"Payment details stored during the checkout process can be used for future payments","Zahlungsdaten, die während des Bestellvorgangs gespeichert werden, können für zukünftige Zahlungen verwendet werden"
+"Failed","fehlgeschlagen"
+"Completed","abgeschlossen"
+"Please enter valid URL","Geben Sie ein gültiges URL"
+"To setup your shop Notification / Webhook URL, you must add the following webhook endpoint in this format {Shop_url/rest/V1/novalnet/callback} in below Notification / Webhook URL field and click on Configure button to receive notification about transactions.","Um eine Ihr Laden Benachrichtigungs- / Webhook-URL festlegen müssen im, hinzufügen den folgenden Webhook-Ausgangspunkt im Format {Shop_url/rest/V1/novalnet/callback} in unten Benachrichtigungs- / Webhook-URL Feld und klicken Sie auf Konfigurieren Schaltfläche an erhalten benachrichtigung über Transaktionen."
+"Save for future purchase","Speichern für zukünftige Einkäufe"
+"More security with the new Payment Policy (PSD2) Info","Mehr Sicherheit mit der neuen Zahlungsrichtlinie (PSD2)"
+"European card issuing banks often requires a password or some other form of authentication (EU Payment Services Directive 'PSD2') for secure payment. If the payment is not successful, you can try again. If you have any further questions, please contact your bank.","Europäische kartenausgebende Banken verlangen häufig für die sichere Zahlung ein Passwort oder eine andere Form der Authentifizierung (EU-Zahlungsdiensterichtlinie 'PSD2'). Falls die Zahlung nicht erfolgreich ist, können Sie es im Anschluss erneut versuchen. Bei weiteren Fragen kontaktieren Sie bitte Ihre Bank."
+"Enforce 3D secure payment outside EU","3D-Secure-Zahlungen außerhalb der EU erzwingen"
+"By enabling this option, all payments from cards issued outside the EU will be authenticated via 3DS 2.0 SCA.","Wenn Sie diese Option aktivieren, werden alle Zahlungen mit Karten, die außerhalb der EU ausgegeben wurden, mit der starken Kundenauthentifizierung (Strong Customer Authentication, SCA) von 3D-Secure 2.0 authentifiziert."
+"Your customers can checkout using Apple Pay from any page in your web store","Ihre Kunden können mit Apple Pay von jeder Seite Ihres Webshops aus bezahlen."
+"Your customers can checkout using Google Pay from any page in your web store","Ihre Kunden können mit Google Pay von jeder Seite Ihres Webshops aus bezahlen."
+"Button Design","Button-Design"
+"Button Type","Button-Typ"
+"Buy","Kaufen"
+"Donate","Spenden"
+"Book","Buchen"
+"Contribute","Beitragen"
+"Check out","Bezahlen"
+"Order","Bestellen"
+"Subscribe","Abonnieren"
+"Tip","Trinkgeld"
+"Rent","Mieten"
+"Reload","Aufladen"
+"Support","Unterstützen"
+"Button Theme","Button-Farbe"
+"Button Height","Button-Höhe"
+"Range from 30 to 64 pixels","zwischen 30 und 64 Pixel"
+"Button Corner Radius","Abrundungsgrad der Ecken des Buttons"
+"Range from 0 to 10 pixels","zwischen 0 und 10 Pixel"
+"Display the Apple Pay Button on","Apple Pay-Button anzeigen auf"
+"The selected Pages Will Display The Apple Pay Button, Just Below The Proceed To Checkout Button","Die Apple Pay-Schaltfläche wird auf den ausgewählten Seiten direkt unter der Schaltfläche "Zur Kasse gehen" angezeigt."
+"Shopping cart page","Warenkorb"
+"Mini cart page","Mini-Warenkorb"
+"Product page","Produktseite"
+"Guest checkout page","Checkout-Seite für Gastbestellungen"
+"Express Checkout","Express-Checkout"
+"Amount will be booked from your card after successful authentication","Der Betrag wird nach erfolgreicher Authentifizierung von Ihrer Karte abgebucht."
+"Dark","Dunkel"
+"Light","Hell"
+"Light-Outline","An Hintergrund anpassen"
+"Instalment has been cancelled for the TID %1 on %2","Die Ratenzahlung für die TID wurde gekündigt: %1 am %2"
+"Instalment confirmation %storeName Order no: %orderNo","Für Ihren Einkauf bei %storeName, Bestellnr. %orderNo, ist die nächste Rate fällig."
diff --git a/i18n/en_US.csv b/i18n/en_US.csv
new file mode 100755
index 0000000..86c2cfc
--- /dev/null
+++ b/i18n/en_US.csv
@@ -0,0 +1,354 @@
+"You will be redirected to Blik. Please don’t close or refresh the browser until the payment is completed","You will be redirected to Blik. Please don’t close or refresh the browser until the payment is completed"
+"Your order was successfully processed using Google Pay","Your order was successfully processed using Google Pay"
+"Your order was successfully processed using Apple Pay","Your order was successfully processed using Apple Pay"
+"Business name","Business name"
+"Google Merchant ID","Google Merchant ID"
+"The business name is rendered in the Google Pay payment sheet, and this text will appear as PAY 'BUSINESS NAME' so that the customer knows where he is paying to.","The business name is rendered in the Google Pay payment sheet, and this text will appear as PAY 'BUSINESS NAME' so that the customer knows where he is paying to."
+"Display the Google Pay button on","Display the Google Pay button on"
+"Display the Apple Pay button on","Display the Apple Pay button on"
+"Please note that Google's merchant identifier is required for processing the payment method in the live environment. Google's merchant identifier is issued after registration with the Google Pay and Wallet Console . See Request production access for more information about the approval process and obtaining a Google merchant identifier. The registration also involves submitting the integration with sufficient screen-shots, so collect this information by enabling the payment method in test mode. To suppress the validation of this field while saving the configuration, use this test identifier BCR2DN4XXXTN7FSI for testing and submission of your integration to Google.","Please note that Google's merchant identifier is required for processing the payment method in the live environment. Google's merchant identifier is issued after registration with the Google Pay and Wallet Console . See Request production access for more information about the approval process and obtaining a Google merchant identifier. The registration also involves submitting the integration with sufficient screen-shots, so collect this information by enabling the payment method in test mode. To suppress the validation of this field while saving the configuration, use this test identifier BCR2DN4XXXTN7FSI for testing and submission of your integration to Google."
+"The selected pages will display the Google Pay button to pay instantly as an express checkout option","The selected pages will display the Google Pay button to pay instantly as an express checkout option"
+"The selected pages will display the Apple Pay button to pay instantly as an express checkout option","The selected pages will display the Apple Pay button to pay instantly as an express checkout option"
+"Payment Reminder %1 has been sent to the customer.","Payment Reminder %1 has been sent to the customer."
+"The transaction has been submitted to the collection agency. Collection Reference: %1","The transaction has been submitted to the collection agency. Collection Reference: %1"
+"Authorize with zero amount","Authorize with zero amount"
+"This order processed as a zero amount booking","This order processed as a zero amount booking"
+"Amount has been booked successfully","Amount has been booked successfully"
+"Zero Amount has been updated successfully","Zero Amount has been updated successfully"
+"Zero Amount update has been failed","Zero Amount update has been failed"
+"Are you sure you want to book the order amount?","Are you sure you want to book the order amount?"
+"Book transaction","Book transaction"
+"Your order has been booked with the amount of %1. Your new TID for the booked amount: %2","Your order has been booked with the amount of %1. Your new TID for the booked amount: %2"
+"Zero amount booking","Zero amount booking"
+"This order will be processed as zero amount booking which store your payment data for further online purchases.","This order will be processed as zero amount booking which store your payment data for further online purchases."
+"Transaction booking amount","Transaction booking amount"
+"(in minimum unit of currency. E.g. enter 100 which is equal to 1.00)","(in minimum unit of currency. E.g. enter 100 which is equal to 1.00)"
+"You will be redirected to WeChat Pay. Please don’t close or refresh the browser until the payment is completed.","You will be redirected to WeChat Pay. Please don’t close or refresh the browser until the payment is completed."
+"You will be redirected to Trustly. Please don’t close or refresh the browser until the payment is completed.","You will be redirected to Trustly. Please don’t close or refresh the browser until the payment is completed."
+"You will be redirected to Alipay. Please don’t close or refresh the browser until the payment is completed.","You will be redirected to Alipay. Please don’t close or refresh the browser until the payment is completed."
+"On-hold order status","On-hold order status"
+"Status to be used for on-hold orders until the transaction is confirmed or canceled","Status to be used for on-hold orders until the transaction is confirmed or canceled"
+"The instalment amount for this cycle %cycleAmount %currency will be debited from your account in one - three business days.","The instalment amount for this cycle %cycleAmount %currency will be debited from your account in one - three business days."
+"Documentation","Documentation"
+"Deactivate Instalment Renewal Notification E-mail to end-customer","Deactivate Instalment Renewal Notification E-mail to end-customer"
+"Configuration","Configuration"
+"Instalment has been cancelled.","Instalment has been cancelled."
+"Payments","Payments"
+"Product Activation Key","Product Activation Key"
+"Payment Access Key","Payment Access Key"
+"Merchant details are configured successfully. Please select the Tariff ID and click","Merchant details are configured successfully. Please select the Tariff ID and click "
+"button to save the configuration."," button to save the configuration"
+"Activate","Activate"
+"Enter the Novalnet Product activation key that is required for authentication and click Activate. You will find the Product activation key in the Novalnet Admin Portal : Projects > Choose your project > API credentials > API Signature (Product activation key)","Enter the Novalnet Product activation key that is required for authentication and click Activate. You will find the Product activation key in the Novalnet Admin Portal : Projects > Choose your project > API credentials > API Signature (Product activation key)"
+"Merchant ID","Merchant ID"
+"Project ID","Project ID"
+"Authentication code","Authentication code"
+"Select Tariff ID","Select Tariff ID"
+"Select a Tariff ID to match the preferred tariff plan you created at the Novalnet Admin Portal for this project","Select a Tariff ID to match the preferred tariff plan you created at the Novalnet Admin Portal for this project"
+"Enable Live Mode","Enable Live Mode"
+"Selected payment methods will be in Live Mode","Selected payment methods will be in Live Mode"
+"No active payment method for this store","No active payment method for this store"
+"Display payment method logo","Display payment method logo"
+"The payment method logo will be displayed on the checkout page","The payment method logo will be displayed on the checkout page"
+"Products remain in the shopping cart after cancelled payment","Products remain in the shopping cart after cancelled payment"
+"For additional configurations login to Novalnet Merchant Administration portal . To login to the Portal you need to have an account at Novalnet. If you don't have one yet, please contact sales@novalnet.de / tel. +49 (089) 923068320"
+"To accept PayPal transactions, configure your PayPal API info in the Novalnet Admin Portal > PROJECT > "Project" Information > Payment Methods > Paypal > Configure.","To accept PayPal transactions, configure your PayPal API info in the Novalnet Admin Portal > PROJECT > "Project" Information > Payment Methods > Paypal > Configure."
+"Order status management for on-hold transactions","Order status management for on-hold transactions"
+"Order status for the pending payment","Order status for the pending payment"
+"Onhold order status","Onhold order status"
+"Cancellation order status","Cancellation order status"
+"Notification / Webhook URL Setup","Notification / Webhook URL Setup"
+"Allow manual testing of the Notification / Webhook URL","Allow manual testing of the Notification / Webhook URL"
+"E-Mail address of the recipient","Notification / Webhook URL execution messages will be sent to this e-mail."
+"Notification & Webhook URL","Notification / Webhook URL"
+"Notification / Webhook URL is required to keep the merchant’s database/system synchronized with the Novalnet account (e.g. delivery status). Refer the Installation Guide for more information","Notification / Webhook URL is required to keep the merchant’s database/system synchronized with the Novalnet account (e.g. delivery status). Refer the Installation Guide for more information"
+"Payment Methods","Payment Methods"
+"Credit/Debit Cards","Credit/Debit Cards"
+"Direct Debit SEPA","Direct Debit SEPA"
+"Invoice","Invoice"
+"Prepayment","Prepayment"
+"Invoice with payment guarantee","Invoice with payment guarantee"
+"Direct Debit SEPA with payment guarantee","Direct Debit SEPA with payment guarantee"
+"Instalment by Direct Debit SEPA","Instalment by Direct Debit SEPA"
+"Instalment by Invoice","Instalment by Invoice"
+"Sofort","Sofort"
+"Online bank transfer","Online bank transfer"
+"PayPal","PayPal"
+"iDEAL","iDEAL"
+"Eps","eps"
+"Giropay","giropay"
+"Przelewy24","Przelewy24"
+"PostFinance Card","PostFinance Card"
+"PostFinance E-Finance","PostFinance E-Finance"
+"Multibanco","Multibanco"
+"Bancontact","Bancontact"
+"Display payment method","Display payment method"
+"Novalnet Title","Title"
+"Define a sorting order","Define a sorting order"
+"This payment method will be sorted among others (in the ascending order) as per the given sort number","The payment methods will be listed in your checkout (in ascending order) based on your given sorting order."
+"Payment logo","Payment logo"
+"Payment Action","Payment Action"
+"Authorize","Authorize"
+"Capture","Capture"
+"Choose whether or not the payment should be charged immediately. Capture completes the transaction by transferring the funds from buyer account to merchant account. Authorize verifies payment details and reserves funds to capture it later, giving time for the merchant to decide on the order.","Choose whether or not the payment should be charged immediately. Capture completes the transaction by transferring the funds from buyer account to merchant account. Authorize verifies payment details and reserves funds to capture it later, giving time for the merchant to decide on the order."
+"Novalnet Capture","Novalnet Capture"
+"Completed order status","Completed order status"
+"Status to be used for successful orders","Status to be used for successful orders"
+"Payment due date (in days)","Payment due date (in days)"
+"Enter the number of days after which the payment should be processed (must be between 2 and 14 days)","Number of days after which the payment is debited (must be between 2 and 14 days)."
+"Enter the number of days after which the payment should be processed (must be between 7 and 28 days)","Number of days given to the buyer to transfer the amount to Novalnet (must be between 7 and 28 days). If this field is left blank, 14 days will be set as due date by default."
+"Minimum transaction amount for authorization","Minimum transaction amount for authorization (in minimum unit of currency. E.g. enter 100 which is equal to 1.00)"
+"Form appearance","Form appearance"
+"Custom CSS Settings","Custom CSS Settings"
+"CSS settings for iframe form","CSS settings for iframe form"
+"NN CC Label Style","Label"
+"NN CC Input Style","Input"
+"NN CC CSS text","CSS text"
+"Notification for the buyer","Notification for the buyer"
+"The entered text will be displayed on the checkout page","The entered text will be displayed at the checkout page"
+"User Group Excluded","User Group Excluded"
+"Payment from Applicable Countries","Payment From Applicable Countries"
+"Payment from Specific Countries","Payment From Specific Countries"
+"Minimum order amount (in minimum unit of currency. E.g. enter 100 which is equal to 1.00)","Minimum order amount (in minimum unit of currency. E.g. enter 100 which is equal to 1.00)"
+"Minimum order amount: 19.98 EUR or more","Minimum order amount: 19.98 EUR or more"
+"The minimum amount should be at least 9.99 EUR","The minimum amount should be at least 9.99 EUR"
+"The minimum amount should be at least 19.98 EUR","The minimum amount should be at least 19.98 EUR"
+"Minimum Order Total","Minimum Order Total (in EUR)"
+"Maximum Order Total","Maximum Order Total (in EUR)"
+"Minimum Orders Count","Minimum number of orders count"
+"Default: '0' for disabled check | Minimum count of orders (in the past) needed for the customer to use this payment method","Enable this payment method for the particular customer only when they exceed this number of previous orders in your checkout."
+"Your credit/debit card will be charged immediately after the order is completed","Your credit/debit card will be charged immediately after the order is completed"
+"Once you've submitted the order, you will receive an e-mail with account details to make payment","Once you send the order, you will receive an e-mail with the account details to complete the payment."
+"The payment will be processed in the test mode therefore amount for this transaction will not be charged","The payment will be processed in the test mode therefore amount for this transaction will not be charged"
+"Your credit card details are invalid","Your credit card details are invalid"
+"Card holder name","Card holder name"
+"Name on card","Name on card"
+"Card number","Card number"
+"XXXX XXXX XXXX XXXX","XXXX XXXX XXXX XXXX"
+"Expiry date","Expiry date"
+"MM / YY","MM / YY"
+"CVC/CVV/CID","CVC/CVV/CID"
+"XXX","XXX"
+"what is this?","what is this?"
+"The amount will be debited from your account by Novalnet","The amount will be debited from your account by Novalnet"
+"Account holder","Account holder"
+"IBAN","IBAN"
+"I hereby grant the mandate for the SEPA direct debit","I hereby grant the mandate for the SEPA direct debit"
+"(electronic transmission)","(electronic transmission)"
+"and confirm that the given bank details are correct!","and confirm that the given bank details are correct"
+"I authorise (A) Novalnet AG to send instructions to my bank to debit my account and (B) my bank to debit my account in accordance with the instructions from Novalnet AG.","I authorise (A) Novalnet AG to send instructions to my bank to debit my account and (B) my bank to debit my account in accordance with the instructions from Novalnet AG."
+"Creditor identifier: DE53ZZZ00000004253","Creditor identifier: DE53ZZZ00000004253"
+"Note:","Note:"
+"You are entitled to a refund from your bank under the terms and conditions of your agreement with bank. A refund must be claimed within 8 weeks starting from the date on which your account was debited.","You are entitled to a refund from your bank under the terms and conditions of your agreement with bank. A refund must be claimed within 8 weeks starting from the date on which your account was debited."
+"After the successful verification, you will be redirected to Novalnet secure order page to proceed with the payment","You will be redirected to the Novalnet secure payment page to complete the payment."
+"Are you sure you want to remove these account details?","Are you sure you want to remove these account details?"
+"Are you sure you want to remove these Credit Card details?","Are you sure you want to remove these Credit Card details?"
+"Add new card details","Add new card details"
+"Add new account details","Add new account details"
+"Save my card details for future purchases","I want to save my card details for later purchases"
+"Save my account details for future purchases","I want to save my account details for later purchases"
+"Save my PayPal details for future purchases","Save my PayPal account details for later purchases"
+"Test order","Test order"
+"Novalnet Transaction ID: ","Novalnet Transaction ID: "
+"Payment Failed","Payment Failed"
+"The transaction has been confirmed on %1","The transaction has been confirmed on %1"
+"The transaction has been canceled on %1","The transaction has been canceled on %1"
+"Refund has been initiated for the TID:%1 with the amount %2","Refund has been initiated for the TID:%1 with the amount %2"
+"Refund has been initiated for the TID: %1 with the amount %2. New TID:%3","Refund has been initiated for the TID: %1 with the amount %2. New TID:%3"
+"Customer was redirected to Novalnet","Customer was redirected to Novalnet"
+"Customer successfully returned from Novalnet","Customer successfully returned from Novalnet"
+"The transaction has been confirmed","The transaction has been confirmed"
+"The transaction has been canceled","The transaction has been canceled"
+"While redirecting some data has been changed. The hash check failed.","While redirecting some data has been changed. The hash check failed."
+"The transaction has been confirmed on %1","The transaction has been confirmed on %1"
+"The transaction has been canceled on %1","The transaction has been canceled on %1"
+"Refund/Bookback executed successfully for the TID: %1 amount: %2 on %3. The subsequent TID: %4","Refund/Bookback executed successfully for the TID: %1 amount: %2 on %3. The subsequent TID: %4"
+"The transaction status has been changed from pending to on hold for the TID: %1 on %2.","The transaction status has been changed from pending to on-hold for the TID: %1 on %2."
+"Credit has been successfully received for the TID: %1 with amount %2 on %3. Please refer PAID order details in our Novalnet Admin Portal for the TID: %4","Credit has been successfully received for the TID: %1 with amount %2 on %3. Please refer PAID order details in our Novalnet Admin Portal for the TID: %4"
+"NChargeback executed successfully for the TID: %1 amount: %2 on %3. The subsequent TID: %4","Chargeback executed successfully for the TID: %1 amount: %2 on %3. The subsequent TID: %4"
+"Transaction updated successfully for the TID: %1 with the amount %2 on %3","Transaction updated successfully for the TID: %1 with the amount %2 on %3"
+"The Transaction ID already existed","Novalnet Callback executed. The Transaction ID already existed"
+"Enter the number of days to transfer the payment amount to Novalnet (must be greater than 7 days). In case if the field is empty, 14 days will be set as due date by default","Number of days given to the buyer to transfer the amount to Novalnet (must be greater than 7 days). If this field is left blank, 14 days will be set as due date by default."
+"Slip expiry date (in days)","Slip expiry date (in days)"
+"Enter the number of days to pay the amount at store near you. If the field is empty, 14 days will be set as default.","Number of days given to the buyer to pay at a store. If this field is left blank, 14 days will be set as slip expiry date by default."
+"Recurring Period for the instalment cycles","Choose the recurring period for the instalment payment."
+"On choosing an appropriate recurring period, each instalment cycle will be processed based on that","On choosing an appropriate recurring period, each instalment cycle will be processed based on that"
+"Select the various instalment cycles that can be availed in the instalment plan","Select the available instalment cycles."
+"Choose your instalment plan","Choose your instalment plan"
+"Basic requirements for payment guarantee Allowed B2C countries: DE, AT, CH Allowed B2B countries: European Union Allowed currency: EUR Minimum order amount: 9.99 EUR or more Age limit: 18 years or more The billing address must be the same as the shipping address ","Basic requirements for payment guarantee Allowed B2C countries: DE, AT, CH Allowed B2B countries: European Union Allowed currency: EUR Minimum order amount: 9.99 EUR or more Age limit: 18 years or more The billing address must be the same as the shipping address "
+"Basic requirements for the instalment payment Allowed B2C countries: DE, AT, CH Allowed B2B countries: European Union Allowed currency: EUR Minimum order amount: 19.98 EUR or more Please note that the instalment cycle amount has to be a minimum of 9.99 EUR and the instalment cycles which do not meet this criteria will not be displayed in the instalment plan Age limit: 18 years or more The billing address must be the same as the shipping address ","Basic requirements for the instalment payment Allowed B2C countries: DE, AT, CH Allowed B2B countries: European Union Allowed currency: EUR Minimum order amount: 19.98 EUR or more Please note that the instalment cycle amount has to be a minimum of 9.99 EUR and the instalment cycles which do not meet this criteria will not be displayed in the instalment plan Age limit: 18 years or more The billing address must be the same as the shipping address "
+"Choose the financing option that best fits your needs and you will be charged based on that chosen plan","Choose the financing option that best fits your needs and you will be charged based on that chosen plan"
+"Net loan amount: ","Net loan amount: "
+"The payment cannot be processed, because the basic requirements for the %1 haven't been met (The shipping address must be the same as the billing address)","The payment cannot be processed, because the basic requirements for the %1 haven't been met (The shipping address must be the same as the billing address)"
+"The date should be in future","The date should be in future"
+"The transaction has been updated with due date %1","The transaction has been updated with a new due date %1"
+"The transaction has been updated with amount %1 and due date with %2","The transaction has been updated with amount %1 and due date with %2"
+"The transaction has been updated with amount %1","The transaction has been updated with amount %1"
+"The transaction has been updated with amount %1 and slip expiry date with %2","The transaction has been updated with amount %1 and slip expiry date with %2"
+"The transaction has been updated with slip expiry date %1","The transaction has been updated with a new slip expiry date %1"
+"Customer was redirected to Novalnet","Customer was redirected to Novalnet"
+"Customer successfully returned from Novalnet","Customer successfully returned from Novalnet"
+"While redirecting some data has been changed. The hash check failed.","While redirecting some data has been changed. The hash check failed."
+"Payment Failed","Payment Failed"
+"On successful checkout, you will receive a payment slip/SMS to pay your online purchase at one of our retail partners (e.g. supermarket)","On successful checkout, you will receive a payment slip/SMS to pay your online purchase at one of our retail partners (e.g. supermarket)"
+"The transaction has been confirmed successfully for the TID: %1","The transaction has been confirmed successfully for the TID: %1"
+"Please transfer the amount to the below mentioned account details of our payment processor Novalnet","Please transfer the amount to the below mentioned account details of our payment processor Novalnet"
+"Your order is being verified. Once confirmed, we will send you our bank details to which the order amount should be transferred. Please note that this may take up to 24 hours","Your order is being verified. Once confirmed, we will send you our bank details to which the order amount should be transferred. Please note that this may take up to 24 hours"
+"Your order is under verification and we will soon update you with the order status. Please note that this may take upto 24 hours.","Your order is under verification and we will soon update you with the order status. Please note that this may take upto 24 hours."
+"Slip expiry date: %1", "Slip expiry date: %1"
+"Store(s) near you:","Store(s) near to you:"
+"Please enter the refund amount","Please enter the refund amount"
+"(in minimum unit of currency. E.g. enter 100 which is equal to 1.00)","(in minimum unit of currency. E.g. enter 100 which is equal to 1.00)"
+"Change the slip expiry date","Change the slip expiry date"
+"Change the due date","Change the due date"
+"Slip expiry date","Slip expiry date"
+"Transaction due date","Transaction due date"
+"Amount","Amount"
+"Update","Update"
+"Refund","Refund"
+"Paid","Paid"
+"Pending","Pending"
+"Cancel","Cancel"
+"Reference","Reference"
+"Are you sure you want to change the slip expiry date?","Are you sure you want to change the slip expiry date?"
+"Are you sure you want to change the order due date?","Are you sure you want to change the order due date?"
+"Pay now with Barzahlen","Pay now with Barzahlen"
+" Cycles / "," Cycles / "
+"Every month","per month"
+"Every 2 months","per 2 months"
+"Every 3 months","per 3 months"
+"Every 4 months","per 4 months"
+"Every 6 months","per 6 months"
+"Your date of birth","Your date of birth"
+"Date of Birth","Date of Birth"
+"Instalment","Instalment"
+"Instalment Information","Instalment Information"
+"Processed Instalments","Processed Instalments"
+"Due Instalments","Due Instalments"
+"Next Instalment Date","Next Instalment Date"
+"Instalment Cycle Amount","Instalment Cycle Amount"
+"Total paid amount","Total paid amount"
+"Total due amount","Total due amount"
+"Paid Instalments","Paid Instalments"
+"Instalment Summary","Instalment Summary"
+"Paid Date","Paid date"
+"Instalment cycles","Instalment cycles"
+"Instalment Amount","Instalment Amount"
+"%s Instalment","%s Instalment"
+" per month"," per month"
+" Every %1 months"," per %1 months"
+"The next instalment cycle have arrived for the instalment order %orderNo placed at the %store_name, kindly refer further details below.","The next instalment cycle have arrived for the instalment order %orderNo placed at the %store_name, kindly refer further details below."
+"Day","Day"
+"Year","Year"
+"Month","Month"
+"January","January"
+"Feburary","Feburary"
+"March","March"
+"April","April"
+"May","May"
+"June","June"
+"July","July"
+"August","August"
+"September","September"
+"October","October"
+"November","November"
+"December","December"
+"Display inline credit card form","Display inline credit card form"
+"Inline form: The following fields will be shown in the checkout in two lines: card holder & credit card number / expiry date / CVC","Inline form: The following fields will be shown in the checkout in two lines: card holder & credit card number / expiry date / CVC"
+"InvoiceAmount","Amount"
+"On successful checkout, you will receive a payment reference. Using this payment reference, you can either pay in the Multibanco ATM or through your online bank account","On successful checkout, you will receive a payment reference. Using this payment reference, you can either pay in the Multibanco ATM or through your online bank account"
+"Payment References description","Please use any of the following payment references when transferring the amount. This is necessary to match it with your corresponding order"
+"Configure","Configure"
+"You will receive an e-mail with the Novalnet account details to complete the payment","You will receive an e-mail with the Novalnet account details to complete the payment"
+"Send e-mail to","Send e-mail to"
+"Notification / Webhook URL execution messages will be sent to this e-mail","Notification / Webhook URL execution messages will be sent to this e-mail"
+"Unauthorised access from the IP [ %1 ]","Unauthorised access from the IP [ %1 ]"
+"One-click shopping","One-click shopping"
+"Webhook order status","Callback / Webhook order status"
+"The Selected logos will be displayed on the checkout page","The Selected logos will be displayed on the checkout page"
+"Force non-guarantee payment","Force non-guarantee payment"
+"Even if payment guarantee is enabled, payments will still be processed as non-guarantee payments if the payment guarantee requirements are not met. Review the requirements under 'Enable Payment Guarantee' in the Installation Guide.","Even if payment guarantee is enabled, payments will still be processed as non-guarantee payments if the payment guarantee requirements are not met. Review the requirements under 'Enable Payment Guarantee' in the Installation Guide."
+"Minimum order amount: 9.99 EUR or more","Minimum order amount: 9.99 EUR or more"
+"You will be redirected to Sofort. Please don’t close or refresh the browser until the payment is completed","You will be redirected to Sofort. Please don’t close or refresh the browser until the payment is completed"
+"You will be redirected to banking page. Please don’t close or refresh the browser until the payment is completed","You will be redirected to banking page. Please don’t close or refresh the browser until the payment is completed"
+"You will be redirected to giropay. Please don’t close or refresh the browser until the payment is completed","You will be redirected to giropay. Please don’t close or refresh the browser until the payment is completed"
+"You will be redirected to Przelewy24. Please don’t close or refresh the browser until the payment is completed","You will be redirected to Przelewy24. Please don’t close or refresh the browser until the payment is completed"
+"You will be redirected to eps. Please don’t close or refresh the browser until the payment is completed","You will be redirected to eps. Please don’t close or refresh the browser until the payment is completed"
+"You will be redirected to PayPal. Please don’t close or refresh the browser until the payment is completed","You will be redirected to PayPal. Please don’t close or refresh the browser until the payment is completed"
+"You will be redirected to PostFinance. Please don’t close or refresh the browser until the payment is completed","You will be redirected to PostFinance. Please don’t close or refresh the browser until the payment is completed"
+"You will be redirected to Bancontact. Please don’t close or refresh the browser until the payment is completed","You will be redirected to Bancontact. Please don’t close or refresh the browser until the payment is completed"
+"You will be redirected to iDEAL. Please don’t close or refresh the browser until the payment is completed","You will be redirected to iDEAL. Please don’t close or refresh the browser until the payment is completed"
+"Are you sure you want to capture the payment?","Are you sure you want to capture the payment?"
+"Are you sure you want to cancel the payment?","Are you sure you want to cancel the payment?"
+"Payment reference 1","Payment Reference 1"
+"Payment reference 2","Payment Reference 2"
+"Payment Reference","Payment Reference"
+"Please read the Installation Guide before you start and login to the Novalnet Admin Portal using your merchant account. To get a merchant account, mail to sales@novalnet.de or call +49 (089) 923068320","Please read the Installation Guide before you start and login to the Novalnet Admin Portal using your merchant account. To get a merchant account, mail to sales@novalnet.de or call +49 (089) 923068320"
+"Allow manual testing of the Notification / Webhook URL","Allow manual testing of the Notification / Webhook URL"
+"ending in %1 (expires %2/%3)","ending in %1 (expires %2/%3)"
+"IBAN","IBAN"
+"Please enter a valid Product Activation Key and Payment Access key.","Please enter a valid Product Activation Key and Payment Access key."
+"Make sure the Direct Debit SEPA payment is enabled to use this option.","Make sure the Direct Debit SEPA payment is enabled to use this option."
+"Make sure the Invoice payment is enabled to use this option.","Make sure the Invoice payment is enabled to use this option."
+"Configure the valid Product Activation Key and Payment Access key to activate the payment types under Configuration settings.","Configure the valid Product Activation Key and Payment Access key to activate the payment types under Configuration settings."
+"Module version","Module version"
+"Display Credit/Debit card logos","Display Credit/Debit card logos"
+"The selected card logos will be displayed on the checkout page","The selected card logos will be displayed on the checkout page"
+"Allow B2B Customers","Allow B2B Customers"
+"Allow B2B customers to place order","Allow B2B customers to place order"
+"
Secured and trusted means of accepting all payment methods supported worldwide. Novalnet provides the most convenient way to increase your sales and deliver seamless checkout experience for your customers.
","
Secured and trusted means of accepting all payment methods supported worldwide. Novalnet provides the most convenient way to increase your sales and deliver seamless checkout experience for your customers.
"
+"Novalnet webhook added order status %1","Novalnet webhook added order status %1"
+"Novalnet webhook set status (%1) for Order ID = %2","Novalnet webhook set status (%1) for Order ID = %2"
+"Please transfer the amount of %1 to the following account on or before %2","Please transfer the amount of %1 to the following account on or before %2"
+"Please transfer the amount of %1 to the following account","Please transfer the amount of %1 to the following account"
+"Only EUR currency allowed %1","The payment cannot be processed, because the basic requirements for the %1 are not met (Only EUR currency allowed)"
+"Minimum order amount should be %1","The payment cannot be processed, because the basic requirements for the %1 are not met (Minimum order amount must be 9.99 EUR)"
+"Only DE, AT, CH countries allowed %1","The payment cannot be processed, because the basic requirements for the %1 are not met (Only Germany, Austria or Switzerland are allowed)"
+"Please use the following payment reference details to pay the amount of %1 at a Multibanco ATM or through your internet banking.","Please use the following payment reference details to pay the amount of %1 at a Multibanco ATM or through your internet banking."
+"Partner Payment Reference: %1","Partner Payment Reference: %1"
+"DD.MM.YYYY","DD.MM.YYYY"
+"Instalment cancel","Instalment cancel"
+"TestMode","TestMode"
+"Card type not accepted, try using another card type","Card type not accepted, try using another card type"
+"In order to use this option you must have billing agreement option enabled in your PayPal account. Please contact your account manager at PayPal.","In order to use this option you must have billing agreement option enabled in your PayPal account. Please contact your account manager at PayPal."
+"Payment details stored during the checkout process can be used for future payments","Payment details stored during the checkout process can be used for future payments"
+"Failed","Failed"
+"Completed","Completed"
+"Please enter valid URL","Please enter valid URL"
+"To setup your shop Notification / Webhook URL, you must add the following webhook endpoint in this format {Shop_url/rest/V1/novalnet/callback} in below Notification / Webhook URL field and click on Configure button to receive notification about transactions.","To setup your shop Notification / Webhook URL, you must add the following webhook endpoint in this format {Shop_url/rest/V1/novalnet/callback} in below Notification / Webhook URL field and click on Configure button to receive notification about transactions."
+"Save for future purchase","Save for future purchase"
+"More security with the new Payment Policy (PSD2) Info","More security with the new Payment Policy (PSD2) Info"
+"European card issuing banks often requires a password or some other form of authentication (EU Payment Services Directive 'PSD2') for secure payment. If the payment is not successful, you can try again. If you have any further questions, please contact your bank.","European card issuing banks often requires a password or some other form of authentication (EU Payment Services Directive 'PSD2') for secure payment. If the payment is not successful, you can try again. If you have any further questions, please contact your bank."
+"Enforce 3D secure payment outside EU","Enforce 3D secure payment outside EU"
+"By enabling this option, all payments from cards issued outside the EU will be authenticated via 3DS 2.0 SCA.","By enabling this option, all payments from cards issued outside the EU will be authenticated via 3DS 2.0 SCA."
+"Your customers can checkout using Apple Pay from any page in your web store","Your customers can checkout using Apple Pay from any page in your web store"
+"Your customers can checkout using Google Pay from any page in your web store","Your customers can checkout using Google Pay from any page in your web store"
+"Button Design","Button Design"
+"Button Type","Button Type"
+"Buy","Buy"
+"Donate","Donate"
+"Book","Book"
+"Contribute","Contribute"
+"Check out","Check out"
+"Order","Order"
+"Subscribe","Subscribe"
+"Tip","Tip"
+"Rent","Rent"
+"Reload","Reload"
+"Support","Support"
+"Button Theme","Button Theme"
+"Button Height","Button Height"
+"Range from 30 to 64 pixels","Range from 30 to 64 pixels"
+"Button Corner Radius","Button Corner Radius"
+"Range from 0 to 10 pixels","Range from 0 to 10 pixels"
+"Shopping cart page","Shopping cart page"
+"Mini cart page","Mini cart page"
+"Product page","Product page"
+"Guest checkout page","Guest checkout page"
+"Express Checkout","Express Checkout"
+"Amount will be booked from your card after successful authentication","Amount will be booked from your card after successful authentication"
+"Dark","Dark"
+"Light","Light"
+"Light-Outline","Light-Outline"
+"Instalment has been cancelled for the TID %1 on %2","Instalment has been cancelled for the TID %1 on %2"
+"Instalment confirmation %storeName Order no: %orderNo","Instalment confirmation %storeName Order no: %orderNo"
diff --git a/registration.php b/registration.php
new file mode 100755
index 0000000..b6ed345
--- /dev/null
+++ b/registration.php
@@ -0,0 +1,24 @@
+
+
+
+
+
+
+
+
+
+
diff --git a/view/adminhtml/layout/sales_order_create_index.xml b/view/adminhtml/layout/sales_order_create_index.xml
new file mode 100755
index 0000000..146c712
--- /dev/null
+++ b/view/adminhtml/layout/sales_order_create_index.xml
@@ -0,0 +1,26 @@
+
+
+
+
+
+
+
diff --git a/view/adminhtml/layout/sales_order_view.xml b/view/adminhtml/layout/sales_order_view.xml
new file mode 100755
index 0000000..4a0c977
--- /dev/null
+++ b/view/adminhtml/layout/sales_order_view.xml
@@ -0,0 +1,37 @@
+
+
+
+
+
+
+
+ order_novalnet_instalment
+ Novalnet\Payment\Block\Adminhtml\Sales\Order\View\Tab\Instalment
+
+
+ order_novalnet_zeroamountbooking
+ Novalnet\Payment\Block\Adminhtml\Sales\Order\View\Tab\ZeroAmountBooking
+
+
+
+
+
diff --git a/view/adminhtml/requirejs-config.js b/view/adminhtml/requirejs-config.js
new file mode 100755
index 0000000..c67bff9
--- /dev/null
+++ b/view/adminhtml/requirejs-config.js
@@ -0,0 +1,28 @@
+/**
+ * Novalnet payment extension
+ *
+ * NOTICE OF LICENSE
+ *
+ * This source file is subject to the Novalnet End User License Agreement
+ * that is bundled with this package in the file LICENSE.txt
+ *
+ * DISCLAIMER
+ *
+ * If you wish to customize Novalnet payment extension for your needs,
+ * please contact technic@novalnet.de for more information.
+ *
+ * @category Novalnet
+ * @package Novalnet_Payment
+ * @copyright Copyright (c) Novalnet AG
+ * @license https://www.novalnet.de/payment-plugins/kostenlos/lizenz
+ */
+var config = {
+ map: {
+ '*': {
+ novalnetSepaFormJs: 'Novalnet_Payment/js/novalnetSepa',
+ novalnetInvoiceFormJs: 'Novalnet_Payment/js/novalnetInvoice',
+ novalnetCcFormJs: 'Novalnet_Payment/js/novalnetCc',
+ novalnetUtilityJs: 'https://cdn.novalnet.de/js/v2/NovalnetUtility.js'
+ }
+ }
+};
diff --git a/view/adminhtml/templates/config/webhooks_configuration.phtml b/view/adminhtml/templates/config/webhooks_configuration.phtml
new file mode 100755
index 0000000..372b5c6
--- /dev/null
+++ b/view/adminhtml/templates/config/webhooks_configuration.phtml
@@ -0,0 +1,90 @@
+
+
+
+
+= /* @noEscape */ $block->getButtonHtml() ?>
+
+
+
+
+
+
+
diff --git a/view/adminhtml/templates/form/Cashpayment.phtml b/view/adminhtml/templates/form/Cashpayment.phtml
new file mode 100755
index 0000000..52fa25a
--- /dev/null
+++ b/view/adminhtml/templates/form/Cashpayment.phtml
@@ -0,0 +1,50 @@
+escapeHtml($block->getMethodCode());
+?>
+
+
+
+ getPaymentLogo($paymentMethodcode)): ?>
+
+
+
+ getTestMode($paymentMethodcode)): ?>
+
+
= $block->escapeHtml(__('TestMode')); ?>
+
+
+
+
+
+
+ = $block->escapeHtml(__('On successful checkout, you will receive a payment slip/SMS to pay your online purchase at one of our retail partners (e.g. supermarket)')); ?>
+
+
+
diff --git a/view/adminhtml/templates/form/Cc.phtml b/view/adminhtml/templates/form/Cc.phtml
new file mode 100755
index 0000000..488aba8
--- /dev/null
+++ b/view/adminhtml/templates/form/Cc.phtml
@@ -0,0 +1,135 @@
+escapeHtml($block->getMethodCode());
+$formData = [
+ 'code' => $paymentMethodcode,
+ 'inlineForm' => $block->isInlineForm(),
+ 'iframeParams' => $block->getCcIframeParams(),
+ 'config' => $block->getConfig($paymentMethodcode),
+ 'billing' =>$block->novalnetHelper()->getBillingAddress(),
+ 'shipping' =>$block->novalnetHelper()->getShippingAddress(),
+ 'amount' => $block->novalnetHelper()->getAmount()
+];
+$serializedFormData = $block->jsonHelper()->jsonEncode($formData);
+?>
+
+
+
+ getCreditCardLogos($paymentMethodcode))): ?>
+ getCreditCardLogos($paymentMethodcode) as $key => $value): ?>
+
+
+
+
+
+ = $block->escapeHtml(__('More security with the new Payment Policy (PSD2) Info')); ?>
+
+
+
+
+
+ getTestMode($paymentMethodcode)): ?>
+
+
= $block->escapeHtml(__('TestMode')); ?>
+
+
+
+
+
+ = $block->escapeHtml(__('Your credit/debit card will be charged immediately after the order is completed')); ?>
+
+ isZeroAmountBooking()): ?>
+
+ = $block->escapeHtml(__('This order will be processed as zero amount booking which store your payment data for further online purchases.')); ?>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/view/adminhtml/templates/form/Invoice.phtml b/view/adminhtml/templates/form/Invoice.phtml
new file mode 100755
index 0000000..af4592f
--- /dev/null
+++ b/view/adminhtml/templates/form/Invoice.phtml
@@ -0,0 +1,53 @@
+escapeHtml($block->getMethodCode());
+$formData = [
+ 'code' => $paymentMethodcode
+];
+?>
+
+
+
+ getPaymentLogo($paymentMethodcode)): ?>
+
+
+
+ getTestMode($paymentMethodcode)): ?>
+
+
= $block->escapeHtml(__('TestMode')); ?>
+
+
+
+
+
+ = $block->escapeHtml(__('You will receive an e-mail with the Novalnet account details to complete the payment')); ?>
+
+
+
+
diff --git a/view/adminhtml/templates/form/InvoiceGuarantee.phtml b/view/adminhtml/templates/form/InvoiceGuarantee.phtml
new file mode 100755
index 0000000..864db37
--- /dev/null
+++ b/view/adminhtml/templates/form/InvoiceGuarantee.phtml
@@ -0,0 +1,77 @@
+escapeHtml($block->getMethodCode());
+$formData = [
+ 'code' => $paymentMethodcode
+];
+$serializedFormData = $block->jsonHelper()->jsonEncode($formData);
+?>
+
+
+
+ getPaymentLogo($paymentMethodcode)): ?>
+
+
+
+ getTestMode($paymentMethodcode)): ?>
+
+
= $block->escapeHtml(__('TestMode')); ?>
+
+
+
+ novalnetHelper()->validateCompany($paymentMethodcode)): ?>
+
+
+ = $block->escapeHtml(__('Your date of birth')); ?>*
+
+
+
+
+
+
+
+
+
+
+ = $block->escapeHtml(__('You will receive an e-mail with the Novalnet account details to complete the payment')); ?>
+
+
+
+
+
diff --git a/view/adminhtml/templates/form/InvoiceInstalment.phtml b/view/adminhtml/templates/form/InvoiceInstalment.phtml
new file mode 100755
index 0000000..e791960
--- /dev/null
+++ b/view/adminhtml/templates/form/InvoiceInstalment.phtml
@@ -0,0 +1,106 @@
+escapeHtml($block->getMethodCode());
+$formData = [
+ 'code' => $paymentMethodcode
+];
+$serializedFormData = $block->jsonHelper()->jsonEncode($formData);
+$orderTotal = $block->novalnetHelper()->getAdminCheckoutSession()->getQuote()->getGrandTotal();
+$instalmentPeriods = [];
+$allcycles = (!empty($block->getInstalmentCycles())) ? explode(',', $block->getInstalmentCycles()) : [];
+foreach ($allcycles as $allcycle) {
+ if (($orderTotal / $allcycle) >= 9.99) {
+ $instalmentPeriods[$allcycle] = $allcycle .' X '. $block->updateCurrency(sprintf('%0.2f', $orderTotal/$allcycle), true, false) . '('. __(' per month').')';
+ }
+}
+?>
+
+
+
+ getPaymentLogo($paymentMethodcode)): ?>
+
+
+
+ getTestMode($paymentMethodcode)): ?>
+
+
= $block->escapeHtml(__('TestMode')); ?>
+
+
+
+ novalnetHelper()->validateCompany($paymentMethodcode)): ?>
+
+
+ = $block->escapeHtml(__('Your date of birth')); ?>*
+
+
+
+
+
+
+
+
+ = $block->escapeHtml(__('Choose your instalment plan')); ?>
+
+
+ $instalmentValue): ?>
+
+ = /* @noEscape */ $instalmentValue; ?>
+
+
+
+
+
+
+
+
+
+
+
+ = $block->escapeHtml(__('You will receive an e-mail with the Novalnet account details to complete the payment')); ?>
+
+
+
+
+
+
+
+
diff --git a/view/adminhtml/templates/form/Multibanco.phtml b/view/adminhtml/templates/form/Multibanco.phtml
new file mode 100755
index 0000000..578b4de
--- /dev/null
+++ b/view/adminhtml/templates/form/Multibanco.phtml
@@ -0,0 +1,50 @@
+escapeHtml($block->getMethodCode());
+?>
+
+
+
+ getPaymentLogo($paymentMethodcode)): ?>
+
+
+
+ getTestMode($paymentMethodcode)): ?>
+
+
= $block->escapeHtml(__('TestMode')); ?>
+
+
+
+
+
+
+ = $block->escapeHtml(__('On successful checkout, you will receive a payment reference. Using this payment reference, you can either pay in the Multibanco ATM or through your online bank account')); ?>
+
+
+
diff --git a/view/adminhtml/templates/form/Prepayment.phtml b/view/adminhtml/templates/form/Prepayment.phtml
new file mode 100755
index 0000000..020c8b3
--- /dev/null
+++ b/view/adminhtml/templates/form/Prepayment.phtml
@@ -0,0 +1,53 @@
+escapeHtml($block->getMethodCode());
+$formData = [
+ 'code' => $paymentMethodcode
+];
+?>
+
+
+
+ getPaymentLogo($paymentMethodcode)): ?>
+
+
+
+ getTestMode($paymentMethodcode)): ?>
+
+
= $block->escapeHtml(__('TestMode')); ?>
+
+
+
+
+
+
+ = $block->escapeHtml(__('You will receive an e-mail with the Novalnet account details to complete the payment')); ?>
+
+
+
diff --git a/view/adminhtml/templates/form/Sepa.phtml b/view/adminhtml/templates/form/Sepa.phtml
new file mode 100755
index 0000000..5e938fa
--- /dev/null
+++ b/view/adminhtml/templates/form/Sepa.phtml
@@ -0,0 +1,103 @@
+escapeHtml($block->getMethodCode());
+$formData = [
+ 'code' => $paymentMethodcode
+];
+$serializedFormData = $block->jsonHelper()->jsonEncode($formData);
+?>
+
+
+
+ getPaymentLogo($paymentMethodcode)): ?>
+
+
+
+ getTestMode($paymentMethodcode)): ?>
+
+
= $block->escapeHtml(__('TestMode')); ?>
+
+
+
+
+
+ = $block->escapeHtml(__('IBAN')); ?>*
+
+
+
+
+
+
+
+ = $block->escapeHtml(__('BIC')); ?>*
+
+
+
+
+
+
+
diff --git a/view/adminhtml/templates/form/SepaGuarantee.phtml b/view/adminhtml/templates/form/SepaGuarantee.phtml
new file mode 100755
index 0000000..9d108bc
--- /dev/null
+++ b/view/adminhtml/templates/form/SepaGuarantee.phtml
@@ -0,0 +1,117 @@
+escapeHtml($block->getMethodCode());
+$formData = [
+ 'code' => $paymentMethodcode
+];
+$serializedFormData = $block->jsonHelper()->jsonEncode($formData);
+?>
+
+
+
+ getPaymentLogo($paymentMethodcode)): ?>
+
+
+
+ getTestMode($paymentMethodcode)): ?>
+
+
= $block->escapeHtml(__('TestMode')); ?>
+
+
+
+
+ = $block->escapeHtml(__('IBAN')); ?>*
+
+
+
+
+
+
+
+ = $block->escapeHtml(__('BIC')); ?>*
+
+
+
+
+
+ novalnetHelper()->validateCompany($paymentMethodcode)): ?>
+
+
+ = $block->escapeHtml(__('Your date of birth')); ?>*
+
+
+
+
+
+
+
+
+
diff --git a/view/adminhtml/templates/form/SepaInstalment.phtml b/view/adminhtml/templates/form/SepaInstalment.phtml
new file mode 100755
index 0000000..a55cf1c
--- /dev/null
+++ b/view/adminhtml/templates/form/SepaInstalment.phtml
@@ -0,0 +1,146 @@
+escapeHtml($block->getMethodCode());
+$formData = [
+ 'code' => $paymentMethodcode
+];
+$serializedFormData = $block->jsonHelper()->jsonEncode($formData);
+$orderTotal = $block->novalnetHelper()->getAdminCheckoutSession()->getQuote()->getGrandTotal();
+$instalmentPeriods = [];
+$allcycles = (!empty($block->getInstalmentCycles())) ? explode(',', $block->getInstalmentCycles()) : [];
+foreach ($allcycles as $allcycle) {
+ if (($orderTotal / $allcycle) >= 9.99) {
+ $instalmentPeriods[$allcycle] = $allcycle . __(' Cycles / ') . $block->updateCurrency($orderTotal / $allcycle, true, false) . __(' Every month');
+ }
+}
+?>
+
+
+
+ getPaymentLogo($paymentMethodcode)): ?>
+
+
+
+ getTestMode($paymentMethodcode)): ?>
+
+
= $block->escapeHtml(__('TestMode')); ?>
+
+
+
+
+ = $block->escapeHtml(__('IBAN')); ?>*
+
+
+
+
+
+
+
+ = $block->escapeHtml(__('BIC')); ?>*
+
+
+
+
+
+ novalnetHelper()->validateCompany($paymentMethodcode)): ?>
+
+
+ = $block->escapeHtml(__('Your date of birth')); ?>*
+
+
+
+
+
+
+
+
+ = $block->escapeHtml(__('Choose your instalment plan')); ?>
+
+
+ $instalmentValue): ?>
+
+ = /* @noEscape */ $instalmentValue; ?>
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/view/adminhtml/templates/info/Alipay.phtml b/view/adminhtml/templates/info/Alipay.phtml
new file mode 100755
index 0000000..2a1d3e3
--- /dev/null
+++ b/view/adminhtml/templates/info/Alipay.phtml
@@ -0,0 +1,63 @@
+getInfo();
+$transactionId = $block->getAdditionalData('NnTid') ? $block->getAdditionalData('NnTid') : $info->getLastTransId();
+?>
+
+ getAdditionalData('NnTestMode')): ?>
+
+ = /* @noEscape */ __('Test order') ?>
+
+
+ = $block->escapeHtml($block->getMethod()->getTitle()) ?>
+
+
+ = /* @noEscape */ __('Novalnet Transaction ID: '). $transactionId ?>
+
+
+ getAdditionalData('NnRefunded')): ?>
+ getAdditionalData('NnRefunded') as $key => $value): ?>
+
+ = /* @noEscape */ __(
+ 'Refund has been initiated for the TID:%1 with the amount %2',
+ $block->novalnetHelper()->makeValidNumber($value['reqtid']),
+ $value['refamount']
+ ) ?>
+
+ = /* @noEscape */ __(
+ 'Refund has been initiated for the TID: %1 with the amount %2. New TID:%3',
+ $block->novalnetHelper()->makeValidNumber($value['reqtid']),
+ $value['refamount'],
+ $block->novalnetHelper()->makeValidNumber($value['reftid'])
+ ) ?>
+
+
+
+
+ getAdditionalData('NnComments')): ?>
+ = /* @noEscape */ $block->getAdditionalData('NnComments') ?>
+
+
+ = /* @noEscape */ __('Error in getting payment method') ?>
+
diff --git a/view/adminhtml/templates/info/Applepay.phtml b/view/adminhtml/templates/info/Applepay.phtml
new file mode 100755
index 0000000..34cda0f
--- /dev/null
+++ b/view/adminhtml/templates/info/Applepay.phtml
@@ -0,0 +1,75 @@
+getInfo();
+$transactionId = $block->getAdditionalData('NnTid') ? $block->getAdditionalData('NnTid') : $info->getLastTransId();
+?>
+
+ getAdditionalData('NnTestMode')): ?>
+
+ = /* @noEscape */ __('Test order') ?>
+
+
+ = $block->escapeHtml($block->getMethod()->getTitle()) ?>
+
+
+ = /* @noEscape */ __('Novalnet Transaction ID: '). $transactionId ?>
+
+
+ getAdditionalData('ApiProcess') == 'capture'): ?>
+ = /* @noEscape */ __(
+ 'The transaction has been confirmed on %1',
+ $block->getAdditionalData('ApiProcessedAt')
+ ) ?>
+ getAdditionalData('ApiProcess') == 'void'): ?>
+ = /* @noEscape */ __(
+ 'The transaction has been canceled on %1',
+ $block->getAdditionalData('ApiProcessedAt')
+ ) ?>
+
+
+ getAdditionalData('NnRefunded')): ?>
+ getAdditionalData('NnRefunded') as $key => $value): ?>
+
+ = /* @noEscape */ __(
+ 'Refund has been initiated for the TID:%1 with the amount %2',
+ $block->novalnetHelper()->makeValidNumber($value['reqtid']),
+ $value['refamount']
+ ) ?>
+
+ = /* @noEscape */ __(
+ 'Refund has been initiated for the TID: %1 with the amount %2. New TID:%3',
+ $block->novalnetHelper()->makeValidNumber($value['reqtid']),
+ $value['refamount'],
+ $block->novalnetHelper()->makeValidNumber($value['reftid'])
+ ) ?>
+
+
+
+
+ getAdditionalData('NnComments')): ?>
+ = /* @noEscape */ $block->getAdditionalData('NnComments') ?>
+
+
+ = /* @noEscape */ __('Error in getting payment method') ?>
+
diff --git a/view/adminhtml/templates/info/Bancontact.phtml b/view/adminhtml/templates/info/Bancontact.phtml
new file mode 100755
index 0000000..374a42f
--- /dev/null
+++ b/view/adminhtml/templates/info/Bancontact.phtml
@@ -0,0 +1,63 @@
+getInfo();
+$transactionId = $block->getAdditionalData('NnTid') ? $block->getAdditionalData('NnTid') : $info->getLastTransId();
+?>
+
+ getAdditionalData('NnTestMode')): ?>
+
+ = /* @noEscape */ __('Test order') ?>
+
+
+ = $block->escapeHtml($block->getMethod()->getTitle()) ?>
+
+
+ = /* @noEscape */ __('Novalnet Transaction ID: '). $transactionId ?>
+
+
+ getAdditionalData('NnRefunded')): ?>
+ getAdditionalData('NnRefunded') as $key => $value): ?>
+
+ = /* @noEscape */ __(
+ 'Refund has been initiated for the TID:%1 with the amount %2',
+ $block->novalnetHelper()->makeValidNumber($value['reqtid']),
+ $value['refamount']
+ ) ?>
+
+ = /* @noEscape */ __(
+ 'Refund has been initiated for the TID: %1 with the amount %2. New TID:%3',
+ $block->novalnetHelper()->makeValidNumber($value['reqtid']),
+ $value['refamount'],
+ $block->novalnetHelper()->makeValidNumber($value['reftid'])
+ ) ?>
+
+
+
+
+ getAdditionalData('NnComments')): ?>
+ = /* @noEscape */ $block->getAdditionalData('NnComments') ?>
+
+
+ = /* @noEscape */ __('Error in getting payment method') ?>
+
diff --git a/view/adminhtml/templates/info/Banktransfer.phtml b/view/adminhtml/templates/info/Banktransfer.phtml
new file mode 100755
index 0000000..9cd6222
--- /dev/null
+++ b/view/adminhtml/templates/info/Banktransfer.phtml
@@ -0,0 +1,63 @@
+getInfo();
+$transactionId = $block->getAdditionalData('NnTid') ? $block->getAdditionalData('NnTid') : $info->getLastTransId();
+?>
+
+ getAdditionalData('NnTestMode')): ?>
+
+ = /* @noEscape */ __('Test order') ?>
+
+
+ = $block->escapeHtml($block->getMethod()->getTitle()) ?>
+
+
+ = /* @noEscape */ __('Novalnet Transaction ID: '). $transactionId ?>
+
+
+ getAdditionalData('NnRefunded')): ?>
+ getAdditionalData('NnRefunded') as $key => $value): ?>
+
+ = /* @noEscape */ __(
+ 'Refund has been initiated for the TID:%1 with the amount %2',
+ $block->novalnetHelper()->makeValidNumber($value['reqtid']),
+ $value['refamount']
+ ) ?>
+
+ = /* @noEscape */ __(
+ 'Refund has been initiated for the TID: %1 with the amount %2. New TID:%3',
+ $block->novalnetHelper()->makeValidNumber($value['reqtid']),
+ $value['refamount'],
+ $block->novalnetHelper()->makeValidNumber($value['reftid'])
+ ) ?>
+
+
+
+
+ getAdditionalData('NnComments')): ?>
+ = /* @noEscape */ $block->getAdditionalData('NnComments') ?>
+
+
+ = /* @noEscape */ __('Error in getting payment method') ?>
+
diff --git a/view/adminhtml/templates/info/Blik.phtml b/view/adminhtml/templates/info/Blik.phtml
new file mode 100755
index 0000000..86939d4
--- /dev/null
+++ b/view/adminhtml/templates/info/Blik.phtml
@@ -0,0 +1,63 @@
+getInfo();
+$transactionId = $block->getAdditionalData('NnTid') ? $block->getAdditionalData('NnTid') : $info->getLastTransId();
+?>
+
+ getAdditionalData('NnTestMode')): ?>
+
+ = /* @noEscape */ __('Test order') ?>
+
+
+ = $block->escapeHtml($block->getMethod()->getTitle()) ?>
+
+
+ = /* @noEscape */ __('Novalnet Transaction ID: '). $transactionId ?>
+
+
+ getAdditionalData('NnRefunded')): ?>
+ getAdditionalData('NnRefunded') as $key => $value): ?>
+
+ = /* @noEscape */ __(
+ 'Refund has been initiated for the TID:%1 with the amount %2',
+ $block->novalnetHelper()->makeValidNumber($value['reqtid']),
+ $value['refamount']
+ ) ?>
+
+ = /* @noEscape */ __(
+ 'Refund has been initiated for the TID: %1 with the amount %2. New TID:%3',
+ $block->novalnetHelper()->makeValidNumber($value['reqtid']),
+ $value['refamount'],
+ $block->novalnetHelper()->makeValidNumber($value['reftid'])
+ ) ?>
+
+
+
+
+ getAdditionalData('NnComments')): ?>
+ = /* @noEscape */ $block->getAdditionalData('NnComments') ?>
+
+
+ = /* @noEscape */ __('Error in getting payment method') ?>
+
diff --git a/view/adminhtml/templates/info/Cashpayment.phtml b/view/adminhtml/templates/info/Cashpayment.phtml
new file mode 100755
index 0000000..97c73d8
--- /dev/null
+++ b/view/adminhtml/templates/info/Cashpayment.phtml
@@ -0,0 +1,90 @@
+getInfo();
+$transactionId = $block->getAdditionalData('NnTid') ? $block->getAdditionalData('NnTid') : $info->getLastTransId();
+$totalAmount = ($block->getAdditionalData('NnAmount')) ? $block->getAdditionalData('NnAmount') : $block->getGrandTotal();
+?>
+
+ getAdditionalData('NnTestMode')): ?>
+
+ = /* @noEscape */ __('Test order') ?>
+
+
+ = $block->escapeHtml($block->getMethod()->getTitle()) ?>
+
+
+ = /* @noEscape */ __('Novalnet Transaction ID: '). $transactionId ?>
+
+
+ getAdditionalData('CpDueDate') && (empty($block->getAdditionalData('NnPaid')) || $block->getAdditionalData('NnPaid') != 1)): ?>
+ = /* @noEscape */ __('Slip expiry date: %1', $block->getAdditionalData('CpDueDate')) ?>
+
+
+ getAdditionalData('dueDateUpdateAt')): ?>
+ = /* @noEscape */ __(
+ 'The transaction has been updated with amount %1 and slip expiry date with %2',
+ $totalAmount,
+ $block->getAdditionalData('CpDueDate')
+ ) ?>
+
+
+ getUrl('*/*/*', ['_current' => true])) && !preg_match('/invoice|creditmemo|shipment|callback/i', $block->getUrl('*/*/*', ['_current' => true])) &&
+ (empty($block->getAdditionalData('NnPaid')) || $block->getAdditionalData('NnPaid') != 1)): ?>
+ getAdditionalData('CashpaymentStores')): ?>
+ = /* @noEscape */ __('Store(s) near you:') ?>
+ getAdditionalData('CashpaymentStores') as $key => $value): ?>
+ = /* @noEscape */ $value['title'] ?>
+ = /* @noEscape */ $value['street'] ?>
+ = /* @noEscape */ $value['city'] ?>
+ = /* @noEscape */ $value['country'] ?>
+ = /* @noEscape */ $value['zipcode'] ?>
+
+
+
+
+ getAdditionalData('NnRefunded')): ?>
+ getAdditionalData('NnRefunded') as $key => $value): ?>
+
+ = /* @noEscape */ __(
+ 'Refund has been initiated for the TID:%1 with the amount %2',
+ $block->novalnetHelper()->makeValidNumber($value['reqtid']),
+ $value['refamount']
+ ) ?>
+
+ = /* @noEscape */ __(
+ 'Refund has been initiated for the TID: %1 with the amount %2. New TID:%3',
+ $block->novalnetHelper()->makeValidNumber($value['reqtid']),
+ $value['refamount'],
+ $block->novalnetHelper()->makeValidNumber($value['reftid'])
+ ) ?>
+
+
+
+
+ getAdditionalData('NnComments')): ?>
+ = /* @noEscape */ $block->getAdditionalData('NnComments') ?>
+
+
+ = /* @noEscape */ __('Error in getting payment method') ?>
+
diff --git a/view/adminhtml/templates/info/Cc.phtml b/view/adminhtml/templates/info/Cc.phtml
new file mode 100755
index 0000000..6daaa5e
--- /dev/null
+++ b/view/adminhtml/templates/info/Cc.phtml
@@ -0,0 +1,87 @@
+getInfo();
+$transactionId = $block->getAdditionalData('NnTid') ? $block->getAdditionalData('NnTid') : $info->getLastTransId();
+?>
+
+ getAdditionalData('NnTestMode')): ?>
+
+ = /* @noEscape */ __('Test order') ?>
+
+
+ = $block->escapeHtml($block->getMethod()->getTitle()) ?>
+
+
+ = /* @noEscape */ __('Novalnet Transaction ID: '). $transactionId ?>
+
+
+ getAdditionalData('ApiProcess') == 'capture'): ?>
+ = /* @noEscape */ __(
+ 'The transaction has been confirmed on %1',
+ $block->getAdditionalData('ApiProcessedAt')
+ ) ?>
+ getAdditionalData('ApiProcess') == 'void'): ?>
+ = /* @noEscape */ __(
+ 'The transaction has been canceled on %1',
+ $block->getAdditionalData('ApiProcessedAt')
+ ) ?>
+
+
+ getAdditionalData('NnZeroAmountBooking')): ?>
+ = /* @noEscape */ __('This order processed as a zero amount booking') ?>
+
+ getAdditionalData('NnUpdatedZeroAmount') && $block->getAdditionalData('NnZeroAmountRefTid')): ?>
+ = /* @noEscape */ __(
+ 'Your order has been booked with the amount of %1. Your new TID for the booked amount: %2',
+ $block->getAdditionalData('NnUpdatedZeroAmount'),
+ $block->getAdditionalData('NnZeroAmountRefTid')
+ ) ?>
+
+
+
+ getAdditionalData('NnRefunded')): ?>
+ getAdditionalData('NnRefunded') as $key => $value): ?>
+
+ = /* @noEscape */ __(
+ 'Refund has been initiated for the TID:%1 with the amount %2',
+ $block->novalnetHelper()->makeValidNumber($value['reqtid']),
+ $value['refamount']
+ ) ?>
+
+ = /* @noEscape */ __(
+ 'Refund has been initiated for the TID: %1 with the amount %2. New TID:%3',
+ $block->novalnetHelper()->makeValidNumber($value['reqtid']),
+ $value['refamount'],
+ $block->novalnetHelper()->makeValidNumber($value['reftid'])
+ ) ?>
+
+
+
+
+ getAdditionalData('NnComments')): ?>
+ = /* @noEscape */ $block->getAdditionalData('NnComments') ?>
+
+
+ = /* @noEscape */ __('Error in getting payment method') ?>
+
diff --git a/view/adminhtml/templates/info/Eps.phtml b/view/adminhtml/templates/info/Eps.phtml
new file mode 100755
index 0000000..cc52423
--- /dev/null
+++ b/view/adminhtml/templates/info/Eps.phtml
@@ -0,0 +1,63 @@
+getInfo();
+$transactionId = $block->getAdditionalData('NnTid') ? $block->getAdditionalData('NnTid') : $info->getLastTransId();
+?>
+
+ getAdditionalData('NnTestMode')): ?>
+
+ = /* @noEscape */ __('Test order') ?>
+
+
+ = $block->escapeHtml($block->getMethod()->getTitle()) ?>
+
+
+ = /* @noEscape */ __('Novalnet Transaction ID: '). $transactionId ?>
+
+
+ getAdditionalData('NnRefunded')): ?>
+ getAdditionalData('NnRefunded') as $key => $value): ?>
+
+ = /* @noEscape */ __(
+ 'Refund has been initiated for the TID:%1 with the amount %2',
+ $block->novalnetHelper()->makeValidNumber($value['reqtid']),
+ $value['refamount']
+ ) ?>
+
+ = /* @noEscape */ __(
+ 'Refund has been initiated for the TID: %1 with the amount %2. New TID:%3',
+ $block->novalnetHelper()->makeValidNumber($value['reqtid']),
+ $value['refamount'],
+ $block->novalnetHelper()->makeValidNumber($value['reftid'])
+ ) ?>
+
+
+
+
+ getAdditionalData('NnComments')): ?>
+ = /* @noEscape */ $block->getAdditionalData('NnComments') ?>
+
+
+ = /* @noEscape */ __('Error in getting payment method') ?>
+
diff --git a/view/adminhtml/templates/info/Giropay.phtml b/view/adminhtml/templates/info/Giropay.phtml
new file mode 100755
index 0000000..04d4237
--- /dev/null
+++ b/view/adminhtml/templates/info/Giropay.phtml
@@ -0,0 +1,63 @@
+getInfo();
+$transactionId = $block->getAdditionalData('NnTid') ? $block->getAdditionalData('NnTid') : $info->getLastTransId();
+?>
+
+ getAdditionalData('NnTestMode')): ?>
+
+ = /* @noEscape */ __('Test order') ?>
+
+
+ = $block->escapeHtml($block->getMethod()->getTitle()) ?>
+
+
+ = /* @noEscape */ __('Novalnet Transaction ID: '). $transactionId ?>
+
+
+ getAdditionalData('NnRefunded')): ?>
+ getAdditionalData('NnRefunded') as $key => $value): ?>
+
+ = /* @noEscape */ __(
+ 'Refund has been initiated for the TID:%1 with the amount %2',
+ $block->novalnetHelper()->makeValidNumber($value['reqtid']),
+ $value['refamount']
+ ) ?>
+
+ = /* @noEscape */ __(
+ 'Refund has been initiated for the TID: %1 with the amount %2. New TID:%3',
+ $block->novalnetHelper()->makeValidNumber($value['reqtid']),
+ $value['refamount'],
+ $block->novalnetHelper()->makeValidNumber($value['reftid'])
+ ) ?>
+
+
+
+
+ getAdditionalData('NnComments')): ?>
+ = /* @noEscape */ $block->getAdditionalData('NnComments') ?>
+
+
+ = /* @noEscape */ __('Error in getting payment method') ?>
+
diff --git a/view/adminhtml/templates/info/Googlepay.phtml b/view/adminhtml/templates/info/Googlepay.phtml
new file mode 100755
index 0000000..9742c29
--- /dev/null
+++ b/view/adminhtml/templates/info/Googlepay.phtml
@@ -0,0 +1,75 @@
+getInfo();
+$transactionId = $block->getAdditionalData('NnTid') ? $block->getAdditionalData('NnTid') : $info->getLastTransId();
+?>
+
+ getAdditionalData('NnTestMode')): ?>
+
+ = /* @noEscape */ __('Test order') ?>
+
+
+ = $block->escapeHtml($block->getMethod()->getTitle()) ?>
+
+
+ = /* @noEscape */ __('Novalnet Transaction ID: '). $transactionId ?>
+
+
+ getAdditionalData('ApiProcess') == 'capture'): ?>
+ = /* @noEscape */ __(
+ 'The transaction has been confirmed on %1',
+ $block->getAdditionalData('ApiProcessedAt')
+ ) ?>
+ getAdditionalData('ApiProcess') == 'void'): ?>
+ = /* @noEscape */ __(
+ 'The transaction has been canceled on %1',
+ $block->getAdditionalData('ApiProcessedAt')
+ ) ?>
+
+
+ getAdditionalData('NnRefunded')): ?>
+ getAdditionalData('NnRefunded') as $key => $value): ?>
+
+ = /* @noEscape */ __(
+ 'Refund has been initiated for the TID:%1 with the amount %2',
+ $block->novalnetHelper()->makeValidNumber($value['reqtid']),
+ $value['refamount']
+ ) ?>
+
+ = /* @noEscape */ __(
+ 'Refund has been initiated for the TID: %1 with the amount %2. New TID:%3',
+ $block->novalnetHelper()->makeValidNumber($value['reqtid']),
+ $value['refamount'],
+ $block->novalnetHelper()->makeValidNumber($value['reftid'])
+ ) ?>
+
+
+
+
+ getAdditionalData('NnComments')): ?>
+ = /* @noEscape */ $block->getAdditionalData('NnComments') ?>
+
+
+ = /* @noEscape */ __('Error in getting payment method') ?>
+
diff --git a/view/adminhtml/templates/info/Ideal.phtml b/view/adminhtml/templates/info/Ideal.phtml
new file mode 100755
index 0000000..362d902
--- /dev/null
+++ b/view/adminhtml/templates/info/Ideal.phtml
@@ -0,0 +1,63 @@
+getInfo();
+$transactionId = $block->getAdditionalData('NnTid') ? $block->getAdditionalData('NnTid') : $info->getLastTransId();
+?>
+
+ getAdditionalData('NnTestMode')): ?>
+
+ = /* @noEscape */ __('Test order') ?>
+
+
+ = $block->escapeHtml($block->getMethod()->getTitle()) ?>
+
+
+ = /* @noEscape */ __('Novalnet Transaction ID: '). $transactionId ?>
+
+
+ getAdditionalData('NnRefunded')): ?>
+ getAdditionalData('NnRefunded') as $key => $value): ?>
+
+ = /* @noEscape */ __(
+ 'Refund has been initiated for the TID:%1 with the amount %2',
+ $block->novalnetHelper()->makeValidNumber($value['reqtid']),
+ $value['refamount']
+ ) ?>
+
+ = /* @noEscape */ __(
+ 'Refund has been initiated for the TID: %1 with the amount %2. New TID:%3',
+ $block->novalnetHelper()->makeValidNumber($value['reqtid']),
+ $value['refamount'],
+ $block->novalnetHelper()->makeValidNumber($value['reftid'])
+ ) ?>
+
+
+
+
+ getAdditionalData('NnComments')): ?>
+ = /* @noEscape */ $block->getAdditionalData('NnComments') ?>
+
+
+ = /* @noEscape */ __('Error in getting payment method') ?>
+
diff --git a/view/adminhtml/templates/info/Invoice.phtml b/view/adminhtml/templates/info/Invoice.phtml
new file mode 100755
index 0000000..9e12334
--- /dev/null
+++ b/view/adminhtml/templates/info/Invoice.phtml
@@ -0,0 +1,120 @@
+getInfo();
+$order = $info->getOrder();
+$transactionId = $block->getAdditionalData('NnTid') ? $block->getAdditionalData('NnTid') : $info->getLastTransId();
+$paymentStatus = $block->novalnetHelper()->getStatus($block->getAdditionalData('NnStatus'), $order);
+$totalAmount = ($block->getAdditionalData('NnAmount')) ? $block->getAdditionalData('NnAmount') : $block->getGrandTotal();
+?>
+
+ getAdditionalData('NnTestMode')): ?>
+
+ = /* @noEscape */ __('Test order') ?>
+
+
+ = $block->escapeHtml($block->getMethod()->getTitle()) ?>
+
+
+ = /* @noEscape */ __('Novalnet Transaction ID: '). $transactionId ?>
+
+
+ getAdditionalData('NnGuarantee')) {
+ /* @noEscape */ echo __('This is processed as a guarantee payment') . ' ';
+ if (($paymentStatus == 'PENDING')): ?>
+ = /* @noEscape */ __('Your order is being verified. Once confirmed, we will send you our bank details to which the order amount should be transferred. Please note that this may take up to 24 hours') ?>
+
+
+ getAdditionalData('ApiProcess') == 'capture'): ?>
+ = /* @noEscape */ __(
+ 'The transaction has been confirmed successfully for the TID: %1',
+ $transactionId
+ ) ?>
+
+
+ getAdditionalData('ApiProcess') == 'void'): ?>
+ = /* @noEscape */ __(
+ 'The transaction has been canceled on %1',
+ $block->getAdditionalData('ApiProcessedAt')
+ ) ?>
+
+
+ getAdditionalData('dueDateUpdateAt') && $paymentStatus != 'ON_HOLD'): ?>
+ = /* @noEscape */ __(
+ 'The transaction has been updated with amount %1 and due date with %2',
+ $totalAmount,
+ $block->getAdditionalData('NnDueDate')
+ ) ?>
+
+
+ getAdditionalData('NnRefunded')): ?>
+ getAdditionalData('NnRefunded') as $key => $value): ?>
+
+ = /* @noEscape */ __(
+ 'Refund has been initiated for the TID:%1 with the amount %2',
+ $block->novalnetHelper()->makeValidNumber($value['reqtid']),
+ $value['refamount']
+ ) ?>
+
+ = /* @noEscape */ __(
+ 'Refund has been initiated for the TID: %1 with the amount %2. New TID:%3',
+ $block->novalnetHelper()->makeValidNumber($value['reqtid']),
+ $value['refamount'],
+ $block->novalnetHelper()->makeValidNumber($value['reftid'])
+ ) ?>
+
+
+
+
+ getUrl('*/*/*', ['_current' => true])) && !preg_match('/creditmemo/i', $block->getUrl('*/*/*', ['_current' => true])) && in_array($paymentStatus, ['PENDING', 'ON_HOLD', 'CONFIRMED']) &&
+ (empty($block->getAdditionalData('NnPaid')) || $block->getAdditionalData('NnPaid') != 1) &&
+ (empty($block->getAdditionalData('NnGuarantee')) ||
+ (!empty($block->getAdditionalData('NnGuarantee')) && $paymentStatus != 'PENDING'))): ?>
+ getAdditionalData('NnInvoiceComments')) && strlen($block->getAdditionalData('NnInvoiceComments'))): ?>
+
+ = /* @noEscape */ __('Please transfer the amount of %1 to the following account on or before %2', $totalAmount, $block->getAdditionalData('NnDueDate')) ?>
+
+ = /* @noEscape */ __('Please transfer the amount of %1 to the following account', $totalAmount) ?>
+
+ getAdditionalData('NnInvoiceComments'))) ? explode('|', $block->getAdditionalData('NnInvoiceComments')) : []; ?>
+
+
+
+
+
+ = /* @noEscape */ __($text) . ': ' . __($referenceTxt) . ' ' . $value ?>
+
+ = /* @noEscape */ __($text) . ': ' . $value ?>
+
+
+
+
+
+ getAdditionalData('NnComments')): ?>
+ = /* @noEscape */ $block->getAdditionalData('NnComments') ?>
+
+
+ = /* @noEscape */ __('Error in getting payment method') ?>
+
diff --git a/view/adminhtml/templates/info/InvoiceGuarantee.phtml b/view/adminhtml/templates/info/InvoiceGuarantee.phtml
new file mode 100755
index 0000000..c6d5ca7
--- /dev/null
+++ b/view/adminhtml/templates/info/InvoiceGuarantee.phtml
@@ -0,0 +1,106 @@
+getInfo();
+$order = $info->getOrder();
+$transactionId = $block->getAdditionalData('NnTid') ? $block->getAdditionalData('NnTid') : $info->getLastTransId();
+$paymentStatus = $block->novalnetHelper()->getStatus($block->getAdditionalData('NnStatus'), $order);
+$totalAmount = ($block->getAdditionalData('NnAmount')) ? $block->getAdditionalData('NnAmount') : $block->getGrandTotal();
+?>
+
+ getAdditionalData('NnTestMode')): ?>
+
+ = /* @noEscape */ __('Test order') ?>
+
+
+ = $block->escapeHtml($block->getMethod()->getTitle()) ?>
+
+
+ = /* @noEscape */ __('Novalnet Transaction ID: '). $transactionId ?>
+
+
+
+ = /* @noEscape */ __('Your order is being verified. Once confirmed, we will send you our bank details to which the order amount should be transferred. Please note that this may take up to 24 hours') ?>
+
+
+
+ getAdditionalData('ApiProcess') == 'capture'): ?>
+ = /* @noEscape */ __(
+ 'The transaction has been confirmed successfully for the TID: %1',
+ $transactionId
+ ) ?>
+
+
+ getAdditionalData('ApiProcess') == 'void'): ?>
+ = /* @noEscape */ __(
+ 'The transaction has been canceled on %1',
+ $block->getAdditionalData('ApiProcessedAt')
+ ) ?>
+
+
+ getAdditionalData('NnRefunded')): ?>
+ getAdditionalData('NnRefunded') as $key => $value): ?>
+
+ = /* @noEscape */ __(
+ 'Refund has been initiated for the TID:%1 with the amount %2',
+ $block->novalnetHelper()->makeValidNumber($value['reqtid']),
+ $value['refamount']
+ ) ?>
+
+ = /* @noEscape */ __(
+ 'Refund has been initiated for the TID: %1 with the amount %2. New TID:%3',
+ $block->novalnetHelper()->makeValidNumber($value['reqtid']),
+ $value['refamount'],
+ $block->novalnetHelper()->makeValidNumber($value['reftid'])
+ ) ?>
+
+
+
+
+ getUrl('*/*/*', ['_current' => true])) && !preg_match('/creditmemo/i', $block->getUrl('*/*/*', ['_current' => true])) && in_array($paymentStatus, ['ON_HOLD', 'CONFIRMED'])): ?>
+ getAdditionalData('NnInvoiceComments')) && strlen($block->getAdditionalData('NnInvoiceComments'))): ?>
+
+ = /* @noEscape */ __('Please transfer the amount of %1 to the following account on or before %2', $totalAmount, $block->getAdditionalData('NnDueDate')) ?>
+
+ = /* @noEscape */ __('Please transfer the amount of %1 to the following account', $totalAmount) ?>
+
+ getAdditionalData('NnInvoiceComments'))) ? explode('|', $block->getAdditionalData('NnInvoiceComments')) : []; ?>
+
+
+
+
+
+ = /* @noEscape */ __($text) . ': ' . __($referenceTxt) . ' ' . $value ?>
+
+ = /* @noEscape */ __($text) . ': ' . $value ?>
+
+
+
+
+
+ getAdditionalData('NnComments')): ?>
+ = /* @noEscape */ $block->getAdditionalData('NnComments') ?>
+
+
+ = /* @noEscape */ __('Error in getting payment method') ?>
+
diff --git a/view/adminhtml/templates/info/InvoiceInstalment.phtml b/view/adminhtml/templates/info/InvoiceInstalment.phtml
new file mode 100755
index 0000000..d6bc46c
--- /dev/null
+++ b/view/adminhtml/templates/info/InvoiceInstalment.phtml
@@ -0,0 +1,116 @@
+getInfo();
+$order = $info->getOrder();
+$transactionId = $block->getAdditionalData('NnTid') ? $block->getAdditionalData('NnTid') : $info->getLastTransId();
+$paymentStatus = $block->novalnetHelper()->getStatus($block->getAdditionalData('NnStatus'), $order);
+$totalAmount = ($block->getAdditionalData('NnAmount')) ? $block->getAdditionalData('NnAmount') : $block->getGrandTotal();
+?>
+
+ getAdditionalData('NnTestMode')): ?>
+
+ = /* @noEscape */ __('Test order') ?>
+
+
+ = $block->escapeHtml($block->getMethod()->getTitle()) ?>
+
+
+ = /* @noEscape */ __('Novalnet Transaction ID: '). $transactionId ?>
+
+
+
+ = /* @noEscape */ __('Your order is being verified. Once confirmed, we will send you our bank details to which the order amount should be transferred. Please note that this may take up to 24 hours') ?>
+
+
+
+ getAdditionalData('ApiProcess') == 'capture'): ?>
+ = /* @noEscape */ __(
+ 'The transaction has been confirmed successfully for the TID: %1',
+ $transactionId
+ ) ?>
+
+
+ getAdditionalData('ApiProcess') == 'void'): ?>
+ = /* @noEscape */ __(
+ 'The transaction has been canceled on %1',
+ $block->getAdditionalData('ApiProcessedAt')
+ ) ?>
+
+
+ getAdditionalData('InstalmentCancel')): ?>
+ = /* @noEscape */ __(
+ 'Instalment has been cancelled.'
+ ) ?>
+
+
+ getAdditionalData('NnRefunded')): ?>
+ getAdditionalData('NnRefunded') as $key => $value): ?>
+
+ = /* @noEscape */ __(
+ 'Refund has been initiated for the TID:%1 with the amount %2',
+ $block->novalnetHelper()->makeValidNumber($value['reqtid']),
+ $value['refamount']
+ ) ?>
+
+ = /* @noEscape */ __(
+ 'Refund has been initiated for the TID: %1 with the amount %2. New TID:%3',
+ $block->novalnetHelper()->makeValidNumber($value['reqtid']),
+ $value['refamount'],
+ $block->novalnetHelper()->makeValidNumber($value['reftid'])
+ ) ?>
+
+
+
+
+ getUrl('*/*/*', ['_current' => true])) && !preg_match('/creditmemo/i', $block->getUrl('*/*/*', ['_current' => true])) && in_array($paymentStatus, ['ON_HOLD', 'CONFIRMED'])): ?>
+ getAdditionalData('NnInvoiceComments')) && strlen($block->getAdditionalData('NnInvoiceComments'))): ?>
+
+ = /* @noEscape */ __('Please transfer the amount of %1 to the following account on or before %2', $totalAmount, $block->getAdditionalData('NnDueDate')) ?>
+
+ = /* @noEscape */ __('Please transfer the amount of %1 to the following account', $totalAmount) ?>
+
+ getAdditionalData('NnInvoiceComments'))) ? explode('|', $block->getAdditionalData('NnInvoiceComments')) : []; ?>
+
+ $noteValue): ?>
+
+
+
+
+
+
+
+ = /* @noEscape */ __($text) . ': ' . __($referenceTxt) . ' ' . $value ?>
+
+ = /* @noEscape */ __($text) . ': ' . $value ?>
+
+
+
+
+
+ getAdditionalData('NnComments')): ?>
+ = /* @noEscape */ $block->getAdditionalData('NnComments') ?>
+
+
+ = /* @noEscape */ __('Error in getting payment method') ?>
+
diff --git a/view/adminhtml/templates/info/Multibanco.phtml b/view/adminhtml/templates/info/Multibanco.phtml
new file mode 100755
index 0000000..8b47289
--- /dev/null
+++ b/view/adminhtml/templates/info/Multibanco.phtml
@@ -0,0 +1,49 @@
+getInfo();
+$transactionId = $block->getAdditionalData('NnTid') ? $block->getAdditionalData('NnTid') : $info->getLastTransId();
+?>
+
+ getAdditionalData('NnTestMode')): ?>
+
+ = /* @noEscape */ __('Test order') ?>
+
+
+ = $block->escapeHtml($block->getMethod()->getTitle()) ?>
+
+
+ = /* @noEscape */ __('Novalnet Transaction ID: '). $transactionId ?>
+
+
+ getAdditionalData('NnPartnerPaymentReference') && (empty($block->getAdditionalData('NnPaid')) || $block->getAdditionalData('NnPaid') != 1)): ?>
+ = /* @noEscape */ __('Please use the following payment reference details to pay the amount of %1 at a Multibanco ATM or through your internet banking.', $block->getGrandTotal()) ?>
+ = /* @noEscape */ __('Partner Payment Reference: %1', $block->getAdditionalData('NnPartnerPaymentReference')) ?>
+
+
+ getAdditionalData('NnComments')): ?>
+ = /* @noEscape */ $block->getAdditionalData('NnComments') ?>
+
+
+ = /* @noEscape */ __('Error in getting payment method') ?>
+
diff --git a/view/adminhtml/templates/info/OnlineBanktransfer.phtml b/view/adminhtml/templates/info/OnlineBanktransfer.phtml
new file mode 100755
index 0000000..4b5ebe2
--- /dev/null
+++ b/view/adminhtml/templates/info/OnlineBanktransfer.phtml
@@ -0,0 +1,63 @@
+getInfo();
+$transactionId = $block->getAdditionalData('NnTid') ? $block->getAdditionalData('NnTid') : $info->getLastTransId();
+?>
+
+ getAdditionalData('NnTestMode')): ?>
+
+ = /* @noEscape */ __('Test order') ?>
+
+
+ = $block->escapeHtml($block->getMethod()->getTitle()) ?>
+
+
+ = /* @noEscape */ __('Novalnet Transaction ID: '). $transactionId ?>
+
+
+ getAdditionalData('NnRefunded')): ?>
+ getAdditionalData('NnRefunded') as $key => $value): ?>
+
+ = /* @noEscape */ __(
+ 'Refund has been initiated for the TID:%1 with the amount %2',
+ $block->novalnetHelper()->makeValidNumber($value['reqtid']),
+ $value['refamount']
+ ) ?>
+
+ = /* @noEscape */ __(
+ 'Refund has been initiated for the TID: %1 with the amount %2. New TID:%3',
+ $block->novalnetHelper()->makeValidNumber($value['reqtid']),
+ $value['refamount'],
+ $block->novalnetHelper()->makeValidNumber($value['reftid'])
+ ) ?>
+
+
+
+
+ getAdditionalData('NnComments')): ?>
+ = /* @noEscape */ $block->getAdditionalData('NnComments') ?>
+
+
+ = /* @noEscape */ __('Error in getting payment method') ?>
+
diff --git a/view/adminhtml/templates/info/Paypal.phtml b/view/adminhtml/templates/info/Paypal.phtml
new file mode 100755
index 0000000..0e69501
--- /dev/null
+++ b/view/adminhtml/templates/info/Paypal.phtml
@@ -0,0 +1,75 @@
+getInfo();
+$transactionId = $block->getAdditionalData('NnTid') ? $block->getAdditionalData('NnTid') : $info->getLastTransId();
+?>
+
+ getAdditionalData('NnTestMode')): ?>
+
+ = /* @noEscape */ __('Test order') ?>
+
+
+ = $block->escapeHtml($block->getMethod()->getTitle()) ?>
+
+
+ = /* @noEscape */ __('Novalnet Transaction ID: '). $transactionId ?>
+
+
+ getAdditionalData('ApiProcess') == 'capture'): ?>
+ = /* @noEscape */ __(
+ 'The transaction has been confirmed on %1',
+ $block->getAdditionalData('ApiProcessedAt')
+ ) ?>
+ getAdditionalData('ApiProcess') == 'void'): ?>
+ = /* @noEscape */ __(
+ 'The transaction has been canceled on %1',
+ $block->getAdditionalData('ApiProcessedAt')
+ ) ?>
+
+
+ getAdditionalData('NnRefunded')): ?>
+ getAdditionalData('NnRefunded') as $key => $value): ?>
+
+ = /* @noEscape */ __(
+ 'Refund has been initiated for the TID:%1 with the amount %2',
+ $block->novalnetHelper()->makeValidNumber($value['reqtid']),
+ $value['refamount']
+ ) ?>
+
+ = /* @noEscape */ __(
+ 'Refund has been initiated for the TID: %1 with the amount %2. New TID:%3',
+ $block->novalnetHelper()->makeValidNumber($value['reqtid']),
+ $value['refamount'],
+ $block->novalnetHelper()->makeValidNumber($value['reftid'])
+ ) ?>
+
+
+
+
+ getAdditionalData('NnComments')): ?>
+ = /* @noEscape */ $block->getAdditionalData('NnComments') ?>
+
+
+ = /* @noEscape */ __('Error in getting payment method') ?>
+
diff --git a/view/adminhtml/templates/info/PostFinance.phtml b/view/adminhtml/templates/info/PostFinance.phtml
new file mode 100755
index 0000000..e7f2ec4
--- /dev/null
+++ b/view/adminhtml/templates/info/PostFinance.phtml
@@ -0,0 +1,75 @@
+getInfo();
+$transactionId = $block->getAdditionalData('NnTid') ? $block->getAdditionalData('NnTid') : $info->getLastTransId();
+?>
+
+ getAdditionalData('NnTestMode')): ?>
+
+ = /* @noEscape */ __('Test order') ?>
+
+
+ = $block->escapeHtml($block->getMethod()->getTitle()) ?>
+
+
+ = /* @noEscape */ __('Novalnet Transaction ID: '). $transactionId ?>
+
+
+ getAdditionalData('ApiProcess') == 'capture'): ?>
+ = /* @noEscape */ __(
+ 'The transaction has been confirmed on %1',
+ $block->getAdditionalData('ApiProcessedAt')
+ ) ?>
+ getAdditionalData('ApiProcess') == 'void'): ?>
+ = /* @noEscape */ __(
+ 'The transaction has been canceled on %1',
+ $block->getAdditionalData('ApiProcessedAt')
+ ) ?>
+
+
+ getAdditionalData('NnRefunded')): ?>
+ getAdditionalData('NnRefunded') as $key => $value): ?>
+
+ = /* @noEscape */ __(
+ 'Refund has been initiated for the TID:%1 with the amount %2',
+ $block->novalnetHelper()->makeValidNumber($value['reqtid']),
+ $value['refamount']
+ ) ?>
+
+ = /* @noEscape */ __(
+ 'Refund has been initiated for the TID: %1 with the amount %2. New TID:%3',
+ $block->novalnetHelper()->makeValidNumber($value['reqtid']),
+ $value['refamount'],
+ $block->novalnetHelper()->makeValidNumber($value['reftid'])
+ ) ?>
+
+
+
+
+ getAdditionalData('NnComments')): ?>
+ = /* @noEscape */ $block->getAdditionalData('NnComments') ?>
+
+
+ = /* @noEscape */ __('Error in getting payment method') ?>
+
diff --git a/view/adminhtml/templates/info/PostFinanceCard.phtml b/view/adminhtml/templates/info/PostFinanceCard.phtml
new file mode 100755
index 0000000..2fcec35
--- /dev/null
+++ b/view/adminhtml/templates/info/PostFinanceCard.phtml
@@ -0,0 +1,75 @@
+getInfo();
+$transactionId = $block->getAdditionalData('NnTid') ? $block->getAdditionalData('NnTid') : $info->getLastTransId();
+?>
+
+ getAdditionalData('NnTestMode')): ?>
+
+ = /* @noEscape */ __('Test order') ?>
+
+
+ = $block->escapeHtml($block->getMethod()->getTitle()) ?>
+
+
+ = /* @noEscape */ __('Novalnet Transaction ID: '). $transactionId ?>
+
+
+ getAdditionalData('ApiProcess') == 'capture'): ?>
+ = /* @noEscape */ __(
+ 'The transaction has been confirmed on %1',
+ $block->getAdditionalData('ApiProcessedAt')
+ ) ?>
+ getAdditionalData('ApiProcess') == 'void'): ?>
+ = /* @noEscape */ __(
+ 'The transaction has been canceled on %1',
+ $block->getAdditionalData('ApiProcessedAt')
+ ) ?>
+
+
+ getAdditionalData('NnRefunded')): ?>
+ getAdditionalData('NnRefunded') as $key => $value): ?>
+
+ = /* @noEscape */ __(
+ 'Refund has been initiated for the TID:%1 with the amount %2',
+ $block->novalnetHelper()->makeValidNumber($value['reqtid']),
+ $value['refamount']
+ ) ?>
+
+ = /* @noEscape */ __(
+ 'Refund has been initiated for the TID: %1 with the amount %2. New TID:%3',
+ $block->novalnetHelper()->makeValidNumber($value['reqtid']),
+ $value['refamount'],
+ $block->novalnetHelper()->makeValidNumber($value['reftid'])
+ ) ?>
+
+
+
+
+ getAdditionalData('NnComments')): ?>
+ = /* @noEscape */ $block->getAdditionalData('NnComments') ?>
+
+
+ = /* @noEscape */ __('Error in getting payment method') ?>
+
diff --git a/view/adminhtml/templates/info/Prepayment.phtml b/view/adminhtml/templates/info/Prepayment.phtml
new file mode 100755
index 0000000..ce65a91
--- /dev/null
+++ b/view/adminhtml/templates/info/Prepayment.phtml
@@ -0,0 +1,106 @@
+getInfo();
+$order = $info->getOrder();
+$transactionId = $block->getAdditionalData('NnTid') ? $block->getAdditionalData('NnTid') : $info->getLastTransId();
+$paymentStatus = $block->novalnetHelper()->getStatus($block->getAdditionalData('NnStatus'), $order);
+$totalAmount = ($block->getAdditionalData('NnAmount')) ? $block->getAdditionalData('NnAmount') : $block->getGrandTotal();
+?>
+
+ getAdditionalData('NnTestMode')): ?>
+
+ = /* @noEscape */ __('Test order') ?>
+
+
+ = $block->escapeHtml($block->getMethod()->getTitle()) ?>
+
+
+ = /* @noEscape */ __('Novalnet Transaction ID: '). $transactionId ?>
+
+
+ getAdditionalData('ApiProcess') == 'capture'): ?>
+ = /* @noEscape */ __(
+ 'The transaction has been confirmed successfully for the TID: %1',
+ $transactionId
+ ) ?>
+
+
+ getAdditionalData('dueDateUpdateAt') && $paymentStatus != 'ON_HOLD'): ?>
+ = /* @noEscape */ __(
+ 'The transaction has been updated with amount %1 and due date with %2',
+ $totalAmount,
+ $block->getAdditionalData('NnDueDate')
+ ) ?>
+
+
+ getAdditionalData('ApiProcess') == 'void'): ?>
+ = /* @noEscape */ __(
+ 'The transaction has been canceled on %1',
+ $block->getAdditionalData('ApiProcessedAt')
+ ) ?>
+
+
+ getAdditionalData('NnRefunded')): ?>
+ getAdditionalData('NnRefunded') as $key => $value): ?>
+
+ = /* @noEscape */ __(
+ 'Refund has been initiated for the TID:%1 with the amount %2',
+ $block->novalnetHelper()->makeValidNumber($value['reqtid']),
+ $value['refamount']
+ ) ?>
+
+ = /* @noEscape */ __(
+ 'Refund has been initiated for the TID: %1 with the amount %2. New TID:%3',
+ $block->novalnetHelper()->makeValidNumber($value['reqtid']),
+ $value['refamount'],
+ $block->novalnetHelper()->makeValidNumber($value['reftid'])
+ ) ?>
+
+
+
+
+ getUrl('*/*/*', ['_current' => true])) && !preg_match('/invoice|creditmemo|shipment|callback/i', $block->getUrl('*/*/*', ['_current' => true])) &&
+ (empty($block->getAdditionalData('NnPaid')) || $block->getAdditionalData('NnPaid') != 1)): ?>
+ getAdditionalData('NnInvoiceComments')) && strlen($block->getAdditionalData('NnInvoiceComments'))): ?>
+ = /* @noEscape */ __('Please transfer the amount of %1 to the following account on or before %2', $totalAmount, $block->getAdditionalData('NnDueDate')) ?>
+ getAdditionalData('NnInvoiceComments'))) ? explode('|', $block->getAdditionalData('NnInvoiceComments')) : []; ?>
+
+
+
+
+
+ = /* @noEscape */ __($text) . ': ' . __($referenceTxt) . ' ' . $value ?>
+
+ = /* @noEscape */ __($text) . ': ' . $value ?>
+
+
+
+
+
+ getAdditionalData('NnComments')): ?>
+ = /* @noEscape */ $block->getAdditionalData('NnComments') ?>
+
+
+ = /* @noEscape */ __('Error in getting payment method') ?>
+
diff --git a/view/adminhtml/templates/info/Przelewy.phtml b/view/adminhtml/templates/info/Przelewy.phtml
new file mode 100755
index 0000000..114ecaf
--- /dev/null
+++ b/view/adminhtml/templates/info/Przelewy.phtml
@@ -0,0 +1,63 @@
+getInfo();
+$transactionId = $block->getAdditionalData('NnTid') ? $block->getAdditionalData('NnTid') : $info->getLastTransId();
+?>
+
+ getAdditionalData('NnTestMode')): ?>
+
+ = /* @noEscape */ __('Test order') ?>
+
+
+ = $block->escapeHtml($block->getMethod()->getTitle()) ?>
+
+
+ = /* @noEscape */ __('Novalnet Transaction ID: '). $transactionId ?>
+
+
+ getAdditionalData('NnRefunded')): ?>
+ getAdditionalData('NnRefunded') as $key => $value): ?>
+
+ = /* @noEscape */ __(
+ 'Refund has been initiated for the TID:%1 with the amount %2',
+ $block->novalnetHelper()->makeValidNumber($value['reqtid']),
+ $value['refamount']
+ ) ?>
+
+ = /* @noEscape */ __(
+ 'Refund has been initiated for the TID: %1 with the amount %2. New TID:%3',
+ $block->novalnetHelper()->makeValidNumber($value['reqtid']),
+ $value['refamount'],
+ $block->novalnetHelper()->makeValidNumber($value['reftid'])
+ ) ?>
+
+
+
+
+ getAdditionalData('NnComments')): ?>
+ = /* @noEscape */ $block->getAdditionalData('NnComments') ?>
+
+
+ = /* @noEscape */ __('Error in getting payment method') ?>
+
diff --git a/view/adminhtml/templates/info/Sepa.phtml b/view/adminhtml/templates/info/Sepa.phtml
new file mode 100755
index 0000000..64c8ca4
--- /dev/null
+++ b/view/adminhtml/templates/info/Sepa.phtml
@@ -0,0 +1,97 @@
+getInfo();
+$transactionId = $block->getAdditionalData('NnTid') ? $block->getAdditionalData('NnTid') : $info->getLastTransId();
+$paymentStatus = $block->novalnetHelper()->getStatus($block->getAdditionalData('NnStatus'), $info->getOrder());
+?>
+
+ getAdditionalData('NnTestMode')): ?>
+
+ = /* @noEscape */ __('Test order') ?>
+
+
+ = $block->escapeHtml($block->getMethod()->getTitle()) ?>
+
+
+ = /* @noEscape */ __('Novalnet Transaction ID: '). $transactionId ?>
+
+
+ getAdditionalData('NnGuarantee')) {
+ /* @noEscape */ echo __('This is processed as a guarantee payment') . ' ';
+ if ($paymentStatus == 'PENDING') {
+ /* @noEscape */ echo __('Your order is under verification and we will soon update you with the order status. Please note that this may take upto 24 hours.') . ' ';
+ }
+ }
+ ?>
+
+ getAdditionalData('ApiProcess') == 'capture'): ?>
+ = /* @noEscape */ __(
+ 'The transaction has been confirmed on %1',
+ $block->getAdditionalData('ApiProcessedAt')
+ ) ?>
+ getAdditionalData('ApiProcess') == 'void'): ?>
+ = /* @noEscape */ __(
+ 'The transaction has been canceled on %1',
+ $block->getAdditionalData('ApiProcessedAt')
+ ) ?>
+
+
+ getAdditionalData('NnZeroAmountBooking')): ?>
+ = /* @noEscape */ __('This order processed as a zero amount booking') ?>
+
+ getAdditionalData('NnUpdatedZeroAmount') && $block->getAdditionalData('NnZeroAmountRefTid')): ?>
+ = /* @noEscape */ __(
+ 'Your order has been booked with the amount of %1. Your new TID for the booked amount: %2',
+ $block->getAdditionalData('NnUpdatedZeroAmount'),
+ $block->getAdditionalData('NnZeroAmountRefTid')
+ ) ?>
+
+
+
+ getAdditionalData('NnRefunded')): ?>
+ getAdditionalData('NnRefunded') as $key => $value): ?>
+
+ = /* @noEscape */ __(
+ 'Refund has been initiated for the TID:%1 with the amount %2',
+ $block->novalnetHelper()->makeValidNumber($value['reqtid']),
+ $value['refamount']
+ ) ?>
+
+ = /* @noEscape */ __(
+ 'Refund has been initiated for the TID: %1 with the amount %2. New TID:%3',
+ $block->novalnetHelper()->makeValidNumber($value['reqtid']),
+ $value['refamount'],
+ $block->novalnetHelper()->makeValidNumber($value['reftid'])
+ ) ?>
+
+
+
+
+ getAdditionalData('NnComments')): ?>
+ = /* @noEscape */ $block->getAdditionalData('NnComments') ?>
+
+
+ = /* @noEscape */ __('Error in getting payment method') ?>
+
diff --git a/view/adminhtml/templates/info/SepaGuarantee.phtml b/view/adminhtml/templates/info/SepaGuarantee.phtml
new file mode 100755
index 0000000..7489317
--- /dev/null
+++ b/view/adminhtml/templates/info/SepaGuarantee.phtml
@@ -0,0 +1,81 @@
+getInfo();
+$order = $info->getOrder();
+$transactionId = $block->getAdditionalData('NnTid') ? $block->getAdditionalData('NnTid') : $info->getLastTransId();
+$paymentStatus = $block->novalnetHelper()->getStatus($block->getAdditionalData('NnStatus'), $order);
+?>
+
+ getAdditionalData('NnTestMode')): ?>
+
+ = /* @noEscape */ __('Test order') ?>
+
+
+ = $block->escapeHtml($block->getMethod()->getTitle()) ?>
+
+
+ = /* @noEscape */ __('Novalnet Transaction ID: '). $transactionId ?>
+
+
+
+ = /* @noEscape */ __('Your order is under verification and we will soon update you with the order status. Please note that this may take upto 24 hours.') ?>
+
+
+ getAdditionalData('ApiProcess') == 'capture'): ?>
+ = /* @noEscape */ __(
+ 'The transaction has been confirmed on %1',
+ $block->getAdditionalData('ApiProcessedAt')
+ ) ?>
+ getAdditionalData('ApiProcess') == 'void'): ?>
+ = /* @noEscape */ __(
+ 'The transaction has been canceled on %1',
+ $block->getAdditionalData('ApiProcessedAt')
+ ) ?>
+
+
+ getAdditionalData('NnRefunded')): ?>
+ getAdditionalData('NnRefunded') as $key => $value): ?>
+
+ = /* @noEscape */ __(
+ 'Refund has been initiated for the TID:%1 with the amount %2',
+ $block->novalnetHelper()->makeValidNumber($value['reqtid']),
+ $value['refamount']
+ ) ?>
+
+ = /* @noEscape */ __(
+ 'Refund has been initiated for the TID: %1 with the amount %2. New TID:%3',
+ $block->novalnetHelper()->makeValidNumber($value['reqtid']),
+ $value['refamount'],
+ $block->novalnetHelper()->makeValidNumber($value['reftid'])
+ ) ?>
+
+
+
+
+ getAdditionalData('NnComments')): ?>
+ = /* @noEscape */ $block->getAdditionalData('NnComments') ?>
+
+
+ = /* @noEscape */ __('Error in getting payment method') ?>
+
diff --git a/view/adminhtml/templates/info/SepaInstalment.phtml b/view/adminhtml/templates/info/SepaInstalment.phtml
new file mode 100755
index 0000000..6d28f4d
--- /dev/null
+++ b/view/adminhtml/templates/info/SepaInstalment.phtml
@@ -0,0 +1,87 @@
+getInfo();
+$order = $info->getOrder();
+$transactionId = $block->getAdditionalData('NnTid') ? $block->getAdditionalData('NnTid') : $info->getLastTransId();
+$paymentStatus = $block->novalnetHelper()->getStatus($block->getAdditionalData('NnStatus'), $order);
+?>
+
+ getAdditionalData('NnTestMode')): ?>
+
+ = /* @noEscape */ __('Test order') ?>
+
+
+ = $block->escapeHtml($block->getMethod()->getTitle()) ?>
+
+
+ = /* @noEscape */ __('Novalnet Transaction ID: '). $transactionId ?>
+
+
+
+ = /* @noEscape */ __('Your order is under verification and we will soon update you with the order status. Please note that this may take upto 24 hours.') ?>
+
+
+ getAdditionalData('ApiProcess') == 'capture'): ?>
+ = /* @noEscape */ __(
+ 'The transaction has been confirmed on %1',
+ $block->getAdditionalData('ApiProcessedAt')
+ ) ?>
+ getAdditionalData('ApiProcess') == 'void'): ?>
+ = /* @noEscape */ __(
+ 'The transaction has been canceled on %1',
+ $block->getAdditionalData('ApiProcessedAt')
+ ) ?>
+
+
+ getAdditionalData('InstalmentCancel')): ?>
+ = /* @noEscape */ __(
+ 'Instalment has been cancelled.'
+ ) ?>
+
+
+ getAdditionalData('NnRefunded')): ?>
+ getAdditionalData('NnRefunded') as $key => $value): ?>
+
+ = /* @noEscape */ __(
+ 'Refund has been initiated for the TID:%1 with the amount %2',
+ $block->novalnetHelper()->makeValidNumber($value['reqtid']),
+ $value['refamount']
+ ) ?>
+
+ = /* @noEscape */ __(
+ 'Refund has been initiated for the TID: %1 with the amount %2. New TID:%3',
+ $block->novalnetHelper()->makeValidNumber($value['reqtid']),
+ $value['refamount'],
+ $block->novalnetHelper()->makeValidNumber($value['reftid'])
+ ) ?>
+
+
+
+
+ getAdditionalData('NnComments')): ?>
+ = /* @noEscape */ $block->getAdditionalData('NnComments') ?>
+
+
+ = /* @noEscape */ __('Error in getting payment method') ?>
+
diff --git a/view/adminhtml/templates/info/Trustly.phtml b/view/adminhtml/templates/info/Trustly.phtml
new file mode 100755
index 0000000..75196d9
--- /dev/null
+++ b/view/adminhtml/templates/info/Trustly.phtml
@@ -0,0 +1,63 @@
+getInfo();
+$transactionId = $block->getAdditionalData('NnTid') ? $block->getAdditionalData('NnTid') : $info->getLastTransId();
+?>
+
+ getAdditionalData('NnTestMode')): ?>
+
+ = /* @noEscape */ __('Test order') ?>
+
+
+ = $block->escapeHtml($block->getMethod()->getTitle()) ?>
+
+
+ = /* @noEscape */ __('Novalnet Transaction ID: '). $transactionId ?>
+
+
+ getAdditionalData('NnRefunded')): ?>
+ getAdditionalData('NnRefunded') as $key => $value): ?>
+
+ = /* @noEscape */ __(
+ 'Refund has been initiated for the TID:%1 with the amount %2',
+ $block->novalnetHelper()->makeValidNumber($value['reqtid']),
+ $value['refamount']
+ ) ?>
+
+ = /* @noEscape */ __(
+ 'Refund has been initiated for the TID: %1 with the amount %2. New TID:%3',
+ $block->novalnetHelper()->makeValidNumber($value['reqtid']),
+ $value['refamount'],
+ $block->novalnetHelper()->makeValidNumber($value['reftid'])
+ ) ?>
+
+
+
+
+ getAdditionalData('NnComments')): ?>
+ = /* @noEscape */ $block->getAdditionalData('NnComments') ?>
+
+
+ = /* @noEscape */ __('Error in getting payment method') ?>
+
diff --git a/view/adminhtml/templates/info/Wechatpay.phtml b/view/adminhtml/templates/info/Wechatpay.phtml
new file mode 100755
index 0000000..1b037f8
--- /dev/null
+++ b/view/adminhtml/templates/info/Wechatpay.phtml
@@ -0,0 +1,63 @@
+getInfo();
+$transactionId = $block->getAdditionalData('NnTid') ? $block->getAdditionalData('NnTid') : $info->getLastTransId();
+?>
+
+ getAdditionalData('NnTestMode')): ?>
+
+ = /* @noEscape */ __('Test order') ?>
+
+
+ = $block->escapeHtml($block->getMethod()->getTitle()) ?>
+
+
+ = /* @noEscape */ __('Novalnet Transaction ID: '). $transactionId ?>
+
+
+ getAdditionalData('NnRefunded')): ?>
+ getAdditionalData('NnRefunded') as $key => $value): ?>
+
+ = /* @noEscape */ __(
+ 'Refund has been initiated for the TID:%1 with the amount %2',
+ $block->novalnetHelper()->makeValidNumber($value['reqtid']),
+ $value['refamount']
+ ) ?>
+
+ = /* @noEscape */ __(
+ 'Refund has been initiated for the TID: %1 with the amount %2. New TID:%3',
+ $block->novalnetHelper()->makeValidNumber($value['reqtid']),
+ $value['refamount'],
+ $block->novalnetHelper()->makeValidNumber($value['reftid'])
+ ) ?>
+
+
+
+
+ getAdditionalData('NnComments')): ?>
+ = /* @noEscape */ $block->getAdditionalData('NnComments') ?>
+
+
+ = /* @noEscape */ __('Error in getting payment method') ?>
+
diff --git a/view/adminhtml/templates/payment/vendorConfig.phtml b/view/adminhtml/templates/payment/vendorConfig.phtml
new file mode 100755
index 0000000..ce50e27
--- /dev/null
+++ b/view/adminhtml/templates/payment/vendorConfig.phtml
@@ -0,0 +1,61 @@
+
+getSectionParam() == 'payment'): ?>
+
+
+
+
+
+
+
diff --git a/view/adminhtml/templates/pdf/Alipay.phtml b/view/adminhtml/templates/pdf/Alipay.phtml
new file mode 100755
index 0000000..03a8c78
--- /dev/null
+++ b/view/adminhtml/templates/pdf/Alipay.phtml
@@ -0,0 +1,63 @@
+getInfo();
+$transactionId = $block->getAdditionalData('NnTid') ? $block->getAdditionalData('NnTid') : $info->getLastTransId();
+?>
+
+ getAdditionalData('NnTestMode')): ?>
+
+ = /* @noEscape */ __('Test order') ?>
+
+ {{pdf_row_separator}}
+ = $block->escapeHtml($block->getMethod()->getTitle()) ?>
+{{pdf_row_separator}}
+
+ = /* @noEscape */ __('Novalnet Transaction ID: '). $transactionId ?>
+
+{{pdf_row_separator}}
+ getAdditionalData('NnRefunded')): ?>
+ getAdditionalData('NnRefunded') as $key => $value): ?>
+
+ = /* @noEscape */ __(
+ 'Refund has been initiated for the TID:%1 with the amount %2',
+ $block->novalnetHelper()->makeValidNumber($value['reqtid']),
+ $value['refamount']
+ ) ?>
+
+ = /* @noEscape */ __(
+ 'Refund has been initiated for the TID: %1 with the amount %2. New TID:%3',
+ $block->novalnetHelper()->makeValidNumber($value['reqtid']),
+ $value['refamount'],
+ $block->novalnetHelper()->makeValidNumber($value['reftid'])
+ ) ?>
+
+
+
+{{pdf_row_separator}}
+ getAdditionalData('NnComments')): ?>
+ = /* @noEscape */ $block->getAdditionalData('NnComments') ?>
+
+
+ = /* @noEscape */ __('Error in getting payment method') ?>
+
diff --git a/view/adminhtml/templates/pdf/Applepay.phtml b/view/adminhtml/templates/pdf/Applepay.phtml
new file mode 100755
index 0000000..f1dcb40
--- /dev/null
+++ b/view/adminhtml/templates/pdf/Applepay.phtml
@@ -0,0 +1,75 @@
+getInfo();
+$transactionId = $block->getAdditionalData('NnTid') ? $block->getAdditionalData('NnTid') : $info->getLastTransId();
+?>
+
+ getAdditionalData('NnTestMode')): ?>
+
+ = /* @noEscape */ __('Test order') ?>
+
+ {{pdf_row_separator}}
+ = $block->escapeHtml($block->getMethod()->getTitle()) ?>
+{{pdf_row_separator}}
+
+ = /* @noEscape */ __('Novalnet Transaction ID: '). $transactionId ?>
+
+{{pdf_row_separator}}
+ getAdditionalData('ApiProcess') == 'capture'): ?>
+ = /* @noEscape */ __(
+ 'The transaction has been confirmed on %1',
+ $block->getAdditionalData('ApiProcessedAt')
+ ) ?>
+ getAdditionalData('ApiProcess') == 'void'): ?>
+ = /* @noEscape */ __(
+ 'The transaction has been canceled on %1',
+ $block->getAdditionalData('ApiProcessedAt')
+ ) ?>
+
+{{pdf_row_separator}}
+ getAdditionalData('NnRefunded')): ?>
+ getAdditionalData('NnRefunded') as $key => $value): ?>
+
+ = /* @noEscape */ __(
+ 'Refund has been initiated for the TID:%1 with the amount %2',
+ $block->novalnetHelper()->makeValidNumber($value['reqtid']),
+ $value['refamount']
+ ) ?>
+
+ = /* @noEscape */ __(
+ 'Refund has been initiated for the TID: %1 with the amount %2. New TID:%3',
+ $block->novalnetHelper()->makeValidNumber($value['reqtid']),
+ $value['refamount'],
+ $block->novalnetHelper()->makeValidNumber($value['reftid'])
+ ) ?>
+
+
+
+{{pdf_row_separator}}
+ getAdditionalData('NnComments')): ?>
+ = /* @noEscape */ $block->getAdditionalData('NnComments') ?>
+
+
+ = /* @noEscape */ __('Error in getting payment method') ?>
+
diff --git a/view/adminhtml/templates/pdf/Bancontact.phtml b/view/adminhtml/templates/pdf/Bancontact.phtml
new file mode 100755
index 0000000..f7650e1
--- /dev/null
+++ b/view/adminhtml/templates/pdf/Bancontact.phtml
@@ -0,0 +1,63 @@
+getInfo();
+$transactionId = $block->getAdditionalData('NnTid') ? $block->getAdditionalData('NnTid') : $info->getLastTransId();
+?>
+
+ getAdditionalData('NnTestMode')): ?>
+
+ = /* @noEscape */ __('Test order') ?>
+
+ {{pdf_row_separator}}
+ = $block->escapeHtml($block->getMethod()->getTitle()) ?>
+{{pdf_row_separator}}
+
+ = /* @noEscape */ __('Novalnet Transaction ID: '). $transactionId ?>
+
+{{pdf_row_separator}}
+ getAdditionalData('NnRefunded')): ?>
+ getAdditionalData('NnRefunded') as $key => $value): ?>
+
+ = /* @noEscape */ __(
+ 'Refund has been initiated for the TID:%1 with the amount %2',
+ $block->novalnetHelper()->makeValidNumber($value['reqtid']),
+ $value['refamount']
+ ) ?>
+
+ = /* @noEscape */ __(
+ 'Refund has been initiated for the TID: %1 with the amount %2. New TID:%3',
+ $block->novalnetHelper()->makeValidNumber($value['reqtid']),
+ $value['refamount'],
+ $block->novalnetHelper()->makeValidNumber($value['reftid'])
+ ) ?>
+
+
+
+{{pdf_row_separator}}
+ getAdditionalData('NnComments')): ?>
+ = /* @noEscape */ $block->getAdditionalData('NnComments') ?>
+
+
+ = /* @noEscape */ __('Error in getting payment method') ?>
+
diff --git a/view/adminhtml/templates/pdf/Banktransfer.phtml b/view/adminhtml/templates/pdf/Banktransfer.phtml
new file mode 100755
index 0000000..4dab0e7
--- /dev/null
+++ b/view/adminhtml/templates/pdf/Banktransfer.phtml
@@ -0,0 +1,63 @@
+getInfo();
+$transactionId = $block->getAdditionalData('NnTid') ? $block->getAdditionalData('NnTid') : $info->getLastTransId();
+?>
+
+ getAdditionalData('NnTestMode')): ?>
+
+ = /* @noEscape */ __('Test order') ?>
+
+ {{pdf_row_separator}}
+ = $block->escapeHtml($block->getMethod()->getTitle()) ?>
+{{pdf_row_separator}}
+
+ = /* @noEscape */ __('Novalnet Transaction ID: '). $transactionId ?>
+
+{{pdf_row_separator}}
+ getAdditionalData('NnRefunded')): ?>
+ getAdditionalData('NnRefunded') as $key => $value): ?>
+
+ = /* @noEscape */ __(
+ 'Refund has been initiated for the TID:%1 with the amount %2',
+ $block->novalnetHelper()->makeValidNumber($value['reqtid']),
+ $value['refamount']
+ ) ?>
+
+ = /* @noEscape */ __(
+ 'Refund has been initiated for the TID: %1 with the amount %2. New TID:%3',
+ $block->novalnetHelper()->makeValidNumber($value['reqtid']),
+ $value['refamount'],
+ $block->novalnetHelper()->makeValidNumber($value['reftid'])
+ ) ?>
+
+
+
+{{pdf_row_separator}}
+ getAdditionalData('NnComments')): ?>
+ = /* @noEscape */ $block->getAdditionalData('NnComments') ?>
+
+
+ = /* @noEscape */ __('Error in getting payment method') ?>
+
diff --git a/view/adminhtml/templates/pdf/Blik.phtml b/view/adminhtml/templates/pdf/Blik.phtml
new file mode 100755
index 0000000..85e22a5
--- /dev/null
+++ b/view/adminhtml/templates/pdf/Blik.phtml
@@ -0,0 +1,63 @@
+getInfo();
+$transactionId = $block->getAdditionalData('NnTid') ? $block->getAdditionalData('NnTid') : $info->getLastTransId();
+?>
+
+ getAdditionalData('NnTestMode')): ?>
+
+ = /* @noEscape */ __('Test order') ?>
+
+ {{pdf_row_separator}}
+ = $block->escapeHtml($block->getMethod()->getTitle()) ?>
+{{pdf_row_separator}}
+
+ = /* @noEscape */ __('Novalnet Transaction ID: '). $transactionId ?>
+
+{{pdf_row_separator}}
+ getAdditionalData('NnRefunded')): ?>
+ getAdditionalData('NnRefunded') as $key => $value): ?>
+
+ = /* @noEscape */ __(
+ 'Refund has been initiated for the TID:%1 with the amount %2',
+ $block->novalnetHelper()->makeValidNumber($value['reqtid']),
+ $value['refamount']
+ ) ?>
+
+ = /* @noEscape */ __(
+ 'Refund has been initiated for the TID: %1 with the amount %2. New TID:%3',
+ $block->novalnetHelper()->makeValidNumber($value['reqtid']),
+ $value['refamount'],
+ $block->novalnetHelper()->makeValidNumber($value['reftid'])
+ ) ?>
+
+
+
+{{pdf_row_separator}}
+ getAdditionalData('NnComments')): ?>
+ = /* @noEscape */ $block->getAdditionalData('NnComments') ?>
+
+
+ = /* @noEscape */ __('Error in getting payment method') ?>
+
diff --git a/view/adminhtml/templates/pdf/Cashpayment.phtml b/view/adminhtml/templates/pdf/Cashpayment.phtml
new file mode 100755
index 0000000..73e5df6
--- /dev/null
+++ b/view/adminhtml/templates/pdf/Cashpayment.phtml
@@ -0,0 +1,90 @@
+getInfo();
+$transactionId = $block->getAdditionalData('NnTid') ? $block->getAdditionalData('NnTid') : $info->getLastTransId();
+$totalAmount = ($block->getAdditionalData('NnAmount')) ? $block->getAdditionalData('NnAmount') : $block->getGrandTotal();
+?>
+
+ getAdditionalData('NnTestMode')): ?>
+
+ = /* @noEscape */ __('Test order') ?>
+
+ {{pdf_row_separator}}
+ = $block->escapeHtml($block->getMethod()->getTitle()) ?>
+{{pdf_row_separator}}
+
+ = /* @noEscape */ __('Novalnet Transaction ID: '). $transactionId ?>
+
+{{pdf_row_separator}}
+ getAdditionalData('CpDueDate') && (empty($block->getAdditionalData('NnPaid')) || $block->getAdditionalData('NnPaid') != 1)): ?>
+ = /* @noEscape */ __('Slip expiry date: %1', $block->getAdditionalData('CpDueDate')) ?>
+
+{{pdf_row_separator}}
+ getAdditionalData('dueDateUpdateAt')): ?>
+ = /* @noEscape */ __(
+ 'The transaction has been updated with amount %1 and slip expiry date with %2',
+ $totalAmount,
+ $block->getAdditionalData('CpDueDate')
+ ) ?>
+
+{{pdf_row_separator}}
+ getUrl('*/*/*', ['_current' => true])) && !preg_match('/invoice|creditmemo|shipment|callback/i', $block->getUrl('*/*/*', ['_current' => true])) &&
+ (empty($block->getAdditionalData('NnPaid')) || $block->getAdditionalData('NnPaid') != 1)): ?>
+ getAdditionalData('CashpaymentStores')): ?>
+ = /* @noEscape */ __('Store(s) near you:') ?>
+ getAdditionalData('CashpaymentStores') as $key => $value): ?>
+ = /* @noEscape */ $value['title'] ?>
+ = /* @noEscape */ $value['street'] ?>
+ = /* @noEscape */ $value['city'] ?>
+ = /* @noEscape */ $value['country'] ?>
+ = /* @noEscape */ $value['zipcode'] ?>
+
+
+
+{{pdf_row_separator}}
+ getAdditionalData('NnRefunded')): ?>
+ getAdditionalData('NnRefunded') as $key => $value): ?>
+
+ = /* @noEscape */ __(
+ 'Refund has been initiated for the TID:%1 with the amount %2',
+ $block->novalnetHelper()->makeValidNumber($value['reqtid']),
+ $value['refamount']
+ ) ?>
+
+ = /* @noEscape */ __(
+ 'Refund has been initiated for the TID: %1 with the amount %2. New TID:%3',
+ $block->novalnetHelper()->makeValidNumber($value['reqtid']),
+ $value['refamount'],
+ $block->novalnetHelper()->makeValidNumber($value['reftid'])
+ ) ?>
+
+
+
+{{pdf_row_separator}}
+ getAdditionalData('NnComments')): ?>
+ = /* @noEscape */ $block->getAdditionalData('NnComments') ?>
+
+
+ = /* @noEscape */ __('Error in getting payment method') ?>
+
diff --git a/view/adminhtml/templates/pdf/Cc.phtml b/view/adminhtml/templates/pdf/Cc.phtml
new file mode 100755
index 0000000..55a1eba
--- /dev/null
+++ b/view/adminhtml/templates/pdf/Cc.phtml
@@ -0,0 +1,88 @@
+getInfo();
+$transactionId = $block->getAdditionalData('NnTid') ? $block->getAdditionalData('NnTid') : $info->getLastTransId();
+?>
+
+ getAdditionalData('NnTestMode')): ?>
+
+ = /* @noEscape */ __('Test order') ?>
+
+ {{pdf_row_separator}}
+ = $block->escapeHtml($block->getMethod()->getTitle()) ?>
+{{pdf_row_separator}}
+
+ = /* @noEscape */ __('Novalnet Transaction ID: '). $transactionId ?>
+
+{{pdf_row_separator}}
+ getAdditionalData('ApiProcess') == 'capture'): ?>
+ = /* @noEscape */ __(
+ 'The transaction has been confirmed on %1',
+ $block->getAdditionalData('ApiProcessedAt')
+ ) ?>
+ getAdditionalData('ApiProcess') == 'void'): ?>
+ = /* @noEscape */ __(
+ 'The transaction has been canceled on %1',
+ $block->getAdditionalData('ApiProcessedAt')
+ ) ?>
+
+{{pdf_row_separator}}
+ getAdditionalData('NnZeroAmountBooking')): ?>
+ = /* @noEscape */ __('This order processed as a zero amount booking') ?>
+
+ getAdditionalData('NnUpdatedZeroAmount') && $block->getAdditionalData('NnZeroAmountRefTid')): ?>
+ = /* @noEscape */ __(
+ 'Your order has been booked with the amount of %1. Your new TID for the booked amount: %2',
+ $block->getAdditionalData('NnUpdatedZeroAmount'),
+ $block->getAdditionalData('NnZeroAmountRefTid')
+ ) ?>
+
+
+{{pdf_row_separator}}
+ getAdditionalData('NnRefunded')): ?>
+ getAdditionalData('NnRefunded') as $key => $value): ?>
+
+ = /* @noEscape */ __(
+ 'Refund has been initiated for the TID:%1 with the amount %2',
+ $block->novalnetHelper()->makeValidNumber($value['reqtid']),
+ $value['refamount']
+ ) ?>
+
+ = /* @noEscape */ __(
+ 'Refund has been initiated for the TID: %1 with the amount %2. New TID:%3',
+ $block->novalnetHelper()->makeValidNumber($value['reqtid']),
+ $value['refamount'],
+ $block->novalnetHelper()->makeValidNumber($value['reftid'])
+ ) ?>
+
+
+
+{{pdf_row_separator}}
+
+ getAdditionalData('NnComments')): ?>
+ = /* @noEscape */ $block->getAdditionalData('NnComments') ?>
+
+
+ = /* @noEscape */ __('Error in getting payment method') ?>
+
diff --git a/view/adminhtml/templates/pdf/Eps.phtml b/view/adminhtml/templates/pdf/Eps.phtml
new file mode 100755
index 0000000..2022878
--- /dev/null
+++ b/view/adminhtml/templates/pdf/Eps.phtml
@@ -0,0 +1,63 @@
+getInfo();
+$transactionId = $block->getAdditionalData('NnTid') ? $block->getAdditionalData('NnTid') : $info->getLastTransId();
+?>
+
+ getAdditionalData('NnTestMode')): ?>
+
+ = /* @noEscape */ __('Test order') ?>
+
+ {{pdf_row_separator}}
+ = $block->escapeHtml($block->getMethod()->getTitle()) ?>
+{{pdf_row_separator}}
+
+ = /* @noEscape */ __('Novalnet Transaction ID: '). $transactionId ?>
+
+{{pdf_row_separator}}
+ getAdditionalData('NnRefunded')): ?>
+ getAdditionalData('NnRefunded') as $key => $value): ?>
+
+ = /* @noEscape */ __(
+ 'Refund has been initiated for the TID:%1 with the amount %2',
+ $block->novalnetHelper()->makeValidNumber($value['reqtid']),
+ $value['refamount']
+ ) ?>
+
+ = /* @noEscape */ __(
+ 'Refund has been initiated for the TID: %1 with the amount %2. New TID:%3',
+ $block->novalnetHelper()->makeValidNumber($value['reqtid']),
+ $value['refamount'],
+ $block->novalnetHelper()->makeValidNumber($value['reftid'])
+ ) ?>
+
+
+
+{{pdf_row_separator}}
+ getAdditionalData('NnComments')): ?>
+ = /* @noEscape */ $block->getAdditionalData('NnComments') ?>
+
+
+ = /* @noEscape */ __('Error in getting payment method') ?>
+
diff --git a/view/adminhtml/templates/pdf/Giropay.phtml b/view/adminhtml/templates/pdf/Giropay.phtml
new file mode 100755
index 0000000..49ba81d
--- /dev/null
+++ b/view/adminhtml/templates/pdf/Giropay.phtml
@@ -0,0 +1,63 @@
+getInfo();
+$transactionId = $block->getAdditionalData('NnTid') ? $block->getAdditionalData('NnTid') : $info->getLastTransId();
+?>
+
+ getAdditionalData('NnTestMode')): ?>
+
+ = /* @noEscape */ __('Test order') ?>
+
+ {{pdf_row_separator}}
+ = $block->escapeHtml($block->getMethod()->getTitle()) ?>
+{{pdf_row_separator}}
+
+ = /* @noEscape */ __('Novalnet Transaction ID: '). $transactionId ?>
+
+{{pdf_row_separator}}
+ getAdditionalData('NnRefunded')): ?>
+ getAdditionalData('NnRefunded') as $key => $value): ?>
+
+ = /* @noEscape */ __(
+ 'Refund has been initiated for the TID:%1 with the amount %2',
+ $block->novalnetHelper()->makeValidNumber($value['reqtid']),
+ $value['refamount']
+ ) ?>
+
+ = /* @noEscape */ __(
+ 'Refund has been initiated for the TID: %1 with the amount %2. New TID:%3',
+ $block->novalnetHelper()->makeValidNumber($value['reqtid']),
+ $value['refamount'],
+ $block->novalnetHelper()->makeValidNumber($value['reftid'])
+ ) ?>
+
+
+
+{{pdf_row_separator}}
+ getAdditionalData('NnComments')): ?>
+ = /* @noEscape */ $block->getAdditionalData('NnComments') ?>
+
+
+ = /* @noEscape */ __('Error in getting payment method') ?>
+
diff --git a/view/adminhtml/templates/pdf/Googlepay.phtml b/view/adminhtml/templates/pdf/Googlepay.phtml
new file mode 100755
index 0000000..3b7d0b1
--- /dev/null
+++ b/view/adminhtml/templates/pdf/Googlepay.phtml
@@ -0,0 +1,75 @@
+getInfo();
+$transactionId = $block->getAdditionalData('NnTid') ? $block->getAdditionalData('NnTid') : $info->getLastTransId();
+?>
+
+ getAdditionalData('NnTestMode')): ?>
+
+ = /* @noEscape */ __('Test order') ?>
+
+ {{pdf_row_separator}}
+ = $block->escapeHtml($block->getMethod()->getTitle()) ?>
+{{pdf_row_separator}}
+
+ = /* @noEscape */ __('Novalnet Transaction ID: '). $transactionId ?>
+
+{{pdf_row_separator}}
+ getAdditionalData('ApiProcess') == 'capture'): ?>
+ = /* @noEscape */ __(
+ 'The transaction has been confirmed on %1',
+ $block->getAdditionalData('ApiProcessedAt')
+ ) ?>
+ getAdditionalData('ApiProcess') == 'void'): ?>
+ = /* @noEscape */ __(
+ 'The transaction has been canceled on %1',
+ $block->getAdditionalData('ApiProcessedAt')
+ ) ?>
+
+{{pdf_row_separator}}
+ getAdditionalData('NnRefunded')): ?>
+ getAdditionalData('NnRefunded') as $key => $value): ?>
+
+ = /* @noEscape */ __(
+ 'Refund has been initiated for the TID:%1 with the amount %2',
+ $block->novalnetHelper()->makeValidNumber($value['reqtid']),
+ $value['refamount']
+ ) ?>
+
+ = /* @noEscape */ __(
+ 'Refund has been initiated for the TID: %1 with the amount %2. New TID:%3',
+ $block->novalnetHelper()->makeValidNumber($value['reqtid']),
+ $value['refamount'],
+ $block->novalnetHelper()->makeValidNumber($value['reftid'])
+ ) ?>
+
+
+
+{{pdf_row_separator}}
+ getAdditionalData('NnComments')): ?>
+ = /* @noEscape */ $block->getAdditionalData('NnComments') ?>
+
+
+ = /* @noEscape */ __('Error in getting payment method') ?>
+
diff --git a/view/adminhtml/templates/pdf/Ideal.phtml b/view/adminhtml/templates/pdf/Ideal.phtml
new file mode 100755
index 0000000..fc3b9c2
--- /dev/null
+++ b/view/adminhtml/templates/pdf/Ideal.phtml
@@ -0,0 +1,63 @@
+getInfo();
+$transactionId = $block->getAdditionalData('NnTid') ? $block->getAdditionalData('NnTid') : $info->getLastTransId();
+?>
+
+ getAdditionalData('NnTestMode')): ?>
+
+ = /* @noEscape */ __('Test order') ?>
+
+ {{pdf_row_separator}}
+ = $block->escapeHtml($block->getMethod()->getTitle()) ?>
+{{pdf_row_separator}}
+
+ = /* @noEscape */ __('Novalnet Transaction ID: '). $transactionId ?>
+
+{{pdf_row_separator}}
+ getAdditionalData('NnRefunded')): ?>
+ getAdditionalData('NnRefunded') as $key => $value): ?>
+
+ = /* @noEscape */ __(
+ 'Refund has been initiated for the TID:%1 with the amount %2',
+ $block->novalnetHelper()->makeValidNumber($value['reqtid']),
+ $value['refamount']
+ ) ?>
+
+ = /* @noEscape */ __(
+ 'Refund has been initiated for the TID: %1 with the amount %2. New TID:%3',
+ $block->novalnetHelper()->makeValidNumber($value['reqtid']),
+ $value['refamount'],
+ $block->novalnetHelper()->makeValidNumber($value['reftid'])
+ ) ?>
+
+
+
+{{pdf_row_separator}}
+ getAdditionalData('NnComments')): ?>
+ = /* @noEscape */ $block->getAdditionalData('NnComments') ?>
+
+
+ = /* @noEscape */ __('Error in getting payment method') ?>
+
diff --git a/view/adminhtml/templates/pdf/Invoice.phtml b/view/adminhtml/templates/pdf/Invoice.phtml
new file mode 100755
index 0000000..a14e165
--- /dev/null
+++ b/view/adminhtml/templates/pdf/Invoice.phtml
@@ -0,0 +1,122 @@
+getInfo();
+$order = $info->getOrder();
+$transactionId = $block->getAdditionalData('NnTid') ? $block->getAdditionalData('NnTid') : $info->getLastTransId();
+$paymentStatus = $block->novalnetHelper()->getStatus($block->getAdditionalData('NnStatus'), $order);
+$totalAmount = ($block->getAdditionalData('NnAmount')) ? $block->getAdditionalData('NnAmount') : $block->getGrandTotal();
+?>
+
+ getAdditionalData('NnTestMode')): ?>
+
+ = /* @noEscape */ __('Test order') ?>
+
+ {{pdf_row_separator}}
+ = $block->escapeHtml($block->getMethod()->getTitle()) ?>
+{{pdf_row_separator}}
+
+ = /* @noEscape */ __('Novalnet Transaction ID: '). $transactionId ?>
+
+{{pdf_row_separator}}
+ getAdditionalData('NnGuarantee')) {
+ /* @noEscape */ echo __('This is processed as a guarantee payment') . ' ';
+ if (($paymentStatus == 'PENDING')): ?>
+ = /* @noEscape */ __('Your order is under verification and once confirmed,
+ we will send you our bank details to where the order amount should be transferred.
+ Please note that this may take upto 24 hours.') ?>
+
+{{pdf_row_separator}}
+ getAdditionalData('ApiProcess') == 'capture'): ?>
+ = /* @noEscape */ __(
+ 'The transaction has been confirmed successfully for the TID: %1',
+ $transactionId
+ ) ?>
+
+{{pdf_row_separator}}
+ getAdditionalData('ApiProcess') == 'void'): ?>
+ = /* @noEscape */ __(
+ 'The transaction has been canceled on %1',
+ $block->getAdditionalData('ApiProcessedAt')
+ ) ?>
+
+{{pdf_row_separator}}
+ getAdditionalData('dueDateUpdateAt') && $paymentStatus != 'ON_HOLD'): ?>
+ = /* @noEscape */ __(
+ 'The transaction has been updated with amount %1 and due date with %2',
+ $totalAmount,
+ $block->getAdditionalData('NnDueDate')
+ ) ?>
+
+{{pdf_row_separator}}
+ getAdditionalData('NnRefunded')): ?>
+ getAdditionalData('NnRefunded') as $key => $value): ?>
+
+ = /* @noEscape */ __(
+ 'Refund has been initiated for the TID:%1 with the amount %2',
+ $block->novalnetHelper()->makeValidNumber($value['reqtid']),
+ $value['refamount']
+ ) ?>
+
+ = /* @noEscape */ __(
+ 'Refund has been initiated for the TID: %1 with the amount %2. New TID:%3',
+ $block->novalnetHelper()->makeValidNumber($value['reqtid']),
+ $value['refamount'],
+ $block->novalnetHelper()->makeValidNumber($value['reftid'])
+ ) ?>
+
+
+
+{{pdf_row_separator}}
+ getUrl('*/*/*', ['_current' => true])) && !preg_match('/creditmemo/i', $block->getUrl('*/*/*', ['_current' => true])) && in_array($paymentStatus, ['PENDING', 'ON_HOLD', 'CONFIRMED']) &&
+ (empty($block->getAdditionalData('NnPaid')) || $block->getAdditionalData('NnPaid') != 1) &&
+ (empty($block->getAdditionalData('NnGuarantee')) ||
+ (!empty($block->getAdditionalData('NnGuarantee')) && $paymentStatus != 'PENDING'))): ?>
+ getAdditionalData('NnInvoiceComments')) && strlen($block->getAdditionalData('NnInvoiceComments'))): ?>
+
+ = /* @noEscape */ __('Please transfer the amount of %1 to the following account on or before %2', $totalAmount, $block->getAdditionalData('NnDueDate')) ?>
+
+ = /* @noEscape */ __('Please transfer the amount of %1 to the following account', $totalAmount) ?>
+
+ getAdditionalData('NnInvoiceComments'))) ? explode('|', $block->getAdditionalData('NnInvoiceComments')) : []; ?>
+
+
+
+
+
+ = /* @noEscape */ __($text) . ': ' . __($referenceTxt) . ' ' . $value ?>
+
+ = /* @noEscape */ __($text) . ': ' . $value ?>
+
+
+
+
+{{pdf_row_separator}}
+ getAdditionalData('NnComments')): ?>
+ = /* @noEscape */ $block->getAdditionalData('NnComments') ?>
+
+
+ = /* @noEscape */ __('Error in getting payment method') ?>
+
diff --git a/view/adminhtml/templates/pdf/InvoiceGuarantee.phtml b/view/adminhtml/templates/pdf/InvoiceGuarantee.phtml
new file mode 100755
index 0000000..62d1274
--- /dev/null
+++ b/view/adminhtml/templates/pdf/InvoiceGuarantee.phtml
@@ -0,0 +1,105 @@
+getInfo();
+$order = $info->getOrder();
+$transactionId = $block->getAdditionalData('NnTid') ? $block->getAdditionalData('NnTid') : $info->getLastTransId();
+$paymentStatus = $block->novalnetHelper()->getStatus($block->getAdditionalData('NnStatus'), $order);
+$totalAmount = ($block->getAdditionalData('NnAmount')) ? $block->getAdditionalData('NnAmount') : $block->getGrandTotal();
+?>
+
+ getAdditionalData('NnTestMode')): ?>
+
+ = /* @noEscape */ __('Test order') ?>
+
+ {{pdf_row_separator}}
+ = $block->escapeHtml($block->getMethod()->getTitle()) ?>
+{{pdf_row_separator}}
+
+ = /* @noEscape */ __('Novalnet Transaction ID: '). $transactionId ?>
+
+{{pdf_row_separator}}
+
+ = /* @noEscape */ __('Your order is being verified. Once confirmed, we will send you our bank details to which the order amount should be transferred. Please note that this may take up to 24 hours') ?>
+
+{{pdf_row_separator}}
+ getAdditionalData('ApiProcess') == 'capture'): ?>
+ = /* @noEscape */ __(
+ 'The transaction has been confirmed successfully for the TID: %1',
+ $transactionId
+ ) ?>
+
+{{pdf_row_separator}}
+ getAdditionalData('ApiProcess') == 'void'): ?>
+ = /* @noEscape */ __(
+ 'The transaction has been canceled on %1',
+ $block->getAdditionalData('ApiProcessedAt')
+ ) ?>
+
+{{pdf_row_separator}}
+ getAdditionalData('NnRefunded')): ?>
+ getAdditionalData('NnRefunded') as $key => $value): ?>
+
+ = /* @noEscape */ __(
+ 'Refund has been initiated for the TID:%1 with the amount %2',
+ $block->novalnetHelper()->makeValidNumber($value['reqtid']),
+ $value['refamount']
+ ) ?>
+
+ = /* @noEscape */ __(
+ 'Refund has been initiated for the TID: %1 with the amount %2. New TID:%3',
+ $block->novalnetHelper()->makeValidNumber($value['reqtid']),
+ $value['refamount'],
+ $block->novalnetHelper()->makeValidNumber($value['reftid'])
+ ) ?>
+
+
+
+{{pdf_row_separator}}
+ getUrl('*/*/*', ['_current' => true])) && !preg_match('/creditmemo/i', $block->getUrl('*/*/*', ['_current' => true])) && in_array($paymentStatus, ['ON_HOLD', 'CONFIRMED'])): ?>
+ getAdditionalData('NnInvoiceComments')) && strlen($block->getAdditionalData('NnInvoiceComments'))): ?>
+
+ = /* @noEscape */ __('Please transfer the amount of %1 to the following account on or before %2', $totalAmount, $block->getAdditionalData('NnDueDate')) ?>
+
+ = /* @noEscape */ __('Please transfer the amount of %1 to the following account', $totalAmount) ?>
+
+ getAdditionalData('NnInvoiceComments'))) ? explode('|', $block->getAdditionalData('NnInvoiceComments')) : []; ?>
+
+
+
+
+
+ = /* @noEscape */ __($text) . ': ' . __($referenceTxt) . ' ' . $value ?>
+
+ = /* @noEscape */ __($text) . ': ' . $value ?>
+
+
+
+
+{{pdf_row_separator}}
+ getAdditionalData('NnComments')): ?>
+ = /* @noEscape */ $block->getAdditionalData('NnComments') ?>
+
+
+ = /* @noEscape */ __('Error in getting payment method') ?>
+
diff --git a/view/adminhtml/templates/pdf/InvoiceInstalment.phtml b/view/adminhtml/templates/pdf/InvoiceInstalment.phtml
new file mode 100755
index 0000000..ac84a4d
--- /dev/null
+++ b/view/adminhtml/templates/pdf/InvoiceInstalment.phtml
@@ -0,0 +1,115 @@
+getInfo();
+$order = $info->getOrder();
+$transactionId = $block->getAdditionalData('NnTid') ? $block->getAdditionalData('NnTid') : $info->getLastTransId();
+$paymentStatus = $block->novalnetHelper()->getStatus($block->getAdditionalData('NnStatus'), $order);
+$totalAmount = ($block->getAdditionalData('NnAmount')) ? $block->getAdditionalData('NnAmount') : $block->getGrandTotal();
+?>
+
+ getAdditionalData('NnTestMode')): ?>
+
+ = /* @noEscape */ __('Test order') ?>
+
+ {{pdf_row_separator}}
+ = $block->escapeHtml($block->getMethod()->getTitle()) ?>
+{{pdf_row_separator}}
+
+ = /* @noEscape */ __('Novalnet Transaction ID: '). $transactionId ?>
+
+{{pdf_row_separator}}
+
+ = /* @noEscape */ __('Your order is being verified. Once confirmed, we will send you our bank details to which the order amount should be transferred. Please note that this may take up to 24 hours') ?>
+
+{{pdf_row_separator}}
+ getAdditionalData('ApiProcess') == 'capture'): ?>
+ = /* @noEscape */ __(
+ 'The transaction has been confirmed successfully for the TID: %1',
+ $transactionId
+ ) ?>
+
+{{pdf_row_separator}}
+ getAdditionalData('ApiProcess') == 'void'): ?>
+ = /* @noEscape */ __(
+ 'The transaction has been canceled on %1',
+ $block->getAdditionalData('ApiProcessedAt')
+ ) ?>
+
+{{pdf_row_separator}}
+ getAdditionalData('InstalmentCancel')): ?>
+ = /* @noEscape */ __(
+ 'Instalment has been cancelled.'
+ ) ?>
+
+{{pdf_row_separator}}
+ getAdditionalData('NnRefunded')): ?>
+ getAdditionalData('NnRefunded') as $key => $value): ?>
+
+ = /* @noEscape */ __(
+ 'Refund has been initiated for the TID:%1 with the amount %2',
+ $block->novalnetHelper()->makeValidNumber($value['reqtid']),
+ $value['refamount']
+ ) ?>
+
+ = /* @noEscape */ __(
+ 'Refund has been initiated for the TID: %1 with the amount %2. New TID:%3',
+ $block->novalnetHelper()->makeValidNumber($value['reqtid']),
+ $value['refamount'],
+ $block->novalnetHelper()->makeValidNumber($value['reftid'])
+ ) ?>
+
+
+
+{{pdf_row_separator}}
+ getUrl('*/*/*', ['_current' => true])) && !preg_match('/creditmemo/i', $block->getUrl('*/*/*', ['_current' => true])) && in_array($paymentStatus, ['ON_HOLD', 'CONFIRMED'])): ?>
+ getAdditionalData('NnInvoiceComments')) && strlen($block->getAdditionalData('NnInvoiceComments'))): ?>
+
+ = /* @noEscape */ __('Please transfer the amount of %1 to the following account on or before %2', $totalAmount, $block->getAdditionalData('NnDueDate')) ?>
+
+ = /* @noEscape */ __('Please transfer the amount of %1 to the following account', $totalAmount) ?>
+
+ getAdditionalData('NnInvoiceComments'))) ? explode('|', $block->getAdditionalData('NnInvoiceComments')) : []; ?>
+
+
+
+
+
+
+
+
+
+ = /* @noEscape */ __($text) . ': ' . __($referenceTxt) . ' ' . $value ?>
+
+ = /* @noEscape */ __($text) . ': ' . $value ?>
+
+
+
+
+{{pdf_row_separator}}
+ getAdditionalData('NnComments')): ?>
+ = /* @noEscape */ $block->getAdditionalData('NnComments') ?>
+
+
+ = /* @noEscape */ __('Error in getting payment method') ?>
+
diff --git a/view/adminhtml/templates/pdf/Multibanco.phtml b/view/adminhtml/templates/pdf/Multibanco.phtml
new file mode 100755
index 0000000..1c49276
--- /dev/null
+++ b/view/adminhtml/templates/pdf/Multibanco.phtml
@@ -0,0 +1,49 @@
+getInfo();
+$transactionId = $block->getAdditionalData('NnTid') ? $block->getAdditionalData('NnTid') : $info->getLastTransId();
+?>
+
+ getAdditionalData('NnTestMode')): ?>
+
+ = /* @noEscape */ __('Test order') ?>
+
+ {{pdf_row_separator}}
+ = $block->escapeHtml($block->getMethod()->getTitle()) ?>
+{{pdf_row_separator}}
+
+ = /* @noEscape */ __('Novalnet Transaction ID: '). $transactionId ?>
+
+{{pdf_row_separator}}
+ getAdditionalData('NnPartnerPaymentReference') && (empty($block->getAdditionalData('NnPaid')) || $block->getAdditionalData('NnPaid') != 1)): ?>
+ = /* @noEscape */ __('Please use the following payment reference details to pay the amount of %1 at a Multibanco ATM or through your internet banking.', $block->getGrandTotal()) ?>
+ = /* @noEscape */ __('Partner Payment Reference: %1', $block->getAdditionalData('NnPartnerPaymentReference')) ?>
+
+{{pdf_row_separator}}
+ getAdditionalData('NnComments')): ?>
+ = /* @noEscape */ $block->getAdditionalData('NnComments') ?>
+
+
+ = /* @noEscape */ __('Error in getting payment method') ?>
+
diff --git a/view/adminhtml/templates/pdf/OnlineBanktransfer.phtml b/view/adminhtml/templates/pdf/OnlineBanktransfer.phtml
new file mode 100755
index 0000000..500fbea
--- /dev/null
+++ b/view/adminhtml/templates/pdf/OnlineBanktransfer.phtml
@@ -0,0 +1,63 @@
+getInfo();
+$transactionId = $block->getAdditionalData('NnTid') ? $block->getAdditionalData('NnTid') : $info->getLastTransId();
+?>
+
+ getAdditionalData('NnTestMode')): ?>
+
+ = /* @noEscape */ __('Test order') ?>
+
+ {{pdf_row_separator}}
+ = $block->escapeHtml($block->getMethod()->getTitle()) ?>
+{{pdf_row_separator}}
+
+ = /* @noEscape */ __('Novalnet Transaction ID: '). $transactionId ?>
+
+{{pdf_row_separator}}
+ getAdditionalData('NnRefunded')): ?>
+ getAdditionalData('NnRefunded') as $key => $value): ?>
+
+ = /* @noEscape */ __(
+ 'Refund has been initiated for the TID:%1 with the amount %2',
+ $block->novalnetHelper()->makeValidNumber($value['reqtid']),
+ $value['refamount']
+ ) ?>
+
+ = /* @noEscape */ __(
+ 'Refund has been initiated for the TID: %1 with the amount %2. New TID:%3',
+ $block->novalnetHelper()->makeValidNumber($value['reqtid']),
+ $value['refamount'],
+ $block->novalnetHelper()->makeValidNumber($value['reftid'])
+ ) ?>
+
+
+
+{{pdf_row_separator}}
+ getAdditionalData('NnComments')): ?>
+ = /* @noEscape */ $block->getAdditionalData('NnComments') ?>
+
+
+ = /* @noEscape */ __('Error in getting payment method') ?>
+
diff --git a/view/adminhtml/templates/pdf/Paypal.phtml b/view/adminhtml/templates/pdf/Paypal.phtml
new file mode 100755
index 0000000..f23c3ef
--- /dev/null
+++ b/view/adminhtml/templates/pdf/Paypal.phtml
@@ -0,0 +1,75 @@
+getInfo();
+$transactionId = $block->getAdditionalData('NnTid') ? $block->getAdditionalData('NnTid') : $info->getLastTransId();
+?>
+
+ getAdditionalData('NnTestMode')): ?>
+
+ = /* @noEscape */ __('Test order') ?>
+
+ {{pdf_row_separator}}
+ = $block->escapeHtml($block->getMethod()->getTitle()) ?>
+{{pdf_row_separator}}
+
+ = /* @noEscape */ __('Novalnet Transaction ID: '). $transactionId ?>
+
+{{pdf_row_separator}}
+ getAdditionalData('ApiProcess') == 'capture'): ?>
+ = /* @noEscape */ __(
+ 'The transaction has been confirmed on %1',
+ $block->getAdditionalData('ApiProcessedAt')
+ ) ?>
+ getAdditionalData('ApiProcess') == 'void'): ?>
+ = /* @noEscape */ __(
+ 'The transaction has been canceled on %1',
+ $block->getAdditionalData('ApiProcessedAt')
+ ) ?>
+
+{{pdf_row_separator}}
+ getAdditionalData('NnRefunded')): ?>
+ getAdditionalData('NnRefunded') as $key => $value): ?>
+
+ = /* @noEscape */ __(
+ 'Refund has been initiated for the TID:%1 with the amount %2',
+ $block->novalnetHelper()->makeValidNumber($value['reqtid']),
+ $value['refamount']
+ ) ?>
+
+ = /* @noEscape */ __(
+ 'Refund has been initiated for the TID: %1 with the amount %2. New TID:%3',
+ $block->novalnetHelper()->makeValidNumber($value['reqtid']),
+ $value['refamount'],
+ $block->novalnetHelper()->makeValidNumber($value['reftid'])
+ ) ?>
+
+
+
+{{pdf_row_separator}}
+ getAdditionalData('NnComments')): ?>
+ = /* @noEscape */ $block->getAdditionalData('NnComments') ?>
+
+
+ = /* @noEscape */ __('Error in getting payment method') ?>
+
diff --git a/view/adminhtml/templates/pdf/PostFinance.phtml b/view/adminhtml/templates/pdf/PostFinance.phtml
new file mode 100755
index 0000000..0fd49ae
--- /dev/null
+++ b/view/adminhtml/templates/pdf/PostFinance.phtml
@@ -0,0 +1,75 @@
+getInfo();
+$transactionId = $block->getAdditionalData('NnTid') ? $block->getAdditionalData('NnTid') : $info->getLastTransId();
+?>
+
+ getAdditionalData('NnTestMode')): ?>
+
+ = /* @noEscape */ __('Test order') ?>
+
+ {{pdf_row_separator}}
+ = $block->escapeHtml($block->getMethod()->getTitle()) ?>
+{{pdf_row_separator}}
+
+ = /* @noEscape */ __('Novalnet Transaction ID: '). $transactionId ?>
+
+{{pdf_row_separator}}
+ getAdditionalData('ApiProcess') == 'capture'): ?>
+ = /* @noEscape */ __(
+ 'The transaction has been confirmed on %1',
+ $block->getAdditionalData('ApiProcessedAt')
+ ) ?>
+ getAdditionalData('ApiProcess') == 'void'): ?>
+ = /* @noEscape */ __(
+ 'The transaction has been canceled on %1',
+ $block->getAdditionalData('ApiProcessedAt')
+ ) ?>
+
+{{pdf_row_separator}}
+ getAdditionalData('NnRefunded')): ?>
+ getAdditionalData('NnRefunded') as $key => $value): ?>
+
+ = /* @noEscape */ __(
+ 'Refund has been initiated for the TID:%1 with the amount %2',
+ $block->novalnetHelper()->makeValidNumber($value['reqtid']),
+ $value['refamount']
+ ) ?>
+
+ = /* @noEscape */ __(
+ 'Refund has been initiated for the TID: %1 with the amount %2. New TID:%3',
+ $block->novalnetHelper()->makeValidNumber($value['reqtid']),
+ $value['refamount'],
+ $block->novalnetHelper()->makeValidNumber($value['reftid'])
+ ) ?>
+
+
+
+{{pdf_row_separator}}
+ getAdditionalData('NnComments')): ?>
+ = /* @noEscape */ $block->getAdditionalData('NnComments') ?>
+
+
+ = /* @noEscape */ __('Error in getting payment method') ?>
+
diff --git a/view/adminhtml/templates/pdf/PostFinanceCard.phtml b/view/adminhtml/templates/pdf/PostFinanceCard.phtml
new file mode 100755
index 0000000..ee50112
--- /dev/null
+++ b/view/adminhtml/templates/pdf/PostFinanceCard.phtml
@@ -0,0 +1,75 @@
+getInfo();
+$transactionId = $block->getAdditionalData('NnTid') ? $block->getAdditionalData('NnTid') : $info->getLastTransId();
+?>
+
+ getAdditionalData('NnTestMode')): ?>
+
+ = /* @noEscape */ __('Test order') ?>
+
+ {{pdf_row_separator}}
+ = $block->escapeHtml($block->getMethod()->getTitle()) ?>
+{{pdf_row_separator}}
+
+ = /* @noEscape */ __('Novalnet Transaction ID: '). $transactionId ?>
+
+{{pdf_row_separator}}
+ getAdditionalData('ApiProcess') == 'capture'): ?>
+ = /* @noEscape */ __(
+ 'The transaction has been confirmed on %1',
+ $block->getAdditionalData('ApiProcessedAt')
+ ) ?>
+ getAdditionalData('ApiProcess') == 'void'): ?>
+ = /* @noEscape */ __(
+ 'The transaction has been canceled on %1',
+ $block->getAdditionalData('ApiProcessedAt')
+ ) ?>
+
+{{pdf_row_separator}}
+ getAdditionalData('NnRefunded')): ?>
+ getAdditionalData('NnRefunded') as $key => $value): ?>
+
+ = /* @noEscape */ __(
+ 'Refund has been initiated for the TID:%1 with the amount %2',
+ $block->novalnetHelper()->makeValidNumber($value['reqtid']),
+ $value['refamount']
+ ) ?>
+
+ = /* @noEscape */ __(
+ 'Refund has been initiated for the TID: %1 with the amount %2. New TID:%3',
+ $block->novalnetHelper()->makeValidNumber($value['reqtid']),
+ $value['refamount'],
+ $block->novalnetHelper()->makeValidNumber($value['reftid'])
+ ) ?>
+
+
+
+{{pdf_row_separator}}
+ getAdditionalData('NnComments')): ?>
+ = /* @noEscape */ $block->getAdditionalData('NnComments') ?>
+
+
+ = /* @noEscape */ __('Error in getting payment method') ?>
+
diff --git a/view/adminhtml/templates/pdf/Prepayment.phtml b/view/adminhtml/templates/pdf/Prepayment.phtml
new file mode 100755
index 0000000..49a54b4
--- /dev/null
+++ b/view/adminhtml/templates/pdf/Prepayment.phtml
@@ -0,0 +1,106 @@
+getInfo();
+$order = $info->getOrder();
+$transactionId = $block->getAdditionalData('NnTid') ? $block->getAdditionalData('NnTid') : $info->getLastTransId();
+$paymentStatus = $block->novalnetHelper()->getStatus($block->getAdditionalData('NnStatus'), $order);
+$totalAmount = ($block->getAdditionalData('NnAmount')) ? $block->getAdditionalData('NnAmount') : $block->getGrandTotal();
+?>
+
+ getAdditionalData('NnTestMode')): ?>
+
+ = /* @noEscape */ __('Test order') ?>
+
+ {{pdf_row_separator}}
+ = $block->escapeHtml($block->getMethod()->getTitle()) ?>
+{{pdf_row_separator}}
+
+ = /* @noEscape */ __('Novalnet Transaction ID: '). $transactionId ?>
+
+{{pdf_row_separator}}
+ getAdditionalData('ApiProcess') == 'capture'): ?>
+ = /* @noEscape */ __(
+ 'The transaction has been confirmed successfully for the TID: %1',
+ $transactionId
+ ) ?>
+
+{{pdf_row_separator}}
+ getAdditionalData('dueDateUpdateAt') && $paymentStatus != 'ON_HOLD'): ?>
+ = /* @noEscape */ __(
+ 'The transaction has been updated with amount %1 and due date with %2',
+ $totalAmount,
+ $block->getAdditionalData('NnDueDate')
+ ) ?>
+
+{{pdf_row_separator}}
+ getAdditionalData('ApiProcess') == 'void'): ?>
+ = /* @noEscape */ __(
+ 'The transaction has been canceled on %1',
+ $block->getAdditionalData('ApiProcessedAt')
+ ) ?>
+
+{{pdf_row_separator}}
+ getAdditionalData('NnRefunded')): ?>
+ getAdditionalData('NnRefunded') as $key => $value): ?>
+
+ = /* @noEscape */ __(
+ 'Refund has been initiated for the TID:%1 with the amount %2',
+ $block->novalnetHelper()->makeValidNumber($value['reqtid']),
+ $value['refamount']
+ ) ?>
+
+ = /* @noEscape */ __(
+ 'Refund has been initiated for the TID: %1 with the amount %2. New TID:%3',
+ $block->novalnetHelper()->makeValidNumber($value['reqtid']),
+ $value['refamount'],
+ $block->novalnetHelper()->makeValidNumber($value['reftid'])
+ ) ?>
+
+
+
+{{pdf_row_separator}}
+ getUrl('*/*/*', ['_current' => true])) && !preg_match('/invoice|creditmemo|shipment|callback/i', $block->getUrl('*/*/*', ['_current' => true])) &&
+ (empty($block->getAdditionalData('NnPaid')) || $block->getAdditionalData('NnPaid') != 1)): ?>
+ getAdditionalData('NnInvoiceComments')) && strlen($block->getAdditionalData('NnInvoiceComments'))):?>
+ = /* @noEscape */ __('Please transfer the amount of %1 to the following account on or before %2', $totalAmount, $block->getAdditionalData('NnDueDate')) ?>
+ getAdditionalData('NnInvoiceComments'))) ? explode('|', $block->getAdditionalData('NnInvoiceComments')) : []; ?>
+
+
+
+
+
+ = /* @noEscape */ __($text) . ': ' . __($referenceTxt) . ' ' . $value ?>
+
+ = /* @noEscape */ __($text) . ': ' . $value ?>
+
+
+
+
+{{pdf_row_separator}}
+ getAdditionalData('NnComments')): ?>
+ = /* @noEscape */ $block->getAdditionalData('NnComments') ?>
+
+
+ = /* @noEscape */ __('Error in getting payment method') ?>
+
diff --git a/view/adminhtml/templates/pdf/Przelewy.phtml b/view/adminhtml/templates/pdf/Przelewy.phtml
new file mode 100755
index 0000000..bfeb264
--- /dev/null
+++ b/view/adminhtml/templates/pdf/Przelewy.phtml
@@ -0,0 +1,63 @@
+getInfo();
+$transactionId = $block->getAdditionalData('NnTid') ? $block->getAdditionalData('NnTid') : $info->getLastTransId();
+?>
+
+ getAdditionalData('NnTestMode')): ?>
+
+ = /* @noEscape */ __('Test order') ?>
+
+ {{pdf_row_separator}}
+ = $block->escapeHtml($block->getMethod()->getTitle()) ?>
+{{pdf_row_separator}}
+
+ = /* @noEscape */ __('Novalnet Transaction ID: '). $transactionId ?>
+
+{{pdf_row_separator}}
+ getAdditionalData('NnRefunded')): ?>
+ getAdditionalData('NnRefunded') as $key => $value): ?>
+
+ = /* @noEscape */ __(
+ 'Refund has been initiated for the TID:%1 with the amount %2',
+ $block->novalnetHelper()->makeValidNumber($value['reqtid']),
+ $value['refamount']
+ ) ?>
+
+ = /* @noEscape */ __(
+ 'Refund has been initiated for the TID: %1 with the amount %2. New TID:%3',
+ $block->novalnetHelper()->makeValidNumber($value['reqtid']),
+ $value['refamount'],
+ $block->novalnetHelper()->makeValidNumber($value['reftid'])
+ ) ?>
+
+
+
+{{pdf_row_separator}}
+ getAdditionalData('NnComments')): ?>
+ = /* @noEscape */ $block->getAdditionalData('NnComments') ?>
+
+
+ = /* @noEscape */ __('Error in getting payment method') ?>
+
diff --git a/view/adminhtml/templates/pdf/Sepa.phtml b/view/adminhtml/templates/pdf/Sepa.phtml
new file mode 100755
index 0000000..d9ddb1d
--- /dev/null
+++ b/view/adminhtml/templates/pdf/Sepa.phtml
@@ -0,0 +1,100 @@
+getInfo();
+$transactionId = $block->getAdditionalData('NnTid') ? $block->getAdditionalData('NnTid') : $info->getLastTransId();
+$paymentStatus = $block->novalnetHelper()->getStatus($block->getAdditionalData('NnStatus'), $info->getOrder());
+?>
+
+ getAdditionalData('NnTestMode')): ?>
+
+ = /* @noEscape */ __('Test order') ?>
+
+ {{pdf_row_separator}}
+ = $block->escapeHtml($block->getMethod()->getTitle()) ?>
+{{pdf_row_separator}}
+
+ = /* @noEscape */ __('Novalnet Transaction ID: '). $transactionId ?>
+
+{{pdf_row_separator}}
+ getAdditionalData('NnGuarantee')) {
+ /* @noEscape */ echo __('This is processed as a guarantee payment') . ' ';
+
+ if ($paymentStatus == 'PENDING') {
+ /* @noEscape */ echo __('Your order is under verification and we will soon update you
+ with the order status. Please note that this may take upto 24 hours.') . ' ';
+ }
+ }
+ ?>
+{{pdf_row_separator}}
+ getAdditionalData('ApiProcess') == 'capture'): ?>
+ = /* @noEscape */ __(
+ 'The transaction has been confirmed on %1',
+ $block->getAdditionalData('ApiProcessedAt')
+ ) ?>
+ getAdditionalData('ApiProcess') == 'void'): ?>
+ = /* @noEscape */ __(
+ 'The transaction has been canceled on %1',
+ $block->getAdditionalData('ApiProcessedAt')
+ ) ?>
+
+{{pdf_row_separator}}
+ getAdditionalData('NnZeroAmountBooking')): ?>
+ = /* @noEscape */ __('This order processed as a zero amount booking') ?>
+
+ getAdditionalData('NnUpdatedZeroAmount') && $block->getAdditionalData('NnZeroAmountRefTid')): ?>
+ = /* @noEscape */ __(
+ 'Your order has been booked with the amount of %1. Your new TID for the booked amount: %2',
+ $block->getAdditionalData('NnUpdatedZeroAmount'),
+ $block->getAdditionalData('NnZeroAmountRefTid')
+ ) ?>
+
+
+{{pdf_row_separator}}
+ getAdditionalData('NnRefunded')): ?>
+ getAdditionalData('NnRefunded') as $key => $value): ?>
+
+ = /* @noEscape */ __(
+ 'Refund has been initiated for the TID:%1 with the amount %2',
+ $block->novalnetHelper()->makeValidNumber($value['reqtid']),
+ $value['refamount']
+ ) ?>
+
+ = /* @noEscape */ __(
+ 'Refund has been initiated for the TID: %1 with the amount %2. New TID:%3',
+ $block->novalnetHelper()->makeValidNumber($value['reqtid']),
+ $value['refamount'],
+ $block->novalnetHelper()->makeValidNumber($value['reftid'])
+ ) ?>
+
+
+
+{{pdf_row_separator}}
+
+ getAdditionalData('NnComments')): ?>
+ = /* @noEscape */ $block->getAdditionalData('NnComments') ?>
+
+
+ = /* @noEscape */ __('Error in getting payment method') ?>
+
diff --git a/view/adminhtml/templates/pdf/SepaGuarantee.phtml b/view/adminhtml/templates/pdf/SepaGuarantee.phtml
new file mode 100755
index 0000000..7316e98
--- /dev/null
+++ b/view/adminhtml/templates/pdf/SepaGuarantee.phtml
@@ -0,0 +1,81 @@
+getInfo();
+$order = $info->getOrder();
+$transactionId = $block->getAdditionalData('NnTid') ? $block->getAdditionalData('NnTid') : $info->getLastTransId();
+$paymentStatus = $block->novalnetHelper()->getStatus($block->getAdditionalData('NnStatus'), $order);
+?>
+
+ getAdditionalData('NnTestMode')): ?>
+
+ = /* @noEscape */ __('Test order') ?>
+
+ {{pdf_row_separator}}
+ = $block->escapeHtml($block->getMethod()->getTitle()) ?>
+{{pdf_row_separator}}
+
+ = /* @noEscape */ __('Novalnet Transaction ID: '). $transactionId ?>
+
+{{pdf_row_separator}}
+
+ = /* @noEscape */ __('Your order is under verification and we will soon update you with the order status. Please note that this may take upto 24 hours.') ?>
+
+{{pdf_row_separator}}
+ getAdditionalData('ApiProcess') == 'capture'): ?>
+ = /* @noEscape */ __(
+ 'The transaction has been confirmed on %1',
+ $block->getAdditionalData('ApiProcessedAt')
+ ) ?>
+ getAdditionalData('ApiProcess') == 'void'): ?>
+ = /* @noEscape */ __(
+ 'The transaction has been canceled on %1',
+ $block->getAdditionalData('ApiProcessedAt')
+ ) ?>
+
+{{pdf_row_separator}}
+ getAdditionalData('NnRefunded')): ?>
+ getAdditionalData('NnRefunded') as $key => $value): ?>
+
+ = /* @noEscape */ __(
+ 'Refund has been initiated for the TID:%1 with the amount %2',
+ $block->novalnetHelper()->makeValidNumber($value['reqtid']),
+ $value['refamount']
+ ) ?>
+
+ = /* @noEscape */ __(
+ 'Refund has been initiated for the TID: %1 with the amount %2. New TID:%3',
+ $block->novalnetHelper()->makeValidNumber($value['reqtid']),
+ $value['refamount'],
+ $block->novalnetHelper()->makeValidNumber($value['reftid'])
+ ) ?>
+
+
+
+{{pdf_row_separator}}
+ getAdditionalData('NnComments')): ?>
+ = /* @noEscape */ $block->getAdditionalData('NnComments') ?>
+
+
+ = /* @noEscape */ __('Error in getting payment method') ?>
+
diff --git a/view/adminhtml/templates/pdf/SepaInstalment.phtml b/view/adminhtml/templates/pdf/SepaInstalment.phtml
new file mode 100755
index 0000000..4790d21
--- /dev/null
+++ b/view/adminhtml/templates/pdf/SepaInstalment.phtml
@@ -0,0 +1,87 @@
+getInfo();
+$order = $info->getOrder();
+$transactionId = $block->getAdditionalData('NnTid') ? $block->getAdditionalData('NnTid') : $info->getLastTransId();
+$paymentStatus = $block->novalnetHelper()->getStatus($block->getAdditionalData('NnStatus'), $order);
+?>
+
+ getAdditionalData('NnTestMode')): ?>
+
+ = /* @noEscape */ __('Test order') ?>
+
+ {{pdf_row_separator}}
+ = $block->escapeHtml($block->getMethod()->getTitle()) ?>
+{{pdf_row_separator}}
+
+ = /* @noEscape */ __('Novalnet Transaction ID: '). $transactionId ?>
+
+{{pdf_row_separator}}
+
+ = /* @noEscape */ __('Your order is under verification and we will soon update you with the order status. Please note that this may take upto 24 hours.') ?>
+
+{{pdf_row_separator}}
+ getAdditionalData('ApiProcess') == 'capture'): ?>
+ = /* @noEscape */ __(
+ 'The transaction has been confirmed on %1',
+ $block->getAdditionalData('ApiProcessedAt')
+ ) ?>
+ getAdditionalData('ApiProcess') == 'void'): ?>
+ = /* @noEscape */ __(
+ 'The transaction has been canceled on %1',
+ $block->getAdditionalData('ApiProcessedAt')
+ ) ?>
+
+{{pdf_row_separator}}
+ getAdditionalData('InstalmentCancel')): ?>
+ = /* @noEscape */ __(
+ 'Instalment has been cancelled.'
+ ) ?>
+
+{{pdf_row_separator}}
+ getAdditionalData('NnRefunded')): ?>
+ getAdditionalData('NnRefunded') as $key => $value): ?>
+
+ = /* @noEscape */ __(
+ 'Refund has been initiated for the TID:%1 with the amount %2',
+ $block->novalnetHelper()->makeValidNumber($value['reqtid']),
+ $value['refamount']
+ ) ?>
+
+ = /* @noEscape */ __(
+ 'Refund has been initiated for the TID: %1 with the amount %2. New TID:%3',
+ $block->novalnetHelper()->makeValidNumber($value['reqtid']),
+ $value['refamount'],
+ $block->novalnetHelper()->makeValidNumber($value['reftid'])
+ ) ?>
+
+
+
+{{pdf_row_separator}}
+ getAdditionalData('NnComments')): ?>
+ = /* @noEscape */ $block->getAdditionalData('NnComments') ?>
+
+
+ = /* @noEscape */ __('Error in getting payment method') ?>
+
diff --git a/view/adminhtml/templates/pdf/Trustly.phtml b/view/adminhtml/templates/pdf/Trustly.phtml
new file mode 100755
index 0000000..7b7ddb6
--- /dev/null
+++ b/view/adminhtml/templates/pdf/Trustly.phtml
@@ -0,0 +1,63 @@
+getInfo();
+$transactionId = $block->getAdditionalData('NnTid') ? $block->getAdditionalData('NnTid') : $info->getLastTransId();
+?>
+
+ getAdditionalData('NnTestMode')): ?>
+
+ = /* @noEscape */ __('Test order') ?>
+
+ {{pdf_row_separator}}
+ = $block->escapeHtml($block->getMethod()->getTitle()) ?>
+{{pdf_row_separator}}
+
+ = /* @noEscape */ __('Novalnet Transaction ID: '). $transactionId ?>
+
+{{pdf_row_separator}}
+ getAdditionalData('NnRefunded')): ?>
+ getAdditionalData('NnRefunded') as $key => $value): ?>
+
+ = /* @noEscape */ __(
+ 'Refund has been initiated for the TID:%1 with the amount %2',
+ $block->novalnetHelper()->makeValidNumber($value['reqtid']),
+ $value['refamount']
+ ) ?>
+
+ = /* @noEscape */ __(
+ 'Refund has been initiated for the TID: %1 with the amount %2. New TID:%3',
+ $block->novalnetHelper()->makeValidNumber($value['reqtid']),
+ $value['refamount'],
+ $block->novalnetHelper()->makeValidNumber($value['reftid'])
+ ) ?>
+
+
+
+{{pdf_row_separator}}
+ getAdditionalData('NnComments')): ?>
+ = /* @noEscape */ $block->getAdditionalData('NnComments') ?>
+
+
+ = /* @noEscape */ __('Error in getting payment method') ?>
+
diff --git a/view/adminhtml/templates/pdf/Wechatpay.phtml b/view/adminhtml/templates/pdf/Wechatpay.phtml
new file mode 100755
index 0000000..fe7adb4
--- /dev/null
+++ b/view/adminhtml/templates/pdf/Wechatpay.phtml
@@ -0,0 +1,63 @@
+getInfo();
+$transactionId = $block->getAdditionalData('NnTid') ? $block->getAdditionalData('NnTid') : $info->getLastTransId();
+?>
+
+ getAdditionalData('NnTestMode')): ?>
+
+ = /* @noEscape */ __('Test order') ?>
+
+ {{pdf_row_separator}}
+ = $block->escapeHtml($block->getMethod()->getTitle()) ?>
+{{pdf_row_separator}}
+
+ = /* @noEscape */ __('Novalnet Transaction ID: '). $transactionId ?>
+
+{{pdf_row_separator}}
+ getAdditionalData('NnRefunded')): ?>
+ getAdditionalData('NnRefunded') as $key => $value): ?>
+
+ = /* @noEscape */ __(
+ 'Refund has been initiated for the TID:%1 with the amount %2',
+ $block->novalnetHelper()->makeValidNumber($value['reqtid']),
+ $value['refamount']
+ ) ?>
+
+ = /* @noEscape */ __(
+ 'Refund has been initiated for the TID: %1 with the amount %2. New TID:%3',
+ $block->novalnetHelper()->makeValidNumber($value['reqtid']),
+ $value['refamount'],
+ $block->novalnetHelper()->makeValidNumber($value['reftid'])
+ ) ?>
+
+
+
+{{pdf_row_separator}}
+ getAdditionalData('NnComments')): ?>
+ = /* @noEscape */ $block->getAdditionalData('NnComments') ?>
+
+
+ = /* @noEscape */ __('Error in getting payment method') ?>
+
diff --git a/view/adminhtml/templates/sales/order/view/tab/instalment.phtml b/view/adminhtml/templates/sales/order/view/tab/instalment.phtml
new file mode 100755
index 0000000..85e624f
--- /dev/null
+++ b/view/adminhtml/templates/sales/order/view/tab/instalment.phtml
@@ -0,0 +1,194 @@
+getOrder();
+$customerUrl = $block->getCustomerViewUrl();
+?>
+
+
+
+ = $block->escapeHtml(__('Instalment')) ?>
+
+
+
+
+
+ = $block->escapeHtml(__('Customer details')) ?>
+
+
+
+
+
+
+
+
+ = $block->escapeHtml(__('Instalment Information')) ?>
+
+
+
+
+
+
+
+
+
+ = $block->escapeHtml(__('Instalment Summary')) ?>
+
+
+ getPayment();
+ $tid = $payment->getLastTransId();
+ ?>
+ getAdditionalData('InstalmentCancel')): ?>
+
+
+
+
+
+
diff --git a/view/adminhtml/templates/sales/order/view/tab/zeroamountbooking.phtml b/view/adminhtml/templates/sales/order/view/tab/zeroamountbooking.phtml
new file mode 100755
index 0000000..e7610ca
--- /dev/null
+++ b/view/adminhtml/templates/sales/order/view/tab/zeroamountbooking.phtml
@@ -0,0 +1,57 @@
+getOrder();
+?>
+
+
+
+
+ = $block->escapeHtml(__('Zero amount booking')) ?>
+
+
+
+
diff --git a/view/adminhtml/templates/system/config/form/field/AvailablePayments.phtml b/view/adminhtml/templates/system/config/form/field/AvailablePayments.phtml
new file mode 100755
index 0000000..d3aacab
--- /dev/null
+++ b/view/adminhtml/templates/system/config/form/field/AvailablePayments.phtml
@@ -0,0 +1,30 @@
+
+activateGlobalConfiguration()): ?>
+
+
+
+
+
+
+
diff --git a/view/adminhtml/templates/system/config/form/field/Guaranteeforce.phtml b/view/adminhtml/templates/system/config/form/field/Guaranteeforce.phtml
new file mode 100755
index 0000000..3e55c71
--- /dev/null
+++ b/view/adminhtml/templates/system/config/form/field/Guaranteeforce.phtml
@@ -0,0 +1,57 @@
+
+
diff --git a/view/adminhtml/templates/system/config/form/field/VendorAutoConfig.phtml b/view/adminhtml/templates/system/config/form/field/VendorAutoConfig.phtml
new file mode 100755
index 0000000..d8b778e
--- /dev/null
+++ b/view/adminhtml/templates/system/config/form/field/VendorAutoConfig.phtml
@@ -0,0 +1,185 @@
+
+
+
+
+ getHtmlId() ?>>
+ = $block->escapeHtml($block->getButtonLabel()) ?>
+
+
+
+
diff --git a/view/adminhtml/templates/system/config/form/field/creditcardStyle.phtml b/view/adminhtml/templates/system/config/form/field/creditcardStyle.phtml
new file mode 100755
index 0000000..06db81c
--- /dev/null
+++ b/view/adminhtml/templates/system/config/form/field/creditcardStyle.phtml
@@ -0,0 +1,93 @@
+
+
+
+
+
+ = $block->escapeHtml(__('Custom CSS Settings')) ?>
+
+
+
+
= $block->escapeHtml(__('CSS settings for iframe form')) ?>
+
+
diff --git a/view/adminhtml/web/css/novalnet_payment.css b/view/adminhtml/web/css/novalnet_payment.css
new file mode 100755
index 0000000..af905ce
--- /dev/null
+++ b/view/adminhtml/web/css/novalnet_payment.css
@@ -0,0 +1,145 @@
+.nn-payment-guarantee, .nn-payment-instalment {
+ display: block;
+ position: relative;
+ width: 100%;
+}
+.nn-payment-guarantee .control, .nn-payment-instalment .control {
+ display: block;
+ position: relative;
+ width: 100%;
+}
+.nn-payment-guarantee .control input, .nn-payment-instalment .control input {
+ width: 125px;
+ max-width: 125px;
+}
+.nn-payment-guarantee .control .nn-customer_dob_mm, .nn-payment-instalment .control .nn-customer_dob_mm {
+ width: 125px;
+ max-width: 125px;
+}
+.nn-payment-guarantee .control .autocomplete, .nn-payment-instalment .control .autocomplete {
+ display: inline-block;
+ position: relative;
+ width: 80px;
+ max-width: 80px;
+}
+.nn-payment-guarantee .control .autocomplete-items, .nn-payment-instalment .control .autocomplete-items {
+ display: block;
+ position: absolute;
+ border: 1px solid #d4d4d4;
+ border-bottom: none;
+ border-top: none;
+ z-index: 99;
+ width: 55px;
+}
+.nn-payment-guarantee .control .autocomplete-items div, .nn-payment-instalment .control .autocomplete-items div {
+ padding: 10px;
+ cursor: pointer;
+ background-color: #fff;
+ border-bottom: 1px solid #d4d4d4;
+}
+.admin__payment-method-wrapper {
+ width:100%;
+}
+.novalnet-payment-logo {
+ background: url("../images/novalnet-logo.svg") no-repeat 0 0% / 18rem auto;
+ height: 100px;
+ width: auto;
+ padding-left: 20rem;
+ display:inline-block;
+ vertical-align: middle;
+ }
+.novalnet-section .button-container {
+ float: right;
+}
+.nn-test-drive{
+ position: relative;
+ background-color: #0080c9;
+ color: #fff;
+ padding: 10px 20px;
+ margin-bottom: 8px;
+ font-size: 10px;
+ text-align: center;
+ text-transform: uppercase;
+ letter-spacing: 1px;
+ line-height: 0.8px;
+ border-radius: 0px 0px 5px 5px;
+ transition: transform 0.5s ease 0.5s;
+ animation: novalnet-blinker 4s linear infinite;
+ font-weight: bold;
+ float:right;
+}
+@keyframes novalnet-blinker {
+ 100% {
+ opacity: 0;
+ }
+}
+
+.info-box{
+ position:relative;
+ width: auto;
+ height: auto;
+ background: content-box;
+ font-size: 14px;
+ color: #333;
+ margin: 20px 0px;
+ padding:1em;
+ letter-spacing:1px;
+ border-left: 5px solid #0080c9;
+ box-shadow: 0 0 8px 0px rgba(0,0,0,.4);
+}
+.info-box ul{
+ margin: 0 20px 0px 20px;
+ padding: 0;
+}
+.info-box li{
+ list-style: disc !important;
+}
+.info-box li:before{
+ display:block !important;
+}
+.instalment-details-table tbody tr th, .instalment-details-table tbody tr td {
+ border-top: 1px solid #ccc;
+ border-left: 1px solid #ccc;
+ border-bottom: 1px solid #ccc;
+ border-right: 1px solid #ccc;
+ border: .1rem solid #8a837f;
+ padding: 5px 10px;
+}
+.instalment-details-table thead th {
+ background-color: #514943;
+ border: .1rem solid #8a837f;
+ border-left-color: transparent;
+ color: #fff;
+ font-weight: 600;
+ padding: 5px 10px;
+ text-align: left;
+}
+.instalment-details-table tr {
+ transition: background 0.2s ease-in;
+}
+.instalment-details-table tr:nth-child(even) {
+ background: #f5f5f5;
+}
+.instalment-details-table {
+ margin-bottom: 30px;
+}
+.novalnet-challenge-window-overlay {
+ position: fixed;
+ width: 100%;
+ height: 100% ! important;
+ top: 0;
+ left: 0;
+ right: 0;
+ bottom: 0;
+ background-color: rgba(0,0,0,0.5);
+ z-index: 999;
+ cursor: pointer;
+}
+.novalnet-section.section-config.active > .admin__collapsible-block + input + fieldset {
+ margin-left: 50px;
+}
+.novalnet-section .novalnet-payment-text {
+ display: inline-block;
+ vertical-align: middle;
+ width: 50%;
+}
diff --git a/view/adminhtml/web/js/novalnetCc.js b/view/adminhtml/web/js/novalnetCc.js
new file mode 100755
index 0000000..2390220
--- /dev/null
+++ b/view/adminhtml/web/js/novalnetCc.js
@@ -0,0 +1,222 @@
+/**
+ * Novalnet payment extension
+ *
+ * NOTICE OF LICENSE
+ *
+ * This source file is subject to the Novalnet End User License Agreement
+ * that is bundled with this package in the file LICENSE.txt
+ *
+ * DISCLAIMER
+ *
+ * If you wish to customize Novalnet payment extension for your needs,
+ * please contact technic@novalnet.de for more information.
+ *
+ * @category Novalnet
+ * @package Novalnet_Payment
+ * @copyright Copyright (c) Novalnet AG
+ * @license https://www.novalnet.de/payment-plugins/kostenlos/lizenz
+ */
+define(
+ [
+ "jquery",
+ "Magento_Ui/js/modal/alert",
+ "mage/translate",
+ "jquery/ui",
+ "novalnetUtilityJs"
+ ],
+ function ($, alert, $t) {
+ 'use strict';
+ var nnButton = false;
+
+ $.widget('mage.novalnetCcFormJs', {
+ /**
+ * Returns payment method signature key
+ */
+ initIframe: function () {
+ var paymentCode = this.options.code;
+ var iframeParams = this.options.iframeParams;
+ NovalnetUtility.setClientKey(iframeParams.client_key);
+ var request = {
+ callback: {
+ on_success: function (result) {
+ if (result) {
+ if (result['do_redirect'] != 0) {
+ alert({
+ content: $t('Card type not accepted, try using another card type')
+ });
+ } else {
+ $('#' + paymentCode + '_pan_hash').val(result['hash']);
+ $('#' + paymentCode + '_unique_id').val(result['unique_id']);
+ eval($('#nn_chk_button').val());
+ $('button[onclick="getHash()"]').each(function () {
+ var nnButtonContent = $(this).attr('onclick');
+ $('#nn_chk_button').val(nnButtonContent);
+ this.removeAttribute('onclick');
+ $(this).attr('onclick', 'order.submit()');
+ $(this).trigger('onclick');
+ });
+ }
+ }
+ },
+ on_error: function (result) {
+ alert({
+ content: result['error_message']
+ });
+ },
+ on_show_overlay: function () {
+ $('#novalnet_iframe').addClass("novalnet-challenge-window-overlay");
+ },
+ on_hide_overlay: function () {
+ $('#novalnet_iframe').removeClass("novalnet-challenge-window-overlay");
+ },
+ },
+ iframe: {
+ id: "novalnet_iframe",
+ inline: this.options.inlineForm,
+ style: {
+ container: $('#nn_cc_standard_style_css').val(),
+ input: $('#nn_cc_standard_style_input').val(),
+ label: $('#nn_cc_standard_style_label').val()
+ },
+ text: {
+ lang : iframeParams.lang,
+ error: $t("Your credit card details are invalid"),
+ card_holder : {
+ label: $t("Card holder name"),
+ place_holder: $t("Name on card"),
+ error: $t("Please enter the valid card holder name")
+ },
+ card_number : {
+ label: $t("Card number"),
+ place_holder: $t("XXXX XXXX XXXX XXXX"),
+ error: $t("Please enter the valid card number")
+ },
+ expiry_date : {
+ label: $t("Expiry date"),
+ error: $t("Please enter the valid expiry month / year in the given format")
+ },
+ cvc : {
+ label: $t("CVC/CVV/CID"),
+ place_holder: $t("XXX"),
+ error: $t("Please enter the valid CVC/CVV/CID")
+ }
+ }
+ },
+ customer: {
+ first_name: this.options.billing.firstname,
+ last_name: this.options.billing.lastname,
+ email: this.options.billing.email,
+ billing: {
+ street: this.getStreet(this.options.billing.street),
+ city: this.options.billing.city,
+ zip: this.options.billing.postcode,
+ country_code: this.options.billing.country_id
+ },
+ shipping: this.getShipping(this.options)
+ },
+ transaction: {
+ amount: this.options.amount,
+ currency: this.options.config.currencyCode,
+ test_mode: this.options.config.testmode,
+ enforce_3d: this.options.config.enforce_3d
+ },
+ custom: {
+ lang : iframeParams.lang
+ }
+ };
+ if ($('#novalnet_iframe').length) {
+ NovalnetUtility.createCreditCardForm(request);
+ }
+
+ this.setButtonAttr();
+ },
+
+ setButtonAttr:function () {
+ $('#submit_order_top_button').attr('onclick', 'getHash()');
+ $('.order-totals .actions button').attr('onclick', 'getHash()');
+ if ($('input[name="payment[method]"]:checked').val() === 'novalnetCc') {
+ $('button[onclick="order.submit()"]').each(function () {
+ var nnButtonContent = $(this).attr('onclick');
+ $('#nn_chk_button').val(nnButtonContent);
+ this.removeAttribute('onclick');
+ this.stopObserving('click');
+ $(this).attr('onclick', 'getHash()');
+ });
+ }
+ },
+
+ getShipping:function(options) {
+ if (options.billing.country_id == options.shipping.country_id &&
+ this.getStreet(options.billing.street) == this.getStreet(options.shipping.street) &&
+ options.billing.city == options.shipping.city &&
+ options.billing.postcode == options.shipping.postcode) {
+ var shipping = {same_as_billing: 1};
+ } else {
+ var shipping = {
+ first_name: options.shipping.firstname,
+ last_name: options.shipping.lastname,
+ street: this.getStreet(options.shipping.street),
+ city: options.shipping.city,
+ zip: options.shipping.postcode,
+ country_code: options.shipping.country_id
+ };
+ }
+ return shipping;
+ },
+
+ getStreet: function(streetArray) {
+ var i, street = '';
+ for(i=0; i 57) return false;
+ });
+
+ $(document).on('input', '#novalnetInvoiceGuarantee_dd, #novalnetInvoiceInstalment_dd', function (e) {
+ if (e.keyCode != 8 ) {
+ var min_date = 1;
+ var max_date = 31;
+ var date_val = $(this).val();
+ if (isNaN(date_val) || date_val.length > 1 && date_val < min_date || date_val > max_date) {
+ $(this).val(date_val.substring(0, date_val.length - 1));
+ return false;
+ }
+ }
+ });
+
+ $(document).on('focusout', '#novalnetInvoiceGuarantee_dd, #novalnetInvoiceInstalment_dd', function (e) {
+ var date_val = $(this).val();
+ if (date_val && date_val.length < 2 && date_val < 10) {
+ if (date_val == 0) {
+ date_val = 1;
+ }
+ $(this).val('0' + date_val);
+ }
+ });
+
+ $('#novalnetInvoiceInstalment_cycle').off('change').on('change', function() {
+ var orderTotal = $('#invoiceinstalment_total').val();
+ var currency = $('#invoiceinstalment_currency').val();
+ var cycle = $(this).val();
+ if (cycle == null) {
+ return;
+ }
+ var cycleAmount;
+ var lastCycleAmount;
+ storage.get(
+ $('#invoiceinstalment_cycle_detail_url').val() + orderTotal + '/' + cycle
+ ).done(function (response) {
+ response = $.parseJSON(response);
+ cycleAmount = response.cycle_amount;
+ lastCycleAmount = response.last_cycle;
+ var html = '' + $.mage.__("Instalment cycles") + ' ' + $.mage.__("Instalment Amount") + ' ';
+ var j = 0;
+ for (var i = 1; i <= cycle; i++) {
+ if (i != cycle) {
+ html += ''+ i + ' ' + currency + priceUtils.formatPrice(cycleAmount ) + ' ';
+ } else if (i == cycle) {
+ html += ''+ i + ' ' + currency + priceUtils.formatPrice(lastCycleAmount ) + ' ';
+ }
+ j++;
+ }
+ $('.novalnetInvoiceInstalment-details').html(html);
+ });
+ });
+
+ $('#p_method_novalnetInvoiceInstalment').click(function(){
+ $( "#novalnetInvoiceInstalment_cycle" ).trigger('change');
+ });
+ $(document).ready(function(){
+ $( "#novalnetInvoiceInstalment_cycle" ).trigger('change');
+ });
+
+ function getNumberWithOrdinal(n) {
+ var s=["th","st","nd","rd"],
+ v=n%100;
+ return n+(s[(v-20)%10]||s[v]||s[0]);
+ }
+
+ // Year input listener
+ var current_date = new Date();
+ var max_year = current_date.getFullYear() - 18;
+ var min_year = current_date.getFullYear() - 91;
+ var years_range = [];
+ var yearElement;
+ for(var year = max_year; year >= min_year; year--) {
+ years_range.push(String(year));
+ }
+
+ $(document).on('input', '#novalnetInvoiceGuarantee_yyyy, #novalnetInvoiceInstalment_yyyy', function (e) {
+ yearElement = document.getElementById(e.target.id);
+ var a, b, i, year_val = this.value;
+ closeAllLists();
+ if (!year_val || isNaN(year_val) || year_val.length < 1) {return false;}
+ if (year_val.length == 1) {
+ if (year_val != String(max_year).charAt(0) && year_val != String(min_year).charAt(0)) {
+ $(this).val(year_val.substring(0, year_val.length - 1));
+ }
+ } else if (year_val.length > 1) {
+ var years_string = years_range.join("|");
+ years_string = years_string.slice(0, -(4 - year_val.length));
+ var dots = '.'.repeat((4 - year_val.length));
+ years_string = years_string.replace(new RegExp(dots + '\\|', 'g'), '|');
+ if (!new RegExp(years_string).test(year_val)) {
+ $(this).val(year_val.substring(0, year_val.length - 1));
+ year_val = $(this).val()
+ }
+ }
+
+ if (year_val.length > 1) {
+ a = document.createElement("div");
+ a.setAttribute("id", this.id + "autocomplete-list");
+ a.setAttribute("class", "autocomplete-items");
+ this.parentNode.appendChild(a);
+ for (i = 0; i < years_range.length; i++) {
+ if (years_range[i].substr(0, year_val.length).toUpperCase() == year_val.toUpperCase()) {
+ b = document.createElement("div");
+ b.innerHTML = "" + years_range[i].substr(0, year_val.length) + " ";
+ b.innerHTML += years_range[i].substr(year_val.length);
+ b.innerHTML += " ";
+ b.addEventListener("click", function(e) {
+ yearElement.value = this.getElementsByTagName("input")[0].value;
+ closeAllLists();
+ });
+ a.appendChild(b);
+ }
+ }
+
+ if (!new RegExp(years_string).test(year_val)) {
+ e.preventDefault();
+ e.stopImmediatePropagation();
+ return false;
+ }
+ }
+ });
+
+ function closeAllLists(elmnt) {
+ var x = document.getElementsByClassName("autocomplete-items");
+ for (var i = 0; i < x.length; i++) {
+ if (elmnt != x[i] && elmnt != yearElement) {
+ x[i].parentNode.removeChild(x[i]);
+ }
+ }
+ }
+
+ $(document).on('click', function (e) {
+ closeAllLists(e.target);
+ });
+
+ $('#p_method_novalnetInvoiceGuarantee').ready(function () {
+ if ($('#p_method_novalnetInvoice:visible').length && $('#p_method_novalnetInvoiceGuarantee').length) {
+ $('#p_method_novalnetInvoice').closest('dt').hide();
+ $('#payment_form_novalnetInvoice').hide();
+ }
+ });
+ }
+ });
+
+ return $.mage.novalnetInvoiceFormJs;
+ }
+);
diff --git a/view/adminhtml/web/js/novalnetSepa.js b/view/adminhtml/web/js/novalnetSepa.js
new file mode 100755
index 0000000..bb24818
--- /dev/null
+++ b/view/adminhtml/web/js/novalnetSepa.js
@@ -0,0 +1,237 @@
+/**
+ * Novalnet payment extension
+ *
+ * NOTICE OF LICENSE
+ *
+ * This source file is subject to the Novalnet End User License Agreement
+ * that is bundled with this package in the file LICENSE.txt
+ *
+ * DISCLAIMER
+ *
+ * If you wish to customize Novalnet payment extension for your needs,
+ * please contact technic@novalnet.de for more information.
+ *
+ * @category Novalnet
+ * @package Novalnet_Payment
+ * @copyright Copyright (c) Novalnet AG
+ * @license https://www.novalnet.de/payment-plugins/kostenlos/lizenz
+ */
+define(
+ [
+ "jquery",
+ 'Magento_Catalog/js/price-utils',
+ 'mage/storage',
+ 'mage/url',
+ "jquery/ui",
+ "novalnetUtilityJs"
+ ],
+ function ($, priceUtils, storage, urlBuilder) {
+ 'use strict';
+
+ $.widget('mage.novalnetSepaFormJs', {
+ _create:function () {
+ var self = this;
+
+ $(document).on('keypress', '#novalnetSepaGuarantee_dd, #novalnetSepaInstalment_dd, #novalnetSepaGuarantee_yyyy, #novalnetSepaInstalment_yyyy', function (e) {
+ if(e.charCode < 48 || e.charCode > 57) return false;
+ });
+
+ $(document).on('input', '#novalnetSepaGuarantee_dd, #novalnetSepaInstalment_dd', function (e) {
+ if (e.keyCode != 8 ) {
+ var min_date = 1;
+ var max_date = 31;
+ var date_val = $(this).val();
+ if (isNaN(date_val) || date_val.length > 1 && date_val < min_date || date_val > max_date) {
+ $(this).val(date_val.substring(0, date_val.length - 1));
+ return false;
+ }
+ }
+ });
+
+ $(document).on('focusout', '#novalnetSepaGuarantee_dd, #novalnetSepaInstalment_dd', function (e) {
+ var date_val = $(this).val();
+ if (date_val && date_val.length < 2 && date_val < 10) {
+ if (date_val == 0) {
+ date_val = 1;
+ }
+ $(this).val('0' + date_val);
+ }
+ });
+
+ $('#novalnetSepaInstalment_cycle').off('change').on('change', function() {
+ var orderTotal = $('#sepainstalment_total').val();
+ var currency = $('#sepainstalment_currency').val();
+ var cycle = $(this).val();
+ if (cycle == null) {
+ return;
+ }
+ var cycleAmount;
+ var lastCycleAmount;
+ storage.get(
+ $('#sepaInstalment_cycle_detail_url').val() + orderTotal + '/' + cycle
+ ).done(function (response) {
+ response = $.parseJSON(response);
+ cycleAmount = response.cycle_amount;
+ lastCycleAmount = response.last_cycle;
+ var html = '' + $.mage.__("Instalment cycles") + ' ' + $.mage.__("Instalment Amount") + ' ';
+ var j = 0;
+ for (var i = 1; i <= cycle; i++) {
+ if (i != cycle) {
+ html += ''+ i + ' ' + currency + priceUtils.formatPrice(cycleAmount ) + ' ';
+ } else if (i == cycle) {
+ html += ''+ i + ' ' + currency + priceUtils.formatPrice(lastCycleAmount) + ' ';
+ }
+ j++;
+ }
+ $('.novalnetSepaInstalment-details').html(html);
+ });
+ });
+
+ $('#p_method_novalnetSepaInstalment').click(function(){
+ $( "#novalnetSepaInstalment_cycle" ).trigger('change');
+ });
+ $(document).ready(function(){
+ $( "#novalnetSepaInstalment_cycle" ).trigger('change');
+ });
+
+ function getNumberWithOrdinal(n) {
+ var s=["th","st","nd","rd"],
+ v=n%100;
+ return n+(s[(v-20)%10]||s[v]||s[0]);
+ }
+
+ // Year input listener
+ var current_date = new Date();
+ var max_year = current_date.getFullYear() - 18;
+ var min_year = current_date.getFullYear() - 91;
+ var years_range = [];
+ var yearElement;
+ for(var year = max_year; year >= min_year; year--) {
+ years_range.push(String(year));
+ }
+
+ $(document).on('input', '#novalnetSepaGuarantee_yyyy, #novalnetSepaInstalment_yyyy', function (e) {
+ yearElement = document.getElementById(e.target.id);
+ var a, b, i, year_val = this.value;
+ closeAllLists();
+ if (!year_val || isNaN(year_val) || year_val.length < 1) {return false;}
+ if (year_val.length == 1) {
+ if (year_val != String(max_year).charAt(0) && year_val != String(min_year).charAt(0)) {
+ $(this).val(year_val.substring(0, year_val.length - 1));
+ }
+ } else if (year_val.length > 1) {
+ var years_string = years_range.join("|");
+ years_string = years_string.slice(0, -(4 - year_val.length));
+ var dots = '.'.repeat((4 - year_val.length));
+ years_string = years_string.replace(new RegExp(dots + '\\|', 'g'), '|');
+ if (!new RegExp(years_string).test(year_val)) {
+ $(this).val(year_val.substring(0, year_val.length - 1));
+ year_val = $(this).val()
+ }
+ }
+
+ if (year_val.length > 1) {
+ a = document.createElement("div");
+ a.setAttribute("id", this.id + "autocomplete-list");
+ a.setAttribute("class", "autocomplete-items");
+ this.parentNode.appendChild(a);
+ for (i = 0; i < years_range.length; i++) {
+ if (years_range[i].substr(0, year_val.length).toUpperCase() == year_val.toUpperCase()) {
+ b = document.createElement("div");
+ b.innerHTML = "" + years_range[i].substr(0, year_val.length) + " ";
+ b.innerHTML += years_range[i].substr(year_val.length);
+ b.innerHTML += " ";
+ b.addEventListener("click", function(e) {
+ yearElement.value = this.getElementsByTagName("input")[0].value;
+ closeAllLists();
+ });
+ a.appendChild(b);
+ }
+ }
+
+ if (!new RegExp(years_string).test(year_val)) {
+ e.preventDefault();
+ e.stopImmediatePropagation();
+ return false;
+ }
+ }
+ });
+
+ function closeAllLists(elmnt) {
+ var x = document.getElementsByClassName("autocomplete-items");
+ for (var i = 0; i < x.length; i++) {
+ if (elmnt != x[i] && elmnt != yearElement) {
+ x[i].parentNode.removeChild(x[i]);
+ }
+ }
+ }
+
+ $(document).on('click', function (e) {
+ closeAllLists(e.target);
+ });
+
+ $('#p_method_novalnetSepaGuarantee').ready(function () {
+ if ($('#p_method_novalnetSepa:visible').length && $('#p_method_novalnetSepaGuarantee').length) {
+ $('#p_method_novalnetSepa').closest('dt').hide();
+ $('#payment_form_novalnetSepa').hide();
+ }
+ });
+
+ // check is BIC field required
+ $(document).on(
+ 'keypress onchange keyup',
+ '#novalnetSepa_account_number, #novalnetSepaGuarantee_account_number, #novalnetSepaInstalment_account_number',
+ function(event)
+ {
+ if (this.id == 'novalnetSepa_account_number') {
+ return NovalnetUtility.formatIban(event, 'novalnetSepa_bic_code_div');
+ } else if (this.id == 'novalnetSepaGuarantee_account_number') {
+ return NovalnetUtility.formatIban(event, 'novalnetSepaGuarantee_bic_code_div');
+ } else if (this.id == 'novalnetSepaInstalment_account_number') {
+ return NovalnetUtility.formatIban(event, 'novalnetSepaInstalment_bic_code_div');
+ }
+ });
+
+ // check iban
+ $(document).on(
+ 'keyup',
+ '#novalnetSepa_account_number, #novalnetSepaGuarantee_account_number, #novalnetSepaInstalment_account_number',
+ function(event)
+ {
+ if (this.id == 'novalnetSepa_account_number' || this.id == 'novalnetSepaGuarantee_account_number' || this.id == 'novalnetSepaInstalment_account_number') {
+ var iban = $(this).val(),
+ iban = iban.substring(0,2),
+ iban = iban.toUpperCase(),
+ allowedCountries = NovalnetUtility.bicAllowedCountries;
+
+ if (allowedCountries.includes(iban)) {
+ $('#novalnetSepa_bic_code, #novalnetSepaGuarantee_bic_code, #novalnetSepaInstalment_bic_code').addClass('required-entry');
+ } else {
+ $('#novalnetSepa_bic_code, #novalnetSepaGuarantee_bic_code, #novalnetSepaInstalment_bic_code').removeClass('required-entry');
+ }
+
+ return NovalnetUtility.checkIban(event);
+ }
+ });
+
+ // Format bic code
+ $(document).on(
+ 'keypress change',
+ '#novalnetSepa_bic_code, #novalnetSepaGuarantee_bic_code, #novalnetSepaInstalment_bic_code',
+ function(event)
+ {
+ if (this.id == 'novalnetSepa_bic_code' || this.id == 'novalnetSepaGuarantee_bic_code' || this.id == 'novalnetSepaInstalment_bic_code') {
+ return NovalnetUtility.formatBic(event);
+ }
+ });
+ }
+ });
+
+ $('#sepa_mandate_toggle, #sepa_guarantee_mandate_toggle, #sepa_instalment_mandate_toggle').on('click', function () {
+ var toggleId = this.id.replace('toggle', 'details');
+ $('#' + toggleId).toggle();
+ });
+
+ return $.mage.novalnetSepaFormJs;
+ }
+);
diff --git a/view/base/web/images/novalnet-logo.svg b/view/base/web/images/novalnet-logo.svg
new file mode 100755
index 0000000..55914cd
--- /dev/null
+++ b/view/base/web/images/novalnet-logo.svg
@@ -0,0 +1 @@
+140716_Novalnet_Logos_Corporate - scaled-3
\ No newline at end of file
diff --git a/view/base/web/images/novalnetalipay.png b/view/base/web/images/novalnetalipay.png
new file mode 100755
index 0000000..4df62d2
Binary files /dev/null and b/view/base/web/images/novalnetalipay.png differ
diff --git a/view/base/web/images/novalnetamex.png b/view/base/web/images/novalnetamex.png
new file mode 100755
index 0000000..cfbbba5
Binary files /dev/null and b/view/base/web/images/novalnetamex.png differ
diff --git a/view/base/web/images/novalnetapplepay.png b/view/base/web/images/novalnetapplepay.png
new file mode 100755
index 0000000..1fadf23
Binary files /dev/null and b/view/base/web/images/novalnetapplepay.png differ
diff --git a/view/base/web/images/novalnetbancontact.png b/view/base/web/images/novalnetbancontact.png
new file mode 100755
index 0000000..7d959db
Binary files /dev/null and b/view/base/web/images/novalnetbancontact.png differ
diff --git a/view/base/web/images/novalnetbanktransfer.png b/view/base/web/images/novalnetbanktransfer.png
new file mode 100755
index 0000000..3804437
Binary files /dev/null and b/view/base/web/images/novalnetbanktransfer.png differ
diff --git a/view/base/web/images/novalnetblik.png b/view/base/web/images/novalnetblik.png
new file mode 100644
index 0000000..859b904
Binary files /dev/null and b/view/base/web/images/novalnetblik.png differ
diff --git a/view/base/web/images/novalnetcartasi.png b/view/base/web/images/novalnetcartasi.png
new file mode 100755
index 0000000..8b2cc12
Binary files /dev/null and b/view/base/web/images/novalnetcartasi.png differ
diff --git a/view/base/web/images/novalnetcartebleue.png b/view/base/web/images/novalnetcartebleue.png
new file mode 100755
index 0000000..ffe67f4
Binary files /dev/null and b/view/base/web/images/novalnetcartebleue.png differ
diff --git a/view/base/web/images/novalnetcashpayment.png b/view/base/web/images/novalnetcashpayment.png
new file mode 100755
index 0000000..6319569
Binary files /dev/null and b/view/base/web/images/novalnetcashpayment.png differ
diff --git a/view/base/web/images/novalnetcb.png b/view/base/web/images/novalnetcb.png
new file mode 100755
index 0000000..99bdc09
Binary files /dev/null and b/view/base/web/images/novalnetcb.png differ
diff --git a/view/base/web/images/novalnetdiners.png b/view/base/web/images/novalnetdiners.png
new file mode 100755
index 0000000..d9d4810
Binary files /dev/null and b/view/base/web/images/novalnetdiners.png differ
diff --git a/view/base/web/images/novalnetdiscover.png b/view/base/web/images/novalnetdiscover.png
new file mode 100755
index 0000000..6db9e3c
Binary files /dev/null and b/view/base/web/images/novalnetdiscover.png differ
diff --git a/view/base/web/images/novalneteps.png b/view/base/web/images/novalneteps.png
new file mode 100755
index 0000000..02875ae
Binary files /dev/null and b/view/base/web/images/novalneteps.png differ
diff --git a/view/base/web/images/novalnetgiropay.png b/view/base/web/images/novalnetgiropay.png
new file mode 100755
index 0000000..5bcd509
Binary files /dev/null and b/view/base/web/images/novalnetgiropay.png differ
diff --git a/view/base/web/images/novalnetgooglepay.png b/view/base/web/images/novalnetgooglepay.png
new file mode 100755
index 0000000..7904f33
Binary files /dev/null and b/view/base/web/images/novalnetgooglepay.png differ
diff --git a/view/base/web/images/novalnetideal.png b/view/base/web/images/novalnetideal.png
new file mode 100755
index 0000000..9d08251
Binary files /dev/null and b/view/base/web/images/novalnetideal.png differ
diff --git a/view/base/web/images/novalnetinvoice.png b/view/base/web/images/novalnetinvoice.png
new file mode 100755
index 0000000..e9a4a36
Binary files /dev/null and b/view/base/web/images/novalnetinvoice.png differ
diff --git a/view/base/web/images/novalnetinvoiceguarantee.png b/view/base/web/images/novalnetinvoiceguarantee.png
new file mode 100755
index 0000000..e9a4a36
Binary files /dev/null and b/view/base/web/images/novalnetinvoiceguarantee.png differ
diff --git a/view/base/web/images/novalnetinvoiceinstalment.png b/view/base/web/images/novalnetinvoiceinstalment.png
new file mode 100755
index 0000000..e9a4a36
Binary files /dev/null and b/view/base/web/images/novalnetinvoiceinstalment.png differ
diff --git a/view/base/web/images/novalnetjcb.png b/view/base/web/images/novalnetjcb.png
new file mode 100755
index 0000000..0064100
Binary files /dev/null and b/view/base/web/images/novalnetjcb.png differ
diff --git a/view/base/web/images/novalnetmaestro.png b/view/base/web/images/novalnetmaestro.png
new file mode 100755
index 0000000..26c6386
Binary files /dev/null and b/view/base/web/images/novalnetmaestro.png differ
diff --git a/view/base/web/images/novalnetmastercard.png b/view/base/web/images/novalnetmastercard.png
new file mode 100755
index 0000000..fed2b8e
Binary files /dev/null and b/view/base/web/images/novalnetmastercard.png differ
diff --git a/view/base/web/images/novalnetmultibanco.png b/view/base/web/images/novalnetmultibanco.png
new file mode 100755
index 0000000..f652230
Binary files /dev/null and b/view/base/web/images/novalnetmultibanco.png differ
diff --git a/view/base/web/images/novalnetonlinebanktransfer.png b/view/base/web/images/novalnetonlinebanktransfer.png
new file mode 100755
index 0000000..2856393
Binary files /dev/null and b/view/base/web/images/novalnetonlinebanktransfer.png differ
diff --git a/view/base/web/images/novalnetpaypal.png b/view/base/web/images/novalnetpaypal.png
new file mode 100755
index 0000000..9defac5
Binary files /dev/null and b/view/base/web/images/novalnetpaypal.png differ
diff --git a/view/base/web/images/novalnetpostfinance.png b/view/base/web/images/novalnetpostfinance.png
new file mode 100755
index 0000000..0b34416
Binary files /dev/null and b/view/base/web/images/novalnetpostfinance.png differ
diff --git a/view/base/web/images/novalnetpostfinancecard.png b/view/base/web/images/novalnetpostfinancecard.png
new file mode 100755
index 0000000..e704b07
Binary files /dev/null and b/view/base/web/images/novalnetpostfinancecard.png differ
diff --git a/view/base/web/images/novalnetprepayment.png b/view/base/web/images/novalnetprepayment.png
new file mode 100755
index 0000000..9104281
Binary files /dev/null and b/view/base/web/images/novalnetprepayment.png differ
diff --git a/view/base/web/images/novalnetprzelewy.png b/view/base/web/images/novalnetprzelewy.png
new file mode 100755
index 0000000..331d7b3
Binary files /dev/null and b/view/base/web/images/novalnetprzelewy.png differ
diff --git a/view/base/web/images/novalnetsepa.png b/view/base/web/images/novalnetsepa.png
new file mode 100755
index 0000000..7daf3ca
Binary files /dev/null and b/view/base/web/images/novalnetsepa.png differ
diff --git a/view/base/web/images/novalnetsepaguarantee.png b/view/base/web/images/novalnetsepaguarantee.png
new file mode 100755
index 0000000..7daf3ca
Binary files /dev/null and b/view/base/web/images/novalnetsepaguarantee.png differ
diff --git a/view/base/web/images/novalnetsepainstalment.png b/view/base/web/images/novalnetsepainstalment.png
new file mode 100755
index 0000000..7daf3ca
Binary files /dev/null and b/view/base/web/images/novalnetsepainstalment.png differ
diff --git a/view/base/web/images/novalnettrustly.png b/view/base/web/images/novalnettrustly.png
new file mode 100755
index 0000000..6952d79
Binary files /dev/null and b/view/base/web/images/novalnettrustly.png differ
diff --git a/view/base/web/images/novalnetunionpay.png b/view/base/web/images/novalnetunionpay.png
new file mode 100755
index 0000000..5b8c37c
Binary files /dev/null and b/view/base/web/images/novalnetunionpay.png differ
diff --git a/view/base/web/images/novalnetvisa.png b/view/base/web/images/novalnetvisa.png
new file mode 100755
index 0000000..87b9709
Binary files /dev/null and b/view/base/web/images/novalnetvisa.png differ
diff --git a/view/base/web/images/novalnetwechatpay.png b/view/base/web/images/novalnetwechatpay.png
new file mode 100755
index 0000000..288c959
Binary files /dev/null and b/view/base/web/images/novalnetwechatpay.png differ
diff --git a/view/frontend/email/novalnet_callback_email.html b/view/frontend/email/novalnet_callback_email.html
new file mode 100755
index 0000000..04455d0
--- /dev/null
+++ b/view/frontend/email/novalnet_callback_email.html
@@ -0,0 +1,38 @@
+
+
+
+
+
+
+
+
+ Dear Mr./Ms./Mrs. {{var toName}}
+
+ This email is sent to you ({{var toEmail}}) by {{var fromName}} from {{var fromEmail}}
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/view/frontend/email/novalnet_callback_instalment_email.html b/view/frontend/email/novalnet_callback_instalment_email.html
new file mode 100755
index 0000000..0985df0
--- /dev/null
+++ b/view/frontend/email/novalnet_callback_instalment_email.html
@@ -0,0 +1,40 @@
+
+
+
+{{template config_path="design/email/header_template"}}
+
+
+
+
+ {{trans "%customer_name," customer_name=$customer_name}}
+ {{trans "The next instalment cycle have arrived for the instalment order %orderNo placed at the %store_name, kindly refer further details below." orderNo=$orderNo store_name=$store.getFrontendName()}}
+
+
+
+
+
+
+
+ {{trans "Payment Method"}}
+ {{var payment_html|raw}}
+
+ {{depend sepaPayment}}
+ {{trans "The instalment amount for this cycle %cycleAmount %currency will be debited from your account in one - three business days." cycleAmount=$cycleAmount currency=$currency}}
+ {{/depend}}
+
+
+
+ {{layout handle="sales_email_order_items" order_id=$order_id area="frontend"}}
+
+
+
+
+{{template config_path="design/email/footer_template"}}
diff --git a/view/frontend/layout/catalog_product_view.xml b/view/frontend/layout/catalog_product_view.xml
new file mode 100755
index 0000000..442bc1f
--- /dev/null
+++ b/view/frontend/layout/catalog_product_view.xml
@@ -0,0 +1,34 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/view/frontend/layout/checkout_index_index.xml b/view/frontend/layout/checkout_index_index.xml
new file mode 100755
index 0000000..45b0c5f
--- /dev/null
+++ b/view/frontend/layout/checkout_index_index.xml
@@ -0,0 +1,152 @@
+
+
+
+
+
+
+
+
+
+
+ -
+
-
+
-
+
-
+
-
+
+
-
+
-
+
-
+
- Novalnet_Payment/js/checkout/novalnetGuestCheckout
+ - 1
+ -
+
- Novalnet_Payment/checkout/novalnetGuestCheckout
+
+
+
+
+ -
+
-
+
-
+
-
+
-
+
+
-
+
-
+
- Novalnet_Payment/js/view/payment/novalnet-payment
+ -
+
-
+
- true
+
+ -
+
- false
+
+ -
+
- false
+
+ -
+
- true
+
+ -
+
- true
+
+ -
+
- true
+
+ -
+
- true
+
+ -
+
- true
+
+ -
+
- true
+
+ -
+
- true
+
+ -
+
- true
+
+ -
+
- true
+
+ -
+
- true
+
+ -
+
- true
+
+ -
+
- true
+
+ -
+
- true
+
+ -
+
- true
+
+ -
+
- true
+
+ -
+
- true
+
+ -
+
- true
+
+ -
+
- true
+
+ -
+
- true
+
+ -
+
- true
+
+ -
+
- true
+
+ -
+
- true
+
+ -
+
- true
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/view/frontend/layout/checkout_onepage_failure.xml b/view/frontend/layout/checkout_onepage_failure.xml
new file mode 100755
index 0000000..caf7e88
--- /dev/null
+++ b/view/frontend/layout/checkout_onepage_failure.xml
@@ -0,0 +1,26 @@
+
+
+
+
+
+
+
diff --git a/view/frontend/layout/checkout_onepage_success.xml b/view/frontend/layout/checkout_onepage_success.xml
new file mode 100755
index 0000000..19720c3
--- /dev/null
+++ b/view/frontend/layout/checkout_onepage_success.xml
@@ -0,0 +1,32 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/view/frontend/layout/default.xml b/view/frontend/layout/default.xml
new file mode 100755
index 0000000..146c712
--- /dev/null
+++ b/view/frontend/layout/default.xml
@@ -0,0 +1,26 @@
+
+
+
+
+
+
+
diff --git a/view/frontend/requirejs-config.js b/view/frontend/requirejs-config.js
new file mode 100755
index 0000000..1ee43b2
--- /dev/null
+++ b/view/frontend/requirejs-config.js
@@ -0,0 +1,27 @@
+/**
+ * Novalnet payment extension
+ *
+ * NOTICE OF LICENSE
+ *
+ * This source file is subject to the Novalnet End User License Agreement
+ * that is bundled with this package in the file LICENSE.txt
+ *
+ * DISCLAIMER
+ *
+ * If you wish to customize Novalnet payment extension for your needs,
+ * please contact technic@novalnet.de for more information.
+ *
+ * @category Novalnet
+ * @package Novalnet_Payment
+ * @copyright Copyright (c) Novalnet AG
+ * @license https://www.novalnet.de/payment-plugins/kostenlos/lizenz
+ */
+
+var config = {
+ map: {
+ '*': {
+ 'novalnetUtilityJs': 'https://cdn.novalnet.de/js/v2/NovalnetUtility.js',
+ 'novalnetPaymentJs': 'https://cdn.novalnet.de/js/v3/payment.js'
+ }
+ }
+};
diff --git a/view/frontend/templates/checkout/CartPageShortcut.phtml b/view/frontend/templates/checkout/CartPageShortcut.phtml
new file mode 100755
index 0000000..47004eb
--- /dev/null
+++ b/view/frontend/templates/checkout/CartPageShortcut.phtml
@@ -0,0 +1,47 @@
+isPageEnabledForExpressCheckout('shopping_cart_page');
+?>
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/view/frontend/templates/checkout/MinicartShortcut.phtml b/view/frontend/templates/checkout/MinicartShortcut.phtml
new file mode 100755
index 0000000..8c4e426
--- /dev/null
+++ b/view/frontend/templates/checkout/MinicartShortcut.phtml
@@ -0,0 +1,92 @@
+isPageEnabledForExpressCheckout('mini_cart_page');
+?>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/view/frontend/templates/checkout/ProductPageShortcut.phtml b/view/frontend/templates/checkout/ProductPageShortcut.phtml
new file mode 100755
index 0000000..483f03b
--- /dev/null
+++ b/view/frontend/templates/checkout/ProductPageShortcut.phtml
@@ -0,0 +1,72 @@
+isPageEnabledForExpressCheckout('product_page');
+?>
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/view/frontend/templates/info/Alipay.phtml b/view/frontend/templates/info/Alipay.phtml
new file mode 100755
index 0000000..2a1d3e3
--- /dev/null
+++ b/view/frontend/templates/info/Alipay.phtml
@@ -0,0 +1,63 @@
+getInfo();
+$transactionId = $block->getAdditionalData('NnTid') ? $block->getAdditionalData('NnTid') : $info->getLastTransId();
+?>
+
+ getAdditionalData('NnTestMode')): ?>
+
+ = /* @noEscape */ __('Test order') ?>
+
+
+ = $block->escapeHtml($block->getMethod()->getTitle()) ?>
+
+
+ = /* @noEscape */ __('Novalnet Transaction ID: '). $transactionId ?>
+
+
+ getAdditionalData('NnRefunded')): ?>
+ getAdditionalData('NnRefunded') as $key => $value): ?>
+
+ = /* @noEscape */ __(
+ 'Refund has been initiated for the TID:%1 with the amount %2',
+ $block->novalnetHelper()->makeValidNumber($value['reqtid']),
+ $value['refamount']
+ ) ?>
+
+ = /* @noEscape */ __(
+ 'Refund has been initiated for the TID: %1 with the amount %2. New TID:%3',
+ $block->novalnetHelper()->makeValidNumber($value['reqtid']),
+ $value['refamount'],
+ $block->novalnetHelper()->makeValidNumber($value['reftid'])
+ ) ?>
+
+
+
+
+ getAdditionalData('NnComments')): ?>
+ = /* @noEscape */ $block->getAdditionalData('NnComments') ?>
+
+
+ = /* @noEscape */ __('Error in getting payment method') ?>
+
diff --git a/view/frontend/templates/info/Applepay.phtml b/view/frontend/templates/info/Applepay.phtml
new file mode 100755
index 0000000..e793e96
--- /dev/null
+++ b/view/frontend/templates/info/Applepay.phtml
@@ -0,0 +1,75 @@
+getInfo();
+$transactionId = $block->getAdditionalData('NnTid') ? $block->getAdditionalData('NnTid') : $info->getLastTransId();
+?>
+
+ getAdditionalData('NnTestMode')): ?>
+
+ = /* @noEscape */ __('Test order') ?>
+
+
+ = $block->escapeHtml($block->getMethod()->getTitle()) ?>
+
+
+ = /* @noEscape */ __('Novalnet Transaction ID: '). $transactionId ?>
+
+
+ getAdditionalData('ApiProcess') == 'capture'): ?>
+ = /* @noEscape */ __(
+ 'The transaction has been confirmed on %1',
+ $block->getAdditionalData('ApiProcessedAt')
+ ) ?>
+ getAdditionalData('ApiProcess') == 'void'): ?>
+ = /* @noEscape */ __(
+ 'The transaction has been canceled on %1',
+ $block->getAdditionalData('ApiProcessedAt')
+ ) ?>
+
+
+ getAdditionalData('NnRefunded')): ?>
+ getAdditionalData('NnRefunded') as $key => $value): ?>
+
+ = /* @noEscape */ __(
+ 'Refund has been initiated for the TID:%1 with the amount %2',
+ $block->novalnetHelper()->makeValidNumber($value['reqtid']),
+ $value['refamount']
+ ) ?>
+
+ = /* @noEscape */ __(
+ 'Refund has been initiated for the TID: %1 with the amount %2. New TID:%3',
+ $block->novalnetHelper()->makeValidNumber($value['reqtid']),
+ $value['refamount'],
+ $block->novalnetHelper()->makeValidNumber($value['reftid'])
+ ) ?>
+
+
+
+
+ getAdditionalData('NnComments')): ?>
+ = /* @noEscape */ $block->getAdditionalData('NnComments') ?>
+
+
+ = /* @noEscape */ __('Error in getting payment method') ?>
+
diff --git a/view/frontend/templates/info/Bancontact.phtml b/view/frontend/templates/info/Bancontact.phtml
new file mode 100755
index 0000000..374a42f
--- /dev/null
+++ b/view/frontend/templates/info/Bancontact.phtml
@@ -0,0 +1,63 @@
+getInfo();
+$transactionId = $block->getAdditionalData('NnTid') ? $block->getAdditionalData('NnTid') : $info->getLastTransId();
+?>
+
+ getAdditionalData('NnTestMode')): ?>
+
+ = /* @noEscape */ __('Test order') ?>
+
+
+ = $block->escapeHtml($block->getMethod()->getTitle()) ?>
+
+
+ = /* @noEscape */ __('Novalnet Transaction ID: '). $transactionId ?>
+
+
+ getAdditionalData('NnRefunded')): ?>
+ getAdditionalData('NnRefunded') as $key => $value): ?>
+
+ = /* @noEscape */ __(
+ 'Refund has been initiated for the TID:%1 with the amount %2',
+ $block->novalnetHelper()->makeValidNumber($value['reqtid']),
+ $value['refamount']
+ ) ?>
+
+ = /* @noEscape */ __(
+ 'Refund has been initiated for the TID: %1 with the amount %2. New TID:%3',
+ $block->novalnetHelper()->makeValidNumber($value['reqtid']),
+ $value['refamount'],
+ $block->novalnetHelper()->makeValidNumber($value['reftid'])
+ ) ?>
+
+
+
+
+ getAdditionalData('NnComments')): ?>
+ = /* @noEscape */ $block->getAdditionalData('NnComments') ?>
+
+
+ = /* @noEscape */ __('Error in getting payment method') ?>
+
diff --git a/view/frontend/templates/info/Banktransfer.phtml b/view/frontend/templates/info/Banktransfer.phtml
new file mode 100755
index 0000000..9cd6222
--- /dev/null
+++ b/view/frontend/templates/info/Banktransfer.phtml
@@ -0,0 +1,63 @@
+getInfo();
+$transactionId = $block->getAdditionalData('NnTid') ? $block->getAdditionalData('NnTid') : $info->getLastTransId();
+?>
+
+ getAdditionalData('NnTestMode')): ?>
+
+ = /* @noEscape */ __('Test order') ?>
+
+
+ = $block->escapeHtml($block->getMethod()->getTitle()) ?>
+
+
+ = /* @noEscape */ __('Novalnet Transaction ID: '). $transactionId ?>
+
+
+ getAdditionalData('NnRefunded')): ?>
+ getAdditionalData('NnRefunded') as $key => $value): ?>
+
+ = /* @noEscape */ __(
+ 'Refund has been initiated for the TID:%1 with the amount %2',
+ $block->novalnetHelper()->makeValidNumber($value['reqtid']),
+ $value['refamount']
+ ) ?>
+
+ = /* @noEscape */ __(
+ 'Refund has been initiated for the TID: %1 with the amount %2. New TID:%3',
+ $block->novalnetHelper()->makeValidNumber($value['reqtid']),
+ $value['refamount'],
+ $block->novalnetHelper()->makeValidNumber($value['reftid'])
+ ) ?>
+
+
+
+
+ getAdditionalData('NnComments')): ?>
+ = /* @noEscape */ $block->getAdditionalData('NnComments') ?>
+
+
+ = /* @noEscape */ __('Error in getting payment method') ?>
+
diff --git a/view/frontend/templates/info/Blik.phtml b/view/frontend/templates/info/Blik.phtml
new file mode 100755
index 0000000..86939d4
--- /dev/null
+++ b/view/frontend/templates/info/Blik.phtml
@@ -0,0 +1,63 @@
+getInfo();
+$transactionId = $block->getAdditionalData('NnTid') ? $block->getAdditionalData('NnTid') : $info->getLastTransId();
+?>
+
+ getAdditionalData('NnTestMode')): ?>
+
+ = /* @noEscape */ __('Test order') ?>
+
+
+ = $block->escapeHtml($block->getMethod()->getTitle()) ?>
+
+
+ = /* @noEscape */ __('Novalnet Transaction ID: '). $transactionId ?>
+
+
+ getAdditionalData('NnRefunded')): ?>
+ getAdditionalData('NnRefunded') as $key => $value): ?>
+
+ = /* @noEscape */ __(
+ 'Refund has been initiated for the TID:%1 with the amount %2',
+ $block->novalnetHelper()->makeValidNumber($value['reqtid']),
+ $value['refamount']
+ ) ?>
+
+ = /* @noEscape */ __(
+ 'Refund has been initiated for the TID: %1 with the amount %2. New TID:%3',
+ $block->novalnetHelper()->makeValidNumber($value['reqtid']),
+ $value['refamount'],
+ $block->novalnetHelper()->makeValidNumber($value['reftid'])
+ ) ?>
+
+
+
+
+ getAdditionalData('NnComments')): ?>
+ = /* @noEscape */ $block->getAdditionalData('NnComments') ?>
+
+
+ = /* @noEscape */ __('Error in getting payment method') ?>
+
diff --git a/view/frontend/templates/info/Cashpayment.phtml b/view/frontend/templates/info/Cashpayment.phtml
new file mode 100755
index 0000000..97c73d8
--- /dev/null
+++ b/view/frontend/templates/info/Cashpayment.phtml
@@ -0,0 +1,90 @@
+getInfo();
+$transactionId = $block->getAdditionalData('NnTid') ? $block->getAdditionalData('NnTid') : $info->getLastTransId();
+$totalAmount = ($block->getAdditionalData('NnAmount')) ? $block->getAdditionalData('NnAmount') : $block->getGrandTotal();
+?>
+
+ getAdditionalData('NnTestMode')): ?>
+
+ = /* @noEscape */ __('Test order') ?>
+
+
+ = $block->escapeHtml($block->getMethod()->getTitle()) ?>
+
+
+ = /* @noEscape */ __('Novalnet Transaction ID: '). $transactionId ?>
+
+
+ getAdditionalData('CpDueDate') && (empty($block->getAdditionalData('NnPaid')) || $block->getAdditionalData('NnPaid') != 1)): ?>
+ = /* @noEscape */ __('Slip expiry date: %1', $block->getAdditionalData('CpDueDate')) ?>
+
+
+ getAdditionalData('dueDateUpdateAt')): ?>
+ = /* @noEscape */ __(
+ 'The transaction has been updated with amount %1 and slip expiry date with %2',
+ $totalAmount,
+ $block->getAdditionalData('CpDueDate')
+ ) ?>
+
+
+ getUrl('*/*/*', ['_current' => true])) && !preg_match('/invoice|creditmemo|shipment|callback/i', $block->getUrl('*/*/*', ['_current' => true])) &&
+ (empty($block->getAdditionalData('NnPaid')) || $block->getAdditionalData('NnPaid') != 1)): ?>
+ getAdditionalData('CashpaymentStores')): ?>
+ = /* @noEscape */ __('Store(s) near you:') ?>
+ getAdditionalData('CashpaymentStores') as $key => $value): ?>
+ = /* @noEscape */ $value['title'] ?>
+ = /* @noEscape */ $value['street'] ?>
+ = /* @noEscape */ $value['city'] ?>
+ = /* @noEscape */ $value['country'] ?>
+ = /* @noEscape */ $value['zipcode'] ?>
+
+
+
+
+ getAdditionalData('NnRefunded')): ?>
+ getAdditionalData('NnRefunded') as $key => $value): ?>
+
+ = /* @noEscape */ __(
+ 'Refund has been initiated for the TID:%1 with the amount %2',
+ $block->novalnetHelper()->makeValidNumber($value['reqtid']),
+ $value['refamount']
+ ) ?>
+
+ = /* @noEscape */ __(
+ 'Refund has been initiated for the TID: %1 with the amount %2. New TID:%3',
+ $block->novalnetHelper()->makeValidNumber($value['reqtid']),
+ $value['refamount'],
+ $block->novalnetHelper()->makeValidNumber($value['reftid'])
+ ) ?>
+
+
+
+
+ getAdditionalData('NnComments')): ?>
+ = /* @noEscape */ $block->getAdditionalData('NnComments') ?>
+
+
+ = /* @noEscape */ __('Error in getting payment method') ?>
+
diff --git a/view/frontend/templates/info/Cc.phtml b/view/frontend/templates/info/Cc.phtml
new file mode 100755
index 0000000..e793b4f
--- /dev/null
+++ b/view/frontend/templates/info/Cc.phtml
@@ -0,0 +1,87 @@
+getInfo();
+$transactionId = $block->getAdditionalData('NnTid') ? $block->getAdditionalData('NnTid') : $info->getLastTransId();
+?>
+
+ getAdditionalData('NnTestMode')): ?>
+
+ = /* @noEscape */ __('Test order') ?>
+
+
+ = $block->escapeHtml($block->getMethod()->getTitle()) ?>
+
+
+ = /* @noEscape */ __('Novalnet Transaction ID: '). $transactionId ?>
+
+
+ getAdditionalData('ApiProcess') == 'capture'): ?>
+ = /* @noEscape */ __(
+ 'The transaction has been confirmed on %1',
+ $block->getAdditionalData('ApiProcessedAt')
+ ) ?>
+ getAdditionalData('ApiProcess') == 'void'): ?>
+ = /* @noEscape */ __(
+ 'The transaction has been canceled on %1',
+ $block->getAdditionalData('ApiProcessedAt')
+ ) ?>
+
+
+ getAdditionalData('NnZeroAmountBooking')): ?>
+ = /* @noEscape */ __('This order processed as a zero amount booking') ?>
+
+ getAdditionalData('NnUpdatedZeroAmount') && $block->getAdditionalData('NnZeroAmountRefTid')): ?>
+ = /* @noEscape */ __(
+ 'Your order has been booked with the amount of %1. Your new TID for the booked amount: %2',
+ $block->getAdditionalData('NnUpdatedZeroAmount'),
+ $block->getAdditionalData('NnZeroAmountRefTid')
+ ) ?>
+
+
+
+ getAdditionalData('NnRefunded')): ?>
+ getAdditionalData('NnRefunded') as $key => $value): ?>
+
+ = /* @noEscape */ __(
+ 'Refund has been initiated for the TID:%1 with the amount %2',
+ $block->novalnetHelper()->makeValidNumber($value['reqtid']),
+ $value['refamount']
+ ) ?>
+
+ = /* @noEscape */ __(
+ 'Refund has been initiated for the TID: %1 with the amount %2. New TID:%3',
+ $block->novalnetHelper()->makeValidNumber($value['reqtid']),
+ $value['refamount'],
+ $block->novalnetHelper()->makeValidNumber($value['reftid'])
+ ) ?>
+
+
+
+
+ getAdditionalData('NnComments')): ?>
+ = /* @noEscape */ $block->getAdditionalData('NnComments') ?>
+
+
+ = /* @noEscape */ __('Error in getting payment method') ?>
+
diff --git a/view/frontend/templates/info/Eps.phtml b/view/frontend/templates/info/Eps.phtml
new file mode 100755
index 0000000..cc52423
--- /dev/null
+++ b/view/frontend/templates/info/Eps.phtml
@@ -0,0 +1,63 @@
+getInfo();
+$transactionId = $block->getAdditionalData('NnTid') ? $block->getAdditionalData('NnTid') : $info->getLastTransId();
+?>
+
+ getAdditionalData('NnTestMode')): ?>
+
+ = /* @noEscape */ __('Test order') ?>
+
+
+ = $block->escapeHtml($block->getMethod()->getTitle()) ?>
+
+
+ = /* @noEscape */ __('Novalnet Transaction ID: '). $transactionId ?>
+
+
+ getAdditionalData('NnRefunded')): ?>
+ getAdditionalData('NnRefunded') as $key => $value): ?>
+
+ = /* @noEscape */ __(
+ 'Refund has been initiated for the TID:%1 with the amount %2',
+ $block->novalnetHelper()->makeValidNumber($value['reqtid']),
+ $value['refamount']
+ ) ?>
+
+ = /* @noEscape */ __(
+ 'Refund has been initiated for the TID: %1 with the amount %2. New TID:%3',
+ $block->novalnetHelper()->makeValidNumber($value['reqtid']),
+ $value['refamount'],
+ $block->novalnetHelper()->makeValidNumber($value['reftid'])
+ ) ?>
+
+
+
+
+ getAdditionalData('NnComments')): ?>
+ = /* @noEscape */ $block->getAdditionalData('NnComments') ?>
+
+
+ = /* @noEscape */ __('Error in getting payment method') ?>
+
diff --git a/view/frontend/templates/info/Giropay.phtml b/view/frontend/templates/info/Giropay.phtml
new file mode 100755
index 0000000..04d4237
--- /dev/null
+++ b/view/frontend/templates/info/Giropay.phtml
@@ -0,0 +1,63 @@
+getInfo();
+$transactionId = $block->getAdditionalData('NnTid') ? $block->getAdditionalData('NnTid') : $info->getLastTransId();
+?>
+
+ getAdditionalData('NnTestMode')): ?>
+
+ = /* @noEscape */ __('Test order') ?>
+
+
+ = $block->escapeHtml($block->getMethod()->getTitle()) ?>
+
+
+ = /* @noEscape */ __('Novalnet Transaction ID: '). $transactionId ?>
+
+
+ getAdditionalData('NnRefunded')): ?>
+ getAdditionalData('NnRefunded') as $key => $value): ?>
+
+ = /* @noEscape */ __(
+ 'Refund has been initiated for the TID:%1 with the amount %2',
+ $block->novalnetHelper()->makeValidNumber($value['reqtid']),
+ $value['refamount']
+ ) ?>
+
+ = /* @noEscape */ __(
+ 'Refund has been initiated for the TID: %1 with the amount %2. New TID:%3',
+ $block->novalnetHelper()->makeValidNumber($value['reqtid']),
+ $value['refamount'],
+ $block->novalnetHelper()->makeValidNumber($value['reftid'])
+ ) ?>
+
+
+
+
+ getAdditionalData('NnComments')): ?>
+ = /* @noEscape */ $block->getAdditionalData('NnComments') ?>
+
+
+ = /* @noEscape */ __('Error in getting payment method') ?>
+
diff --git a/view/frontend/templates/info/Googlepay.phtml b/view/frontend/templates/info/Googlepay.phtml
new file mode 100755
index 0000000..4827038
--- /dev/null
+++ b/view/frontend/templates/info/Googlepay.phtml
@@ -0,0 +1,75 @@
+getInfo();
+$transactionId = $block->getAdditionalData('NnTid') ? $block->getAdditionalData('NnTid') : $info->getLastTransId();
+?>
+
+ getAdditionalData('NnTestMode')): ?>
+
+ = /* @noEscape */ __('Test order') ?>
+
+
+ = $block->escapeHtml($block->getMethod()->getTitle()) ?>
+
+
+ = /* @noEscape */ __('Novalnet Transaction ID: '). $transactionId ?>
+
+
+ getAdditionalData('ApiProcess') == 'capture'): ?>
+ = /* @noEscape */ __(
+ 'The transaction has been confirmed on %1',
+ $block->getAdditionalData('ApiProcessedAt')
+ ) ?>
+ getAdditionalData('ApiProcess') == 'void'): ?>
+ = /* @noEscape */ __(
+ 'The transaction has been canceled on %1',
+ $block->getAdditionalData('ApiProcessedAt')
+ ) ?>
+
+
+ getAdditionalData('NnRefunded')): ?>
+ getAdditionalData('NnRefunded') as $key => $value): ?>
+
+ = /* @noEscape */ __(
+ 'Refund has been initiated for the TID:%1 with the amount %2',
+ $block->novalnetHelper()->makeValidNumber($value['reqtid']),
+ $value['refamount']
+ ) ?>
+
+ = /* @noEscape */ __(
+ 'Refund has been initiated for the TID: %1 with the amount %2. New TID:%3',
+ $block->novalnetHelper()->makeValidNumber($value['reqtid']),
+ $value['refamount'],
+ $block->novalnetHelper()->makeValidNumber($value['reftid'])
+ ) ?>
+
+
+
+
+ getAdditionalData('NnComments')): ?>
+ = /* @noEscape */ $block->getAdditionalData('NnComments') ?>
+
+
+ = /* @noEscape */ __('Error in getting payment method') ?>
+
diff --git a/view/frontend/templates/info/Ideal.phtml b/view/frontend/templates/info/Ideal.phtml
new file mode 100755
index 0000000..362d902
--- /dev/null
+++ b/view/frontend/templates/info/Ideal.phtml
@@ -0,0 +1,63 @@
+getInfo();
+$transactionId = $block->getAdditionalData('NnTid') ? $block->getAdditionalData('NnTid') : $info->getLastTransId();
+?>
+
+ getAdditionalData('NnTestMode')): ?>
+
+ = /* @noEscape */ __('Test order') ?>
+
+
+ = $block->escapeHtml($block->getMethod()->getTitle()) ?>
+
+
+ = /* @noEscape */ __('Novalnet Transaction ID: '). $transactionId ?>
+
+
+ getAdditionalData('NnRefunded')): ?>
+ getAdditionalData('NnRefunded') as $key => $value): ?>
+
+ = /* @noEscape */ __(
+ 'Refund has been initiated for the TID:%1 with the amount %2',
+ $block->novalnetHelper()->makeValidNumber($value['reqtid']),
+ $value['refamount']
+ ) ?>
+
+ = /* @noEscape */ __(
+ 'Refund has been initiated for the TID: %1 with the amount %2. New TID:%3',
+ $block->novalnetHelper()->makeValidNumber($value['reqtid']),
+ $value['refamount'],
+ $block->novalnetHelper()->makeValidNumber($value['reftid'])
+ ) ?>
+
+
+
+
+ getAdditionalData('NnComments')): ?>
+ = /* @noEscape */ $block->getAdditionalData('NnComments') ?>
+
+
+ = /* @noEscape */ __('Error in getting payment method') ?>
+
diff --git a/view/frontend/templates/info/Invoice.phtml b/view/frontend/templates/info/Invoice.phtml
new file mode 100755
index 0000000..2a4663a
--- /dev/null
+++ b/view/frontend/templates/info/Invoice.phtml
@@ -0,0 +1,118 @@
+getInfo();
+$order = $info->getOrder();
+$transactionId = $block->getAdditionalData('NnTid') ? $block->getAdditionalData('NnTid') : $info->getLastTransId();
+$paymentStatus = $block->novalnetHelper()->getStatus($block->getAdditionalData('NnStatus'), $order);
+$totalAmount = ($block->getAdditionalData('NnAmount')) ? $block->getAdditionalData('NnAmount') : $block->getGrandTotal();
+?>
+
+ getAdditionalData('NnTestMode')): ?>
+
+ = /* @noEscape */ __('Test order') ?>
+
+
+ = $block->escapeHtml($block->getMethod()->getTitle()) ?>
+
+
+ = /* @noEscape */ __('Novalnet Transaction ID: '). $transactionId ?>
+
+ getAdditionalData('NnGuarantee')) {
+ /* @noEscape */ echo __('This is processed as a guarantee payment') . ' ';
+ if (($paymentStatus == 'PENDING')): ?>
+ = /* @noEscape */ __('Your order is being verified. Once confirmed, we will send you our bank details to which the order amount should be transferred. Please note that this may take up to 24 hours') ?>
+
+
+ getAdditionalData('ApiProcess') == 'capture'): ?>
+ = /* @noEscape */ __(
+ 'The transaction has been confirmed successfully for the TID: %1',
+ $transactionId
+ ) ?>
+
+
+ getAdditionalData('ApiProcess') == 'void'): ?>
+ = /* @noEscape */ __(
+ 'The transaction has been canceled on %1',
+ $block->getAdditionalData('ApiProcessedAt')
+ ) ?>
+
+
+ getAdditionalData('dueDateUpdateAt') && $paymentStatus != 'ON_HOLD'): ?>
+ = /* @noEscape */ __(
+ 'The transaction has been updated with amount %1 and due date with %2',
+ $totalAmount,
+ $block->getAdditionalData('NnDueDate')
+ ) ?>
+
+
+ getAdditionalData('NnRefunded')): ?>
+ getAdditionalData('NnRefunded') as $key => $value): ?>
+
+ = /* @noEscape */ __(
+ 'Refund has been initiated for the TID:%1 with the amount %2',
+ $block->novalnetHelper()->makeValidNumber($value['reqtid']),
+ $value['refamount']
+ ) ?>
+
+ = /* @noEscape */ __(
+ 'Refund has been initiated for the TID: %1 with the amount %2. New TID:%3',
+ $block->novalnetHelper()->makeValidNumber($value['reqtid']),
+ $value['refamount'],
+ $block->novalnetHelper()->makeValidNumber($value['reftid'])
+ ) ?>
+
+
+
+
+ getUrl('*/*/*', ['_current' => true])) && !preg_match('/creditmemo/i', $block->getUrl('*/*/*', ['_current' => true])) &&
+ in_array($paymentStatus, ['PENDING', 'ON_HOLD', 'CONFIRMED']) && (empty($block->getAdditionalData('NnPaid')) || $block->getAdditionalData('NnPaid') != 1) &&
+ (empty($block->getAdditionalData('NnGuarantee')) || (!empty($block->getAdditionalData('NnGuarantee')) && $paymentStatus != 'PENDING'))): ?>
+ getAdditionalData('NnInvoiceComments')) && strlen($block->getAdditionalData('NnInvoiceComments'))): ?>
+
+ = /* @noEscape */ __('Please transfer the amount of %1 to the following account on or before %2', $totalAmount, $block->getAdditionalData('NnDueDate')) ?>
+
+ = /* @noEscape */ __('Please transfer the amount of %1 to the following account', $totalAmount) ?>
+
+ getAdditionalData('NnInvoiceComments'))) ? explode('|', $block->getAdditionalData('NnInvoiceComments')) : []; ?>
+
+
+
+
+
+ = /* @noEscape */ __($text) . ': ' . __($referenceTxt) . ' ' . $value ?>
+
+ = /* @noEscape */ __($text) . ': ' . $value ?>
+
+
+
+
+
+ getAdditionalData('NnComments')): ?>
+ = /* @noEscape */ $block->getAdditionalData('NnComments') ?>
+
+
+ = /* @noEscape */ __('Error in getting payment method') ?>
+
diff --git a/view/frontend/templates/info/InvoiceGuarantee.phtml b/view/frontend/templates/info/InvoiceGuarantee.phtml
new file mode 100755
index 0000000..9d6a2d9
--- /dev/null
+++ b/view/frontend/templates/info/InvoiceGuarantee.phtml
@@ -0,0 +1,106 @@
+getInfo();
+$order = $info->getOrder();
+$transactionId = $block->getAdditionalData('NnTid') ? $block->getAdditionalData('NnTid') : $info->getLastTransId();
+$paymentStatus = $block->novalnetHelper()->getStatus($block->getAdditionalData('NnStatus'), $order);
+$totalAmount = ($block->getAdditionalData('NnAmount')) ? $block->getAdditionalData('NnAmount') : $block->getGrandTotal();
+?>
+
+ getAdditionalData('NnTestMode')): ?>
+
+ = /* @noEscape */ __('Test order') ?>
+
+
+ = $block->escapeHtml($block->getMethod()->getTitle()) ?>
+
+
+ = /* @noEscape */ __('Novalnet Transaction ID: '). $transactionId ?>
+
+
+
+ = /* @noEscape */ __('Your order is being verified. Once confirmed, we will send you our bank details to which the order amount should be transferred. Please note that this may take up to 24 hours') ?>
+
+
+
+ getAdditionalData('ApiProcess') == 'capture'): ?>
+ = /* @noEscape */ __(
+ 'The transaction has been confirmed successfully for the TID: %1',
+ $transactionId
+ ) ?>
+
+
+ getAdditionalData('ApiProcess') == 'void'): ?>
+ = /* @noEscape */ __(
+ 'The transaction has been canceled on %1',
+ $block->getAdditionalData('ApiProcessedAt')
+ ) ?>
+
+
+ getAdditionalData('NnRefunded')): ?>
+ getAdditionalData('NnRefunded') as $key => $value): ?>
+
+ = /* @noEscape */ __(
+ 'Refund has been initiated for the TID:%1 with the amount %2',
+ $block->novalnetHelper()->makeValidNumber($value['reqtid']),
+ $value['refamount']
+ ) ?>
+
+ = /* @noEscape */ __(
+ 'Refund has been initiated for the TID: %1 with the amount %2. New TID:%3',
+ $block->novalnetHelper()->makeValidNumber($value['reqtid']),
+ $value['refamount'],
+ $block->novalnetHelper()->makeValidNumber($value['reftid'])
+ ) ?>
+
+
+
+
+ getUrl('*/*/*', ['_current' => true])) && !preg_match('/creditmemo/i', $block->getUrl('*/*/*', ['_current' => true])) && in_array($paymentStatus, ['ON_HOLD', 'CONFIRMED'])): ?>
+ getAdditionalData('NnInvoiceComments')) && strlen($block->getAdditionalData('NnInvoiceComments'))): ?>
+
+ = /* @noEscape */ __('Please transfer the amount of %1 to the following account on or before %2', $totalAmount, $block->getAdditionalData('NnDueDate')) ?>
+
+ = /* @noEscape */ __('Please transfer the amount of %1 to the following account', $totalAmount) ?>
+
+ getAdditionalData('NnInvoiceComments'))) ? explode('|', $block->getAdditionalData('NnInvoiceComments')) : []; ?>
+
+
+
+
+
+ = /* @noEscape */ __($text) . ': ' . __($referenceTxt) . ' ' . $value ?>
+
+ = /* @noEscape */ __($text) . ': ' . $value ?>
+
+
+
+
+
+ getAdditionalData('NnComments')): ?>
+ = /* @noEscape */ $block->getAdditionalData('NnComments') ?>
+
+
+ = /* @noEscape */ __('Error in getting payment method') ?>
+
diff --git a/view/frontend/templates/info/InvoiceInstalment.phtml b/view/frontend/templates/info/InvoiceInstalment.phtml
new file mode 100755
index 0000000..586df66
--- /dev/null
+++ b/view/frontend/templates/info/InvoiceInstalment.phtml
@@ -0,0 +1,139 @@
+getInfo();
+$order = $info->getOrder();
+$transactionId = $block->getAdditionalData('NnTid') ? $block->getAdditionalData('NnTid') : $info->getLastTransId();
+$paymentStatus = $block->novalnetHelper()->getStatus($block->getAdditionalData('NnStatus'), $order);
+$totalAmount = ($block->getAdditionalData('NnAmount')) ? $block->getAdditionalData('NnAmount') : $block->getGrandTotal();
+?>
+
+ getAdditionalData('NnTestMode')): ?>
+
+ = /* @noEscape */ __('Test order') ?>
+
+
+ = $block->escapeHtml($block->getMethod()->getTitle()) ?>
+
+
+ = /* @noEscape */ __('Novalnet Transaction ID: '). $transactionId ?>
+
+
+
+ = /* @noEscape */ __('Your order is being verified. Once confirmed, we will send you our bank details to which the order amount should be transferred. Please note that this may take up to 24 hours') ?>
+
+
+
+ getAdditionalData('ApiProcess') == 'capture'): ?>
+ = /* @noEscape */ __(
+ 'The transaction has been confirmed successfully for the TID: %1',
+ $transactionId
+ ) ?>
+
+
+ getAdditionalData('ApiProcess') == 'void'): ?>
+ = /* @noEscape */ __(
+ 'The transaction has been canceled on %1',
+ $block->getAdditionalData('ApiProcessedAt')
+ ) ?>
+
+
+ getAdditionalData('InstalmentCancel')): ?>
+ = /* @noEscape */ __(
+ 'Instalment has been cancelled.'
+ ) ?>
+
+
+ getAdditionalData('NnRefunded')): ?>
+ getAdditionalData('NnRefunded') as $key => $value): ?>
+
+ = /* @noEscape */ __(
+ 'Refund has been initiated for the TID:%1 with the amount %2',
+ $block->novalnetHelper()->makeValidNumber($value['reqtid']),
+ $value['refamount']
+ ) ?>
+
+ = /* @noEscape */ __(
+ 'Refund has been initiated for the TID: %1 with the amount %2. New TID:%3',
+ $block->novalnetHelper()->makeValidNumber($value['reqtid']),
+ $value['refamount'],
+ $block->novalnetHelper()->makeValidNumber($value['reftid'])
+ ) ?>
+
+
+
+
+ getUrl('*/*/*', ['_current' => true])) && !preg_match('/creditmemo/i', $block->getUrl('*/*/*', ['_current' => true])) && in_array($paymentStatus, ['ON_HOLD', 'CONFIRMED']) && empty($block->getAdditionalData('prepaid'))): ?>
+ getAdditionalData('NnInvoiceComments')) && strlen($block->getAdditionalData('NnInvoiceComments'))): ?>
+
+ = /* @noEscape */ __('Please transfer the amount of %1 to the following account on or before %2', $totalAmount, $block->getAdditionalData('NnDueDate')) ?>
+
+ = /* @noEscape */ __('Please transfer the amount of %1 to the following account', $totalAmount) ?>
+
+ getAdditionalData('NnInvoiceComments'))) ? explode('|', $block->getAdditionalData('NnInvoiceComments')) : []; ?>
+
+ $noteValue): ?>
+
+
+
+
+
+
+
+ = /* @noEscape */ __($text) . ': ' . __($referenceTxt) . ' ' . $value ?>
+
+ = /* @noEscape */ __($text) . ': ' . $value ?>
+
+
+
+
+
+ getAdditionalData('PaidInstall') && $paymentStatus == 'CONFIRMED' && (empty($block->getAdditionalData('InstalmentCancel')) || $block->getAdditionalData('InstalmentCancel') != 1)): ?>
+
+
+ = /* @noEscape */ __('Instalment Information') . ':' ?>
+
+
+
+ = /* @noEscape */ __('Processed Instalments') ?>
+ = /* @noEscape */ $block->getAdditionalData('PaidInstall') ?>
+
+
+ = /* @noEscape */ __('Due Instalments') ?>
+ = /* @noEscape */ $block->getAdditionalData('DueInstall') ? $block->getAdditionalData('DueInstall') : 0 ?>
+
+
+ = /* @noEscape */ __('Instalment Cycle Amount') ?>
+ = /* @noEscape */ $block->getAdditionalData('InstallCycleAmount') ? $block->updateCurrency($block->getAdditionalData('InstallCycleAmount')) : '-' ?>
+
+
+
+
+
+
+ getAdditionalData('NnComments')): ?>
+ = /* @noEscape */ $block->getAdditionalData('NnComments') ?>
+
+
+ = /* @noEscape */ __('Error in getting payment method') ?>
+
diff --git a/view/frontend/templates/info/Multibanco.phtml b/view/frontend/templates/info/Multibanco.phtml
new file mode 100755
index 0000000..8b47289
--- /dev/null
+++ b/view/frontend/templates/info/Multibanco.phtml
@@ -0,0 +1,49 @@
+getInfo();
+$transactionId = $block->getAdditionalData('NnTid') ? $block->getAdditionalData('NnTid') : $info->getLastTransId();
+?>
+
+ getAdditionalData('NnTestMode')): ?>
+
+ = /* @noEscape */ __('Test order') ?>
+
+
+ = $block->escapeHtml($block->getMethod()->getTitle()) ?>
+
+
+ = /* @noEscape */ __('Novalnet Transaction ID: '). $transactionId ?>
+
+
+ getAdditionalData('NnPartnerPaymentReference') && (empty($block->getAdditionalData('NnPaid')) || $block->getAdditionalData('NnPaid') != 1)): ?>
+ = /* @noEscape */ __('Please use the following payment reference details to pay the amount of %1 at a Multibanco ATM or through your internet banking.', $block->getGrandTotal()) ?>
+ = /* @noEscape */ __('Partner Payment Reference: %1', $block->getAdditionalData('NnPartnerPaymentReference')) ?>
+
+
+ getAdditionalData('NnComments')): ?>
+ = /* @noEscape */ $block->getAdditionalData('NnComments') ?>
+
+
+ = /* @noEscape */ __('Error in getting payment method') ?>
+
diff --git a/view/frontend/templates/info/OnlineBanktransfer.phtml b/view/frontend/templates/info/OnlineBanktransfer.phtml
new file mode 100755
index 0000000..4b5ebe2
--- /dev/null
+++ b/view/frontend/templates/info/OnlineBanktransfer.phtml
@@ -0,0 +1,63 @@
+getInfo();
+$transactionId = $block->getAdditionalData('NnTid') ? $block->getAdditionalData('NnTid') : $info->getLastTransId();
+?>
+
+ getAdditionalData('NnTestMode')): ?>
+
+ = /* @noEscape */ __('Test order') ?>
+
+
+ = $block->escapeHtml($block->getMethod()->getTitle()) ?>
+
+
+ = /* @noEscape */ __('Novalnet Transaction ID: '). $transactionId ?>
+
+
+ getAdditionalData('NnRefunded')): ?>
+ getAdditionalData('NnRefunded') as $key => $value): ?>
+
+ = /* @noEscape */ __(
+ 'Refund has been initiated for the TID:%1 with the amount %2',
+ $block->novalnetHelper()->makeValidNumber($value['reqtid']),
+ $value['refamount']
+ ) ?>
+
+ = /* @noEscape */ __(
+ 'Refund has been initiated for the TID: %1 with the amount %2. New TID:%3',
+ $block->novalnetHelper()->makeValidNumber($value['reqtid']),
+ $value['refamount'],
+ $block->novalnetHelper()->makeValidNumber($value['reftid'])
+ ) ?>
+
+
+
+
+ getAdditionalData('NnComments')): ?>
+ = /* @noEscape */ $block->getAdditionalData('NnComments') ?>
+
+
+ = /* @noEscape */ __('Error in getting payment method') ?>
+
diff --git a/view/frontend/templates/info/Paypal.phtml b/view/frontend/templates/info/Paypal.phtml
new file mode 100755
index 0000000..0e69501
--- /dev/null
+++ b/view/frontend/templates/info/Paypal.phtml
@@ -0,0 +1,75 @@
+getInfo();
+$transactionId = $block->getAdditionalData('NnTid') ? $block->getAdditionalData('NnTid') : $info->getLastTransId();
+?>
+
+ getAdditionalData('NnTestMode')): ?>
+
+ = /* @noEscape */ __('Test order') ?>
+
+
+ = $block->escapeHtml($block->getMethod()->getTitle()) ?>
+
+
+ = /* @noEscape */ __('Novalnet Transaction ID: '). $transactionId ?>
+
+
+ getAdditionalData('ApiProcess') == 'capture'): ?>
+ = /* @noEscape */ __(
+ 'The transaction has been confirmed on %1',
+ $block->getAdditionalData('ApiProcessedAt')
+ ) ?>
+ getAdditionalData('ApiProcess') == 'void'): ?>
+ = /* @noEscape */ __(
+ 'The transaction has been canceled on %1',
+ $block->getAdditionalData('ApiProcessedAt')
+ ) ?>
+
+
+ getAdditionalData('NnRefunded')): ?>
+ getAdditionalData('NnRefunded') as $key => $value): ?>
+
+ = /* @noEscape */ __(
+ 'Refund has been initiated for the TID:%1 with the amount %2',
+ $block->novalnetHelper()->makeValidNumber($value['reqtid']),
+ $value['refamount']
+ ) ?>
+
+ = /* @noEscape */ __(
+ 'Refund has been initiated for the TID: %1 with the amount %2. New TID:%3',
+ $block->novalnetHelper()->makeValidNumber($value['reqtid']),
+ $value['refamount'],
+ $block->novalnetHelper()->makeValidNumber($value['reftid'])
+ ) ?>
+
+
+
+
+ getAdditionalData('NnComments')): ?>
+ = /* @noEscape */ $block->getAdditionalData('NnComments') ?>
+
+
+ = /* @noEscape */ __('Error in getting payment method') ?>
+
diff --git a/view/frontend/templates/info/PostFinance.phtml b/view/frontend/templates/info/PostFinance.phtml
new file mode 100755
index 0000000..e7f2ec4
--- /dev/null
+++ b/view/frontend/templates/info/PostFinance.phtml
@@ -0,0 +1,75 @@
+getInfo();
+$transactionId = $block->getAdditionalData('NnTid') ? $block->getAdditionalData('NnTid') : $info->getLastTransId();
+?>
+
+ getAdditionalData('NnTestMode')): ?>
+
+ = /* @noEscape */ __('Test order') ?>
+
+
+ = $block->escapeHtml($block->getMethod()->getTitle()) ?>
+
+
+ = /* @noEscape */ __('Novalnet Transaction ID: '). $transactionId ?>
+
+
+ getAdditionalData('ApiProcess') == 'capture'): ?>
+ = /* @noEscape */ __(
+ 'The transaction has been confirmed on %1',
+ $block->getAdditionalData('ApiProcessedAt')
+ ) ?>
+ getAdditionalData('ApiProcess') == 'void'): ?>
+ = /* @noEscape */ __(
+ 'The transaction has been canceled on %1',
+ $block->getAdditionalData('ApiProcessedAt')
+ ) ?>
+
+
+ getAdditionalData('NnRefunded')): ?>
+ getAdditionalData('NnRefunded') as $key => $value): ?>
+
+ = /* @noEscape */ __(
+ 'Refund has been initiated for the TID:%1 with the amount %2',
+ $block->novalnetHelper()->makeValidNumber($value['reqtid']),
+ $value['refamount']
+ ) ?>
+
+ = /* @noEscape */ __(
+ 'Refund has been initiated for the TID: %1 with the amount %2. New TID:%3',
+ $block->novalnetHelper()->makeValidNumber($value['reqtid']),
+ $value['refamount'],
+ $block->novalnetHelper()->makeValidNumber($value['reftid'])
+ ) ?>
+
+
+
+
+ getAdditionalData('NnComments')): ?>
+ = /* @noEscape */ $block->getAdditionalData('NnComments') ?>
+
+
+ = /* @noEscape */ __('Error in getting payment method') ?>
+
diff --git a/view/frontend/templates/info/PostFinanceCard.phtml b/view/frontend/templates/info/PostFinanceCard.phtml
new file mode 100755
index 0000000..2fcec35
--- /dev/null
+++ b/view/frontend/templates/info/PostFinanceCard.phtml
@@ -0,0 +1,75 @@
+getInfo();
+$transactionId = $block->getAdditionalData('NnTid') ? $block->getAdditionalData('NnTid') : $info->getLastTransId();
+?>
+
+ getAdditionalData('NnTestMode')): ?>
+
+ = /* @noEscape */ __('Test order') ?>
+
+
+ = $block->escapeHtml($block->getMethod()->getTitle()) ?>
+
+
+ = /* @noEscape */ __('Novalnet Transaction ID: '). $transactionId ?>
+
+
+ getAdditionalData('ApiProcess') == 'capture'): ?>
+ = /* @noEscape */ __(
+ 'The transaction has been confirmed on %1',
+ $block->getAdditionalData('ApiProcessedAt')
+ ) ?>
+ getAdditionalData('ApiProcess') == 'void'): ?>
+ = /* @noEscape */ __(
+ 'The transaction has been canceled on %1',
+ $block->getAdditionalData('ApiProcessedAt')
+ ) ?>
+
+
+ getAdditionalData('NnRefunded')): ?>
+ getAdditionalData('NnRefunded') as $key => $value): ?>
+
+ = /* @noEscape */ __(
+ 'Refund has been initiated for the TID:%1 with the amount %2',
+ $block->novalnetHelper()->makeValidNumber($value['reqtid']),
+ $value['refamount']
+ ) ?>
+
+ = /* @noEscape */ __(
+ 'Refund has been initiated for the TID: %1 with the amount %2. New TID:%3',
+ $block->novalnetHelper()->makeValidNumber($value['reqtid']),
+ $value['refamount'],
+ $block->novalnetHelper()->makeValidNumber($value['reftid'])
+ ) ?>
+
+
+
+
+ getAdditionalData('NnComments')): ?>
+ = /* @noEscape */ $block->getAdditionalData('NnComments') ?>
+
+
+ = /* @noEscape */ __('Error in getting payment method') ?>
+
diff --git a/view/frontend/templates/info/Prepayment.phtml b/view/frontend/templates/info/Prepayment.phtml
new file mode 100755
index 0000000..31562cb
--- /dev/null
+++ b/view/frontend/templates/info/Prepayment.phtml
@@ -0,0 +1,106 @@
+getInfo();
+$order = $info->getOrder();
+$transactionId = $block->getAdditionalData('NnTid') ? $block->getAdditionalData('NnTid') : $info->getLastTransId();
+$paymentStatus = $block->novalnetHelper()->getStatus($block->getAdditionalData('NnStatus'), $order);
+$totalAmount = ($block->getAdditionalData('NnAmount')) ? $block->getAdditionalData('NnAmount') : $block->getGrandTotal();
+?>
+
+ getAdditionalData('NnTestMode')): ?>
+
+ = /* @noEscape */ __('Test order') ?>
+
+
+ = $block->escapeHtml($block->getMethod()->getTitle()) ?>
+
+
+ = /* @noEscape */ __('Novalnet Transaction ID: '). $transactionId ?>
+
+
+ getAdditionalData('ApiProcess') == 'capture'): ?>
+ = /* @noEscape */ __(
+ 'The transaction has been confirmed successfully for the TID: %1',
+ $transactionId
+ ) ?>
+
+
+ getAdditionalData('dueDateUpdateAt') && $paymentStatus != 'ON_HOLD'): ?>
+ = /* @noEscape */ __(
+ 'The transaction has been updated with amount %1 and due date with %2',
+ $totalAmount,
+ $block->getAdditionalData('NnDueDate')
+ ) ?>
+
+
+ getAdditionalData('ApiProcess') == 'void'): ?>
+ = /* @noEscape */ __(
+ 'The transaction has been canceled on %1',
+ $block->getAdditionalData('ApiProcessedAt')
+ ) ?>
+
+
+ getAdditionalData('NnRefunded')): ?>
+ getAdditionalData('NnRefunded') as $key => $value): ?>
+
+ = /* @noEscape */ __(
+ 'Refund has been initiated for the TID:%1 with the amount %2',
+ $block->novalnetHelper()->makeValidNumber($value['reqtid']),
+ $value['refamount']
+ ) ?>
+
+ = /* @noEscape */ __(
+ 'Refund has been initiated for the TID: %1 with the amount %2. New TID:%3',
+ $block->novalnetHelper()->makeValidNumber($value['reqtid']),
+ $value['refamount'],
+ $block->novalnetHelper()->makeValidNumber($value['reftid'])
+ ) ?>
+
+
+
+
+ getUrl('*/*/*', ['_current' => true])) && !preg_match('/invoice|creditmemo|shipment|callback/i', $block->getUrl('*/*/*', ['_current' => true])) &&
+ (empty($block->getAdditionalData('NnPaid')) || $block->getAdditionalData('NnPaid') != 1)): ?>
+ getAdditionalData('NnInvoiceComments')) && strlen($block->getAdditionalData('NnInvoiceComments'))): ?>
+ = /* @noEscape */ __('Please transfer the amount of %1 to the following account on or before %2', $totalAmount, $block->getAdditionalData('NnDueDate')) ?>
+ getAdditionalData('NnInvoiceComments'))) ? explode('|', $block->getAdditionalData('NnInvoiceComments')) : []; ?>
+
+
+
+
+
+ = /* @noEscape */ __($text) . ': ' . __($referenceTxt) . ' ' . $value ?>
+
+ = /* @noEscape */ __($text) . ': ' . $value ?>
+
+
+
+
+
+ getAdditionalData('NnComments')): ?>
+ = /* @noEscape */ $block->getAdditionalData('NnComments') ?>
+
+
+ = /* @noEscape */ __('Error in getting payment method') ?>
+
diff --git a/view/frontend/templates/info/Przelewy.phtml b/view/frontend/templates/info/Przelewy.phtml
new file mode 100755
index 0000000..114ecaf
--- /dev/null
+++ b/view/frontend/templates/info/Przelewy.phtml
@@ -0,0 +1,63 @@
+getInfo();
+$transactionId = $block->getAdditionalData('NnTid') ? $block->getAdditionalData('NnTid') : $info->getLastTransId();
+?>
+
+ getAdditionalData('NnTestMode')): ?>
+
+ = /* @noEscape */ __('Test order') ?>
+
+
+ = $block->escapeHtml($block->getMethod()->getTitle()) ?>
+
+
+ = /* @noEscape */ __('Novalnet Transaction ID: '). $transactionId ?>
+
+
+ getAdditionalData('NnRefunded')): ?>
+ getAdditionalData('NnRefunded') as $key => $value): ?>
+
+ = /* @noEscape */ __(
+ 'Refund has been initiated for the TID:%1 with the amount %2',
+ $block->novalnetHelper()->makeValidNumber($value['reqtid']),
+ $value['refamount']
+ ) ?>
+
+ = /* @noEscape */ __(
+ 'Refund has been initiated for the TID: %1 with the amount %2. New TID:%3',
+ $block->novalnetHelper()->makeValidNumber($value['reqtid']),
+ $value['refamount'],
+ $block->novalnetHelper()->makeValidNumber($value['reftid'])
+ ) ?>
+
+
+
+
+ getAdditionalData('NnComments')): ?>
+ = /* @noEscape */ $block->getAdditionalData('NnComments') ?>
+
+
+ = /* @noEscape */ __('Error in getting payment method') ?>
+
diff --git a/view/frontend/templates/info/Sepa.phtml b/view/frontend/templates/info/Sepa.phtml
new file mode 100755
index 0000000..64c8ca4
--- /dev/null
+++ b/view/frontend/templates/info/Sepa.phtml
@@ -0,0 +1,97 @@
+getInfo();
+$transactionId = $block->getAdditionalData('NnTid') ? $block->getAdditionalData('NnTid') : $info->getLastTransId();
+$paymentStatus = $block->novalnetHelper()->getStatus($block->getAdditionalData('NnStatus'), $info->getOrder());
+?>
+
+ getAdditionalData('NnTestMode')): ?>
+
+ = /* @noEscape */ __('Test order') ?>
+
+
+ = $block->escapeHtml($block->getMethod()->getTitle()) ?>
+
+
+ = /* @noEscape */ __('Novalnet Transaction ID: '). $transactionId ?>
+
+
+ getAdditionalData('NnGuarantee')) {
+ /* @noEscape */ echo __('This is processed as a guarantee payment') . ' ';
+ if ($paymentStatus == 'PENDING') {
+ /* @noEscape */ echo __('Your order is under verification and we will soon update you with the order status. Please note that this may take upto 24 hours.') . ' ';
+ }
+ }
+ ?>
+
+ getAdditionalData('ApiProcess') == 'capture'): ?>
+ = /* @noEscape */ __(
+ 'The transaction has been confirmed on %1',
+ $block->getAdditionalData('ApiProcessedAt')
+ ) ?>
+ getAdditionalData('ApiProcess') == 'void'): ?>
+ = /* @noEscape */ __(
+ 'The transaction has been canceled on %1',
+ $block->getAdditionalData('ApiProcessedAt')
+ ) ?>
+
+
+ getAdditionalData('NnZeroAmountBooking')): ?>
+ = /* @noEscape */ __('This order processed as a zero amount booking') ?>
+
+ getAdditionalData('NnUpdatedZeroAmount') && $block->getAdditionalData('NnZeroAmountRefTid')): ?>
+ = /* @noEscape */ __(
+ 'Your order has been booked with the amount of %1. Your new TID for the booked amount: %2',
+ $block->getAdditionalData('NnUpdatedZeroAmount'),
+ $block->getAdditionalData('NnZeroAmountRefTid')
+ ) ?>
+
+
+
+ getAdditionalData('NnRefunded')): ?>
+ getAdditionalData('NnRefunded') as $key => $value): ?>
+
+ = /* @noEscape */ __(
+ 'Refund has been initiated for the TID:%1 with the amount %2',
+ $block->novalnetHelper()->makeValidNumber($value['reqtid']),
+ $value['refamount']
+ ) ?>
+
+ = /* @noEscape */ __(
+ 'Refund has been initiated for the TID: %1 with the amount %2. New TID:%3',
+ $block->novalnetHelper()->makeValidNumber($value['reqtid']),
+ $value['refamount'],
+ $block->novalnetHelper()->makeValidNumber($value['reftid'])
+ ) ?>
+
+
+
+
+ getAdditionalData('NnComments')): ?>
+ = /* @noEscape */ $block->getAdditionalData('NnComments') ?>
+
+
+ = /* @noEscape */ __('Error in getting payment method') ?>
+
diff --git a/view/frontend/templates/info/SepaGuarantee.phtml b/view/frontend/templates/info/SepaGuarantee.phtml
new file mode 100755
index 0000000..7489317
--- /dev/null
+++ b/view/frontend/templates/info/SepaGuarantee.phtml
@@ -0,0 +1,81 @@
+getInfo();
+$order = $info->getOrder();
+$transactionId = $block->getAdditionalData('NnTid') ? $block->getAdditionalData('NnTid') : $info->getLastTransId();
+$paymentStatus = $block->novalnetHelper()->getStatus($block->getAdditionalData('NnStatus'), $order);
+?>
+
+ getAdditionalData('NnTestMode')): ?>
+
+ = /* @noEscape */ __('Test order') ?>
+
+
+ = $block->escapeHtml($block->getMethod()->getTitle()) ?>
+
+
+ = /* @noEscape */ __('Novalnet Transaction ID: '). $transactionId ?>
+
+
+
+ = /* @noEscape */ __('Your order is under verification and we will soon update you with the order status. Please note that this may take upto 24 hours.') ?>
+
+
+ getAdditionalData('ApiProcess') == 'capture'): ?>
+ = /* @noEscape */ __(
+ 'The transaction has been confirmed on %1',
+ $block->getAdditionalData('ApiProcessedAt')
+ ) ?>
+ getAdditionalData('ApiProcess') == 'void'): ?>
+ = /* @noEscape */ __(
+ 'The transaction has been canceled on %1',
+ $block->getAdditionalData('ApiProcessedAt')
+ ) ?>
+
+
+ getAdditionalData('NnRefunded')): ?>
+ getAdditionalData('NnRefunded') as $key => $value): ?>
+
+ = /* @noEscape */ __(
+ 'Refund has been initiated for the TID:%1 with the amount %2',
+ $block->novalnetHelper()->makeValidNumber($value['reqtid']),
+ $value['refamount']
+ ) ?>
+
+ = /* @noEscape */ __(
+ 'Refund has been initiated for the TID: %1 with the amount %2. New TID:%3',
+ $block->novalnetHelper()->makeValidNumber($value['reqtid']),
+ $value['refamount'],
+ $block->novalnetHelper()->makeValidNumber($value['reftid'])
+ ) ?>
+
+
+
+
+ getAdditionalData('NnComments')): ?>
+ = /* @noEscape */ $block->getAdditionalData('NnComments') ?>
+
+
+ = /* @noEscape */ __('Error in getting payment method') ?>
+
diff --git a/view/frontend/templates/info/SepaInstalment.phtml b/view/frontend/templates/info/SepaInstalment.phtml
new file mode 100755
index 0000000..f2970a5
--- /dev/null
+++ b/view/frontend/templates/info/SepaInstalment.phtml
@@ -0,0 +1,110 @@
+getInfo();
+$order = $info->getOrder();
+$transactionId = $block->getAdditionalData('NnTid') ? $block->getAdditionalData('NnTid') : $info->getLastTransId();
+$paymentStatus = $block->novalnetHelper()->getStatus($block->getAdditionalData('NnStatus'), $order);
+?>
+
+ getAdditionalData('NnTestMode')): ?>
+
+ = /* @noEscape */ __('Test order') ?>
+
+
+ = $block->escapeHtml($block->getMethod()->getTitle()) ?>
+
+
+ = /* @noEscape */ __('Novalnet Transaction ID: '). $transactionId ?>
+
+
+
+ = /* @noEscape */ __('Your order is under verification and we will soon update you with the order status. Please note that this may take upto 24 hours.') ?>
+
+
+ getAdditionalData('ApiProcess') == 'capture'): ?>
+ = /* @noEscape */ __(
+ 'The transaction has been confirmed on %1',
+ $block->getAdditionalData('ApiProcessedAt')
+ ) ?>
+ getAdditionalData('ApiProcess') == 'void'): ?>
+ = /* @noEscape */ __(
+ 'The transaction has been canceled on %1',
+ $block->getAdditionalData('ApiProcessedAt')
+ ) ?>
+
+
+ getAdditionalData('InstalmentCancel')): ?>
+ = /* @noEscape */ __(
+ 'Instalment has been cancelled.'
+ ) ?>
+
+
+ getAdditionalData('PaidInstall') && $paymentStatus == 'CONFIRMED' && (empty($block->getAdditionalData('InstalmentCancel')) || $block->getAdditionalData('InstalmentCancel') != 1)): ?>
+
+
+ = /* @noEscape */ __('Instalment Information') . ':' ?>
+
+
+
+ = /* @noEscape */ __('Processed Instalments') ?>
+ = /* @noEscape */ $block->getAdditionalData('PaidInstall') ?>
+
+
+ = /* @noEscape */ __('Due Instalments') ?>
+ = /* @noEscape */ $block->getAdditionalData('DueInstall') ? $block->getAdditionalData('DueInstall') : 0 ?>
+
+
+ = /* @noEscape */ __('Instalment Cycle Amount') ?>
+ = /* @noEscape */ $block->getAdditionalData('InstallCycleAmount') ? $block->updateCurrency($block->getAdditionalData('InstallCycleAmount')) : '-' ?>
+
+
+
+
+
+
+ getAdditionalData('NnRefunded')): ?>
+ getAdditionalData('NnRefunded') as $key => $value): ?>
+
+ = /* @noEscape */ __(
+ 'Refund has been initiated for the TID:%1 with the amount %2',
+ $block->novalnetHelper()->makeValidNumber($value['reqtid']),
+ $value['refamount']
+ ) ?>
+
+ = /* @noEscape */ __(
+ 'Refund has been initiated for the TID: %1 with the amount %2. New TID:%3',
+ $block->novalnetHelper()->makeValidNumber($value['reqtid']),
+ $value['refamount'],
+ $block->novalnetHelper()->makeValidNumber($value['reftid'])
+ ) ?>
+
+
+
+
+ getAdditionalData('NnComments')): ?>
+ = /* @noEscape */ $block->getAdditionalData('NnComments') ?>
+
+
+ = /* @noEscape */ __('Error in getting payment method') ?>
+
diff --git a/view/frontend/templates/info/Trustly.phtml b/view/frontend/templates/info/Trustly.phtml
new file mode 100755
index 0000000..75196d9
--- /dev/null
+++ b/view/frontend/templates/info/Trustly.phtml
@@ -0,0 +1,63 @@
+getInfo();
+$transactionId = $block->getAdditionalData('NnTid') ? $block->getAdditionalData('NnTid') : $info->getLastTransId();
+?>
+
+ getAdditionalData('NnTestMode')): ?>
+
+ = /* @noEscape */ __('Test order') ?>
+
+
+ = $block->escapeHtml($block->getMethod()->getTitle()) ?>
+
+
+ = /* @noEscape */ __('Novalnet Transaction ID: '). $transactionId ?>
+
+
+ getAdditionalData('NnRefunded')): ?>
+ getAdditionalData('NnRefunded') as $key => $value): ?>
+
+ = /* @noEscape */ __(
+ 'Refund has been initiated for the TID:%1 with the amount %2',
+ $block->novalnetHelper()->makeValidNumber($value['reqtid']),
+ $value['refamount']
+ ) ?>
+
+ = /* @noEscape */ __(
+ 'Refund has been initiated for the TID: %1 with the amount %2. New TID:%3',
+ $block->novalnetHelper()->makeValidNumber($value['reqtid']),
+ $value['refamount'],
+ $block->novalnetHelper()->makeValidNumber($value['reftid'])
+ ) ?>
+
+
+
+
+ getAdditionalData('NnComments')): ?>
+ = /* @noEscape */ $block->getAdditionalData('NnComments') ?>
+
+
+ = /* @noEscape */ __('Error in getting payment method') ?>
+
diff --git a/view/frontend/templates/info/Wechatpay.phtml b/view/frontend/templates/info/Wechatpay.phtml
new file mode 100755
index 0000000..1b037f8
--- /dev/null
+++ b/view/frontend/templates/info/Wechatpay.phtml
@@ -0,0 +1,63 @@
+getInfo();
+$transactionId = $block->getAdditionalData('NnTid') ? $block->getAdditionalData('NnTid') : $info->getLastTransId();
+?>
+
+ getAdditionalData('NnTestMode')): ?>
+
+ = /* @noEscape */ __('Test order') ?>
+
+
+ = $block->escapeHtml($block->getMethod()->getTitle()) ?>
+
+
+ = /* @noEscape */ __('Novalnet Transaction ID: '). $transactionId ?>
+
+
+ getAdditionalData('NnRefunded')): ?>
+ getAdditionalData('NnRefunded') as $key => $value): ?>
+
+ = /* @noEscape */ __(
+ 'Refund has been initiated for the TID:%1 with the amount %2',
+ $block->novalnetHelper()->makeValidNumber($value['reqtid']),
+ $value['refamount']
+ ) ?>
+
+ = /* @noEscape */ __(
+ 'Refund has been initiated for the TID: %1 with the amount %2. New TID:%3',
+ $block->novalnetHelper()->makeValidNumber($value['reqtid']),
+ $value['refamount'],
+ $block->novalnetHelper()->makeValidNumber($value['reftid'])
+ ) ?>
+
+
+
+
+ getAdditionalData('NnComments')): ?>
+ = /* @noEscape */ $block->getAdditionalData('NnComments') ?>
+
+
+ = /* @noEscape */ __('Error in getting payment method') ?>
+
diff --git a/view/frontend/templates/onepage/success/expresscheckoutmessage.phtml b/view/frontend/templates/onepage/success/expresscheckoutmessage.phtml
new file mode 100755
index 0000000..10e5673
--- /dev/null
+++ b/view/frontend/templates/onepage/success/expresscheckoutmessage.phtml
@@ -0,0 +1,35 @@
+getGpayAdditionalData();
+$applePayAdditionalData = $block->getApplepayAdditionalData();
+
+?>
+
+
+ = /* @noEscape */ __('Your order was successfully processed using Google Pay') ?>= /* @noEscape */ $gpayAdditionalData['NnGpaysuccesstext']; ?>
+
+
+
+ = /* @noEscape */ __('Your order was successfully processed using Apple Pay') ?> = /* @noEscape */ $gpayAdditionalData['NnApplepaysuccesstext']; ?>
+
diff --git a/view/frontend/templates/onepage/success/message.phtml b/view/frontend/templates/onepage/success/message.phtml
new file mode 100755
index 0000000..b6b2a1b
--- /dev/null
+++ b/view/frontend/templates/onepage/success/message.phtml
@@ -0,0 +1,39 @@
+getCpAdditionalData();
+?>
+
+
+
+
+
+ = /* @noEscape */ __('Pay now with Barzahlen'); ?>
+
diff --git a/view/frontend/templates/product/view/instalmentsinfo.phtml b/view/frontend/templates/product/view/instalmentsinfo.phtml
new file mode 100755
index 0000000..87e7b34
--- /dev/null
+++ b/view/frontend/templates/product/view/instalmentsinfo.phtml
@@ -0,0 +1,209 @@
+getProductData();
+$productId = $product['productId'];
+$productType = $product['type'];
+?>
+
+canShowInstalmentsInfo()): ?>
+
+
You can pay this product in instalments. Learn more
+
+
+
+
Instalment by Direct Debit SEPA
+
Instalment by Invoice
+
+
+
+
+
+
Things to note:
+
Available in Germany, Austria and Switzerland
+
The shipping address must be the same as the billing address
+
+
+
+
+
+
+
+
diff --git a/view/frontend/templates/removeTokenPopup.phtml b/view/frontend/templates/removeTokenPopup.phtml
new file mode 100755
index 0000000..843c624
--- /dev/null
+++ b/view/frontend/templates/removeTokenPopup.phtml
@@ -0,0 +1,27 @@
+
+
+
+ = /* @noEscape */ __('Are you sure you want to remove these account details?') ?>
+
+
+ = /* @noEscape */ __('Are you sure you want to remove these Credit Card details?') ?>
+
diff --git a/view/frontend/web/css/novalnet_payment.css b/view/frontend/web/css/novalnet_payment.css
new file mode 100755
index 0000000..d54de82
--- /dev/null
+++ b/view/frontend/web/css/novalnet_payment.css
@@ -0,0 +1,262 @@
+.instalment-details-table tbody tr th, .instalment-details-table tbody tr td {
+ border-top: 1px solid #ccc;
+ border-left: 1px solid #ccc;
+ border-bottom: 1px solid #ccc;
+ border-right: 1px solid #ccc;
+ border: .1rem solid #8a837f;
+ padding: 5px 10px;
+}
+.instalment-details-table thead th {
+ background-color: #514943;
+ border: .1rem solid #8a837f;
+ border-left-color: transparent;
+ color: #fff;
+ font-weight: 600;
+ padding: 5px 10px;
+ text-align: left;
+}
+.instalment-details-table tr {
+ transition: background 0.2s ease-in;
+}
+.instalment-details-table tr:nth-child(even) {
+ background: #f5f5f5;
+}
+.instalment-details-table {
+ margin-bottom: 30px;
+}
+.checkout-payment-method .nnpayment-logo {
+ max-height: 75px;
+}
+.nntoken.action.delete {
+ padding-left: 15px;
+}
+.nntoken.action.delete:before {
+ content: '\e604';
+ -webkit-font-smoothing: antialiased;
+ -moz-osx-font-smoothing: grayscale;
+ font-size: 15px;
+ line-height: 18px;
+ color: #757575;
+ font-family: 'luma-icons';
+ vertical-align: middle;
+ display: inline-block;
+ font-weight: normal;
+ overflow: hidden;
+ speak: none;
+ text-align: center;
+}
+.nntoken.action.delete > span {
+ border: 0;
+ clip: rect(0, 0, 0, 0);
+ height: 1px;
+ margin: -1px;
+ overflow: hidden;
+ padding: 0;
+ position: absolute;
+ width: 1px;
+}
+.nntoken-remove-popup-modal.modal-popup .modal-header {
+ padding-top: 1.8rem;
+}
+.nntoken-remove-popup-modal.modal-slide .modal-content {
+ padding-bottom: 1rem;
+}
+.nntoken-remove-popup-modal.modal-popup .modal-footer {
+ padding-bottom: 1rem;
+ padding-top: 1rem;
+}
+.nn-payment-guarantee, .nn-payment-instalment {
+ display: block;
+ position: relative;
+ width: 100%;
+}
+.nn-payment-guarantee .control, .nn-payment-instalment .control {
+ display: block;
+ position: relative;
+ width: 100%;
+}
+.nn-payment-guarantee .control input, .nn-payment-instalment .control input {
+ width: 225px;
+ max-width: 225px;
+}
+.nn-payment-guarantee .control .nn-customer_dob_mm, .nn-payment-instalment .control .nn-customer_dob_mm {
+ width: 120px;
+ max-width: 120px;
+}
+.nn-payment-guarantee .control .autocomplete, .nn-payment-instalment .control .autocomplete {
+ display: inline-block;
+ position: relative;
+ width: 80px;
+ max-width: 80px;
+}
+.nn-payment-guarantee .control .autocomplete-items, .nn-payment-instalment .control .autocomplete-items {
+ display: block;
+ position: absolute;
+ border: 1px solid #d4d4d4;
+ border-bottom: none;
+ border-top: none;
+ z-index: 99;
+ width: 75px;
+}
+.nn-payment-guarantee .control .autocomplete-items div, .nn-payment-instalment .control .autocomplete-items div {
+ padding: 4px 10px;
+ cursor: pointer;
+ background-color: #fff;
+ border-bottom: 1px solid #d4d4d4;
+}
+.nn-payment-guarantee .control div.mage-error {
+ display: none !important;
+}
+.nn-payment-instalment .control div.mage-error {
+ display: none !important;
+}
+.nn-test-drive{
+ position: relative;
+ background-color: #0080c9;
+ color: #fff;
+ padding: 10px 20px;
+ margin-bottom: 8px;
+ font-size: 10px;
+ text-align: center;
+ text-transform: uppercase;
+ letter-spacing: 1px;
+ line-height: 0.8px;
+ border-radius: 0px 0px 5px 5px;
+ transition: transform 0.5s ease 0.5s;
+ animation: novalnet-blinker 4s linear infinite;
+ font-weight: bold;
+ float:right;
+}
+@keyframes novalnet-blinker {
+ 100% {
+ opacity: 0;
+ }
+}
+
+.info-box{
+ position:relative;
+ width:auto;
+ height: auto;
+ background: content-box;
+ font-size: 14px;
+ color: #333;
+ margin: 20px 0px;
+ padding:1em 1em;
+ border-left: 5px solid #0080c9;
+ box-shadow: 0 0 8px 0px rgba(0,0,0,.4);
+ clear:both;
+ word-break: break-word;
+}
+.info-box ul{
+ margin: 0 20px 0px 20px;
+ padding: 0;
+}
+.info-box li{
+ list-style: disc !important;
+}
+.info-box li:before{
+ display:block !important;
+}
+.info-box p{
+ padding:0 1em;
+ margin-bottom:0px;
+}
+.info-box a{
+ padding:0 1em;
+ margin-bottom:0px;
+ display:block;
+}
+.novalnet-challenge-window-overlay {
+ position: fixed;
+ width: 100%;
+ height: 100% ! important;
+ top: 0;
+ left: 0;
+ right: 0;
+ bottom: 0;
+ background-color: rgba(0,0,0,0.5);
+ z-index: 999;
+ cursor: pointer;
+}
+.info-box .nn-instructions {
+ white-space: break-spaces;
+}
+.field-tooltip {
+ cursor: pointer;
+ position: relative;
+ right: 0;
+ top: 0;
+ display: inline-block;
+}
+
+@media screen and (min-width: 270px) and (max-width: 330px) {
+ #novalnet_form_cc {
+ width: 100%;
+ }
+
+ #novalnet_form_cc .field-tooltip .field-tooltip-content {
+ right: -10px;
+ top: 40px;
+ left: 475%;
+ transform: translateX(-62%);
+ }
+ #novalnet_form_cc .field-tooltip .field-tooltip-content::before, #novalnet_form_cc .field-tooltip .field-tooltip-content::after {
+ left: 28%;
+ }
+}
+@media screen and (min-width: 331px) and (max-width: 355px) {
+ #novalnet_form_cc .field-tooltip .field-tooltip-content {
+ right: -10px;
+ top: 40px;
+ left: -75px;
+ }
+ #novalnet_form_cc .field-tooltip .field-tooltip-content::before, #novalnet_form_cc .field-tooltip .field-tooltip-content::after {
+ left: 75px;
+ }
+}
+@media screen and (min-width: 356px) and (max-width: 384px) {
+ #novalnet_form_cc .field-tooltip .field-tooltip-content {
+ right: -10px;
+ top: 40px;
+ left: -30px;
+ }
+ #novalnet_form_cc .field-tooltip .field-tooltip-content::before, #novalnet_form_cc .field-tooltip .field-tooltip-content::after {
+ left: 30px;
+ }
+}
+@media screen and (min-width: 385px) and (max-width: 410px) {
+ #novalnet_form_cc .field-tooltip .field-tooltip-content {
+ right: -10px;
+ top: 40px;
+ left: 0px;
+ }
+ #novalnet_form_cc .field-tooltip .field-tooltip-content::before, #novalnet_form_cc .field-tooltip .field-tooltip-content::after {
+ left: 0px;
+ }
+}
+@media screen and (min-width: 331px) and (max-width: 768px) {
+
+ #novalnet_form_cc {
+ width: 100%;
+ }
+}
+
+div.novalnet-payment-saved-payments {
+ clear: both;
+}
+
+#nn_googlepay_product .gpay-card-info-container {
+ min-width: unset !important;
+}
+
+#nn_googlepay_cart .gpay-card-info-container {
+ min-width: unset !important;
+}
+
+#nn_googlepay_minicart .gpay-card-info-container {
+ min-width: unset !important;
+}
+
+#novalnet_googlepay_guest_checkout .gpay-card-info-container {
+ min-width: unset !important;
+}
diff --git a/view/frontend/web/js/action/get-redirect-url.js b/view/frontend/web/js/action/get-redirect-url.js
new file mode 100755
index 0000000..068bbf3
--- /dev/null
+++ b/view/frontend/web/js/action/get-redirect-url.js
@@ -0,0 +1,40 @@
+/**
+ * Novalnet payment extension
+ *
+ * NOTICE OF LICENSE
+ *
+ * This source file is subject to the Novalnet End User License Agreement
+ * that is bundled with this package in the file LICENSE.txt
+ *
+ * DISCLAIMER
+ *
+ * If you wish to customize Novalnet payment extension for your needs,
+ * please contact technic@novalnet.de for more information.
+ *
+ * @category Novalnet
+ * @package Novalnet_Payment
+ * @copyright Copyright (c) Novalnet AG
+ * @license https://www.novalnet.de/payment-plugins/kostenlos/lizenz
+ */
+define(
+ [
+ 'jquery',
+ 'mage/url',
+ 'mage/storage',
+ 'Magento_Checkout/js/model/error-processor',
+ 'Magento_Checkout/js/model/full-screen-loader',
+ 'Magento_Checkout/js/model/quote'
+ ],
+ function (jQuery, urlBuilder, storage, errorProcessor, fullScreenLoader, quote) {
+ 'use strict';
+
+ return function () {
+ fullScreenLoader.startLoader();
+
+ let serviceUrl = urlBuilder.build("/rest/V1/novalnet/payment/getRedirectURL", {}),
+ payLoad = {data: {quote_id: quote.getQuoteId()}};
+
+ return storage.post(serviceUrl, JSON.stringify(payLoad));
+ };
+ }
+);
diff --git a/view/frontend/web/js/checkout/novalnetGuestCheckout.js b/view/frontend/web/js/checkout/novalnetGuestCheckout.js
new file mode 100755
index 0000000..f305742
--- /dev/null
+++ b/view/frontend/web/js/checkout/novalnetGuestCheckout.js
@@ -0,0 +1,554 @@
+/**
+ * Novalnet payment extension
+ *
+ * NOTICE OF LICENSE
+ *
+ * This source file is subject to the Novalnet End User License Agreement
+ * that is bundled with this package in the file LICENSE.txt
+ *
+ * DISCLAIMER
+ *
+ * If you wish to customize Novalnet payment extension for your needs,
+ * please contact technic@novalnet.de for more information.
+ *
+ * @category Novalnet
+ * @package Novalnet_Payment
+ * @copyright Copyright (c) Novalnet AG
+ * @license https://www.novalnet.de/payment-plugins/kostenlos/lizenz
+ */
+define(
+ [
+ 'jquery',
+ 'uiComponent',
+ 'mage/url',
+ 'mage/storage',
+ 'Magento_Ui/js/modal/alert',
+ 'Magento_Checkout/js/model/quote',
+ 'mage/translate',
+ 'Magento_Checkout/js/model/totals',
+ 'Magento_Customer/js/customer-data',
+ 'Magento_Checkout/js/model/cart/totals-processor/default',
+ 'novalnetUtilityJs',
+ 'novalnetPaymentJs'
+ ],
+ function($, Component, urlBuilder, storage, alert, quote, $t, totals, customerData, totalsDefaultProvider)
+ {
+ "use strict";
+ return Component.extend({
+ /**
+ * Default's
+ */
+ defaults: {
+ template: {
+ name: "Novalnet_Payment/checkout/novalnetGuestCheckout"
+ },
+ novalnetApplepay: "APPLEPAY",
+ novalnetGooglepay: "GOOGLEPAY"
+ },
+
+ /**
+ * Initialize function
+ */
+ initObservable: function () {
+ this._super();
+ window.addEventListener("hashchange", _.bind(this.handleCheckoutVisibility,this));
+ let cart = customerData.get("cart");
+ cart.subscribe(this.refreshCheckout, this);
+ return this;
+ },
+
+ /**
+ * Handle's Guest checkout button visibility
+ */
+ handleCheckoutVisibility: function() {
+ this.initGuestCheckoutPage();
+ },
+
+ /**
+ * Refresh quote grand total on cart change
+ */
+ refreshCheckout: function() {
+ const cart = customerData.get("cart");
+ if (cart().summary_count && cart().summary_count > 0) {
+ totalsDefaultProvider.estimateTotals(quote.shippingAddress());
+ }
+ },
+
+ /**
+ * To check the data is JSON
+ *
+ * @return bool
+ */
+ isJson: function(data) {
+ try {
+ JSON.parse(data);
+ return true;
+ } catch (e) {
+ return false;
+ }
+ },
+
+ /**
+ * Returns Grand Total
+ *
+ * @return mixed
+ */
+ getGrandTotal: function() {
+ if (quote.totals()) {
+ return Math.round(parseFloat(quote.totals().base_grand_total) * 100);
+ }
+ },
+
+ /**
+ * Returns Languge Code
+ *
+ * @return string
+ */
+ getLangCode: function() {
+ return window.checkoutConfig.payment[this.getCode()].langCode;
+ },
+
+ /**
+ * Returns Method Code
+ *
+ * @return string
+ */
+ getCode: function() {
+ return "novalnetApplepay";
+ },
+
+
+ /**
+ * Throw's alert on payment error
+ */
+ throwError: function(message) {
+ alert({
+ title: $t("Error"),
+ content: message
+ });
+ },
+
+ /**
+ * Returns display items for payment sheet
+ *
+ * @return array
+ */
+ getLineItems: function() {
+ let items = totals.totals().items,
+ currencyRate = window.checkoutConfig.quoteData.base_to_quote_rate,
+ lineItem = [],
+ i;
+
+ if (items.length) {
+ for( i = 0; i < items.length; i++ ) {
+ lineItem[i] = {
+ label: items[i].name + " (" + Math.round(parseFloat(items[i].qty)) + " x " + Number.parseFloat(items[i].base_price).toFixed(2) + ")",
+ type: "SUBTOTAL",
+ amount: Math.round((parseFloat(items[i].base_row_total)) * 100) + ""
+ };
+ }
+ }
+
+ if (totals.totals().hasOwnProperty("tax_amount")) {
+ let tax = Math.round( (parseFloat(totals.totals().tax_amount) / parseFloat(currencyRate)) * 100);
+
+ if(parseInt(tax) > 0) {
+ lineItem.push({label: "Tax", type: "SUBTOTAL", amount: tax + ""});
+ }
+ }
+
+ if (totals.totals().hasOwnProperty("discount_amount")) {
+ let discountTotal = (Math.round( (parseFloat(totals.totals().discount_amount) / parseFloat(currencyRate)) * 100)).toString(),
+ discount = ((Math.sign(discountTotal)) == -1 ) ? discountTotal.substr(1) : discountTotal;
+
+ if(parseInt(discount) > 0) {
+ lineItem.push({label: "Discount", type: "SUBTOTAL", amount: "-" + discount});
+ }
+ }
+
+ if (totals.totals().hasOwnProperty("shipping_amount") && !quote.isVirtual()) {
+ let shippingTitle = "Shipping";
+ if (totals.totals().hasOwnProperty("total_segments")) {
+ let segments = totals.totals().total_segments;
+ $.each(segments, function (index, value) {
+ if (value.code == "shipping") {
+ shippingTitle = value.title
+ shippingTitle = shippingTitle.replace("Shipping & Handling", "")
+ }
+ });
+ }
+
+ if (shippingTitle == "") {
+ shippingTitle = "Shipping";
+ }
+
+ let Shipping = Math.round( (parseFloat(totals.totals().shipping_amount) / parseFloat(currencyRate)) * 100),
+ ShippingItem = {label: shippingTitle, type: "SUBTOTAL", amount: Shipping + ''};
+ lineItem.push(ShippingItem);
+ }
+
+ return lineItem;
+ },
+
+ /**
+ * Built Applepay Payment Request
+ *
+ * @return object
+ */
+ applepayPaymentRequest: function() {
+ const requestData = window.checkoutConfig.payment.novalnetApplepay,
+ self = this,
+ requestObj = {
+ clientKey: requestData.clientKey,
+ paymentIntent: {
+ merchant: {
+ countryCode: requestData.countryCode,
+ paymentDataPresent: false
+ },
+ transaction: {
+ amount: self.getGrandTotal(),
+ currency: requestData.currencyCode,
+ paymentMethod: self.novalnetApplepay,
+ environment: (requestData.testmode == 1) ? "SANDBOX" : "PRODUCTION",
+ setPendingPayment: requestData.is_pending
+ },
+ order: {
+ paymentDataPresent: false,
+ merchantName: requestData.sellerName,
+ lineItems: self.getLineItems(),
+ billing: {
+ requiredFields: ["postalAddress"]
+ },
+ shipping: {
+ requiredFields: ["postalAddress", "phone", "email"],
+ methodsUpdatedLater: true
+ }
+ },
+ button: {
+ style: requestData.btnTheme,
+ locale: requestData.langCode,
+ type: requestData.btnType,
+ boxSizing: "border-box",
+ dimensions: {
+ width: 240,
+ cornerRadius: parseInt(requestData.btnRadius),
+ height: parseInt(requestData.btnHeight)
+ }
+ },
+ callbacks: {
+ onProcessCompletion: function (response, bookingResult) {
+ if (response.result.status == "SUCCESS") {
+ let serviceUrl = urlBuilder.build("/rest/V1/novalnet/payment/placeOrder", {}),
+ payload = {
+ paymentData: {
+ methodCode: "novalnetApplepay",
+ amount: response.transaction.amount,
+ doRedirect: response.transaction.doRedirect,
+ token: response.transaction.token,
+ cardBrand: response.transaction.paymentData.cardBrand,
+ lastFour: response.transaction.paymentData.lastFour
+ },
+ billingAddress: {},
+ shippingAddress: {},
+ shippingMethod: {}
+ };
+
+ if (response.order.hasOwnProperty("billing") && response.order.billing.hasOwnProperty("contact")) {
+ payload.billingAddress = response.order.billing.contact;
+ }
+
+ if (response.order.hasOwnProperty("shipping") && response.order.shipping.hasOwnProperty("contact")) {
+ payload.shippingAddress = response.order.shipping.contact;
+ }
+
+ if (response.order.hasOwnProperty("shipping") && response.order.shipping.hasOwnProperty("method")) {
+ payload.shippingMethod = response.order.shipping.method;
+ }
+
+ storage.post( serviceUrl, JSON.stringify(payload)).done(function(response) {
+ if (self.isJson(response)) {
+ response = JSON.parse(response);
+ }
+ $('body').trigger('processStart');
+ window.location.replace(response.redirectUrl);
+ bookingResult({status: "SUCCESS", statusText: ""});
+ }).fail(function(xhr, textStatus, errorThrown) {
+ $('body').trigger('processStop');
+ const errMsg = (xhr.responseJSON.message) ? xhr.responseJSON.message : errorThrown;
+ self.throwError(errMsg);
+ bookingResult({status: "FAILURE", statusText: errMsg});
+ });
+ } else {
+ $('body').trigger('processStop');
+ bookingResult({status: "FAILURE", statusText: ""});
+ }
+ },
+ onShippingContactChange: function(choosenShippingAddress, updatedRequestData) {
+ let serviceUrl = urlBuilder.build("/rest/V1/novalnet/payment/estimateShippingMethod", {}),
+ payload = {address : choosenShippingAddress};
+
+ new Promise(function(resolve, reject) {
+ storage.post( serviceUrl, JSON.stringify(payload)).done(function(response) {
+ response = JSON.parse(response);
+ resolve(response);
+ }).fail(function(xhr, textStatus, errorThrown) {
+ const errMsg = (xhr.responseJSON.message) ? xhr.responseJSON.message : errorThrown;
+ self.throwError(errMsg);
+ });
+ }).then(function (result) {
+ if (!result.methods.length) {
+ updatedRequestData({methodsNotFound :"No Shipping Contact Available, please enter a valid contact"});
+ } else {
+ updatedRequestData({
+ amount: result.total.amount,
+ lineItems: result.displayItems,
+ methods: result.methods,
+ defaultIdentifier: result.methods[0].identifier
+ });
+ }
+ });
+ },
+ onShippingMethodChange: function(choosenShippingMethod, updatedRequestData) {
+ let serviceUrl = urlBuilder.build("/rest/V1/novalnet/payment/applyShippingMethod", {}),
+ payload = {shippingMethod : choosenShippingMethod};
+
+ new Promise(function(resolve, reject) {
+ storage.post( serviceUrl, JSON.stringify(payload)).done(function(response) {
+ response = JSON.parse(response);
+ resolve(response);
+ }).fail(function(xhr, textStatus, errorThrown) {
+ const errMsg = (xhr.responseJSON.message) ? xhr.responseJSON.message : errorThrown;
+ self.throwError(errMsg);
+ });
+ }).then(function(result) {
+ updatedRequestData({
+ amount: result.total.amount,
+ lineItems: result.displayItems
+ });
+ });
+ },
+ onPaymentButtonClicked: function(clickResult) {
+ clickResult({status: "SUCCESS"});
+ }
+ }
+ }
+ };
+
+ if (requestData.isVirtual) {
+ requestObj.paymentIntent.transaction.setPendingPayment = true;
+ requestObj.paymentIntent.order.shipping = {requiredFields: ["phone", "email"]};
+ }
+
+ return requestObj;
+ },
+
+ /**
+ * Built Googlepay payment request
+ *
+ * @return object
+ */
+ googlePayPaymentRequest: function(btnWidth = 0) {
+ let requestData = window.checkoutConfig.payment.novalnetGooglepay,
+ self = this,
+ requestObj = {
+ clientKey: requestData.clientKey,
+ paymentIntent: {
+ merchant: {
+ countryCode: requestData.countryCode,
+ paymentDataPresent: false,
+ partnerId: requestData.partnerId
+ },
+ transaction: {
+ amount: self.getGrandTotal(),
+ currency: requestData.currencyCode,
+ paymentMethod: self.novalnetGooglepay,
+ environment: (requestData.testmode == 1) ? "SANDBOX" : "PRODUCTION",
+ setPendingPayment: requestData.is_pending,
+ enforce3d: requestData.enforce3d
+ },
+ order: {
+ paymentDataPresent: false,
+ merchantName: requestData.sellerName,
+ lineItems: self.getLineItems(),
+ billing: {
+ requiredFields: ["postalAddress", "phone", "email"]
+ },
+ shipping: {
+ requiredFields: ["postalAddress", "phone"],
+ methodsUpdatedLater: true
+ }
+ },
+ button: {
+ style: requestData.btnTheme,
+ locale: requestData.langCode,
+ type: requestData.btnType,
+ boxSizing: "fill",
+ dimensions: {
+ width: btnWidth,
+ height: parseInt(requestData.btnHeight)
+ }
+ },
+ callbacks: {
+ onProcessCompletion: function (response, bookingResult) {
+ if (response.result.status == "SUCCESS") {
+ let serviceUrl = urlBuilder.build("/rest/V1/novalnet/payment/placeOrder", {}),
+ payload = {
+ paymentData: {
+ methodCode: "novalnetGooglepay",
+ amount: response.transaction.amount,
+ doRedirect: response.transaction.doRedirect,
+ token: response.transaction.token,
+ cardBrand: response.transaction.paymentData.cardBrand,
+ lastFour: response.transaction.paymentData.lastFour
+ },
+ billingAddress: {},
+ shippingAddress: {},
+ shippingMethod: {}
+ };
+
+ if (response.order.hasOwnProperty("billing") && response.order.billing.hasOwnProperty("contact")) {
+ payload.billingAddress = response.order.billing.contact;
+ }
+
+ if (response.order.hasOwnProperty("shipping") && response.order.shipping.hasOwnProperty("contact")) {
+ payload.shippingAddress = response.order.shipping.contact;
+ }
+
+ if (response.order.hasOwnProperty("shipping") && response.order.shipping.hasOwnProperty("method")) {
+ payload.shippingMethod = response.order.shipping.method;
+ }
+
+ storage.post( serviceUrl, JSON.stringify(payload)).done(function(response) {
+ if (self.isJson(response)) {
+ response = JSON.parse(response);
+ }
+ $('body').trigger('processStart');
+ window.location.replace(response.redirectUrl);
+ bookingResult({status: "SUCCESS", statusText: ""});
+ }).fail(function(xhr, textStatus, errorThrown) {
+ $('body').trigger('processStop');
+ const errMsg = (xhr.responseJSON.message) ? xhr.responseJSON.message : errorThrown;
+ self.throwError(errMsg);
+ bookingResult({status: "FAILURE", statusText: errMsg});
+ });
+ } else {
+ $('body').trigger('processStop');
+ bookingResult({status: "FAILURE", statusText: ""});
+ }
+ },
+ onShippingContactChange: function(choosenShippingAddress, updatedRequestData) {
+ let serviceUrl = urlBuilder.build("/rest/V1/novalnet/payment/estimateShippingMethod", {}),
+ payload = {address : choosenShippingAddress};
+
+ new Promise(function(resolve, reject) {
+ storage.post( serviceUrl, JSON.stringify(payload)).done(function(response) {
+ response = JSON.parse(response);
+ resolve(response);
+ }).fail(function(xhr, textStatus, errorThrown) {
+ const errMsg = (xhr.responseJSON.message) ? xhr.responseJSON.message : errorThrown;
+ self.throwError(errMsg);
+ });
+ }).then(function (result) {
+ if (!result.methods.length) {
+ updatedRequestData({methodsNotFound :"No Shipping Contact Available, please enter a valid contact"});
+ } else {
+ updatedRequestData({
+ amount: result.total.amount,
+ lineItems: result.displayItems,
+ methods: result.methods,
+ defaultIdentifier: result.methods[0].identifier
+ });
+ }
+ });
+ },
+ onShippingMethodChange: function(choosenShippingMethod, updatedRequestData) {
+ let serviceUrl = urlBuilder.build("/rest/V1/novalnet/payment/applyShippingMethod", {}),
+ payload = {shippingMethod : choosenShippingMethod};
+
+ new Promise(function(resolve, reject) {
+ storage.post( serviceUrl, JSON.stringify(payload)).done(function(response) {
+ response = JSON.parse(response);
+ resolve(response);
+ }).fail(function(xhr, textStatus, errorThrown) {
+ const errMsg = (xhr.responseJSON.message) ? xhr.responseJSON.message : errorThrown;
+ self.throwError(errMsg);
+ });
+ }).then(function(result) {
+ updatedRequestData({
+ amount: result.total.amount,
+ lineItems: result.displayItems
+ });
+ });
+ },
+ onPaymentButtonClicked: function(clickResult) {
+ clickResult({status: "SUCCESS"});
+ }
+ }
+ }
+ };
+
+ if (quote.isVirtual()) {
+ requestObj.paymentIntent.transaction.setPendingPayment = true;
+ delete requestObj.paymentIntent.order.shipping;
+ }
+
+ return requestObj;
+ },
+
+ /**
+ * Init guest checkout payment buttons
+ *
+ * @see Novalnet_Payment/checkout/novalnetGuestCheckout
+ */
+ initGuestCheckoutPage: function() {
+ const self = this,
+ currentURL = window.location.href,
+ pattern = new RegExp("/checkout/#payment"),
+ paymentPage = pattern.test(currentURL),
+ googlePayInstance = NovalnetPayment().createPaymentObject(),
+ applePayInstance = NovalnetPayment().createPaymentObject();
+
+ googlePayInstance.setPaymentIntent(self.googlePayPaymentRequest());
+ googlePayInstance.isPaymentMethodAvailable(function(canShowGooglepay) {
+ if (canShowGooglepay && paymentPage !== true && window.checkoutConfig.payment.novalnetGooglepay.guest_page.novalnetGooglepay) {
+ $("#novalnet_googlepay_guest_checkout").empty();
+ googlePayInstance.addPaymentButton("#novalnet_googlepay_guest_checkout");
+ $("#novalnet_guest_checkoutdiv").css({"display" : "block"});
+ const btnWidth = ($(window).width() > 768) ? "63%" : "100%";
+ $("#novalnet_googlepay_guest_checkout").find("button").css({'width': btnWidth});
+ $(window).resize(function() {
+ if ($(window).width() > 768) {
+ $("#novalnet_googlepay_guest_checkout").find("button").css({'width': "63%"});
+ } else {
+ $("#novalnet_googlepay_guest_checkout").find("button").css({'width': "100%"});
+ }
+ });
+ } else {
+ $("#novalnet_guest_checkoutdiv").css({"display" : "none"});
+ }
+ });
+
+ applePayInstance.setPaymentIntent(self.applepayPaymentRequest());
+ applePayInstance.isPaymentMethodAvailable(function(canShowApplepay) {
+ if (canShowApplepay && paymentPage !== true && window.checkoutConfig.payment.novalnetGooglepay.guest_page.novalnetApplepay) {
+ $("#novalnet_applepay_guest_checkout").empty();
+ applePayInstance.addPaymentButton('#novalnet_applepay_guest_checkout');
+ $("#novalnet_guest_checkoutdiv").css({"display" : "block"});
+ const btnWidth = ($(window).width() > 768) ? "63%" : "100%";
+ $("#novalnet_applepay_guest_checkout").find("apple-pay-button").css({'width': btnWidth});
+ $(window).resize(function() {
+ if ($(window).width() > 768) {
+ $("#novalnet_applepay_guest_checkout").find("apple-pay-button").css({'width': "63%"});
+ } else {
+ $("#novalnet_applepay_guest_checkout").find("apple-pay-button").css({'width': "100%"});
+ }
+ });
+
+ } else {
+ $("#novalnet_guest_checkoutdiv").css({"display" : "none"});
+ }
+ });
+ }
+ });
+ }
+);
diff --git a/view/frontend/web/js/novalnetCheckoutHelper.js b/view/frontend/web/js/novalnetCheckoutHelper.js
new file mode 100755
index 0000000..cd5ba4b
--- /dev/null
+++ b/view/frontend/web/js/novalnetCheckoutHelper.js
@@ -0,0 +1,612 @@
+/**
+ * Novalnet payment extension
+ *
+ * NOTICE OF LICENSE
+ *
+ * This source file is subject to the Novalnet End User License Agreement
+ * that is bundled with this package in the file LICENSE.txt
+ *
+ * DISCLAIMER
+ *
+ * If you wish to customize Novalnet payment extension for your needs,
+ * please contact technic@novalnet.de for more information.
+ *
+ * @category Novalnet
+ * @package Novalnet_Payment
+ * @copyright Copyright (c) Novalnet AG
+ * @license https://www.novalnet.de/payment-plugins/kostenlos/lizenz
+ */
+define(
+ [
+ 'jquery',
+ 'mage/url',
+ 'mage/storage',
+ 'Magento_Ui/js/modal/alert',
+ 'mage/translate',
+ 'Magento_Catalog/product/view/validation',
+ 'Magento_Customer/js/customer-data',
+ 'novalnetUtilityJs',
+ 'novalnetPaymentJs'
+ ], function(
+ $,
+ urlBuilder,
+ storage,
+ mageAlert,
+ $t,
+ validation,
+ customerData
+ ) {
+ "use strict";
+ return {
+ defaults: {
+ novalnetApplepay: "APPLEPAY",
+ novalnetGooglepay: "GOOGLEPAY",
+ displayBlock: {"display" : "block"},
+ displayNone: {"display" : "none"},
+ },
+
+ /**
+ * Throw's Alert on Ajax Error
+ */
+ throwError: function(message) {
+ mageAlert({
+ title: $t("Error"),
+ content: message
+ });
+ },
+
+ /**
+ * To check the data is JSON
+ *
+ * @return bool
+ */
+ isJson: function(data) {
+ try {
+ JSON.parse(data);
+ return true;
+ } catch (e) {
+ return false;
+ }
+ },
+
+ /**
+ * Returns cart items from quote
+ *
+ * @param callback
+ * @see Novalnet/Payment/view/frontend/templates/checkout/ProductPageShortcut.phtml
+ * @see Novalnet/Payment/view/frontend/templates/checkout/CartPageShortcut.phtml
+ * @see Novalnet/Payment/view/frontend/templates/checkout/MinicartShortcut.phtml
+ */
+ getCartItems: function(callback) {
+ const getCartUrl = urlBuilder.build("/rest/V1/novalnet/payment/getCart", {}),
+ self = this;
+
+ storage.post( getCartUrl, null , false).done(function(response) {
+ if (self.isJson(response)) {
+ response = JSON.parse(response);
+ }
+
+ callback(response);
+ }).fail(function(xhr, textStatus, errorThrown) {
+ const errMsg = (xhr.responseJSON.message) ? xhr.responseJSON.message : errorThrown;
+ self.throwError(errMsg);
+ });
+ },
+
+ /**
+ * Add product to cart
+ *
+ * @param form
+ * @return void
+ */
+ addToCart: function(form) {
+ const addToCartUrl = urlBuilder.build("/rest/V1/novalnet/payment/addToCart", {}),
+ request = form.serialize(),
+ payload = {data : request},
+ self = this;
+
+ storage.post( addToCartUrl, JSON.stringify(payload)).done(function(response) {
+ customerData.reload(["cart"], true);
+ }).fail(function(xhr, textStatus, errorThrown) {
+ const errMsg = (xhr.responseJSON.message) ? xhr.responseJSON.message : errorThrown;
+ self.throwError(errMsg);
+ });
+ },
+
+ /**
+ * Get Initial Params
+ *
+ * @param productId
+ * @param callback
+ * @see Novalnet/Payment/view/frontend/templates/checkout/ProductPageShortcut.phtml
+ */
+ getQuoteValues: function(productId, callback) {
+ const serviceUrl = urlBuilder.build("/rest/V1/novalnet/payment/getProductPageParams", {}),
+ payload = {data : {product_id: productId}},
+ self = this;
+
+ storage.post(serviceUrl, JSON.stringify(payload)).done(function(response) {
+ if (self.isJson(response)) {
+ response = JSON.parse(response);
+ }
+
+ callback(response);
+ }).fail(function(xhr, textStatus, errorThrown) {
+ const errMsg = (xhr.responseJSON.message) ? xhr.responseJSON.message : errorThrown;
+ self.throwError(errMsg);
+ });
+ },
+
+ /**
+ * Built ApplePay Payment Request
+ *
+ * @param requestData
+ * @return object
+ */
+ applepayPaymentRequest: function(requestData, btnWidth = 0, productPage = false) {
+ let self = this,
+ requestObj = {
+ clientKey: requestData.sheetConfig.clientKey,
+ paymentIntent: {
+ merchant: {
+ countryCode: requestData.sheetConfig.countryCode,
+ paymentDataPresent: false
+ },
+ transaction: {
+ amount: requestData.total.amount,
+ currency: requestData.sheetConfig.currencyCode,
+ paymentMethod: self.defaults.novalnetApplepay,
+ environment: requestData.sheetConfig.novalnetApplepay.environment,
+ setPendingPayment: requestData.is_pending
+ },
+ order: {
+ paymentDataPresent: false,
+ merchantName: requestData.sheetConfig.novalnetApplepay.sellerName,
+ lineItems: requestData.displayItems,
+ billing: {
+ requiredFields: ["postalAddress"]
+ },
+ shipping: {
+ requiredFields: ["postalAddress", "phone", "email"],
+ methodsUpdatedLater: true
+ }
+ },
+ button: {
+ style: requestData.sheetConfig.novalnetApplepay.btnTheme,
+ locale: requestData.sheetConfig.langCode,
+ type: requestData.sheetConfig.novalnetApplepay.btnType,
+ boxSizing: "border-box",
+ dimensions: {
+ width: btnWidth,
+ cornerRadius: parseInt(requestData.sheetConfig.novalnetApplepay.btnRadius),
+ height: parseInt(requestData.sheetConfig.novalnetApplepay.btnHeight)
+ }
+ },
+ callbacks: {
+ onProcessCompletion: function (response, bookingResult) {
+ if (response.result.status == "SUCCESS") {
+ let serviceUrl = urlBuilder.build("/rest/V1/novalnet/payment/placeOrder", {}),
+ payload = {
+ paymentData: {
+ methodCode: "novalnetApplepay",
+ amount: response.transaction.amount,
+ doRedirect: response.transaction.doRedirect,
+ token: response.transaction.token,
+ cardBrand: response.transaction.paymentData.cardBrand,
+ lastFour: response.transaction.paymentData.lastFour
+ },
+ billingAddress: {},
+ shippingAddress: {},
+ shippingMethod: {}
+ };
+
+ if (response.order.hasOwnProperty("billing") && response.order.billing.hasOwnProperty("contact")) {
+ payload.billingAddress = response.order.billing.contact;
+ }
+
+ if (response.order.hasOwnProperty("shipping") && response.order.shipping.hasOwnProperty("contact")) {
+ payload.shippingAddress = response.order.shipping.contact;
+ }
+
+ if (response.order.hasOwnProperty("shipping") && response.order.shipping.hasOwnProperty("method")) {
+ payload.shippingMethod = response.order.shipping.method;
+ }
+
+ storage.post( serviceUrl, JSON.stringify(payload)).done(function(response) {
+ if (self.isJson(response)) {
+ response = JSON.parse(response);
+ }
+ $('body').trigger('processStart');
+ window.location.replace(response.redirectUrl);
+ bookingResult({status: "SUCCESS", statusText: ""});
+ }).fail(function(xhr, textStatus, errorThrown) {
+ $('body').trigger('processStop');
+ const errMsg = (xhr.responseJSON.message) ? xhr.responseJSON.message : errorThrown;
+ self.throwError(errMsg);
+ bookingResult({status: "FAILURE", statusText: errMsg});
+ });
+ } else {
+ $('body').trigger('processStop');
+ bookingResult({status: "FAILURE", statusText: ""});
+ }
+ },
+ onShippingContactChange: function(choosenShippingAddress, updatedRequestData) {
+ let serviceUrl = urlBuilder.build("/rest/V1/novalnet/payment/estimateShippingMethod", {}),
+ payload = {address : choosenShippingAddress};
+
+ new Promise(function(resolve, reject) {
+ storage.post( serviceUrl, JSON.stringify(payload)).done(function(response) {
+ response = JSON.parse(response);
+ resolve(response);
+ }).fail(function(xhr, textStatus, errorThrown) {
+ const errMsg = (xhr.responseJSON.message) ? xhr.responseJSON.message : errorThrown;
+ self.throwError(errMsg);
+ });
+ }).then(function (result) {
+ if (!result.methods.length) {
+ updatedRequestData({methodsNotFound :"No Shipping Contact Available, please enter a valid contact"});
+ } else {
+ updatedRequestData({
+ amount: result.total.amount,
+ lineItems: result.displayItems,
+ methods: result.methods,
+ defaultIdentifier: result.methods[0].identifier
+ });
+ }
+ });
+ },
+ onShippingMethodChange: function(choosenShippingMethod, updatedRequestData) {
+ let serviceUrl = urlBuilder.build("/rest/V1/novalnet/payment/applyShippingMethod", {}),
+ payload = {shippingMethod : choosenShippingMethod};
+
+ new Promise(function(resolve, reject) {
+ storage.post( serviceUrl, JSON.stringify(payload)).done(function(response) {
+ response = JSON.parse(response);
+ resolve(response);
+ }).fail(function(xhr, textStatus, errorThrown) {
+ const errMsg = (xhr.responseJSON.message) ? xhr.responseJSON.message : errorThrown;
+ self.throwError(errMsg);
+ });
+ }).then(function(result) {
+ updatedRequestData({
+ amount: result.total.amount,
+ lineItems: result.displayItems
+ });
+ });
+ },
+ onPaymentButtonClicked: function(clickResult) {
+ if (productPage) {
+ const productForm = $("#product_addtocart_form"),
+ validator = productForm.validation({radioCheckboxClosest: ".nested"});
+
+ if (!validator.valid()) {
+ clickResult({status: "FAILURE"});
+ } else {
+ clickResult({status: "SUCCESS"});
+ self.addToCart(productForm);
+ }
+ } else {
+ clickResult({status: "SUCCESS"});
+ }
+ }
+ }
+ }
+ };
+
+ if (requestData.isVirtual) {
+ requestObj.paymentIntent.transaction.setPendingPayment = true;
+ requestObj.paymentIntent.order.shipping = {requiredFields: ["phone", "email"]};
+ }
+
+ return requestObj;
+ },
+
+ /**
+ * GooglePay request data
+ *
+ * @param requestData
+ * @param buttonWidth
+ * @param productPage
+ * @return object
+ */
+ googlePayPaymentRequest: function(requestData, buttonWidth = 0, productPage = false) {
+ let self = this,
+ requestObj = {
+ clientKey: requestData.sheetConfig.clientKey,
+ paymentIntent: {
+ merchant: {
+ countryCode: requestData.sheetConfig.countryCode,
+ paymentDataPresent: false,
+ partnerId: requestData.sheetConfig.novalnetGooglepay.partnerId
+ },
+ transaction: {
+ amount: requestData.total.amount,
+ currency: requestData.sheetConfig.currencyCode,
+ paymentMethod: self.defaults.novalnetGooglepay,
+ environment: requestData.sheetConfig.novalnetGooglepay.environment,
+ setPendingPayment: requestData.is_pending,
+ enforce3d: requestData.sheetConfig.novalnetGooglepay.enforce3d
+ },
+ order: {
+ paymentDataPresent: false,
+ merchantName: requestData.sheetConfig.novalnetGooglepay.sellerName,
+ lineItems: requestData.displayItems,
+ billing: {
+ requiredFields: ["postalAddress", "phone", "email"]
+ },
+ shipping: {
+ requiredFields: ["postalAddress", "phone"],
+ methodsUpdatedLater: true
+ }
+ },
+ button: {
+ style: requestData.sheetConfig.novalnetGooglepay.btnTheme,
+ locale: requestData.sheetConfig.langCode,
+ type: requestData.sheetConfig.novalnetGooglepay.btnType,
+ boxSizing: "fill",
+ dimensions: {
+ width: buttonWidth,
+ height: parseInt(requestData.sheetConfig.novalnetGooglepay.btnHeight)
+ }
+ },
+ callbacks: {
+ onProcessCompletion: function (response, bookingResult) {
+ if (response.result.status == "SUCCESS") {
+ let serviceUrl = urlBuilder.build("/rest/V1/novalnet/payment/placeOrder", {}),
+ payload = {
+ paymentData: {
+ methodCode: "novalnetGooglepay",
+ amount: response.transaction.amount,
+ doRedirect: response.transaction.doRedirect,
+ token: response.transaction.token,
+ cardBrand: response.transaction.paymentData.cardBrand,
+ lastFour: response.transaction.paymentData.lastFour
+ },
+ billingAddress: {},
+ shippingAddress: {},
+ shippingMethod: {}
+ };
+
+ if (response.order.hasOwnProperty("billing") && response.order.billing.hasOwnProperty("contact")) {
+ payload.billingAddress = response.order.billing.contact;
+ }
+
+ if (response.order.hasOwnProperty("shipping") && response.order.shipping.hasOwnProperty("contact")) {
+ payload.shippingAddress = response.order.shipping.contact;
+ }
+
+ if (response.order.hasOwnProperty("shipping") && response.order.shipping.hasOwnProperty("method")) {
+ payload.shippingMethod = response.order.shipping.method;
+ }
+
+ storage.post( serviceUrl, JSON.stringify(payload)).done(function(response) {
+ if (self.isJson(response)) {
+ response = JSON.parse(response);
+ }
+ $('body').trigger('processStart');
+ window.location.replace(response.redirectUrl);
+ bookingResult({status: "SUCCESS", statusText: ''});
+ }).fail(function(xhr, textStatus, errorThrown) {
+ $('body').trigger('processStop');
+ const errMsg = (xhr.responseJSON.message) ? xhr.responseJSON.message : errorThrown;
+ self.throwError(errMsg);
+ bookingResult({status: "FAILURE", statusText: errMsg});
+ });
+ } else {
+ $('body').trigger('processStop');
+ bookingResult({status: "FAILURE", statusText: ''});
+ }
+ },
+ onShippingContactChange: function(choosenShippingAddress, updatedRequestData) {
+ let serviceUrl = urlBuilder.build("/rest/V1/novalnet/payment/estimateShippingMethod", {}),
+ payload = {address : choosenShippingAddress};
+
+ new Promise(function(resolve, reject) {
+ storage.post( serviceUrl, JSON.stringify(payload)).done(function(response) {
+ response = JSON.parse(response);
+ resolve(response);
+ }).fail(function(xhr, textStatus, errorThrown) {
+ const errMsg = (xhr.responseJSON.message) ? xhr.responseJSON.message : errorThrown;
+ self.throwError(errMsg);
+ });
+ }).then(function (result) {
+ if (!result.methods.length) {
+ updatedRequestData({methodsNotFound :"No Shipping Contact Available, please enter a valid contact"});
+ } else {
+ updatedRequestData({
+ amount: result.total.amount,
+ lineItems: result.displayItems,
+ methods: result.methods,
+ defaultIdentifier: result.methods[0].identifier
+ });
+ }
+ });
+ },
+ onShippingMethodChange: function(choosenShippingMethod, updatedRequestData) {
+ let serviceUrl = urlBuilder.build("/rest/V1/novalnet/payment/applyShippingMethod", {}),
+ payload = {shippingMethod : choosenShippingMethod};
+
+ new Promise(function(resolve, reject) {
+ storage.post( serviceUrl, JSON.stringify(payload)).done(function(response) {
+ response = JSON.parse(response);
+ resolve(response);
+ }).fail(function(xhr, textStatus, errorThrown) {
+ const errMsg = (xhr.responseJSON.message) ? xhr.responseJSON.message : errorThrown;
+ self.throwError(errMsg);
+ });
+ }).then(function(result) {
+ updatedRequestData({
+ amount: result.total.amount,
+ lineItems: result.displayItems
+ });
+ });
+ },
+ onPaymentButtonClicked: function(clickResult) {
+ if (productPage) {
+ const productForm = $("#product_addtocart_form"),
+ validator = productForm.validation({radioCheckboxClosest: ".nested"});
+
+ if (!validator.valid()) {
+ clickResult({status: "FAILURE"});
+ } else {
+ self.addToCart(productForm);
+ clickResult({status: "SUCCESS"});
+ }
+ } else {
+ clickResult({status: "SUCCESS"});
+ }
+ }
+ }
+ }
+ };
+
+ if (requestData.isVirtual) {
+ requestObj.paymentIntent.transaction.setPendingPayment = true;
+ delete requestObj.paymentIntent.order.shipping;
+ }
+
+ return requestObj;
+ },
+
+ /**
+ * Init Mini Cart express checkout Button
+ *
+ * @param miniCartQuote
+ * @see Novalnet/Payment/view/frontend/templates/checkout/MinicartShortcut.phtml
+ */
+ initMiniCart: function(miniCartQuote) {
+ const self = this,
+ googlePayMinicartDiv = $("#novalnet_googlepay_minicartdiv"),
+ googlePayMinicartContainer = $("#nn_googlepay_minicart"),
+ applePayMinicartDiv = $("#novalnet_applepay_minicartdiv"),
+ applePayMinicartContainer = $("#nn_applepay_minicart"),
+ googlePayInstance = NovalnetPayment().createPaymentObject(),
+ applePayInstance = NovalnetPayment().createPaymentObject();
+
+ googlePayInstance.setPaymentIntent(self.googlePayPaymentRequest(miniCartQuote));
+ googlePayInstance.isPaymentMethodAvailable(function(canShowGooglePay) {
+ if (canShowGooglePay && miniCartQuote.isEnabled.novalnetGooglepay) {
+ googlePayMinicartContainer.empty();
+ googlePayInstance.addPaymentButton("#nn_googlepay_minicart");
+ googlePayMinicartDiv.css(self.defaults.displayBlock);
+ $("#nn_googlepay_cart").find("button").css({'width': '100%'});
+ } else {
+ googlePayMinicartDiv.css(self.defaults.displayNone);
+ }
+ });
+
+ applePayInstance.setPaymentIntent(self.applepayPaymentRequest(miniCartQuote));
+ applePayInstance.isPaymentMethodAvailable(function(canShowApplePay) {
+ if (canShowApplePay && miniCartQuote.isEnabled.novalnetApplepay) {
+ applePayMinicartContainer.empty();
+ applePayInstance.addPaymentButton("#nn_applepay_minicart");
+ applePayMinicartDiv.css(self.defaults.displayBlock);
+ $("#nn_applepay_minicart").find("apple-pay-button").css({'width': '100%'});
+ } else {
+ applePayMinicartDiv.css(self.defaults.displayNone);
+ }
+ });
+ },
+
+ /**
+ * Init Product Page express checkout Button
+ *
+ * @param isProductVirtual
+ * @param productPageQuote
+ * @see Novalnet/Payment/view/frontend/templates/checkout/ProductPageShortcut.phtml
+ */
+ initProductPage: function(isProductVirtual, productPageQuote) {
+ const self = this,
+ isRequestVirtual = ((isProductVirtual == true && productPageQuote.isVirtual == null) || (isProductVirtual == true && productPageQuote.isVirtual == true) ) ? true : false,
+ googlePayProductDiv = $("#novalnet_googlepay_productdiv"),
+ googlePayProductContainer = $("#nn_googlepay_product"),
+ applePayProductDiv = $("#novalnet_applepay_productdiv"),
+ applePayProductContainer = $("#nn_applepay_product"),
+ googlePayInstance = NovalnetPayment().createPaymentObject(),
+ applePayInstance = NovalnetPayment().createPaymentObject();
+
+ productPageQuote.isVirtual = isRequestVirtual;
+ googlePayInstance.setPaymentIntent(self.googlePayPaymentRequest(productPageQuote, 0, true));
+ googlePayInstance.isPaymentMethodAvailable(function(canShowGooglePay) {
+ if (canShowGooglePay && productPageQuote.isEnabled.novalnetGooglepay) {
+ googlePayProductContainer.empty();
+ googlePayInstance.addPaymentButton("#nn_googlepay_product");
+ googlePayProductDiv.css(self.defaults.displayBlock);
+ const btnWidth = ($(window).width() <= 768) ? "100%" : "49%";
+ $("#nn_googlepay_product").find("button").css({'width': btnWidth});
+ $( window ).resize(function() {
+ if ($(window).width() <= 768) {
+ $("#nn_googlepay_product").find("button").css({'width': "100%"});
+ } else {
+ $("#nn_googlepay_product").find("button").css({'width': "49%"});
+ }
+ });
+ } else {
+ googlePayProductDiv.css(self.defaults.displayNone);
+ }
+ });
+
+ applePayInstance.setPaymentIntent(self.applepayPaymentRequest(productPageQuote, 0, true));
+ applePayInstance.isPaymentMethodAvailable(function(canShowApplePay) {
+ if (canShowApplePay && productPageQuote.isEnabled.novalnetApplepay) {
+ applePayProductContainer.empty();
+ applePayInstance.addPaymentButton("#nn_applepay_product", true);
+ applePayProductDiv.css(self.defaults.displayBlock);
+ const btnWidth = ($(window).width() <= 768) ? "100%" : "49%";
+ $("#nn_applepay_product").find("apple-pay-button").css({'width': btnWidth});
+ $( window ).resize(function() {
+ if ($(window).width() <= 768) {
+ $("#nn_applepay_product").find("apple-pay-button").css({'width': "100%"});
+ } else {
+ $("#nn_applepay_product").find("apple-pay-button").css({'width': "49%"});
+ }
+ });
+
+ } else {
+ applePayProductDiv.css(self.defaults.displayNone);
+ }
+ });
+ },
+
+ /**
+ * Init cart page express checkout button
+ *
+ * @param cartPageQuote
+ * @see Novalnet/Payment/view/frontend/templates/checkout/CartPageShortcut.phtml
+ */
+ initCartPage: function(cartPageQuote) {
+ const self = this,
+ googlePayCartDiv = $("#novalnet_googlepay_cartdiv"),
+ googlePayCartContainer = $("#nn_googlepay_cart"),
+ applePayCartDiv = $("#novalnet_applepay_cartdiv"),
+ applePayCartContainer = $("#nn_applepay_cart"),
+ googlePayInstance = NovalnetPayment().createPaymentObject(),
+ applePayInstance = NovalnetPayment().createPaymentObject();
+
+ googlePayInstance.setPaymentIntent(self.googlePayPaymentRequest(cartPageQuote));
+ googlePayInstance.isPaymentMethodAvailable(function(canShowGooglePay) {
+ if (canShowGooglePay) {
+ googlePayCartContainer.empty();
+ googlePayInstance.addPaymentButton("#nn_googlepay_cart");
+ googlePayCartDiv.css(self.defaults.displayBlock);
+ $("#nn_googlepay_cart").find("button").css({'width': '100%'});
+ } else {
+ googlePayCartDiv.css(self.defaults.displayNone);
+ }
+ });
+
+ applePayInstance.setPaymentIntent(self.applepayPaymentRequest(cartPageQuote));
+ applePayInstance.isPaymentMethodAvailable(function(canShowApplePay) {
+ if (canShowApplePay) {
+ applePayCartContainer.empty();
+ applePayInstance.addPaymentButton("#nn_applepay_cart");
+ applePayCartDiv.css(self.defaults.displayBlock);
+ $("#nn_applepay_cart").find("apple-pay-button").css({'width': '100%'});
+ } else {
+ applePayCartDiv.css(self.defaults.displayNone);
+ }
+ });
+ }
+ };
+ }
+);
diff --git a/view/frontend/web/js/novalnetRefreshMinicart.js b/view/frontend/web/js/novalnetRefreshMinicart.js
new file mode 100755
index 0000000..bb47917
--- /dev/null
+++ b/view/frontend/web/js/novalnetRefreshMinicart.js
@@ -0,0 +1,27 @@
+/**
+ * Novalnet payment extension
+ *
+ * NOTICE OF LICENSE
+ *
+ * This source file is subject to the Novalnet End User License Agreement
+ * that is bundled with this package in the file LICENSE.txt
+ *
+ * DISCLAIMER
+ *
+ * If you wish to customize Novalnet payment extension for your needs,
+ * please contact technic@novalnet.de for more information.
+ *
+ * @category Novalnet
+ * @package Novalnet_Payment
+ * @copyright Copyright (c) Novalnet AG
+ * @license https://www.novalnet.de/payment-plugins/kostenlos/lizenz
+ */
+require([
+ 'Magento_Customer/js/customer-data'
+], function (customerData) {
+ return function() {
+ var sections = ['cart'];
+ customerData.invalidate(sections);
+ customerData.reload(sections, true);
+ }
+});
diff --git a/view/frontend/web/js/view/payment/method-renderer/novalnetAlipay.js b/view/frontend/web/js/view/payment/method-renderer/novalnetAlipay.js
new file mode 100755
index 0000000..74a707c
--- /dev/null
+++ b/view/frontend/web/js/view/payment/method-renderer/novalnetAlipay.js
@@ -0,0 +1,83 @@
+/**
+ * Novalnet payment extension
+ *
+ * NOTICE OF LICENSE
+ *
+ * This source file is subject to the Novalnet End User License Agreement
+ * that is bundled with this package in the file LICENSE.txt
+ *
+ * DISCLAIMER
+ *
+ * If you wish to customize Novalnet payment extension for your needs,
+ * please contact technic@novalnet.de for more information.
+ *
+ * @category Novalnet
+ * @package Novalnet_Payment
+ * @copyright Copyright (c) Novalnet AG
+ * @license https://www.novalnet.de/payment-plugins/kostenlos/lizenz
+ */
+define(
+ [
+ 'jquery',
+ 'mage/url',
+ 'mage/translate',
+ 'Magento_Checkout/js/view/payment/default',
+ 'Magento_Checkout/js/action/redirect-on-success',
+ 'Novalnet_Payment/js/action/get-redirect-url',
+ 'Magento_Ui/js/model/messageList'
+ ],
+ function (
+ $,
+ url,
+ $t,
+ Component,
+ redirectOnSuccessAction,
+ redirectURLAction,
+ globalMessageList
+ ) {
+ 'use strict';
+
+ return Component.extend({
+ defaults: {
+ template: 'Novalnet_Payment/payment/novalnetAlipay'
+ },
+
+ /**
+ * After place order callback
+ */
+ afterPlaceOrder: function () {
+ this.redirectAfterPlaceOrder = false;
+
+ redirectURLAction().done(function (redirectUrl) {
+ window.location.replace(redirectUrl);
+ }).fail(function (xhr, ajaxOptions, thrownError) {
+ globalMessageList.addErrorMessage({
+ message: $t(thrownError)
+ });
+ window.location.replace(url.build('checkout/cart'));
+ });
+ },
+
+ /**
+ * Returns payment method instructions
+ */
+ getInstructions: function () {
+ return window.checkoutConfig.payment[this.getCode()].instructions;
+ },
+
+ /**
+ * Returns payment testmode status
+ */
+ getTestmode: function () {
+ return window.checkoutConfig.payment[this.getCode()].testmode;
+ },
+
+ /**
+ * Returns payment method logo URL
+ */
+ getLogo: function () {
+ return window.checkoutConfig.payment[this.getCode()].logo;
+ }
+ });
+ }
+);
diff --git a/view/frontend/web/js/view/payment/method-renderer/novalnetApplepay.js b/view/frontend/web/js/view/payment/method-renderer/novalnetApplepay.js
new file mode 100755
index 0000000..de8f6f6
--- /dev/null
+++ b/view/frontend/web/js/view/payment/method-renderer/novalnetApplepay.js
@@ -0,0 +1,361 @@
+/**
+ * Novalnet payment extension
+ *
+ * NOTICE OF LICENSE
+ *
+ * This source file is subject to the Novalnet End User License Agreement
+ * that is bundled with this package in the file LICENSE.txt
+ *
+ * DISCLAIMER
+ *
+ * If you wish to customize Novalnet payment extension for your needs,
+ * please contact technic@novalnet.de for more information.
+ *
+ * @category Novalnet
+ * @package Novalnet_Payment
+ * @copyright Copyright (c) Novalnet AG
+ * @license https://www.novalnet.de/payment-plugins/kostenlos/lizenz
+ */
+define(
+ [
+ 'jquery',
+ 'Magento_Checkout/js/view/payment/default',
+ 'Magento_Ui/js/modal/alert',
+ 'Magento_Checkout/js/model/quote',
+ 'mage/translate',
+ 'Magento_Checkout/js/model/totals',
+ 'mage/url',
+ 'mage/storage',
+ 'Magento_Customer/js/customer-data',
+ 'Magento_Checkout/js/model/cart/totals-processor/default',
+ 'Magento_Checkout/js/model/payment/additional-validators',
+ 'novalnetUtilityJs',
+ 'novalnetPaymentJs'
+ ],
+ function(
+ $,
+ Component,
+ alert,
+ quote,
+ $t,
+ totals,
+ urlBuilder,
+ storage,
+ customerData,
+ totalsDefaultProvider,
+ additionalValidators
+ ) {
+ "use strict";
+ let nn_applepay = {
+ /**
+ * Default's
+ */
+ defaults: {
+ template: {
+ name: "Novalnet_Payment/payment/novalnetApplepay"
+ },
+ novalnetApplepay: "APPLEPAY",
+ canShowPaymentMethod: "",
+ applePayInstance: NovalnetPayment().createPaymentObject()
+ },
+
+ /**
+ * Initialize observables
+ */
+ initObservable: function () {
+ this._super().observe(["canShowPaymentMethod"]);
+ let cart = customerData.get("cart");
+ cart.subscribe(this.refreshCheckout, this);
+ return this;
+ },
+
+ /**
+ * Refresh quote grand total on cart change
+ */
+ refreshCheckout: function() {
+ let cart = customerData.get("cart");
+ if (cart().summary_count && cart().summary_count > 0) {
+ totalsDefaultProvider.estimateTotals(quote.shippingAddress());
+ }
+ },
+
+ /**
+ * Returns payment method instructions
+ */
+ getInstructions: function() {
+ return window.checkoutConfig.payment[this.item.method].instructions;
+ },
+
+ /**
+ * Returns payment method logo
+ */
+ getLogo: function() {
+ return window.checkoutConfig.payment[this.item.method].logo;
+ },
+
+ /**
+ * Check payment availability
+ *
+ * @return object Promise
+ */
+ checkAvailability: async function() {
+ const self = this,
+ response = new Promise(function(resolve, reject) {
+ self.applePayInstance.setPaymentIntent(self.paymentRequest());
+ self.applePayInstance.isPaymentMethodAvailable(function(canShowButton) {
+ resolve(canShowButton);
+ });
+ }),
+ isAllowed = await response.then(function(result) {
+ return result;
+ });
+
+ return (isAllowed == true) ? self.canShowPaymentMethod(1) : self.canShowPaymentMethod(0);
+ },
+
+ /**
+ * Can show apple pay payment
+ *
+ * @return bool
+ */
+ isApplePayAllowed: function() {
+ var self = this;
+ self.checkAvailability();
+ return self.canShowPaymentMethod();
+ },
+
+ /**
+ * Returns payment testmode status
+ */
+ getTestmode: function() {
+ return window.checkoutConfig.payment[this.item.method].testmode;
+ },
+
+ /**
+ * Returns Grand Total
+ */
+ getGrandTotal: function() {
+ if (quote.totals()) {
+ return Math.round(parseFloat(quote.totals().base_grand_total) * 100);
+ }
+ },
+
+ /**
+ * Throw's alert on payment error
+ */
+ throwError: function(message) {
+ alert({
+ title: $t("Error"),
+ content: message
+ });
+ },
+
+ /**
+ * To check the data is JSON
+ *
+ * @return bool
+ */
+ isJson: function(data) {
+ try {
+ JSON.parse(data);
+ return true;
+ } catch (e) {
+ return false;
+ }
+ },
+
+ /**
+ * Returns display items for payment sheet
+ *
+ * @return array
+ */
+ getLineItems: function() {
+ let items = totals.totals().items,
+ currencyRate = window.checkoutConfig.quoteData.base_to_quote_rate,
+ lineItem = [],
+ i;
+
+ if (items.length) {
+ for( i = 0; i < items.length; i++ ) {
+ lineItem[i] = {
+ label: items[i].name + " (" + Math.round(parseFloat(items[i].qty)) + " x " + Number.parseFloat(items[i].base_price).toFixed(2) + ")",
+ type: "SUBTOTAL",
+ amount: Math.round((parseFloat(items[i].base_row_total)) * 100) + ""
+ };
+ }
+ }
+
+ if (totals.totals().hasOwnProperty("tax_amount")) {
+ let tax = Math.round( (parseFloat(totals.totals().tax_amount) / parseFloat(currencyRate)) * 100);
+
+ if(parseInt(tax) > 0) {
+ lineItem.push({label: "Tax", type: "SUBTOTAL", amount: tax + ""});
+ }
+ }
+
+ if (totals.totals().hasOwnProperty("discount_amount")) {
+ let discountTotal = (Math.round( (parseFloat(totals.totals().discount_amount) / parseFloat(currencyRate)) * 100)).toString(),
+ discount = ((Math.sign(discountTotal)) == -1 ) ? discountTotal.substr(1) : discountTotal;
+
+ if(parseInt(discount) > 0) {
+ lineItem.push({label: "Discount", type: "SUBTOTAL", amount: "-" + discount});
+ }
+ }
+
+ if (totals.totals().hasOwnProperty("shipping_amount") && !quote.isVirtual()) {
+ let shippingTitle = "Shipping";
+ if (totals.totals().hasOwnProperty("total_segments")) {
+ let segments = totals.totals().total_segments;
+ $.each(segments, function (index, value) {
+ if (value.code == "shipping") {
+ shippingTitle = value.title
+ shippingTitle = shippingTitle.replace("Shipping & Handling", "")
+ }
+ });
+ }
+
+ if (shippingTitle == "") {
+ shippingTitle = "Shipping";
+ }
+
+ let Shipping = Math.round( (parseFloat(totals.totals().shipping_amount) / parseFloat(currencyRate)) * 100),
+ ShippingItem = {label: shippingTitle, type: "SUBTOTAL", amount: Shipping + ''};
+ lineItem.push(ShippingItem);
+ }
+
+ return lineItem;
+ },
+
+ /**
+ * Init checkout page applepay button on DOM load
+ */
+ initApplePay: function() {
+ const self = this;
+
+ $("#novalnet_guest_checkoutdiv").css({"display" : "none"});
+ self.applePayInstance.setPaymentIntent(self.paymentRequest());
+ self.applePayInstance.isPaymentMethodAvailable(function(canShowApplePay) {
+ if (canShowApplePay) {
+ $("#novalnet_applepay_checkoutdiv").empty();
+ self.applePayInstance.addPaymentButton("#novalnet_applepay_checkoutdiv");
+ $("#novalnet_applepay_checkoutdiv").find("apple-pay-button").css({'width': "100%"});
+ }
+ });
+ },
+
+ /**
+ * Applepay Payment Request
+ *
+ * @return object
+ */
+ paymentRequest: function() {
+ const self = this,
+ requestData = window.checkoutConfig.payment.novalnetApplepay;
+
+ return {
+ clientKey: requestData.clientKey,
+ paymentIntent: {
+ merchant: {
+ countryCode: requestData.countryCode,
+ paymentDataPresent: false
+ },
+ transaction: {
+ amount: self.getGrandTotal(),
+ currency: requestData.currencyCode,
+ paymentMethod: self.novalnetApplepay,
+ environment: (requestData.testmode == 1) ? "SANDBOX" : "PRODUCTION",
+ setPendingPayment: quote.isVirtual() ? true : requestData.is_pending
+ },
+ order: {
+ paymentDataPresent: false,
+ merchantName: requestData.sellerName,
+ lineItems: self.getLineItems(),
+ billing: {
+ requiredFields: ["postalAddress"]
+ },
+ shipping: {
+ requiredFields: ["phone", "email"],
+ }
+ },
+ button: {
+ style: requestData.btnTheme,
+ locale: requestData.langCode,
+ type: requestData.btnType,
+ boxSizing: "border-box",
+ dimensions: {
+ width: 240,
+ cornerRadius: parseInt(requestData.btnRadius),
+ height: parseInt(requestData.btnHeight)
+ }
+ },
+ callbacks: {
+ onProcessCompletion: function (response, bookingResult) {
+ if (response.result.status == "SUCCESS") {
+ let serviceUrl = urlBuilder.build("/rest/V1/novalnet/payment/placeOrder", {}),
+ payload = {
+ paymentData: {
+ methodCode: "novalnetApplepay",
+ amount: response.transaction.amount,
+ doRedirect: response.transaction.doRedirect,
+ token: response.transaction.token,
+ cardBrand: response.transaction.paymentData.cardBrand,
+ lastFour: response.transaction.paymentData.lastFour
+ },
+ billingAddress: {},
+ shippingAddress: {},
+ shippingMethod: {},
+ isPaymentPage: true
+ };
+
+ if (response.order.hasOwnProperty("billing") && response.order.billing.hasOwnProperty("contact")) {
+ payload.billingAddress = response.order.billing.contact;
+ }
+
+ if (response.order.hasOwnProperty("shipping") && response.order.shipping.hasOwnProperty("contact")) {
+ payload.shippingAddress = response.order.shipping.contact;
+ }
+
+ storage.post( serviceUrl, JSON.stringify(payload)).done(function(response) {
+ if (self.isJson(response)) {
+ response = JSON.parse(response);
+ }
+ $('body').trigger('processStart');
+ window.location.replace(response.redirectUrl);
+ bookingResult({status: "SUCCESS", statusText: ""});
+ }).fail(function(xhr, textStatus, errorThrown) {
+ $('body').trigger('processStop');
+ const errMsg = (xhr.responseJSON.message) ? xhr.responseJSON.message : errorThrown;
+ self.throwError(errMsg);
+ bookingResult({status: "FAILURE", statusText: errMsg});
+ });
+ } else {
+ $('body').trigger('processStop');
+ bookingResult({status: 'FAILURE', statusText: ""});
+ }
+ },
+ onPaymentButtonClicked: function(clickResult) {
+ clickResult({status: "SUCCESS"});
+ }
+ }
+ }
+ };
+ }
+ };
+
+ $(document).on("click", '#co-payment-form input[type="radio"]', function() {
+ if(this.value == "novalnetApplepay") {
+ const applePayInstance = NovalnetPayment().createPaymentObject();
+ applePayInstance.setPaymentIntent(nn_applepay.paymentRequest());
+ applePayInstance.isPaymentMethodAvailable(function(canShowApplePay) {
+ if (canShowApplePay) {
+ $("#novalnet_applepay_checkoutdiv").empty();
+ applePayInstance.addPaymentButton("#novalnet_applepay_checkoutdiv");
+ $("#novalnet_applepay_checkoutdiv").find("apple-pay-button").css({'width': "100%"});
+ }
+ });
+ }
+ });
+
+ return Component.extend(nn_applepay);
+ }
+);
diff --git a/view/frontend/web/js/view/payment/method-renderer/novalnetBancontact.js b/view/frontend/web/js/view/payment/method-renderer/novalnetBancontact.js
new file mode 100755
index 0000000..837def7
--- /dev/null
+++ b/view/frontend/web/js/view/payment/method-renderer/novalnetBancontact.js
@@ -0,0 +1,83 @@
+/**
+ * Novalnet payment extension
+ *
+ * NOTICE OF LICENSE
+ *
+ * This source file is subject to the Novalnet End User License Agreement
+ * that is bundled with this package in the file LICENSE.txt
+ *
+ * DISCLAIMER
+ *
+ * If you wish to customize Novalnet payment extension for your needs,
+ * please contact technic@novalnet.de for more information.
+ *
+ * @category Novalnet
+ * @package Novalnet_Payment
+ * @copyright Copyright (c) Novalnet AG
+ * @license https://www.novalnet.de/payment-plugins/kostenlos/lizenz
+ */
+define(
+ [
+ 'jquery',
+ 'mage/url',
+ 'mage/translate',
+ 'Magento_Checkout/js/view/payment/default',
+ 'Magento_Checkout/js/action/redirect-on-success',
+ 'Novalnet_Payment/js/action/get-redirect-url',
+ 'Magento_Ui/js/model/messageList'
+ ],
+ function (
+ $,
+ url,
+ $t,
+ Component,
+ redirectOnSuccessAction,
+ redirectURLAction,
+ globalMessageList
+ ) {
+ 'use strict';
+
+ return Component.extend({
+ defaults: {
+ template: 'Novalnet_Payment/payment/novalnetBancontact'
+ },
+
+ /**
+ * After place order callback
+ */
+ afterPlaceOrder: function () {
+ this.redirectAfterPlaceOrder = false;
+
+ redirectURLAction().done(function (redirectUrl) {
+ window.location.replace(redirectUrl);
+ }).fail(function (xhr, ajaxOptions, thrownError) {
+ globalMessageList.addErrorMessage({
+ message: $t(thrownError)
+ });
+ window.location.replace(url.build('checkout/cart'));
+ });
+ },
+
+ /**
+ * Returns payment method instructions
+ */
+ getInstructions: function () {
+ return window.checkoutConfig.payment[this.getCode()].instructions;
+ },
+
+ /**
+ * Returns payment testmode status
+ */
+ getTestmode: function () {
+ return window.checkoutConfig.payment[this.getCode()].testmode;
+ },
+
+ /**
+ * Returns payment method logo URL
+ */
+ getLogo: function () {
+ return window.checkoutConfig.payment[this.getCode()].logo;
+ }
+ });
+ }
+);
diff --git a/view/frontend/web/js/view/payment/method-renderer/novalnetBanktransfer.js b/view/frontend/web/js/view/payment/method-renderer/novalnetBanktransfer.js
new file mode 100755
index 0000000..d603f04
--- /dev/null
+++ b/view/frontend/web/js/view/payment/method-renderer/novalnetBanktransfer.js
@@ -0,0 +1,83 @@
+/**
+ * Novalnet payment extension
+ *
+ * NOTICE OF LICENSE
+ *
+ * This source file is subject to the Novalnet End User License Agreement
+ * that is bundled with this package in the file LICENSE.txt
+ *
+ * DISCLAIMER
+ *
+ * If you wish to customize Novalnet payment extension for your needs,
+ * please contact technic@novalnet.de for more information.
+ *
+ * @category Novalnet
+ * @package Novalnet_Payment
+ * @copyright Copyright (c) Novalnet AG
+ * @license https://www.novalnet.de/payment-plugins/kostenlos/lizenz
+ */
+define(
+ [
+ 'jquery',
+ 'mage/url',
+ 'mage/translate',
+ 'Magento_Checkout/js/view/payment/default',
+ 'Magento_Checkout/js/action/redirect-on-success',
+ 'Novalnet_Payment/js/action/get-redirect-url',
+ 'Magento_Ui/js/model/messageList'
+ ],
+ function (
+ $,
+ url,
+ $t,
+ Component,
+ redirectOnSuccessAction,
+ redirectURLAction,
+ globalMessageList
+ ) {
+ 'use strict';
+
+ return Component.extend({
+ defaults: {
+ template: 'Novalnet_Payment/payment/novalnetBanktransfer'
+ },
+
+ /**
+ * After place order callback
+ */
+ afterPlaceOrder: function () {
+ this.redirectAfterPlaceOrder = false;
+
+ redirectURLAction().done(function (redirectUrl) {
+ window.location.replace(redirectUrl);
+ }).fail(function (xhr, ajaxOptions, thrownError) {
+ globalMessageList.addErrorMessage({
+ message: $t(thrownError)
+ });
+ window.location.replace(url.build('checkout/cart'));
+ });
+ },
+
+ /**
+ * Returns payment method instructions
+ */
+ getInstructions: function () {
+ return window.checkoutConfig.payment[this.getCode()].instructions;
+ },
+
+ /**
+ * Returns payment testmode status
+ */
+ getTestmode: function () {
+ return window.checkoutConfig.payment[this.getCode()].testmode;
+ },
+
+ /**
+ * Returns payment method logo URL
+ */
+ getLogo: function () {
+ return window.checkoutConfig.payment[this.getCode()].logo;
+ }
+ });
+ }
+);
diff --git a/view/frontend/web/js/view/payment/method-renderer/novalnetBlik.js b/view/frontend/web/js/view/payment/method-renderer/novalnetBlik.js
new file mode 100755
index 0000000..645a5dc
--- /dev/null
+++ b/view/frontend/web/js/view/payment/method-renderer/novalnetBlik.js
@@ -0,0 +1,83 @@
+/**
+ * Novalnet payment extension
+ *
+ * NOTICE OF LICENSE
+ *
+ * This source file is subject to the Novalnet End User License Agreement
+ * that is bundled with this package in the file LICENSE.txt
+ *
+ * DISCLAIMER
+ *
+ * If you wish to customize Novalnet payment extension for your needs,
+ * please contact technic@novalnet.de for more information.
+ *
+ * @category Novalnet
+ * @package Novalnet_Payment
+ * @copyright Copyright (c) Novalnet AG
+ * @license https://www.novalnet.de/payment-plugins/kostenlos/lizenz
+ */
+define(
+ [
+ 'jquery',
+ 'mage/url',
+ 'mage/translate',
+ 'Magento_Checkout/js/view/payment/default',
+ 'Magento_Checkout/js/action/redirect-on-success',
+ 'Novalnet_Payment/js/action/get-redirect-url',
+ 'Magento_Ui/js/model/messageList'
+ ],
+ function (
+ $,
+ url,
+ $t,
+ Component,
+ redirectOnSuccessAction,
+ redirectURLAction,
+ globalMessageList
+ ) {
+ 'use strict';
+
+ return Component.extend({
+ defaults: {
+ template: 'Novalnet_Payment/payment/novalnetBlik'
+ },
+
+ /**
+ * After place order callback
+ */
+ afterPlaceOrder: function () {
+ this.redirectAfterPlaceOrder = false;
+
+ redirectURLAction().done(function (redirectUrl) {
+ window.location.replace(redirectUrl);
+ }).fail(function (xhr, ajaxOptions, thrownError) {
+ globalMessageList.addErrorMessage({
+ message: $t(thrownError)
+ });
+ window.location.replace(url.build('checkout/cart'));
+ });
+ },
+
+ /**
+ * Returns payment method instructions
+ */
+ getInstructions: function () {
+ return window.checkoutConfig.payment[this.getCode()].instructions;
+ },
+
+ /**
+ * Returns payment testmode status
+ */
+ getTestmode: function () {
+ return window.checkoutConfig.payment[this.getCode()].testmode;
+ },
+
+ /**
+ * Returns payment method logo URL
+ */
+ getLogo: function () {
+ return window.checkoutConfig.payment[this.getCode()].logo;
+ }
+ });
+ }
+);
diff --git a/view/frontend/web/js/view/payment/method-renderer/novalnetCashpayment.js b/view/frontend/web/js/view/payment/method-renderer/novalnetCashpayment.js
new file mode 100755
index 0000000..72baf62
--- /dev/null
+++ b/view/frontend/web/js/view/payment/method-renderer/novalnetCashpayment.js
@@ -0,0 +1,52 @@
+/**
+ * Novalnet payment extension
+ *
+ * NOTICE OF LICENSE
+ *
+ * This source file is subject to the Novalnet End User License Agreement
+ * that is bundled with this package in the file LICENSE.txt
+ *
+ * DISCLAIMER
+ *
+ * If you wish to customize Novalnet payment extension for your needs,
+ * please contact technic@novalnet.de for more information.
+ *
+ * @category Novalnet
+ * @package Novalnet_Payment
+ * @copyright Copyright (c) Novalnet AG
+ * @license https://www.novalnet.de/payment-plugins/kostenlos/lizenz
+ */
+define(
+ [
+ 'Magento_Checkout/js/view/payment/default'
+ ],
+ function (Component) {
+ 'use strict';
+ return Component.extend({
+ defaults: {
+ template: 'Novalnet_Payment/payment/novalnetCashpayment'
+ },
+
+ /**
+ * Returns payment method instructions
+ */
+ getInstructions: function () {
+ return window.checkoutConfig.payment[this.getCode()].instructions;
+ },
+
+ /**
+ * Returns payment testmode status
+ */
+ getTestmode: function () {
+ return window.checkoutConfig.payment[this.getCode()].testmode;
+ },
+
+ /**
+ * Returns payment method logo URL
+ */
+ getLogo: function () {
+ return window.checkoutConfig.payment[this.getCode()].logo;
+ }
+ });
+ }
+);
diff --git a/view/frontend/web/js/view/payment/method-renderer/novalnetCc.js b/view/frontend/web/js/view/payment/method-renderer/novalnetCc.js
new file mode 100755
index 0000000..1421f21
--- /dev/null
+++ b/view/frontend/web/js/view/payment/method-renderer/novalnetCc.js
@@ -0,0 +1,516 @@
+/**
+ * Novalnet payment extension
+ *
+ * NOTICE OF LICENSE
+ *
+ * This source file is subject to the Novalnet End User License Agreement
+ * that is bundled with this package in the file LICENSE.txt
+ *
+ * DISCLAIMER
+ *
+ * If you wish to customize Novalnet payment extension for your needs,
+ * please contact technic@novalnet.de for more information.
+ *
+ * @category Novalnet
+ * @package Novalnet_Payment
+ * @copyright Copyright (c) Novalnet AG
+ * @license https://www.novalnet.de/payment-plugins/kostenlos/lizenz
+ */
+define(
+ [
+ 'jquery',
+ 'mage/url',
+ 'mage/storage',
+ 'mage/translate',
+ 'Magento_Checkout/js/view/payment/default',
+ 'Magento_Checkout/js/model/url-builder',
+ 'Magento_Customer/js/model/customer',
+ 'Magento_Customer/js/customer-data',
+ 'Magento_Checkout/js/model/cart/totals-processor/default',
+ 'Magento_Checkout/js/model/quote',
+ 'Magento_Ui/js/modal/alert',
+ 'Magento_Ui/js/modal/modal',
+ 'Novalnet_Payment/js/action/get-redirect-url',
+ 'Magento_Ui/js/model/messageList',
+ 'novalnetUtilityJs'
+ ],
+ function (
+ $,
+ url,
+ storage,
+ $t,
+ Component,
+ urlBuilder,
+ customer,
+ customerData,
+ totalsDefaultProvider,
+ quote,
+ alert,
+ modal,
+ redirectURLAction,
+ globalMessageList
+ ) {
+ 'use strict';
+
+ var nn_cc = {
+ defaults: {
+ template: {
+ name: 'Novalnet_Payment/payment/novalnetCc',
+ afterRender: function (renderedNodesArray, data) {
+ data.initIframe();
+ }
+ },
+ ccHashValue: '',
+ ccUniqueid: '',
+ ccDoRedirect: '',
+ novalnetPaymentToken: ''
+ },
+
+ initObservable: function () {
+ this._super()
+ .observe([
+ 'ccHashValue',
+ 'ccUniqueid',
+ 'ccDoRedirect',
+ 'novalnetPaymentToken'
+ ]);
+ this.novalnetPaymentToken.subscribe(this.onAccountChange, this);
+ if (window.checkoutConfig.payment[this.getCode()].tokenId != '' &&
+ window.checkoutConfig.payment[this.getCode()].storePayment == '1') {
+ this.novalnetPaymentToken(window.checkoutConfig.payment[this.getCode()].tokenId);
+ } else {
+ this.novalnetPaymentToken('new_account');
+ }
+ var cart = customerData.get('cart');
+ cart.subscribe(this.refreshCheckout, this);
+ quote.totals.subscribe(this.reLoadIframe, this);
+ return this;
+ },
+
+ refreshCheckout: function() {
+ var cart = customerData.get('cart');
+ if (cart().summary_count && cart().summary_count > 0) {
+ totalsDefaultProvider.estimateTotals(quote.shippingAddress());
+ }
+ },
+
+ reLoadIframe: function() {
+ nn_cc.initIframe();
+ if (window.checkoutConfig.payment[this.getCode()].tokenId != '' &&
+ window.checkoutConfig.payment[this.getCode()].storePayment == '1') {
+ this.novalnetPaymentToken(window.checkoutConfig.payment[this.getCode()].tokenId);
+ this.onAccountChange(window.checkoutConfig.payment[this.getCode()].tokenId);
+ } else {
+ this.novalnetPaymentToken('new_account');
+ this.onAccountChange('new_account');
+ }
+ },
+
+ onAccountChange: function (selectedAccount) {
+ if (selectedAccount == 'new_account') {
+ $("#novalnet_form_cc").show();
+ } else {
+ $("#novalnet_form_cc").hide();
+ }
+ },
+
+ /**
+ * After place order callback
+ */
+ afterPlaceOrder: function () {
+ // check is cc3d
+ if ($('#' + this.getCode() + '_do_redirect').val() != 0) {
+ this.redirectAfterPlaceOrder = false;
+
+ redirectURLAction().done(function (redirectUrl) {
+ window.location.replace(redirectUrl);
+ }).fail(function (xhr, ajaxOptions, thrownError) {
+ globalMessageList.addErrorMessage({
+ message: $t(thrownError)
+ });
+ window.location.replace(url.build('checkout/cart'));
+ });
+ }
+ },
+
+ getData: function () {
+ return {
+ 'method': this.item.method,
+ 'additional_data': {
+ 'novalnetCc_pan_hash': $('#' + this.getCode() + '_hash').val(),
+ 'novalnetCc_unique_id': $('#' + this.getCode() + '_uniqueid').val(),
+ 'novalnetCc_do_redirect': $('#' + this.getCode() + '_do_redirect').val(),
+ 'novalnetCc_create_token': this.canStorePayment(),
+ 'novalnetCc_token': this.getPaymentToken()
+ }
+ };
+ },
+
+ /**
+ * Returns payment method instructions
+ */
+ getInstructions: function () {
+ return window.checkoutConfig.payment[this.getCode()].instructions;
+ },
+
+ /**
+ * Returns payment testmode status
+ */
+ getTestmode: function () {
+ return window.checkoutConfig.payment[this.getCode()].testmode;
+ },
+
+ /**
+ * Returns payment method icons
+ */
+ getIcons: function () {
+ return window.checkoutConfig.payment[this.item.method].icon;
+ },
+
+ getCardlogo : function (cardName) {
+ return window.checkoutConfig.payment[this.getCode()].cardLogoUrl+'/novalnet'+cardName.toLowerCase()+'.png';
+ },
+
+ isZeroAmountBooking: function () {
+ return window.checkoutConfig.payment[this.item.method].isZeroAmountBooking;
+ },
+
+ /**
+ * check can store payment reference
+ */
+ canStorePayment: function () {
+ if (!this.getPaymentToken()) {
+ return ($('#' + this.getCode() + '_store_payment').prop("checked") == true);
+ } else {
+ return false;
+ }
+ },
+
+ /**
+ * check can show store payment
+ */
+ showStorePayment: function () {
+ if (window.checkoutConfig.payment[this.getCode()].storePayment == '1') {
+ return customer.isLoggedIn();
+ } else {
+ return false;
+ }
+ },
+
+ /**
+ * get stored payments
+ */
+ getStoredPayments: function () {
+ if (window.checkoutConfig.payment[this.getCode()].storePayment == '1') {
+ return window.checkoutConfig.payment[this.getCode()].storedPayments;
+ } else {
+ return false;
+ }
+ },
+
+ /**
+ * get payment token
+ */
+ getPaymentToken: function () {
+ if (this.novalnetPaymentToken() && this.novalnetPaymentToken() != 'new_account') {
+ return this.novalnetPaymentToken();
+ } else {
+ return false;
+ }
+ },
+
+ /**
+ * remove payment token
+ */
+ removeToken: function (tokenId) {
+ var parent = this;
+
+ var options = {
+ type: 'popup',
+ modalClass: 'nntoken-remove-popup-modal',
+ responsive: true,
+ innerScroll: false,
+ buttons: [{
+ text: $t('No'),
+ class: 'nntoken-cancel-remove-modal action tocart primary',
+ click: function () {
+ this.closeModal();
+ }
+ },
+ {
+ text: $t('Yes'),
+ class: 'nntoken-confirm-remove-modal action tocart primary',
+ click: function () {
+ var button = this;
+ storage.get(
+ urlBuilder.createUrl('/novalnet/payment/remove_token/' + tokenId, {})
+ ).done(function (response) {
+ button.closeModal();
+ if (response) {
+ $('a[nntoken-id=' + tokenId + ']').closest('.novalnet-payment-saved-payments').remove();
+ if ($('form#novalnetCc .novalnet-payment-saved-payments').length <= 0) {
+ $('form#novalnetCc .novalnet-payment-new_account').remove();
+ }
+ $('#novalnet_form_cc').show();
+ parent.novalnetPaymentToken('new_account');
+ window.location = window.location.hash ;
+ location.reload();
+ } else {
+ alert({
+ content: $t('Novalnet Payment Token does not found')
+ });
+ }
+ }).fail(function (xhr, ajaxOptions, thrownError) {
+ button.closeModal();
+ alert({
+ content: $t(thrownError)
+ });
+ });
+ }
+ }]
+ };
+
+ // Initialize and Open popup
+ modal(options, $('#remove-nntoken-cc-modal'));
+ $("#remove-nntoken-cc-modal").modal("openModal");
+ },
+
+ /**
+ * Returns payment method signature key
+ */
+ initIframe: function () {
+ var paymentCode = "novalnetCc";
+ if ((window.checkoutConfig.payment[paymentCode].storePayment != '1') || (window.checkoutConfig.payment[paymentCode].storedPayments.length == '0')) {
+ this.onAccountChange('new_account');
+ } else {
+ this.onAccountChange(window.checkoutConfig.payment[paymentCode].tokenId);
+ }
+
+ var iframeParams = window.checkoutConfig.payment[paymentCode].iframeParams;
+ NovalnetUtility.setClientKey(iframeParams.client_key);
+ var request = {
+ callback: {
+ on_success: function (result) {
+ if (result) {
+ $('#' + paymentCode + '_hash').val(result['hash']);
+ $('#' + paymentCode + '_uniqueid').val(result['unique_id']);
+ $('#' + paymentCode + '_do_redirect').val(result['do_redirect']);
+ $('#' + paymentCode + '_submit').trigger('click');
+ return false;
+ }
+ },
+ on_error: function (result) {
+ alert({
+ content: result['error_message']
+ });
+ },
+ on_show_overlay: function () {
+ $('#novalnet_iframe').addClass("novalnet-challenge-window-overlay");
+ },
+ on_hide_overlay: function () {
+ $('#novalnet_iframe').removeClass("novalnet-challenge-window-overlay");
+ },
+ on_show_captcha: function (result) {
+ $('#' + this.getCode() + '_gethash').val(0);
+ },
+ },
+ iframe: {
+ id: "novalnet_iframe",
+ inline: window.checkoutConfig.payment[paymentCode].inlineForm,
+ style: {
+ container: window.checkoutConfig.payment[paymentCode].styleText,
+ input: window.checkoutConfig.payment[paymentCode].inputStyle,
+ label: window.checkoutConfig.payment[paymentCode].labelStyle,
+ },
+ text: {
+ lang : iframeParams.lang,
+ error: $t("Your credit card details are invalid"),
+ card_holder : {
+ label: $t("Card holder name"),
+ place_holder: $t("Name on card"),
+ error: $t("Please enter the valid card holder name")
+ },
+ card_number : {
+ label: $t("Card number"),
+ place_holder: $t("XXXX XXXX XXXX XXXX"),
+ error: $t("Please enter the valid card number")
+ },
+ expiry_date : {
+ label: $t("Expiry date"),
+ error: $t("Please enter the valid expiry month / year in the given format")
+ },
+ cvc : {
+ label: $t("CVC/CVV/CID"),
+ place_holder: $t("XXX"),
+ error: $t("Please enter the valid CVC/CVV/CID")
+ }
+ }
+ },
+ customer: this.getCustomerObject(),
+ transaction: {
+ amount: this.getGrandTotal(),
+ currency: window.checkoutConfig.payment[paymentCode].currencyCode,
+ test_mode: window.checkoutConfig.payment[paymentCode].testmode,
+ enforce_3d: window.checkoutConfig.payment[paymentCode].enforce_3d
+ },
+ custom: {
+ lang : iframeParams.lang
+ }
+ };
+ if ($('#novalnet_iframe').length) {
+ NovalnetUtility.createCreditCardForm(request);
+ }
+ },
+
+ getEmail: function () {
+ if(quote.guestEmail) return quote.guestEmail;
+ else return window.checkoutConfig.customerData.email;
+ },
+
+ getCustomerObject : function () {
+ if (quote.isVirtual()) {
+ if (quote.billingAddress() != null) {
+ var customer = {
+ first_name: quote.billingAddress().firstname,
+ last_name: quote.billingAddress().lastname,
+ email: this.getEmail(),
+ billing: {
+ street: this.getStreet(quote.billingAddress().street),
+ city: quote.billingAddress().city,
+ zip: quote.billingAddress().postcode,
+ country_code: quote.billingAddress().countryId
+ },
+ shipping: { same_as_billing: 1 }
+ };
+ return customer;
+ } else {
+ return;
+ }
+ } else if (quote.billingAddress() != null && quote.shippingAddress() != null) {
+ if (this.getStreet(quote.billingAddress().street) == this.getStreet(quote.shippingAddress().street) &&
+ quote.billingAddress().city == quote.shippingAddress().city &&
+ quote.billingAddress().postcode == quote.shippingAddress().postcode &&
+ quote.billingAddress().countryId == quote.shippingAddress().countryId) {
+ var customer = {
+ first_name: quote.billingAddress().firstname,
+ last_name: quote.billingAddress().lastname,
+ email: this.getEmail(),
+ billing: {
+ street: this.getStreet(quote.billingAddress().street),
+ city: quote.billingAddress().city,
+ zip: quote.billingAddress().postcode,
+ country_code: quote.billingAddress().countryId
+ },
+ shipping: { same_as_billing: 1 }
+
+ };
+ } else {
+ var customer = {
+ first_name: quote.billingAddress().firstname,
+ last_name: quote.billingAddress().lastname,
+ email: this.getEmail(),
+ billing: {
+ street: this.getStreet(quote.billingAddress().street),
+ city: quote.billingAddress().city,
+ zip: quote.billingAddress().postcode,
+ country_code: quote.billingAddress().countryId
+ },
+ shipping: {
+ first_name: quote.shippingAddress().firstname,
+ last_name: quote.shippingAddress().lastname,
+ street: this.getStreet(quote.shippingAddress().street),
+ city: quote.shippingAddress().city,
+ zip: quote.shippingAddress().postcode,
+ country_code: quote.shippingAddress().countryId
+ }
+ };
+ }
+ return customer;
+ } else if (quote.billingAddress() != null) {
+ var customer = {
+ first_name: quote.billingAddress().firstname,
+ last_name: quote.billingAddress().lastname,
+ email: this.getEmail(),
+ billing: {
+ street: this.getStreet(quote.billingAddress().street),
+ city: quote.billingAddress().city,
+ zip: quote.billingAddress().postcode,
+ country_code: quote.billingAddress().countryId
+ },
+ shipping: { same_as_billing: 1 }
+ };
+ return customer;
+ } else {
+ return null;
+ }
+ },
+
+ getStreet: function(streetArray) {
+ var i, street = '';
+ if (streetArray) {
+ for(i=0; i 0) {
+ NovalnetUtility.setCreditCardFormHeight();
+ }
+ },
+
+ validate: function () {
+ if (this.getPaymentToken()) {
+ return true;
+ } else {
+ if ($('#' + this.getCode() + '_gethash').val() != 0 && $('#' + this.getCode() + '_hash').val() != '') {
+ $('#' + this.getCode() + '_gethash').val(0);
+ return true;
+ } else {
+ $('#' + this.getCode() + '_gethash').val(1);
+ NovalnetUtility.getPanHash();
+ }
+ }
+
+ return false;
+ },
+ };
+
+ $(document).on('click', '#co-payment-form input[type="radio"]', function (event) {
+ if (this.value == "novalnetCc") {
+ nn_cc.reSize();
+ }
+ });
+
+ $(document).on('click', '.action-update, #billing-address-same-as-shipping-novalnetCc', function (event) {
+ if ($('.payment-method-title input[type="radio"]:checked').val() == "novalnetCc") {
+ nn_cc.initIframe();
+ if($('#novalnetCc_new_account').is(':checked'))
+ {
+ $("#novalnet_form_cc").show();
+ }
+ }
+ });
+
+ $(document).ready(function () {
+ $(window).resize(function () {
+ nn_cc.reSize();
+ });
+ });
+
+ return Component.extend(nn_cc);
+ }
+);
diff --git a/view/frontend/web/js/view/payment/method-renderer/novalnetEps.js b/view/frontend/web/js/view/payment/method-renderer/novalnetEps.js
new file mode 100755
index 0000000..e7a8cb4
--- /dev/null
+++ b/view/frontend/web/js/view/payment/method-renderer/novalnetEps.js
@@ -0,0 +1,83 @@
+/**
+ * Novalnet payment extension
+ *
+ * NOTICE OF LICENSE
+ *
+ * This source file is subject to the Novalnet End User License Agreement
+ * that is bundled with this package in the file LICENSE.txt
+ *
+ * DISCLAIMER
+ *
+ * If you wish to customize Novalnet payment extension for your needs,
+ * please contact technic@novalnet.de for more information.
+ *
+ * @category Novalnet
+ * @package Novalnet_Payment
+ * @copyright Copyright (c) Novalnet AG
+ * @license https://www.novalnet.de/payment-plugins/kostenlos/lizenz
+ */
+define(
+ [
+ 'jquery',
+ 'mage/url',
+ 'mage/translate',
+ 'Magento_Checkout/js/view/payment/default',
+ 'Magento_Checkout/js/action/redirect-on-success',
+ 'Novalnet_Payment/js/action/get-redirect-url',
+ 'Magento_Ui/js/model/messageList'
+ ],
+ function (
+ $,
+ url,
+ $t,
+ Component,
+ redirectOnSuccessAction,
+ redirectURLAction,
+ globalMessageList
+ ) {
+ 'use strict';
+
+ return Component.extend({
+ defaults: {
+ template: 'Novalnet_Payment/payment/novalnetEps'
+ },
+
+ /**
+ * After place order callback
+ */
+ afterPlaceOrder: function () {
+ this.redirectAfterPlaceOrder = false;
+
+ redirectURLAction().done(function (redirectUrl) {
+ window.location.replace(redirectUrl);
+ }).fail(function (xhr, ajaxOptions, thrownError) {
+ globalMessageList.addErrorMessage({
+ message: $t(thrownError)
+ });
+ window.location.replace(url.build('checkout/cart'));
+ });
+ },
+
+ /**
+ * Returns payment method instructions
+ */
+ getInstructions: function () {
+ return window.checkoutConfig.payment[this.getCode()].instructions;
+ },
+
+ /**
+ * Returns payment testmode status
+ */
+ getTestmode: function () {
+ return window.checkoutConfig.payment[this.getCode()].testmode;
+ },
+
+ /**
+ * Returns payment method logo URL
+ */
+ getLogo: function () {
+ return window.checkoutConfig.payment[this.getCode()].logo;
+ }
+ });
+ }
+);
diff --git a/view/frontend/web/js/view/payment/method-renderer/novalnetGiropay.js b/view/frontend/web/js/view/payment/method-renderer/novalnetGiropay.js
new file mode 100755
index 0000000..3700db9
--- /dev/null
+++ b/view/frontend/web/js/view/payment/method-renderer/novalnetGiropay.js
@@ -0,0 +1,83 @@
+/**
+ * Novalnet payment extension
+ *
+ * NOTICE OF LICENSE
+ *
+ * This source file is subject to the Novalnet End User License Agreement
+ * that is bundled with this package in the file LICENSE.txt
+ *
+ * DISCLAIMER
+ *
+ * If you wish to customize Novalnet payment extension for your needs,
+ * please contact technic@novalnet.de for more information.
+ *
+ * @category Novalnet
+ * @package Novalnet_Payment
+ * @copyright Copyright (c) Novalnet AG
+ * @license https://www.novalnet.de/payment-plugins/kostenlos/lizenz
+ */
+define(
+ [
+ 'jquery',
+ 'mage/url',
+ 'mage/translate',
+ 'Magento_Checkout/js/view/payment/default',
+ 'Magento_Checkout/js/action/redirect-on-success',
+ 'Novalnet_Payment/js/action/get-redirect-url',
+ 'Magento_Ui/js/model/messageList'
+ ],
+ function (
+ $,
+ url,
+ $t,
+ Component,
+ redirectOnSuccessAction,
+ redirectURLAction,
+ globalMessageList
+ ) {
+ 'use strict';
+
+ return Component.extend({
+ defaults: {
+ template: 'Novalnet_Payment/payment/novalnetGiropay'
+ },
+
+ /**
+ * After place order callback
+ */
+ afterPlaceOrder: function () {
+ this.redirectAfterPlaceOrder = false;
+
+ redirectURLAction().done(function (redirectUrl) {
+ window.location.replace(redirectUrl);
+ }).fail(function (xhr, ajaxOptions, thrownError) {
+ globalMessageList.addErrorMessage({
+ message: $t(thrownError)
+ });
+ window.location.replace(url.build('checkout/cart'));
+ });
+ },
+
+ /**
+ * Returns payment method instructions
+ */
+ getInstructions: function () {
+ return window.checkoutConfig.payment[this.getCode()].instructions;
+ },
+
+ /**
+ * Returns payment testmode status
+ */
+ getTestmode: function () {
+ return window.checkoutConfig.payment[this.getCode()].testmode;
+ },
+
+ /**
+ * Returns payment method logo URL
+ */
+ getLogo: function () {
+ return window.checkoutConfig.payment[this.getCode()].logo;
+ }
+ });
+ }
+);
diff --git a/view/frontend/web/js/view/payment/method-renderer/novalnetGooglepay.js b/view/frontend/web/js/view/payment/method-renderer/novalnetGooglepay.js
new file mode 100755
index 0000000..65575cb
--- /dev/null
+++ b/view/frontend/web/js/view/payment/method-renderer/novalnetGooglepay.js
@@ -0,0 +1,359 @@
+/**
+ * Novalnet payment extension
+ *
+ * NOTICE OF LICENSE
+ *
+ * This source file is subject to the Novalnet End User License Agreement
+ * that is bundled with this package in the file LICENSE.txt
+ *
+ * DISCLAIMER
+ *
+ * If you wish to customize Novalnet payment extension for your needs,
+ * please contact technic@novalnet.de for more information.
+ *
+ * @category Novalnet
+ * @package Novalnet_Payment
+ * @copyright Copyright (c) Novalnet AG
+ * @license https://www.novalnet.de/payment-plugins/kostenlos/lizenz
+ */
+define(
+ [
+ 'jquery',
+ 'Magento_Checkout/js/view/payment/default',
+ 'Magento_Ui/js/modal/alert',
+ 'Magento_Checkout/js/model/quote',
+ 'mage/translate',
+ 'Magento_Checkout/js/model/totals',
+ 'mage/url',
+ 'mage/storage',
+ 'Magento_Customer/js/customer-data',
+ 'Magento_Checkout/js/model/cart/totals-processor/default',
+ 'Magento_Checkout/js/model/payment/additional-validators',
+ 'novalnetUtilityJs',
+ 'novalnetPaymentJs'
+ ],
+ function(
+ $,
+ Component,
+ alert,
+ quote,
+ $t,
+ totals,
+ urlBuilder,
+ storage,
+ customerData,
+ totalsDefaultProvider,
+ additionalValidators
+ ) {
+ "use strict";
+ let nn_googlepay = {
+ /**
+ * Default's
+ */
+ defaults: {
+ template: {
+ name: "Novalnet_Payment/payment/novalnetGooglepay"
+ },
+ novalnetGooglepay: "GOOGLEPAY",
+ canShowPaymentMethod: "",
+ googlePayInstance: NovalnetPayment().createPaymentObject()
+ },
+
+ /**
+ * Initialize observables
+ */
+ initObservable: function () {
+ this._super().observe(["canShowPaymentMethod"]);
+ let cart = customerData.get("cart");
+ cart.subscribe(this.refreshCheckout, this);
+ return this;
+ },
+
+ /**
+ * Refresh quote grand total on cart change
+ */
+ refreshCheckout: function() {
+ let cart = customerData.get("cart");
+ if (cart().summary_count && cart().summary_count > 0) {
+ totalsDefaultProvider.estimateTotals(quote.shippingAddress());
+ }
+ },
+
+ /**
+ * Returns display items for payment sheet
+ *
+ * @return array
+ */
+ getLineItems: function() {
+ let items = totals.totals().items,
+ currencyRate = window.checkoutConfig.quoteData.base_to_quote_rate,
+ lineItem = [],
+ i;
+
+ if (items.length) {
+ for( i = 0; i < items.length; i++ ) {
+ lineItem[i] = {
+ label: items[i].name + " (" + Math.round(parseFloat(items[i].qty)) + " x " + Number.parseFloat(items[i].base_price).toFixed(2) + ")",
+ type: "SUBTOTAL",
+ amount: Math.round((parseFloat(items[i].base_row_total)) * 100) + ""
+ };
+ }
+ }
+
+ if (totals.totals().hasOwnProperty("tax_amount")) {
+ let tax = Math.round( (parseFloat(totals.totals().tax_amount) / parseFloat(currencyRate)) * 100);
+
+ if(parseInt(tax) > 0) {
+ lineItem.push({label: "Tax", type: "SUBTOTAL", amount: tax + ""});
+ }
+ }
+
+ if (totals.totals().hasOwnProperty("discount_amount")) {
+ let discountTotal = (Math.round( (parseFloat(totals.totals().discount_amount) / parseFloat(currencyRate)) * 100)).toString(),
+ discount = ((Math.sign(discountTotal)) == -1 ) ? discountTotal.substr(1) : discountTotal;
+
+ if(parseInt(discount) > 0) {
+ lineItem.push({label: "Discount", type: "SUBTOTAL", amount: "-" + discount});
+ }
+ }
+
+ if (totals.totals().hasOwnProperty("shipping_amount") && !quote.isVirtual()) {
+ let shippingTitle = "Shipping";
+ if (totals.totals().hasOwnProperty("total_segments")) {
+ let segments = totals.totals().total_segments;
+ $.each(segments, function (index, value) {
+ if (value.code == "shipping") {
+ shippingTitle = value.title
+ shippingTitle = shippingTitle.replace("Shipping & Handling", "")
+ }
+ });
+ }
+
+ if (shippingTitle == "") {
+ shippingTitle = "Shipping";
+ }
+
+ let Shipping = Math.round( (parseFloat(totals.totals().shipping_amount) / parseFloat(currencyRate)) * 100),
+ ShippingItem = {label: shippingTitle, type: "SUBTOTAL", amount: Shipping + ''};
+ lineItem.push(ShippingItem);
+ }
+
+ return lineItem;
+ },
+
+ /**
+ * Returns Grand Total
+ */
+ getGrandTotal: function() {
+ if (quote.totals()) {
+ return Math.round(parseFloat(quote.totals().base_grand_total) * 100);
+ }
+ },
+
+ /**
+ * To check the data is JSON
+ *
+ * @return bool
+ */
+ isJson: function(data) {
+ try {
+ JSON.parse(data);
+ return true;
+ } catch (e) {
+ return false;
+ }
+ },
+
+ /**
+ * Returns payment method instructions
+ *
+ * @return string
+ */
+ getInstructions: function() {
+ return window.checkoutConfig.payment[this.item.method].instructions;
+ },
+
+ /**
+ * Returns payment method logo
+ *
+ * @return string
+ */
+ getLogo: function() {
+ return window.checkoutConfig.payment[this.item.method].logo;
+ },
+
+ /**
+ * Check payment availability
+ *
+ * @return object Promise
+ */
+ checkAvailability: async function() {
+ const self = this,
+ response = new Promise(function(resolve, reject) {
+ self.googlePayInstance.setPaymentIntent(self.paymentRequest());
+ self.googlePayInstance.isPaymentMethodAvailable(function(canShowButton) {
+ resolve(canShowButton);
+ });
+ }),
+ isAllowed = await response.then(function(result) {
+ return result;
+ });
+
+ return (isAllowed == true) ? self.canShowPaymentMethod(1) : self.canShowPaymentMethod(0);
+ },
+
+ /**
+ * Can show google pay payment
+ *
+ * @return bool
+ */
+ isGooglePayAllowed: function() {
+ var self = this;
+ self.checkAvailability();
+ return self.canShowPaymentMethod();
+ },
+
+ /**
+ * Init GooglePay button
+ */
+ initGooglePay: function() {
+ const self = this;
+
+ $("#novalnet_guest_checkoutdiv").css({"display" : "none"});
+ self.googlePayInstance.setPaymentIntent(self.paymentRequest());
+ self.googlePayInstance.isPaymentMethodAvailable(function(canShowGooglePay) {
+ if (canShowGooglePay) {
+ $("#novalnet_googlepay_checkoutdiv").empty();
+ self.googlePayInstance.addPaymentButton("#novalnet_googlepay_checkoutdiv");
+ $("#novalnet_googlepay_checkoutdiv").find("button").css({'width': "100%"});
+ }
+ });
+ },
+
+ /**
+ * Returns payment testmode status
+ *
+ * @return string
+ */
+ getTestmode: function() {
+ return window.checkoutConfig.payment[this.item.method].testmode;
+ },
+
+ /**
+ * Throw's alert on payment error
+ */
+ throwError: function(message) {
+ alert({
+ title: $t("Error"),
+ content: message
+ });
+ },
+
+ /**
+ * GooglePay payment request
+ */
+ paymentRequest: function(btnWidth = 0) {
+ const self = this,
+ requestData = window.checkoutConfig.payment.novalnetGooglepay;
+
+ return {
+ clientKey: requestData.clientKey,
+ paymentIntent: {
+ merchant: {
+ countryCode: requestData.countryCode,
+ paymentDataPresent: false,
+ partnerId: requestData.partnerId
+ },
+ transaction: {
+ amount: self.getGrandTotal(),
+ currency: requestData.currencyCode,
+ paymentMethod: self.novalnetGooglepay,
+ environment: (requestData.testmode == 1) ? "SANDBOX" : "PRODUCTION",
+ setPendingPayment: quote.isVirtual() ? true : requestData.is_pending,
+ enforce3d: requestData.enforce3d
+ },
+ order: {
+ paymentDataPresent: false,
+ merchantName: requestData.sellerName,
+ lineItems: self.getLineItems(),
+ billing: {
+ requiredFields: ["postalAddress", "phone", "email"]
+ }
+ },
+ button: {
+ style: requestData.btnTheme,
+ locale: requestData.langCode,
+ type: requestData.btnType,
+ boxSizing: "fill",
+ dimensions: {
+ width: btnWidth,
+ height: parseInt(requestData.btnHeight)
+ }
+ },
+ callbacks: {
+ onProcessCompletion: function (response, bookingResult) {
+ if (response.result.status == "SUCCESS") {
+ let serviceUrl = urlBuilder.build("/rest/V1/novalnet/payment/placeOrder", {}),
+ payload = {
+ paymentData: {
+ methodCode: "novalnetGooglepay",
+ amount: response.transaction.amount,
+ doRedirect: response.transaction.doRedirect,
+ token: response.transaction.token,
+ cardBrand: response.transaction.paymentData.cardBrand,
+ lastFour: response.transaction.paymentData.lastFour
+ },
+ billingAddress: {},
+ shippingAddress: {},
+ shippingMethod: {},
+ isPaymentPage: true
+ };
+
+ if (response.order.hasOwnProperty("billing") && response.order.billing.hasOwnProperty("contact")) {
+ payload.billingAddress = response.order.billing.contact;
+ }
+
+ storage.post( serviceUrl, JSON.stringify(payload)).done(function(response) {
+ if (self.isJson(response)) {
+ response = JSON.parse(response);
+ }
+ $('body').trigger('processStart');
+ window.location.replace(response.redirectUrl);
+ bookingResult({status: "SUCCESS", statusText: ""});
+ }).fail(function(xhr, textStatus, errorThrown) {
+ $('body').trigger('processStop');
+ const errMsg = (xhr.responseJSON.message) ? xhr.responseJSON.message : errorThrown;
+ self.throwError(errMsg);
+ bookingResult({status: "FAILURE", statusText: errMsg});
+ });
+ } else {
+ $('body').trigger('processStop');
+ bookingResult({status: "FAILURE", statusText: ""});
+ }
+ }
+ },
+ onPaymentButtonClicked: function(clickResult) {
+ clickResult({status: "SUCCESS"});
+ }
+ }
+ };
+ }
+ };
+
+ $(document).on("click", '#co-payment-form input[type="radio"]', function() {
+ if(this.value == "novalnetGooglepay") {
+ const googlePayInstance = NovalnetPayment().createPaymentObject();
+ googlePayInstance.setPaymentIntent(nn_googlepay.paymentRequest());
+ googlePayInstance.isPaymentMethodAvailable(function(canShowGooglePay) {
+ if (canShowGooglePay) {
+ $("#novalnet_googlepay_checkoutdiv").empty();
+ googlePayInstance.addPaymentButton("#novalnet_googlepay_checkoutdiv");
+ $("#novalnet_googlepay_checkoutdiv").find("button").css({'width': "100%"});
+ }
+ });
+ }
+ });
+
+ return Component.extend(nn_googlepay);
+ }
+);
diff --git a/view/frontend/web/js/view/payment/method-renderer/novalnetIdeal.js b/view/frontend/web/js/view/payment/method-renderer/novalnetIdeal.js
new file mode 100755
index 0000000..aa846f3
--- /dev/null
+++ b/view/frontend/web/js/view/payment/method-renderer/novalnetIdeal.js
@@ -0,0 +1,83 @@
+/**
+ * Novalnet payment extension
+ *
+ * NOTICE OF LICENSE
+ *
+ * This source file is subject to the Novalnet End User License Agreement
+ * that is bundled with this package in the file LICENSE.txt
+ *
+ * DISCLAIMER
+ *
+ * If you wish to customize Novalnet payment extension for your needs,
+ * please contact technic@novalnet.de for more information.
+ *
+ * @category Novalnet
+ * @package Novalnet_Payment
+ * @copyright Copyright (c) Novalnet AG
+ * @license https://www.novalnet.de/payment-plugins/kostenlos/lizenz
+ */
+define(
+ [
+ 'jquery',
+ 'mage/url',
+ 'mage/translate',
+ 'Magento_Checkout/js/view/payment/default',
+ 'Magento_Checkout/js/action/redirect-on-success',
+ 'Novalnet_Payment/js/action/get-redirect-url',
+ 'Magento_Ui/js/model/messageList'
+ ],
+ function (
+ $,
+ url,
+ $t,
+ Component,
+ redirectOnSuccessAction,
+ redirectURLAction,
+ globalMessageList
+ ) {
+ 'use strict';
+
+ return Component.extend({
+ defaults: {
+ template: 'Novalnet_Payment/payment/novalnetIdeal'
+ },
+
+ /**
+ * After place order callback
+ */
+ afterPlaceOrder: function () {
+ this.redirectAfterPlaceOrder = false;
+
+ redirectURLAction().done(function (redirectUrl) {
+ window.location.replace(redirectUrl);
+ }).fail(function (xhr, ajaxOptions, thrownError) {
+ globalMessageList.addErrorMessage({
+ message: $t(thrownError)
+ });
+ window.location.replace(url.build('checkout/cart'));
+ });
+ },
+
+ /**
+ * Returns payment method instructions
+ */
+ getInstructions: function () {
+ return window.checkoutConfig.payment[this.getCode()].instructions;
+ },
+
+ /**
+ * Returns payment testmode status
+ */
+ getTestmode: function () {
+ return window.checkoutConfig.payment[this.getCode()].testmode;
+ },
+
+ /**
+ * Returns payment method logo URL
+ */
+ getLogo: function () {
+ return window.checkoutConfig.payment[this.getCode()].logo;
+ }
+ });
+ }
+);
diff --git a/view/frontend/web/js/view/payment/method-renderer/novalnetInvoice.js b/view/frontend/web/js/view/payment/method-renderer/novalnetInvoice.js
new file mode 100755
index 0000000..714b6bd
--- /dev/null
+++ b/view/frontend/web/js/view/payment/method-renderer/novalnetInvoice.js
@@ -0,0 +1,108 @@
+/**
+ * Novalnet payment extension
+ *
+ * NOTICE OF LICENSE
+ *
+ * This source file is subject to the Novalnet End User License Agreement
+ * that is bundled with this package in the file LICENSE.txt
+ *
+ * DISCLAIMER
+ *
+ * If you wish to customize Novalnet payment extension for your needs,
+ * please contact technic@novalnet.de for more information.
+ *
+ * @category Novalnet
+ * @package Novalnet_Payment
+ * @copyright Copyright (c) Novalnet AG
+ * @license https://www.novalnet.de/payment-plugins/kostenlos/lizenz
+ */
+define(
+ [
+ 'jquery',
+ 'Magento_Checkout/js/model/quote',
+ 'Magento_Checkout/js/checkout-data',
+ 'Magento_Checkout/js/action/select-payment-method',
+ 'Magento_Checkout/js/view/payment/default'
+ ],
+ function (
+ $,
+ quote,
+ checkoutData,
+ selectPaymentMethodAction,
+ Component
+ ) {
+ 'use strict';
+
+ return Component.extend({
+ defaults: {
+ template: {
+ name: 'Novalnet_Payment/payment/novalnetInvoice',
+ afterRender: function (renderedNodesArray, data) {
+ data.displayPayment();
+ },
+ },
+ },
+
+ /**
+ * Returns payment method instructions
+ */
+ getInstructions: function () {
+ return window.checkoutConfig.payment[this.getCode()].instructions;
+ },
+
+ /**
+ * Returns payment testmode status
+ */
+ getTestmode: function () {
+ return window.checkoutConfig.payment[this.getCode()].testmode;
+ },
+
+ /**
+ * Returns payment method logo URL
+ */
+ getLogo: function () {
+ return window.checkoutConfig.payment[this.getCode()].logo;
+ },
+
+ displayPayment: function () {
+ if ($('input[id="novalnetInvoice"][name="payment[method]"]').length && $('input[id="novalnetInvoiceGuarantee"][name="payment[method]"]').length) {
+ if (JSON.stringify(quote.billingAddress()) == JSON.stringify(quote.shippingAddress()) || quote.isVirtual()) {
+ if ($('input[id="novalnetInvoice"][name="payment[method]"]:visible').length) {
+ $('input[id="novalnetInvoice"][name="payment[method]"]').closest('.payment-method').hide();
+ }
+ if ($('input[id="novalnetInvoiceGuarantee"][name="payment[method]"]:hidden').length) {
+ $('input[id="novalnetInvoiceGuarantee"][name="payment[method]"]').closest('.payment-method').show();
+ if (checkoutData.getSelectedPaymentMethod() == 'novalnetInvoice') {
+ var methodData = {
+ 'method': 'novalnetInvoiceGuarantee',
+ 'additional_data': {}
+ };
+ selectPaymentMethodAction(methodData);
+ checkoutData.setSelectedPaymentMethod(methodData.method);
+ }
+ }
+ } else {
+ if ($('input[id="novalnetInvoiceGuarantee"][name="payment[method]"]:visible').length) {
+ $('input[id="novalnetInvoiceGuarantee"][name="payment[method]"]').closest('.payment-method').hide();
+ }
+ if ($('input[id="novalnetInvoice"][name="payment[method]"]:hidden').length) {
+ $('input[id="novalnetInvoice"][name="payment[method]"]').closest('.payment-method').show();
+ if (checkoutData.getSelectedPaymentMethod() == 'novalnetInvoiceGuarantee') {
+ var methodData = {
+ 'method': 'novalnetInvoice',
+ 'additional_data': {}
+ };
+ selectPaymentMethodAction(methodData);
+ checkoutData.setSelectedPaymentMethod(methodData.method);
+ }
+ }
+ }
+ } else if (($('input[id="novalnetInvoice"][name="payment[method]"]').length && !$('input[id="novalnetInvoiceGuarantee"][name="payment[method]"]').length)) {
+ $('input[id="novalnetInvoice"][name="payment[method]"]').closest('.payment-method').show();
+ } else if ((!$('input[id="novalnetInvoice"][name="payment[method]"]').length && $('input[id="novalnetInvoiceGuarantee"][name="payment[method]"]').length)) {
+ $('input[id="novalnetInvoiceGuarantee"][name="payment[method]"]').closest('.payment-method').show();
+ }
+ }
+ });
+ }
+);
diff --git a/view/frontend/web/js/view/payment/method-renderer/novalnetInvoiceGuarantee.js b/view/frontend/web/js/view/payment/method-renderer/novalnetInvoiceGuarantee.js
new file mode 100755
index 0000000..9649b41
--- /dev/null
+++ b/view/frontend/web/js/view/payment/method-renderer/novalnetInvoiceGuarantee.js
@@ -0,0 +1,164 @@
+/**
+ * Novalnet payment extension
+ *
+ * NOTICE OF LICENSE
+ *
+ * This source file is subject to the Novalnet End User License Agreement
+ * that is bundled with this package in the file LICENSE.txt
+ *
+ * DISCLAIMER
+ *
+ * If you wish to customize Novalnet payment extension for your needs,
+ * please contact technic@novalnet.de for more information.
+ *
+ * @category Novalnet
+ * @package Novalnet_Payment
+ * @copyright Copyright (c) Novalnet AG
+ * @license https://www.novalnet.de/payment-plugins/kostenlos/lizenz
+ */
+define(
+ [
+ 'jquery',
+ 'Magento_Checkout/js/view/payment/default',
+ 'Magento_Checkout/js/model/quote',
+ 'Magento_Checkout/js/checkout-data',
+ 'Magento_Checkout/js/action/select-payment-method',
+ 'mage/validation',
+ 'novalnetUtilityJs'
+ ],
+ function (
+ $,
+ Component,
+ quote,
+ checkoutData,
+ selectPaymentMethodAction,
+ ) {
+ 'use strict';
+
+ var current_date = new Date();
+ var max_year = current_date.getFullYear() - 18;
+ var min_year = current_date.getFullYear() - 91;
+ var years_range = [];
+ for(var year = max_year; year >= min_year; year--) {
+ years_range.push(String(year));
+ }
+
+ return Component.extend({
+ defaults: {
+ template: {
+ name: 'Novalnet_Payment/payment/novalnetInvoiceGuarantee',
+ afterRender: function (renderedNodesArray, data) {
+ data.displayPayment();
+ }
+ },
+ },
+ currentBillingAddress: quote.billingAddress,
+
+ getData: function () {
+ return {
+ 'method': this.item.method,
+ 'additional_data': {
+ 'novalnetInvoiceGuarantee_dob': $('#' + this.getCode() + '_dob').val(),
+ }
+ };
+ },
+
+ displayPayment: function () {
+ if ($('input[id="novalnetInvoice"][name="payment[method]"]').length && $('input[id="novalnetInvoiceGuarantee"][name="payment[method]"]').length) {
+ if (JSON.stringify(quote.billingAddress()) == JSON.stringify(quote.shippingAddress()) || quote.isVirtual()) {
+ if ($('input[id="novalnetInvoice"][name="payment[method]"]:visible').length) {
+ $('input[id="novalnetInvoice"][name="payment[method]"]').closest('.payment-method').hide();
+ }
+ if ($('input[id="novalnetInvoiceGuarantee"][name="payment[method]"]:hidden').length) {
+ $('input[id="novalnetInvoiceGuarantee"][name="payment[method]"]').closest('.payment-method').show();
+ if (checkoutData.getSelectedPaymentMethod() == 'novalnetInvoice') {
+ var methodData = {
+ 'method': 'novalnetInvoiceGuarantee',
+ 'additional_data': {}
+ };
+ selectPaymentMethodAction(methodData);
+ checkoutData.setSelectedPaymentMethod(methodData.method);
+ }
+ }
+ } else {
+ if ($('input[id="novalnetInvoiceGuarantee"][name="payment[method]"]:visible').length) {
+ $('input[id="novalnetInvoiceGuarantee"][name="payment[method]"]').closest('.payment-method').hide();
+ }
+ if ($('input[id="novalnetInvoice"][name="payment[method]"]:hidden').length) {
+ $('input[id="novalnetInvoice"][name="payment[method]"]').closest('.payment-method').show();
+ if (checkoutData.getSelectedPaymentMethod() == 'novalnetInvoiceGuarantee') {
+ var methodData = {
+ 'method': 'novalnetInvoice',
+ 'additional_data': {}
+ };
+ selectPaymentMethodAction(methodData);
+ checkoutData.setSelectedPaymentMethod(methodData.method);
+ }
+ }
+ }
+ }
+ if (($('input[id="novalnetInvoice"][name="payment[method]"]').length && !$('input[id="novalnetInvoiceGuarantee"][name="payment[method]"]').length)) {
+ $('input[id="novalnetInvoice"][name="payment[method]"]').closest('.payment-method').show();
+ }
+ if ((!$('input[id="novalnetInvoice"][name="payment[method]"]').length && $('input[id="novalnetInvoiceGuarantee"][name="payment[method]"]').length)) {
+ $('input[id="novalnetInvoiceGuarantee"][name="payment[method]"]').closest('.payment-method').show();
+ }
+ },
+
+ /**
+ * Returns payment method instructions
+ */
+ getInstructions: function () {
+ return window.checkoutConfig.payment[this.getCode()].instructions;
+ },
+
+ /**
+ * Returns payment testmode status
+ */
+ getTestmode: function () {
+ return window.checkoutConfig.payment[this.getCode()].testmode;
+ },
+
+ /**
+ * Returns payment method logo URL
+ */
+ getLogo: function () {
+ return window.checkoutConfig.payment[this.getCode()].logo;
+ },
+
+ /**
+ * get DOB
+ */
+ getDob: function () {
+ if (window.checkoutConfig.customerData.dob) {
+ var date = new Date(window.checkoutConfig.customerData.dob);
+ var newDate = ("0" + date.getDate()).slice(-2)+'.'+("0" + (date.getMonth() + 1)).slice(-2)+'.'+date.getFullYear();
+ return newDate;
+ }
+ },
+
+ validate: function () {
+ var form = 'form[data-role=novalnetInvoiceGuarantee]';
+ return $(form).validation() && $(form).validation('isValid');
+ },
+
+ validateCompany: function (company) {
+ if (company != null && window.checkoutConfig.payment[this.getCode()].allow_b2b_customer == 1) {
+ if (!NovalnetUtility.isValidCompanyName(company)) {
+ return false;
+ } else {
+ return true;
+ }
+ }
+ return false;
+ },
+
+ allowOnlyNumber: function (data, event) {
+ if(event.charCode < 48 || event.charCode > 57) {
+ return false;
+ }
+ return true;
+ },
+ });
+ }
+);
diff --git a/view/frontend/web/js/view/payment/method-renderer/novalnetInvoiceInstalment.js b/view/frontend/web/js/view/payment/method-renderer/novalnetInvoiceInstalment.js
new file mode 100755
index 0000000..0b8cae7
--- /dev/null
+++ b/view/frontend/web/js/view/payment/method-renderer/novalnetInvoiceInstalment.js
@@ -0,0 +1,189 @@
+/**
+ * Novalnet payment extension
+ *
+ * NOTICE OF LICENSE
+ *
+ * This source file is subject to the Novalnet End User License Agreement
+ * that is bundled with this package in the file LICENSE.txt
+ *
+ * DISCLAIMER
+ *
+ * If you wish to customize Novalnet payment extension for your needs,
+ * please contact technic@novalnet.de for more information.
+ *
+ * @category Novalnet
+ * @package Novalnet_Payment
+ * @copyright Copyright (c) Novalnet AG
+ * @license https://www.novalnet.de/payment-plugins/kostenlos/lizenz
+ */
+define(
+ [
+ 'jquery',
+ 'mage/translate',
+ 'mage/storage',
+ 'Magento_Checkout/js/model/url-builder',
+ 'Magento_Checkout/js/view/payment/default',
+ 'Magento_Checkout/js/model/quote',
+ 'Magento_Catalog/js/price-utils',
+ 'mage/validation',
+ 'novalnetUtilityJs'
+ ],
+ function (
+ $,
+ $t,
+ storage,
+ urlBuilder,
+ Component,
+ quote,
+ priceUtils
+ ) {
+ 'use strict';
+
+ $(document).on('change','#novalnetInvoiceInstalment_cycle',function(){
+ var orderTotal = quote.totals()['base_grand_total'];
+ var cycle = $(this).val();
+ if (cycle == null) {
+ return;
+ }
+ var cycleAmount;
+ var lastCycleAmount;
+ storage.get(
+ urlBuilder.createUrl('/novalnet/payment/instalment_cycle/' + orderTotal + '/' + cycle, {})
+ ).done(function (response) {
+ response = $.parseJSON(response);
+ cycleAmount = response.cycle_amount;
+ lastCycleAmount = response.last_cycle;
+ var html = '' + $.mage.__("Instalment cycles") + ' ' + $.mage.__("Instalment Amount") + ' ';
+ var j = 0;
+ var number_text = '';
+ for (var i = 1; i <= cycle; i++) {
+ if (i != cycle) {
+ html += ''+ i + ' ' + priceUtils.formatPrice(cycleAmount, quote.getPriceFormat()) + ' ';
+ } else if (i == cycle) {
+ html += ''+ i + ' ' + priceUtils.formatPrice(lastCycleAmount, quote.getPriceFormat()) + ' ';
+ }
+ j++;
+ }
+
+ $('.novalnetInvoiceInstalment-details').html(html);
+ });
+ });
+
+ var current_date = new Date();
+ var max_year = current_date.getFullYear() - 18;
+ var min_year = current_date.getFullYear() - 91;
+ var years_range = [];
+ for(var year = max_year; year >= min_year; year--) {
+ years_range.push(String(year));
+ }
+
+ return Component.extend({
+ defaults: {
+ template: {
+ name: 'Novalnet_Payment/payment/novalnetInvoiceInstalment',
+ afterRender: function (renderedNodesArray, data) {
+ }
+ },
+ },
+ currentBillingAddress: quote.billingAddress,
+ totals: quote.getTotals(),
+
+ getData: function () {
+ return {
+ 'method': this.item.method,
+ 'additional_data': {
+ 'novalnetInvoiceInstalment_cycle': $('#' + this.getCode() + '_cycle').val(),
+ 'novalnetInvoiceInstalment_dob': $('#' + this.getCode() + '_dob').val(),
+ }
+ };
+ },
+
+ /**
+ * Returns payment method instructions
+ */
+ getInstructions: function () {
+ return window.checkoutConfig.payment[this.getCode()].instructions;
+ },
+
+ /**
+ * Returns payment testmode status
+ */
+ getTestmode: function () {
+ return window.checkoutConfig.payment[this.getCode()].testmode;
+ },
+
+ /**
+ * Returns payment method logo URL
+ */
+ getLogo: function () {
+ return window.checkoutConfig.payment[this.getCode()].logo;
+ },
+
+ /**
+ * get DOB
+ */
+ getDob: function () {
+ if (window.checkoutConfig.customerData.dob) {
+ var date = new Date(window.checkoutConfig.customerData.dob);
+ var newDate = ("0" + date.getDate()).slice(-2)+'.'+("0" + (date.getMonth() + 1)).slice(-2)+'.'+date.getFullYear();
+ return newDate;
+ }
+ },
+
+ validate: function () {
+ var form = 'form[data-role=novalnetInvoiceInstalment]';
+ return $(form).validation() && $(form).validation('isValid');
+ },
+
+ validateCompany: function (company) {
+ if (company != null && window.checkoutConfig.payment[this.getCode()].allow_b2b_customer == 1) {
+ if (!NovalnetUtility.isValidCompanyName(company)) {
+ return false;
+ } else {
+ return true;
+ }
+ }
+ return false;
+ },
+
+ /**
+ * @return {*|String}
+ */
+ getValue: function () {
+ var price = 0;
+
+ if (this.totals()) {
+ price = quote.totals()['base_grand_total'];
+ }
+
+ return priceUtils.formatPrice(price, quote.getPriceFormat());
+ },
+
+ getInstalmentOptions: function () {
+ var orderTotal = quote.totals()['base_grand_total'];
+ storage.get(
+ urlBuilder.createUrl('/novalnet/payment/instalment_options/'+ this.getCode() + '/' + orderTotal, {})
+ ).done(function (response) {
+ var allCycles = $.parseJSON(response);
+ var tariffField = $('#novalnetInvoiceInstalment_cycle');
+ tariffField.find('option').remove();
+ $.each(allCycles, function(id, value) {
+ if (0 == $('#novalnetInvoiceInstalment_cycle[value='+value.instalment_value+']').length) {
+ tariffField.append(
+ $(' ').attr('value', value.instalment_value).text(value.instalment_key)
+ );
+ }
+ });
+ $('#novalnetInvoiceInstalment_cycle').trigger('change');
+ });
+ },
+
+ allowOnlyNumber: function (data, event) {
+ if(event.charCode < 48 || event.charCode > 57) {
+ return false;
+ }
+ return true;
+ }
+ });
+ }
+);
diff --git a/view/frontend/web/js/view/payment/method-renderer/novalnetMultibanco.js b/view/frontend/web/js/view/payment/method-renderer/novalnetMultibanco.js
new file mode 100755
index 0000000..c594e05
--- /dev/null
+++ b/view/frontend/web/js/view/payment/method-renderer/novalnetMultibanco.js
@@ -0,0 +1,52 @@
+/**
+ * Novalnet payment extension
+ *
+ * NOTICE OF LICENSE
+ *
+ * This source file is subject to the Novalnet End User License Agreement
+ * that is bundled with this package in the file LICENSE.txt
+ *
+ * DISCLAIMER
+ *
+ * If you wish to customize Novalnet payment extension for your needs,
+ * please contact technic@novalnet.de for more information.
+ *
+ * @category Novalnet
+ * @package Novalnet_Payment
+ * @copyright Copyright (c) Novalnet AG
+ * @license https://www.novalnet.de/payment-plugins/kostenlos/lizenz
+ */
+define(
+ [
+ 'Magento_Checkout/js/view/payment/default'
+ ],
+ function (Component) {
+ 'use strict';
+ return Component.extend({
+ defaults: {
+ template: 'Novalnet_Payment/payment/novalnetMultibanco'
+ },
+
+ /**
+ * Returns payment method instructions
+ */
+ getInstructions: function () {
+ return window.checkoutConfig.payment[this.getCode()].instructions;
+ },
+
+ /**
+ * Returns payment testmode status
+ */
+ getTestmode: function () {
+ return window.checkoutConfig.payment[this.getCode()].testmode;
+ },
+
+ /**
+ * Returns payment method logo URL
+ */
+ getLogo: function () {
+ return window.checkoutConfig.payment[this.getCode()].logo;
+ }
+ });
+ }
+);
diff --git a/view/frontend/web/js/view/payment/method-renderer/novalnetOnlineBanktransfer.js b/view/frontend/web/js/view/payment/method-renderer/novalnetOnlineBanktransfer.js
new file mode 100755
index 0000000..763d4f8
--- /dev/null
+++ b/view/frontend/web/js/view/payment/method-renderer/novalnetOnlineBanktransfer.js
@@ -0,0 +1,83 @@
+/**
+ * Novalnet payment extension
+ *
+ * NOTICE OF LICENSE
+ *
+ * This source file is subject to the Novalnet End User License Agreement
+ * that is bundled with this package in the file LICENSE.txt
+ *
+ * DISCLAIMER
+ *
+ * If you wish to customize Novalnet payment extension for your needs,
+ * please contact technic@novalnet.de for more information.
+ *
+ * @category Novalnet
+ * @package Novalnet_Payment
+ * @copyright Copyright (c) Novalnet AG
+ * @license https://www.novalnet.de/payment-plugins/kostenlos/lizenz
+ */
+define(
+ [
+ 'jquery',
+ 'mage/url',
+ 'mage/translate',
+ 'Magento_Checkout/js/view/payment/default',
+ 'Magento_Checkout/js/action/redirect-on-success',
+ 'Novalnet_Payment/js/action/get-redirect-url',
+ 'Magento_Ui/js/model/messageList'
+ ],
+ function (
+ $,
+ url,
+ $t,
+ Component,
+ redirectOnSuccessAction,
+ redirectURLAction,
+ globalMessageList
+ ) {
+ 'use strict';
+
+ return Component.extend({
+ defaults: {
+ template: 'Novalnet_Payment/payment/novalnetOnlineBanktransfer'
+ },
+
+ /**
+ * After place order callback
+ */
+ afterPlaceOrder: function () {
+ this.redirectAfterPlaceOrder = false;
+
+ redirectURLAction().done(function (redirectUrl) {
+ window.location.replace(redirectUrl);
+ }).fail(function (xhr, ajaxOptions, thrownError) {
+ globalMessageList.addErrorMessage({
+ message: $t(thrownError)
+ });
+ window.location.replace(url.build('checkout/cart'));
+ });
+ },
+
+ /**
+ * Returns payment method instructions
+ */
+ getInstructions: function () {
+ return window.checkoutConfig.payment[this.getCode()].instructions;
+ },
+
+ /**
+ * Returns payment testmode status
+ */
+ getTestmode: function () {
+ return window.checkoutConfig.payment[this.getCode()].testmode;
+ },
+
+ /**
+ * Returns payment method logo URL
+ */
+ getLogo: function () {
+ return window.checkoutConfig.payment[this.getCode()].logo;
+ }
+ });
+ }
+);
diff --git a/view/frontend/web/js/view/payment/method-renderer/novalnetPaypal.js b/view/frontend/web/js/view/payment/method-renderer/novalnetPaypal.js
new file mode 100755
index 0000000..2c18e6c
--- /dev/null
+++ b/view/frontend/web/js/view/payment/method-renderer/novalnetPaypal.js
@@ -0,0 +1,243 @@
+/**
+ * Novalnet payment extension
+ *
+ * NOTICE OF LICENSE
+ *
+ * This source file is subject to the Novalnet End User License Agreement
+ * that is bundled with this package in the file LICENSE.txt
+ *
+ * DISCLAIMER
+ *
+ * If you wish to customize Novalnet payment extension for your needs,
+ * please contact technic@novalnet.de for more information.
+ *
+ * @category Novalnet
+ * @package Novalnet_Payment
+ * @copyright Copyright (c) Novalnet AG
+ * @license https://www.novalnet.de/payment-plugins/kostenlos/lizenz
+ */
+define(
+ [
+ 'jquery',
+ 'mage/url',
+ 'mage/storage',
+ 'mage/translate',
+ 'Magento_Checkout/js/view/payment/default',
+ 'Magento_Checkout/js/model/url-builder',
+ 'Magento_Checkout/js/action/redirect-on-success',
+ 'Novalnet_Payment/js/action/get-redirect-url',
+ 'Magento_Ui/js/model/messageList',
+ 'Magento_Customer/js/model/customer',
+ 'Magento_Ui/js/modal/alert',
+ 'Magento_Ui/js/modal/modal',
+ 'mage/validation'
+ ],
+ function (
+ $,
+ url,
+ storage,
+ $t,
+ Component,
+ urlBuilder,
+ redirectOnSuccessAction,
+ redirectURLAction,
+ globalMessageList,
+ customer,
+ alert,
+ modal
+ ) {
+ 'use strict';
+
+ return Component.extend({
+ defaults: {
+ template: {
+ name: 'Novalnet_Payment/payment/novalnetPaypal',
+ afterRender: function (renderedNodesArray, data) {
+ data.displayForm();
+ }
+ },
+ novalnetPaymentToken: ''
+ },
+
+ initObservable: function () {
+ this._super()
+ .observe(
+ [
+ 'novalnetPaymentToken'
+ ]
+ );
+ this.novalnetPaymentToken.subscribe(this.onAccountChange, this);
+ this.novalnetPaymentToken(window.checkoutConfig.payment[this.getCode()].tokenId);
+
+ return this;
+ },
+
+ onAccountChange: function (selectedAccount) {
+ if (selectedAccount == 'new_account') {
+ $('#' + this.getCode() + '_store_payment_container').show();
+ } else {
+ $('#' + this.getCode() + '_store_payment_container').hide();
+ }
+ },
+
+ displayForm: function () {
+ if ((window.checkoutConfig.payment[this.getCode()].storePayment != '1') || (window.checkoutConfig.payment[this.getCode()].storedPayments.length == '0')) {
+ this.onAccountChange('new_account');
+ } else {
+ this.onAccountChange(window.checkoutConfig.payment[this.getCode()].tokenId);
+ }
+ },
+
+ /**
+ * After place order callback
+ */
+ afterPlaceOrder: function () {
+ this.redirectAfterPlaceOrder = false;
+
+ redirectURLAction().done(function (redirectUrl) {
+ window.location.replace(redirectUrl);
+ }).fail(function (xhr, ajaxOptions, thrownError) {
+ globalMessageList.addErrorMessage({
+ message: $t(thrownError)
+ });
+ window.location.replace(url.build('checkout/cart'));
+ });
+ },
+
+ getData: function () {
+ return {
+ 'method': this.item.method,
+ 'additional_data': {
+ 'novalnetPaypal_create_token': this.canStorePayment(),
+ 'novalnetPaypal_token': this.getPaymentToken()
+ }
+ };
+ },
+
+ /**
+ * Returns payment method instructions
+ */
+ getInstructions: function () {
+ return window.checkoutConfig.payment[this.getCode()].instructions;
+ },
+
+ /**
+ * Returns payment testmode status
+ */
+ getTestmode: function () {
+ return window.checkoutConfig.payment[this.getCode()].testmode;
+ },
+
+ /**
+ * Returns payment method logo URL
+ */
+ getLogo: function () {
+ return window.checkoutConfig.payment[this.getCode()].logo;
+ },
+
+ /**
+ * check can store payment reference
+ */
+ canStorePayment: function () {
+ if (!this.getPaymentToken()) {
+ return ($('#' + this.getCode() + '_store_payment').prop("checked") == true);
+ } else {
+ return false;
+ }
+ },
+
+ /**
+ * check can show store payment
+ */
+ showStorePayment: function () {
+ if (window.checkoutConfig.payment[this.getCode()].storePayment == '1') {
+ return customer.isLoggedIn();
+ } else {
+ return false;
+ }
+ },
+
+ /**
+ * get stored payments
+ */
+ getStoredPayments: function () {
+ if (window.checkoutConfig.payment[this.getCode()].storePayment == '1') {
+ return window.checkoutConfig.payment[this.getCode()].storedPayments;
+ } else {
+ return false;
+ }
+ },
+
+ /**
+ * get payment token
+ */
+ getPaymentToken: function () {
+ if (this.novalnetPaymentToken() && this.novalnetPaymentToken() != 'new_account') {
+ return this.novalnetPaymentToken();
+ } else {
+ return false;
+ }
+ },
+
+ /**
+ * remove payment token
+ */
+ removeToken: function (tokenId) {
+ var parent = this;
+
+ var options = {
+ type: 'popup',
+ modalClass: 'nntoken-remove-popup-modal',
+ responsive: true,
+ innerScroll: false,
+ buttons: [{
+ text: $t('No'),
+ class: 'nntoken-cancel-remove-modal action tocart primary',
+ click: function () {
+ this.closeModal();
+ }
+ },
+ {
+ text: $t('Yes'),
+ class: 'nntoken-confirm-remove-modal action tocart primary',
+ click: function () {
+ var button = this;
+ storage.get(
+ urlBuilder.createUrl('/novalnet/payment/remove_token/' + tokenId, {})
+ ).done(function (response) {
+ button.closeModal();
+ if (response) {
+ $('a[nntoken-id=' + tokenId + ']').closest('.novalnet-payment-saved-payments').remove();
+ if ($('form#novalnetPaypal .novalnet-payment-saved-payments').length <= 0) {
+ $('form#novalnetPaypal .novalnet-payment-new_account').remove();
+ }
+ $('#novalnetPaypal_store_payment_container').show();
+ parent.novalnetPaymentToken('new_account');
+ window.location = window.location.hash ;
+ location.reload();
+ } else {
+ alert({
+ content: $t('Novalnet Payment Token does not found')
+ });
+ }
+ }).fail(function (xhr, ajaxOptions, thrownError) {
+ button.closeModal();
+ alert({
+ content: $t(thrownError)
+ });
+ });
+ }
+ }]
+ };
+
+ // Initialize and Open popup
+ modal(options, $('#remove-nntoken-modal'));
+ $("#remove-nntoken-modal").modal("openModal");
+ },
+
+ validate: function () {
+ return true;
+ },
+ });
+ }
+);
diff --git a/view/frontend/web/js/view/payment/method-renderer/novalnetPostFinance.js b/view/frontend/web/js/view/payment/method-renderer/novalnetPostFinance.js
new file mode 100755
index 0000000..946fcc5
--- /dev/null
+++ b/view/frontend/web/js/view/payment/method-renderer/novalnetPostFinance.js
@@ -0,0 +1,83 @@
+/**
+ * Novalnet payment extension
+ *
+ * NOTICE OF LICENSE
+ *
+ * This source file is subject to the Novalnet End User License Agreement
+ * that is bundled with this package in the file LICENSE.txt
+ *
+ * DISCLAIMER
+ *
+ * If you wish to customize Novalnet payment extension for your needs,
+ * please contact technic@novalnet.de for more information.
+ *
+ * @category Novalnet
+ * @package Novalnet_Payment
+ * @copyright Copyright (c) Novalnet AG
+ * @license https://www.novalnet.de/payment-plugins/kostenlos/lizenz
+ */
+define(
+ [
+ 'jquery',
+ 'mage/url',
+ 'mage/translate',
+ 'Magento_Checkout/js/view/payment/default',
+ 'Magento_Checkout/js/action/redirect-on-success',
+ 'Novalnet_Payment/js/action/get-redirect-url',
+ 'Magento_Ui/js/model/messageList'
+ ],
+ function (
+ $,
+ url,
+ $t,
+ Component,
+ redirectOnSuccessAction,
+ redirectURLAction,
+ globalMessageList
+ ) {
+ 'use strict';
+
+ return Component.extend({
+ defaults: {
+ template: 'Novalnet_Payment/payment/novalnetPostFinance'
+ },
+
+ /**
+ * After place order callback
+ */
+ afterPlaceOrder: function () {
+ this.redirectAfterPlaceOrder = false;
+
+ redirectURLAction().done(function (redirectUrl) {
+ window.location.replace(redirectUrl);
+ }).fail(function (xhr, ajaxOptions, thrownError) {
+ globalMessageList.addErrorMessage({
+ message: $t(thrownError)
+ });
+ window.location.replace(url.build('checkout/cart'));
+ });
+ },
+
+ /**
+ * Returns payment method instructions
+ */
+ getInstructions: function () {
+ return window.checkoutConfig.payment[this.getCode()].instructions;
+ },
+
+ /**
+ * Returns payment testmode status
+ */
+ getTestmode: function () {
+ return window.checkoutConfig.payment[this.getCode()].testmode;
+ },
+
+ /**
+ * Returns payment method logo URL
+ */
+ getLogo: function () {
+ return window.checkoutConfig.payment[this.getCode()].logo;
+ }
+ });
+ }
+);
diff --git a/view/frontend/web/js/view/payment/method-renderer/novalnetPostFinanceCard.js b/view/frontend/web/js/view/payment/method-renderer/novalnetPostFinanceCard.js
new file mode 100755
index 0000000..ecd4cae
--- /dev/null
+++ b/view/frontend/web/js/view/payment/method-renderer/novalnetPostFinanceCard.js
@@ -0,0 +1,83 @@
+/**
+ * Novalnet payment extension
+ *
+ * NOTICE OF LICENSE
+ *
+ * This source file is subject to the Novalnet End User License Agreement
+ * that is bundled with this package in the file LICENSE.txt
+ *
+ * DISCLAIMER
+ *
+ * If you wish to customize Novalnet payment extension for your needs,
+ * please contact technic@novalnet.de for more information.
+ *
+ * @category Novalnet
+ * @package Novalnet_Payment
+ * @copyright Copyright (c) Novalnet AG
+ * @license https://www.novalnet.de/payment-plugins/kostenlos/lizenz
+ */
+define(
+ [
+ 'jquery',
+ 'mage/url',
+ 'mage/translate',
+ 'Magento_Checkout/js/view/payment/default',
+ 'Magento_Checkout/js/action/redirect-on-success',
+ 'Novalnet_Payment/js/action/get-redirect-url',
+ 'Magento_Ui/js/model/messageList'
+ ],
+ function (
+ $,
+ url,
+ $t,
+ Component,
+ redirectOnSuccessAction,
+ redirectURLAction,
+ globalMessageList
+ ) {
+ 'use strict';
+
+ return Component.extend({
+ defaults: {
+ template: 'Novalnet_Payment/payment/novalnetPostFinanceCard'
+ },
+
+ /**
+ * After place order callback
+ */
+ afterPlaceOrder: function () {
+ this.redirectAfterPlaceOrder = false;
+
+ redirectURLAction().done(function (redirectUrl) {
+ window.location.replace(redirectUrl);
+ }).fail(function (xhr, ajaxOptions, thrownError) {
+ globalMessageList.addErrorMessage({
+ message: $t(thrownError)
+ });
+ window.location.replace(url.build('checkout/cart'));
+ });
+ },
+
+ /**
+ * Returns payment method instructions
+ */
+ getInstructions: function () {
+ return window.checkoutConfig.payment[this.getCode()].instructions;
+ },
+
+ /**
+ * Returns payment testmode status
+ */
+ getTestmode: function () {
+ return window.checkoutConfig.payment[this.getCode()].testmode;
+ },
+
+ /**
+ * Returns payment method logo URL
+ */
+ getLogo: function () {
+ return window.checkoutConfig.payment[this.getCode()].logo;
+ }
+ });
+ }
+);
diff --git a/view/frontend/web/js/view/payment/method-renderer/novalnetPrepayment.js b/view/frontend/web/js/view/payment/method-renderer/novalnetPrepayment.js
new file mode 100755
index 0000000..ec700c8
--- /dev/null
+++ b/view/frontend/web/js/view/payment/method-renderer/novalnetPrepayment.js
@@ -0,0 +1,52 @@
+/**
+ * Novalnet payment extension
+ *
+ * NOTICE OF LICENSE
+ *
+ * This source file is subject to the Novalnet End User License Agreement
+ * that is bundled with this package in the file LICENSE.txt
+ *
+ * DISCLAIMER
+ *
+ * If you wish to customize Novalnet payment extension for your needs,
+ * please contact technic@novalnet.de for more information.
+ *
+ * @category Novalnet
+ * @package Novalnet_Payment
+ * @copyright Copyright (c) Novalnet AG
+ * @license https://www.novalnet.de/payment-plugins/kostenlos/lizenz
+ */
+define(
+ [
+ 'Magento_Checkout/js/view/payment/default'
+ ],
+ function (Component) {
+ 'use strict';
+ return Component.extend({
+ defaults: {
+ template: 'Novalnet_Payment/payment/novalnetPrepayment'
+ },
+
+ /**
+ * Returns payment method instructions
+ */
+ getInstructions: function () {
+ return window.checkoutConfig.payment[this.getCode()].instructions;
+ },
+
+ /**
+ * Returns payment testmode status
+ */
+ getTestmode: function () {
+ return window.checkoutConfig.payment[this.getCode()].testmode;
+ },
+
+ /**
+ * Returns payment method logo URL
+ */
+ getLogo: function () {
+ return window.checkoutConfig.payment[this.getCode()].logo;
+ }
+ });
+ }
+);
diff --git a/view/frontend/web/js/view/payment/method-renderer/novalnetPrzelewy.js b/view/frontend/web/js/view/payment/method-renderer/novalnetPrzelewy.js
new file mode 100755
index 0000000..a773690
--- /dev/null
+++ b/view/frontend/web/js/view/payment/method-renderer/novalnetPrzelewy.js
@@ -0,0 +1,83 @@
+/**
+ * Novalnet payment extension
+ *
+ * NOTICE OF LICENSE
+ *
+ * This source file is subject to the Novalnet End User License Agreement
+ * that is bundled with this package in the file LICENSE.txt
+ *
+ * DISCLAIMER
+ *
+ * If you wish to customize Novalnet payment extension for your needs,
+ * please contact technic@novalnet.de for more information.
+ *
+ * @category Novalnet
+ * @package Novalnet_Payment
+ * @copyright Copyright (c) Novalnet AG
+ * @license https://www.novalnet.de/payment-plugins/kostenlos/lizenz
+ */
+define(
+ [
+ 'jquery',
+ 'mage/url',
+ 'mage/translate',
+ 'Magento_Checkout/js/view/payment/default',
+ 'Magento_Checkout/js/action/redirect-on-success',
+ 'Novalnet_Payment/js/action/get-redirect-url',
+ 'Magento_Ui/js/model/messageList'
+ ],
+ function (
+ $,
+ url,
+ $t,
+ Component,
+ redirectOnSuccessAction,
+ redirectURLAction,
+ globalMessageList
+ ) {
+ 'use strict';
+
+ return Component.extend({
+ defaults: {
+ template: 'Novalnet_Payment/payment/novalnetPrzelewy'
+ },
+
+ /**
+ * After place order callback
+ */
+ afterPlaceOrder: function () {
+ this.redirectAfterPlaceOrder = false;
+
+ redirectURLAction().done(function (redirectUrl) {
+ window.location.replace(redirectUrl);
+ }).fail(function (xhr, ajaxOptions, thrownError) {
+ globalMessageList.addErrorMessage({
+ message: $t(thrownError)
+ });
+ window.location.replace(url.build('checkout/cart'));
+ });
+ },
+
+ /**
+ * Returns payment method instructions
+ */
+ getInstructions: function () {
+ return window.checkoutConfig.payment[this.getCode()].instructions;
+ },
+
+ /**
+ * Returns payment testmode status
+ */
+ getTestmode: function () {
+ return window.checkoutConfig.payment[this.getCode()].testmode;
+ },
+
+ /**
+ * Returns payment method logo URL
+ */
+ getLogo: function () {
+ return window.checkoutConfig.payment[this.getCode()].logo;
+ }
+ });
+ }
+);
diff --git a/view/frontend/web/js/view/payment/method-renderer/novalnetSepa.js b/view/frontend/web/js/view/payment/method-renderer/novalnetSepa.js
new file mode 100755
index 0000000..00321d5
--- /dev/null
+++ b/view/frontend/web/js/view/payment/method-renderer/novalnetSepa.js
@@ -0,0 +1,302 @@
+/**
+ * Novalnet payment extension
+ *
+ * NOTICE OF LICENSE
+ *
+ * This source file is subject to the Novalnet End User License Agreement
+ * that is bundled with this package in the file LICENSE.txt
+ *
+ * DISCLAIMER
+ *
+ * If you wish to customize Novalnet payment extension for your needs,
+ * please contact technic@novalnet.de for more information.
+ *
+ * @category Novalnet
+ * @package Novalnet_Payment
+ * @copyright Copyright (c) Novalnet AG
+ * @license https://www.novalnet.de/payment-plugins/kostenlos/lizenz
+ */
+define(
+ [
+ 'jquery',
+ 'mage/storage',
+ 'mage/translate',
+ 'Magento_Checkout/js/view/payment/default',
+ 'Magento_Checkout/js/model/url-builder',
+ 'Magento_Customer/js/model/customer',
+ 'Magento_Checkout/js/model/quote',
+ 'Magento_Checkout/js/checkout-data',
+ 'Magento_Checkout/js/action/select-payment-method',
+ 'Magento_Ui/js/modal/alert',
+ 'Magento_Ui/js/modal/modal',
+ 'mage/validation',
+ 'novalnetUtilityJs'
+ ],
+ function (
+ $,
+ storage,
+ $t,
+ Component,
+ urlBuilder,
+ customer,
+ quote,
+ checkoutData,
+ selectPaymentMethodAction,
+ alert,
+ modal
+ ) {
+ 'use strict';
+
+ return Component.extend({
+ defaults: {
+ template: {
+ name: 'Novalnet_Payment/payment/novalnetSepa',
+ afterRender: function (renderedNodesArray, data) {
+ data.displayPayment();
+ },
+ },
+ sepaAccountNumber: '',
+ sepaBicCode: '',
+ novalnetPaymentToken: ''
+ },
+ currentBillingAddress: quote.billingAddress,
+
+ initObservable: function () {
+ this._super()
+ .observe(
+ [
+ 'sepaAccountNumber',
+ 'novalnetPaymentToken'
+ ]
+ );
+ this.novalnetPaymentToken.subscribe(this.onAccountChange, this);
+ this.novalnetPaymentToken(window.checkoutConfig.payment[this.getCode()].tokenId);
+
+ return this;
+ },
+
+ onAccountChange: function (selectedAccount) {
+ if (selectedAccount == 'new_account') {
+ $("#novalnet_form_sepa").show();
+ } else {
+ $("#novalnet_form_sepa").hide();
+ }
+ },
+
+ getData: function () {
+ return {
+ 'method': this.item.method,
+ 'additional_data': {
+ 'novalnetSepa_iban': this.getIBAN(),
+ 'novalnetSepa_bic': this.getBIC(),
+ 'novalnetSepa_create_token': this.canStorePayment(),
+ 'novalnetSepa_token': this.getPaymentToken()
+ }
+ };
+ },
+
+ displayPayment: function () {
+ if ((window.checkoutConfig.payment[this.getCode()].storePayment != '1') || (window.checkoutConfig.payment[this.getCode()].storedPayments.length == 0)) {
+ this.onAccountChange('new_account');
+ } else {
+ this.onAccountChange(window.checkoutConfig.payment[this.getCode()].tokenId);
+ }
+ if (($('input[id="novalnetSepa"][name="payment[method]"]').length && $('input[id="novalnetSepaGuarantee"][name="payment[method]"]').length)) {
+ if (JSON.stringify(quote.billingAddress()) == JSON.stringify(quote.shippingAddress()) || quote.isVirtual()) {
+ if ($('input[id="novalnetSepa"][name="payment[method]"]:visible').length) {
+ $('input[id="novalnetSepa"][name="payment[method]"]').closest('.payment-method').hide();
+ }
+ if ($('input[id="novalnetSepaGuarantee"][name="payment[method]"]:hidden').length) {
+ $('input[id="novalnetSepaGuarantee"][name="payment[method]"]').closest('.payment-method').show();
+ if (checkoutData.getSelectedPaymentMethod() == 'novalnetSepa') {
+ var methodData = {
+ 'method': 'novalnetSepaGuarantee',
+ 'additional_data': {}
+ };
+ selectPaymentMethodAction(methodData);
+ checkoutData.setSelectedPaymentMethod(methodData.method);
+ }
+ }
+ } else {
+ if ($('input[id="novalnetSepaGuarantee"][name="payment[method]"]:visible').length) {
+ $('input[id="novalnetSepaGuarantee"][name="payment[method]"]').closest('.payment-method').hide();
+ }
+ if ($('input[id="novalnetSepa"][name="payment[method]"]:hidden').length) {
+ $('input[id="novalnetSepa"][name="payment[method]"]').closest('.payment-method').show();
+ if (checkoutData.getSelectedPaymentMethod() == 'novalnetSepaGuarantee') {
+ var methodData = {
+ 'method': 'novalnetSepa',
+ 'additional_data': {}
+ };
+ selectPaymentMethodAction(methodData);
+ checkoutData.setSelectedPaymentMethod(methodData.method);
+ }
+ }
+ }
+ } else if (($('input[id="novalnetSepa"][name="payment[method]"]').length && !$('input[id="novalnetSepaGuarantee"][name="payment[method]"]').length)) {
+ $('input[id="novalnetSepa"][name="payment[method]"]').closest('.payment-method').show();
+ } else if ((!$('input[id="novalnetSepa"][name="payment[method]"]').length && $('input[id="novalnetSepaGuarantee"][name="payment[method]"]').length)) {
+ $('input[id="novalnetSepaGuarantee"][name="payment[method]"]').closest('.payment-method').show();
+ }
+
+ },
+
+ /**
+ * Returns payment method instructions
+ */
+ getInstructions: function () {
+ return window.checkoutConfig.payment[this.getCode()].instructions;
+ },
+
+ /**
+ * Returns payment testmode status
+ */
+ getTestmode: function () {
+ return window.checkoutConfig.payment[this.getCode()].testmode;
+ },
+
+ /**
+ * Returns payment method logo URL
+ */
+ getLogo: function () {
+ return window.checkoutConfig.payment[this.getCode()].logo;
+ },
+
+ isZeroAmountBooking: function () {
+ return window.checkoutConfig.payment[this.item.method].isZeroAmountBooking;
+ },
+
+ /**
+ * check can store payment reference
+ */
+ canStorePayment: function () {
+ if (!this.getPaymentToken()) {
+ return ($('#' + this.getCode() + '_store_payment').prop("checked") == true);
+ } else {
+ return false;
+ }
+ },
+
+ /**
+ * check can show store payment
+ */
+ showStorePayment: function () {
+ if (window.checkoutConfig.payment[this.getCode()].storePayment == '1') {
+ return customer.isLoggedIn();
+ } else {
+ return false;
+ }
+ },
+
+ /**
+ * get stored payments
+ */
+ getStoredPayments: function () {
+ if (window.checkoutConfig.payment[this.getCode()].storePayment == '1') {
+ return window.checkoutConfig.payment[this.getCode()].storedPayments;
+ } else {
+ return false;
+ }
+ },
+
+ /**
+ * get payment token
+ */
+ getPaymentToken: function () {
+ if (this.novalnetPaymentToken() && this.novalnetPaymentToken() != 'new_account') {
+ return this.novalnetPaymentToken();
+ } else {
+ return false;
+ }
+ },
+
+ /**
+ * remove payment token
+ */
+ removeToken: function (tokenId) {
+ var parent = this;
+
+ var options = {
+ type: 'popup',
+ modalClass: 'nntoken-remove-popup-modal',
+ responsive: true,
+ innerScroll: false,
+ buttons: [{
+ text: $t('No'),
+ class: 'nntoken-cancel-remove-modal action tocart primary',
+ click: function () {
+ this.closeModal();
+ }
+ },
+ {
+ text: $t('Yes'),
+ class: 'nntoken-confirm-remove-modal action tocart primary',
+ click: function () {
+ var button = this;
+ storage.get(
+ urlBuilder.createUrl('/novalnet/payment/remove_token/' + tokenId, {})
+ ).done(function (response) {
+ button.closeModal();
+ if (response) {
+ $('a[nntoken-id=' + tokenId + ']').closest('.novalnet-payment-saved-payments').remove();
+ if ($('form#novalnetSepa .novalnet-payment-saved-payments').length <= 0) {
+ $('form#novalnetSepa .novalnet-payment-new_account').remove();
+ }
+ $('#novalnet_form_sepa').show();
+ parent.novalnetPaymentToken('new_account');
+ window.location = window.location.hash ;
+ location.reload();
+ } else {
+ alert({
+ content: $t('Novalnet Payment Token does not found')
+ });
+ }
+ }).fail(function (xhr, ajaxOptions, thrownError) {
+ button.closeModal();
+ alert({
+ content: $t(thrownError)
+ });
+ });
+ }
+ }]
+ };
+
+ // Initialize and Open popup
+ modal(options, $('#remove-nntoken-modal'));
+ $("#remove-nntoken-modal").modal("openModal");
+ },
+
+ /**
+ * get IBAN
+ */
+ getIBAN: function () {
+ if (!this.getPaymentToken()) {
+ return $('#' + this.getCode() + '_account_number').val();
+ }
+ },
+
+ /**
+ * get BIC
+ */
+ getBIC: function () {
+ if (!this.getPaymentToken()) {
+ return $('#' + this.getCode() + '_bic_code').val();
+ }
+ },
+
+ validate: function () {
+ if (this.getPaymentToken()) {
+ return true;
+ } else {
+ var form = 'form[data-role=novalnetSepa]';
+ return $(form).validation() && $(form).validation('isValid');
+ }
+ },
+
+ sepaMandateToggle: function () {
+ $('#sepa_mandate_details').toggle('slow');
+ },
+
+ });
+ }
+);
diff --git a/view/frontend/web/js/view/payment/method-renderer/novalnetSepaGuarantee.js b/view/frontend/web/js/view/payment/method-renderer/novalnetSepaGuarantee.js
new file mode 100755
index 0000000..e1e4923
--- /dev/null
+++ b/view/frontend/web/js/view/payment/method-renderer/novalnetSepaGuarantee.js
@@ -0,0 +1,332 @@
+/**
+ * Novalnet payment extension
+ *
+ * NOTICE OF LICENSE
+ *
+ * This source file is subject to the Novalnet End User License Agreement
+ * that is bundled with this package in the file LICENSE.txt
+ *
+ * DISCLAIMER
+ *
+ * If you wish to customize Novalnet payment extension for your needs,
+ * please contact technic@novalnet.de for more information.
+ *
+ * @category Novalnet
+ * @package Novalnet_Payment
+ * @copyright Copyright (c) Novalnet AG
+ * @license https://www.novalnet.de/payment-plugins/kostenlos/lizenz
+ */
+define(
+ [
+ 'jquery',
+ 'mage/storage',
+ 'mage/translate',
+ 'Magento_Checkout/js/view/payment/default',
+ 'Magento_Checkout/js/model/url-builder',
+ 'Magento_Customer/js/model/customer',
+ 'Magento_Checkout/js/model/quote',
+ 'Magento_Checkout/js/checkout-data',
+ 'Magento_Checkout/js/action/select-payment-method',
+ 'Magento_Ui/js/modal/alert',
+ 'Magento_Ui/js/modal/modal',
+ 'mage/validation',
+ 'novalnetUtilityJs'
+ ],
+ function (
+ $,
+ storage,
+ $t,
+ Component,
+ urlBuilder,
+ customer,
+ quote,
+ checkoutData,
+ selectPaymentMethodAction,
+ alert,
+ modal
+ ) {
+ 'use strict';
+
+ var current_date = new Date();
+ var max_year = current_date.getFullYear() - 18;
+ var min_year = current_date.getFullYear() - 91;
+ var years_range = [];
+ for(var year = max_year; year >= min_year; year--) {
+ years_range.push(String(year));
+ }
+
+ return Component.extend({
+ defaults: {
+ template: {
+ name: 'Novalnet_Payment/payment/novalnetSepaGuarantee',
+ afterRender: function (renderedNodesArray, data) {
+ data.displayPayment();
+ }
+ },
+ sepaAccountNumber: '',
+ sepaBicCode: '',
+ novalnetPaymentToken: ''
+ },
+ currentBillingAddress: quote.billingAddress,
+
+ initObservable: function () {
+ this._super()
+ .observe([
+ 'sepaAccountNumber',
+ 'novalnetPaymentToken'
+ ]);
+ this.novalnetPaymentToken.subscribe(this.onAccountChange, this);
+ this.novalnetPaymentToken(window.checkoutConfig.payment[this.getCode()].tokenId);
+
+ return this;
+ },
+
+ onAccountChange: function (selectedAccount) {
+ if (selectedAccount == 'new_account') {
+ $("#novalnet_form_sepa_guarantee").show();
+ } else {
+ $("#novalnet_form_sepa_guarantee").hide();
+ }
+ },
+
+ getData: function () {
+ var CustomerDOB = $('#' + this.getCode() + '_dob').val();
+
+ return {
+ 'method': this.item.method,
+ 'additional_data': {
+ 'novalnetSepaGuarantee_iban': this.getIBAN(),
+ 'novalnetSepaGuarantee_bic': this.getBIC(),
+ 'novalnetSepaGuarantee_dob': CustomerDOB,
+ 'novalnetSepaGuarantee_create_token': this.canStorePayment(),
+ 'novalnetSepaGuarantee_token': this.getPaymentToken()
+ }
+ };
+ },
+
+ displayPayment: function () {
+ if (window.checkoutConfig.payment[this.getCode()].storePayment != '1' || window.checkoutConfig.payment[this.getCode()].storedPayments.length == 0) {
+ this.onAccountChange('new_account');
+ } else {
+ this.onAccountChange(window.checkoutConfig.payment[this.getCode()].tokenId);
+ }
+ if (($('input[id="novalnetSepa"][name="payment[method]"]').length && $('input[id="novalnetSepaGuarantee"][name="payment[method]"]').length)) {
+ if (JSON.stringify(quote.billingAddress()) == JSON.stringify(quote.shippingAddress()) || quote.isVirtual()) {
+ if ($('input[id="novalnetSepa"][name="payment[method]"]:visible').length) {
+ $('input[id="novalnetSepa"][name="payment[method]"]').closest('.payment-method').hide();
+ }
+ if ($('input[id="novalnetSepaGuarantee"][name="payment[method]"]:hidden').length) {
+ $('input[id="novalnetSepaGuarantee"][name="payment[method]"]').closest('.payment-method').show();
+ if (checkoutData.getSelectedPaymentMethod() == 'novalnetSepa') {
+ var methodData = {
+ 'method': 'novalnetSepaGuarantee',
+ 'additional_data': {}
+ };
+ selectPaymentMethodAction(methodData);
+ checkoutData.setSelectedPaymentMethod(methodData.method);
+ }
+ }
+ } else {
+ if ($('input[id="novalnetSepaGuarantee"][name="payment[method]"]:visible').length) {
+ $('input[id="novalnetSepaGuarantee"][name="payment[method]"]').closest('.payment-method').hide();
+ }
+ if ($('input[id="novalnetSepa"][name="payment[method]"]:hidden').length) {
+ $('input[id="novalnetSepa"][name="payment[method]"]').closest('.payment-method').show();
+ if (checkoutData.getSelectedPaymentMethod() == 'novalnetSepaGuarantee') {
+ var methodData = {
+ 'method': 'novalnetSepa',
+ 'additional_data': {}
+ };
+ selectPaymentMethodAction(methodData);
+ checkoutData.setSelectedPaymentMethod(methodData.method);
+ }
+ }
+ }
+ } else if (($('input[id="novalnetSepa"][name="payment[method]"]').length && !$('input[id="novalnetSepaGuarantee"][name="payment[method]"]').length)) {
+ $('input[id="novalnetSepa"][name="payment[method]"]').closest('.payment-method').show();
+ } else if ((!$('input[id="novalnetSepa"][name="payment[method]"]').length && $('input[id="novalnetSepaGuarantee"][name="payment[method]"]').length)) {
+ $('input[id="novalnetSepaGuarantee"][name="payment[method]"]').closest('.payment-method').show();
+ }
+
+ },
+
+ /**
+ * Returns payment method instructions
+ */
+ getInstructions: function () {
+ return window.checkoutConfig.payment[this.getCode()].instructions;
+ },
+
+ /**
+ * Returns payment testmode status
+ */
+ getTestmode: function () {
+ return window.checkoutConfig.payment[this.getCode()].testmode;
+ },
+
+ /**
+ * Returns payment method logo URL
+ */
+ getLogo: function () {
+ return window.checkoutConfig.payment[this.getCode()].logo;
+ },
+
+ /**
+ * check can store payment reference
+ */
+ canStorePayment: function () {
+ if (!this.getPaymentToken()) {
+ return ($('#' + this.getCode() + '_store_payment').prop("checked") == true);
+ } else {
+ return false;
+ }
+ },
+
+ /**
+ * check can show store payment
+ */
+ showStorePayment: function () {
+ if (window.checkoutConfig.payment[this.getCode()].storePayment == '1') {
+ return customer.isLoggedIn();
+ } else {
+ return false;
+ }
+ },
+
+ /**
+ * get stored payments
+ */
+ getStoredPayments: function () {
+ if (window.checkoutConfig.payment[this.getCode()].storePayment == '1') {
+ return window.checkoutConfig.payment[this.getCode()].storedPayments;
+ } else {
+ return false;
+ }
+ },
+
+ /**
+ * get payment token
+ */
+ getPaymentToken: function () {
+ if (this.novalnetPaymentToken() && this.novalnetPaymentToken() != 'new_account') {
+ return this.novalnetPaymentToken();
+ } else {
+ return false;
+ }
+ },
+
+ /**
+ * remove payment token
+ */
+ removeToken: function (tokenId) {
+ var parent = this;
+
+ var options = {
+ type: 'popup',
+ modalClass: 'nntoken-remove-popup-modal',
+ responsive: true,
+ innerScroll: false,
+ buttons: [{
+ text: $t('No'),
+ class: 'nntoken-cancel-remove-modal action tocart primary',
+ click: function () {
+ this.closeModal();
+ }
+ },
+ {
+ text: $t('Yes'),
+ class: 'nntoken-confirm-remove-modal action tocart primary',
+ click: function () {
+ var button = this;
+ storage.get(
+ urlBuilder.createUrl('/novalnet/payment/remove_token/' + tokenId, {})
+ ).done(function (response) {
+ button.closeModal();
+ if (response) {
+ $('a[nntoken-id=' + tokenId + ']').closest('.novalnet-payment-saved-payments').remove();
+ if ($('form#novalnetSepaGuarantee .novalnet-payment-saved-payments').length <= 0) {
+ $('form#novalnetSepaGuarantee .novalnet-payment-new_account').remove();
+ }
+ $('#novalnet_form_sepa_guarantee').show();
+ parent.novalnetPaymentToken('new_account');
+ window.location = window.location.hash ;
+ location.reload();
+ } else {
+ alert({
+ content: $t('Novalnet Payment Token does not found')
+ });
+ }
+ }).fail(function (xhr, ajaxOptions, thrownError) {
+ button.closeModal();
+ alert({
+ content: $t(thrownError)
+ });
+ });
+ }
+ }]
+ };
+
+ // Initialize and Open popup
+ modal(options, $('#remove-nntoken-modal'));
+ $("#remove-nntoken-modal").modal("openModal");
+ },
+
+ /**
+ * get IBAN
+ */
+ getIBAN: function () {
+ if (!this.getPaymentToken()) {
+ return $('#' + this.getCode() + '_account_number').val();
+ }
+ },
+
+ /**
+ * get BIC
+ */
+ getBIC: function () {
+ if (!this.getPaymentToken()) {
+ return $('#' + this.getCode() + '_bic_code').val();
+ }
+ },
+
+ /**
+ * get DOB
+ */
+ getDob: function () {
+ if (window.checkoutConfig.customerData.dob) {
+ var date = new Date(window.checkoutConfig.customerData.dob);
+ var newDate = ("0" + date.getDate()).slice(-2)+'.'+("0" + (date.getMonth() + 1)).slice(-2)+'.'+date.getFullYear();
+ return newDate;
+ }
+ },
+
+ validate: function () {
+ var form = 'form[data-role=novalnetSepaGuarantee]';
+ return $(form).validation() && $(form).validation('isValid');
+ },
+
+ validateCompany: function (company) {
+ if (company != null && window.checkoutConfig.payment[this.getCode()].allow_b2b_customer == 1) {
+ if (!NovalnetUtility.isValidCompanyName(company)) {
+ return false;
+ } else {
+ return true;
+ }
+ }
+ return false;
+ },
+
+ sepaGuaranteeMandateToggle: function () {
+ $('#sepa_guarantee_mandate_details').toggle('slow');
+ },
+
+ allowOnlyNumber: function (data, event) {
+ if(event.charCode < 48 || event.charCode > 57) {
+ return false;
+ }
+ return true;
+ },
+
+ });
+ }
+);
diff --git a/view/frontend/web/js/view/payment/method-renderer/novalnetSepaInstalment.js b/view/frontend/web/js/view/payment/method-renderer/novalnetSepaInstalment.js
new file mode 100755
index 0000000..cfec61b
--- /dev/null
+++ b/view/frontend/web/js/view/payment/method-renderer/novalnetSepaInstalment.js
@@ -0,0 +1,362 @@
+/**
+ * Novalnet payment extension
+ *
+ * NOTICE OF LICENSE
+ *
+ * This source file is subject to the Novalnet End User License Agreement
+ * that is bundled with this package in the file LICENSE.txt
+ *
+ * DISCLAIMER
+ *
+ * If you wish to customize Novalnet payment extension for your needs,
+ * please contact technic@novalnet.de for more information.
+ *
+ * @category Novalnet
+ * @package Novalnet_Payment
+ * @copyright Copyright (c) Novalnet AG
+ * @license https://www.novalnet.de/payment-plugins/kostenlos/lizenz
+ */
+define(
+ [
+ 'jquery',
+ 'mage/storage',
+ 'mage/translate',
+ 'Magento_Checkout/js/view/payment/default',
+ 'Magento_Checkout/js/model/url-builder',
+ 'Magento_Customer/js/model/customer',
+ 'Magento_Checkout/js/model/quote',
+ 'Magento_Ui/js/modal/alert',
+ 'Magento_Ui/js/modal/modal',
+ 'Magento_Catalog/js/price-utils',
+ 'mage/validation',
+ 'novalnetUtilityJs'
+ ],
+ function (
+ $,
+ storage,
+ $t,
+ Component,
+ urlBuilder,
+ customer,
+ quote,
+ alert,
+ modal,
+ priceUtils
+ ) {
+ 'use strict';
+
+ $(document).on('change','#novalnetSepaInstalment_cycle',function(){
+ var orderTotal = quote.totals()['base_grand_total'];
+ var cycle = $(this).val();
+ if (cycle == null) {
+ return;
+ }
+ var cycleAmount;
+ var lastCycleAmount;
+ storage.get(
+ urlBuilder.createUrl('/novalnet/payment/instalment_cycle/' + orderTotal + '/' + cycle, {})
+ ).done(function (response) {
+ response = $.parseJSON(response);
+ cycleAmount = response.cycle_amount;
+ lastCycleAmount = response.last_cycle;
+ var html = '' + $.mage.__("Instalment cycles") + ' ' + $.mage.__("Instalment Amount") + ' ';
+ var j = 0;
+ var number_text = '';
+ for (var i = 1; i <= cycle; i++) {
+ if (i != cycle) {
+ html += ''+ i + ' ' + priceUtils.formatPrice(cycleAmount, quote.getPriceFormat()) + ' ';
+ } else if (i == cycle) {
+ html += ''+ i + ' ' + priceUtils.formatPrice(lastCycleAmount, quote.getPriceFormat()) + ' ';
+ }
+ j++;
+ }
+ $('.novalnetSepaInstalment-details').html(html);
+ });
+ });
+
+ var current_date = new Date();
+ var max_year = current_date.getFullYear() - 18;
+ var min_year = current_date.getFullYear() - 91;
+ var years_range = [];
+ for(var year = max_year; year >= min_year; year--) {
+ years_range.push(String(year));
+ }
+
+ return Component.extend({
+ defaults: {
+ template: {
+ name: 'Novalnet_Payment/payment/novalnetSepaInstalment',
+ afterRender: function (renderedNodesArray, data) {
+ data.displayForm();
+ }
+ },
+ sepaAccountNumber: '',
+ sepaBicCode: '',
+ novalnetPaymentToken: ''
+ },
+ currentBillingAddress: quote.billingAddress,
+ totals: quote.getTotals(),
+
+ initObservable: function () {
+ this._super()
+ .observe([
+ 'sepaAccountNumber',
+ 'novalnetPaymentToken'
+ ]);
+ this.novalnetPaymentToken.subscribe(this.onAccountChange, this);
+ this.novalnetPaymentToken(window.checkoutConfig.payment[this.getCode()].tokenId);
+
+ return this;
+ },
+
+ onAccountChange: function (selectedAccount) {
+ if (selectedAccount == 'new_account') {
+ $("#novalnet_form_sepa_instalment").show();
+ } else {
+ $("#novalnet_form_sepa_instalment").hide();
+ }
+ },
+
+ displayForm: function () {
+ if (window.checkoutConfig.payment[this.getCode()].storePayment != '1' || window.checkoutConfig.payment[this.getCode()].storedPayments.length == 0) {
+ this.onAccountChange('new_account');
+ } else {
+ this.onAccountChange(window.checkoutConfig.payment[this.getCode()].tokenId);
+ }
+ },
+
+ getData: function () {
+ var CustomerDOB = $('#' + this.getCode() + '_dob').val();
+
+ return {
+ 'method': this.item.method,
+ 'additional_data': {
+ 'novalnetSepaInstalment_iban': this.getIBAN(),
+ 'novalnetSepaInstalment_bic': this.getBIC(),
+ 'novalnetSepaInstalment_dob': CustomerDOB,
+ 'novalnetSepaInstalment_cycle': this.getInstalmentCycle(),
+ 'novalnetSepaInstalment_create_token': this.canStorePayment(),
+ 'novalnetSepaInstalment_token': this.getPaymentToken()
+ }
+ };
+ },
+
+ /**
+ * Returns payment method instructions
+ */
+ getInstructions: function () {
+ return window.checkoutConfig.payment[this.getCode()].instructions;
+ },
+
+ /**
+ * Returns payment testmode status
+ */
+ getTestmode: function () {
+ return window.checkoutConfig.payment[this.getCode()].testmode;
+ },
+
+ /**
+ * Returns payment method logo URL
+ */
+ getLogo: function () {
+ return window.checkoutConfig.payment[this.getCode()].logo;
+ },
+
+ /**
+ * check can store payment reference
+ */
+ canStorePayment: function () {
+ if (!this.getPaymentToken()) {
+ return ($('#' + this.getCode() + '_store_payment').prop("checked") == true);
+ } else {
+ return false;
+ }
+ },
+
+ /**
+ * check can show store payment
+ */
+ showStorePayment: function () {
+ if (window.checkoutConfig.payment[this.getCode()].storePayment == '1') {
+ return customer.isLoggedIn();
+ } else {
+ return false;
+ }
+ },
+
+ /**
+ * get stored payments
+ */
+ getStoredPayments: function () {
+ if (window.checkoutConfig.payment[this.getCode()].storePayment == '1') {
+ return window.checkoutConfig.payment[this.getCode()].storedPayments;
+ } else {
+ return false;
+ }
+ },
+
+ /**
+ * get payment token
+ */
+ getPaymentToken: function () {
+ if (this.novalnetPaymentToken() && this.novalnetPaymentToken() != 'new_account') {
+ return this.novalnetPaymentToken();
+ } else {
+ return false;
+ }
+ },
+
+ /**
+ * remove payment token
+ */
+ removeToken: function (tokenId) {
+ var parent = this;
+
+ var options = {
+ type: 'popup',
+ modalClass: 'nntoken-remove-popup-modal',
+ responsive: true,
+ innerScroll: false,
+ buttons: [{
+ text: $t('No'),
+ class: 'nntoken-cancel-remove-modal action tocart primary',
+ click: function () {
+ this.closeModal();
+ }
+ },
+ {
+ text: $t('Yes'),
+ class: 'nntoken-confirm-remove-modal action tocart primary',
+ click: function () {
+ var button = this;
+ storage.get(
+ urlBuilder.createUrl('/novalnet/payment/remove_token/' + tokenId, {})
+ ).done(function (response) {
+ button.closeModal();
+ if (response) {
+ $('a[nntoken-id=' + tokenId + ']').closest('.novalnet-payment-saved-payments').remove();
+ if ($('form#novalnetSepaInstalment .novalnet-payment-saved-payments').length <= 0) {
+ $('form#novalnetSepaInstalment .novalnet-payment-new_account').remove();
+ }
+ $('#novalnet_form_sepa_instalment').show();
+ parent.novalnetPaymentToken('new_account');
+ window.location = window.location.hash ;
+ location.reload();
+ } else {
+ alert({
+ content: $t('Novalnet Payment Token does not found')
+ });
+ }
+ }).fail(function (xhr, ajaxOptions, thrownError) {
+ button.closeModal();
+ alert({
+ content: $t(thrownError)
+ });
+ });
+ }
+ }]
+ };
+
+ // Initialize and Open popup
+ modal(options, $('#remove-nntoken-modal'));
+ $("#remove-nntoken-modal").modal("openModal");
+ },
+
+ /**
+ * get IBAN
+ */
+ getIBAN: function () {
+ if (!this.getPaymentToken()) {
+ return $('#' + this.getCode() + '_account_number').val();
+ }
+ },
+
+ /**
+ * get BIC
+ */
+ getBIC: function () {
+ if (!this.getPaymentToken()) {
+ return $('#' + this.getCode() + '_bic_code').val();
+ }
+ },
+
+ /**
+ * get DOB
+ */
+ getDob: function () {
+ if (window.checkoutConfig.customerData.dob) {
+ var date = new Date(window.checkoutConfig.customerData.dob);
+ var newDate = ("0" + date.getDate()).slice(-2)+'.'+("0" + (date.getMonth() + 1)).slice(-2)+'.'+date.getFullYear();
+ return newDate;
+ }
+ },
+
+ /**
+ * get InstalmentCycle
+ */
+ getInstalmentCycle: function () {
+ return $('#' + this.getCode() + '_cycle').val();
+ },
+
+ validate: function () {
+ var form = 'form[data-role=novalnetSepaInstalment]';
+ return $(form).validation() && $(form).validation('isValid');
+ },
+
+ validateCompany: function (company) {
+ if (company != null && window.checkoutConfig.payment[this.getCode()].allow_b2b_customer == 1) {
+ if (!NovalnetUtility.isValidCompanyName(company)) {
+ return false;
+ } else {
+ return true;
+ }
+ }
+ return false;
+ },
+
+ sepaInstalmentMandateToggle: function () {
+ $('#sepa_instalment_mandate_details').toggle('slow');
+ },
+
+ /**
+ * @return {*|String}
+ */
+ getValue: function () {
+ var price = 0;
+
+ if (this.totals()) {
+ price = quote.totals()['base_grand_total'];
+ }
+
+ return priceUtils.formatPrice(price, quote.getPriceFormat());
+ },
+
+ getInstalmentOptions: function () {
+ var orderTotal = quote.totals()['base_grand_total'];
+ storage.get(
+ urlBuilder.createUrl('/novalnet/payment/instalment_options/'+ this.getCode() + '/' + orderTotal, {})
+ ).done(function (response) {
+ var allCycles = $.parseJSON(response);
+ var tariffField = $('#novalnetSepaInstalment_cycle');
+ tariffField.find('option').remove();
+ $.each(allCycles, function(id, value) {
+ if (0 == $('#novalnetSepaInstalment_cycle[value='+value.instalment_value+']').length) {
+ tariffField.append(
+ $(' ').attr('value', value.instalment_value).text(value.instalment_key)
+ );
+ }
+ });
+ $('#novalnetSepaInstalment_cycle').trigger('change');
+ });
+ },
+
+ allowOnlyNumber: function (data, event) {
+ if(event.charCode < 48 || event.charCode > 57) {
+ return false;
+ }
+ return true;
+ },
+
+ });
+ }
+);
diff --git a/view/frontend/web/js/view/payment/method-renderer/novalnetTrustly.js b/view/frontend/web/js/view/payment/method-renderer/novalnetTrustly.js
new file mode 100755
index 0000000..5e9fd7c
--- /dev/null
+++ b/view/frontend/web/js/view/payment/method-renderer/novalnetTrustly.js
@@ -0,0 +1,83 @@
+/**
+ * Novalnet payment extension
+ *
+ * NOTICE OF LICENSE
+ *
+ * This source file is subject to the Novalnet End User License Agreement
+ * that is bundled with this package in the file LICENSE.txt
+ *
+ * DISCLAIMER
+ *
+ * If you wish to customize Novalnet payment extension for your needs,
+ * please contact technic@novalnet.de for more information.
+ *
+ * @category Novalnet
+ * @package Novalnet_Payment
+ * @copyright Copyright (c) Novalnet AG
+ * @license https://www.novalnet.de/payment-plugins/kostenlos/lizenz
+ */
+define(
+ [
+ 'jquery',
+ 'mage/url',
+ 'mage/translate',
+ 'Magento_Checkout/js/view/payment/default',
+ 'Magento_Checkout/js/action/redirect-on-success',
+ 'Novalnet_Payment/js/action/get-redirect-url',
+ 'Magento_Ui/js/model/messageList'
+ ],
+ function (
+ $,
+ url,
+ $t,
+ Component,
+ redirectOnSuccessAction,
+ redirectURLAction,
+ globalMessageList
+ ) {
+ 'use strict';
+
+ return Component.extend({
+ defaults: {
+ template: 'Novalnet_Payment/payment/novalnetTrustly'
+ },
+
+ /**
+ * After place order callback
+ */
+ afterPlaceOrder: function () {
+ this.redirectAfterPlaceOrder = false;
+
+ redirectURLAction().done(function (redirectUrl) {
+ window.location.replace(redirectUrl);
+ }).fail(function (xhr, ajaxOptions, thrownError) {
+ globalMessageList.addErrorMessage({
+ message: $t(thrownError)
+ });
+ window.location.replace(url.build('checkout/cart'));
+ });
+ },
+
+ /**
+ * Returns payment method instructions
+ */
+ getInstructions: function () {
+ return window.checkoutConfig.payment[this.getCode()].instructions;
+ },
+
+ /**
+ * Returns payment testmode status
+ */
+ getTestmode: function () {
+ return window.checkoutConfig.payment[this.getCode()].testmode;
+ },
+
+ /**
+ * Returns payment method logo URL
+ */
+ getLogo: function () {
+ return window.checkoutConfig.payment[this.getCode()].logo;
+ }
+ });
+ }
+);
diff --git a/view/frontend/web/js/view/payment/method-renderer/novalnetWechatpay.js b/view/frontend/web/js/view/payment/method-renderer/novalnetWechatpay.js
new file mode 100755
index 0000000..b388ca5
--- /dev/null
+++ b/view/frontend/web/js/view/payment/method-renderer/novalnetWechatpay.js
@@ -0,0 +1,83 @@
+/**
+ * Novalnet payment extension
+ *
+ * NOTICE OF LICENSE
+ *
+ * This source file is subject to the Novalnet End User License Agreement
+ * that is bundled with this package in the file LICENSE.txt
+ *
+ * DISCLAIMER
+ *
+ * If you wish to customize Novalnet payment extension for your needs,
+ * please contact technic@novalnet.de for more information.
+ *
+ * @category Novalnet
+ * @package Novalnet_Payment
+ * @copyright Copyright (c) Novalnet AG
+ * @license https://www.novalnet.de/payment-plugins/kostenlos/lizenz
+ */
+define(
+ [
+ 'jquery',
+ 'mage/url',
+ 'mage/translate',
+ 'Magento_Checkout/js/view/payment/default',
+ 'Magento_Checkout/js/action/redirect-on-success',
+ 'Novalnet_Payment/js/action/get-redirect-url',
+ 'Magento_Ui/js/model/messageList'
+ ],
+ function (
+ $,
+ url,
+ $t,
+ Component,
+ redirectOnSuccessAction,
+ redirectURLAction,
+ globalMessageList
+ ) {
+ 'use strict';
+
+ return Component.extend({
+ defaults: {
+ template: 'Novalnet_Payment/payment/novalnetWechatpay'
+ },
+
+ /**
+ * After place order callback
+ */
+ afterPlaceOrder: function () {
+ this.redirectAfterPlaceOrder = false;
+
+ redirectURLAction().done(function (redirectUrl) {
+ window.location.replace(redirectUrl);
+ }).fail(function (xhr, ajaxOptions, thrownError) {
+ globalMessageList.addErrorMessage({
+ message: $t(thrownError)
+ });
+ window.location.replace(url.build('checkout/cart'));
+ });
+ },
+
+ /**
+ * Returns payment method instructions
+ */
+ getInstructions: function () {
+ return window.checkoutConfig.payment[this.getCode()].instructions;
+ },
+
+ /**
+ * Returns payment testmode status
+ */
+ getTestmode: function () {
+ return window.checkoutConfig.payment[this.getCode()].testmode;
+ },
+
+ /**
+ * Returns payment method logo URL
+ */
+ getLogo: function () {
+ return window.checkoutConfig.payment[this.getCode()].logo;
+ }
+ });
+ }
+);
diff --git a/view/frontend/web/js/view/payment/novalnet-payment.js b/view/frontend/web/js/view/payment/novalnet-payment.js
new file mode 100755
index 0000000..bf448ab
--- /dev/null
+++ b/view/frontend/web/js/view/payment/novalnet-payment.js
@@ -0,0 +1,280 @@
+/**
+ * Novalnet payment extension
+ *
+ * NOTICE OF LICENSE
+ *
+ * This source file is subject to the Novalnet End User License Agreement
+ * that is bundled with this package in the file LICENSE.txt
+ *
+ * DISCLAIMER
+ *
+ * If you wish to customize Novalnet payment extension for your needs,
+ * please contact technic@novalnet.de for more information.
+ *
+ * @category Novalnet
+ * @package Novalnet_Payment
+ * @copyright Copyright (c) Novalnet AG
+ * @license https://www.novalnet.de/payment-plugins/kostenlos/lizenz
+ */
+define(
+ [
+ 'jquery',
+ 'uiComponent',
+ 'Magento_Checkout/js/model/quote',
+ 'Magento_Checkout/js/action/select-payment-method',
+ 'Magento_Checkout/js/checkout-data',
+ 'Magento_Checkout/js/model/payment/renderer-list'
+ ],
+ function (
+ $,
+ Component,
+ quote,
+ selectPaymentMethodAction,
+ checkoutData,
+ rendererList
+ ) {
+ 'use strict';
+
+ rendererList.push(
+ {
+ type: 'novalnetCc',
+ component: 'Novalnet_Payment/js/view/payment/method-renderer/novalnetCc'
+ },
+ {
+ type: 'novalnetSepa',
+ component: 'Novalnet_Payment/js/view/payment/method-renderer/novalnetSepa'
+ },
+ {
+ type: 'novalnetInvoice',
+ component: 'Novalnet_Payment/js/view/payment/method-renderer/novalnetInvoice'
+ },
+ {
+ type: 'novalnetPrepayment',
+ component: 'Novalnet_Payment/js/view/payment/method-renderer/novalnetPrepayment'
+ },
+ {
+ type: 'novalnetInvoiceGuarantee',
+ component: 'Novalnet_Payment/js/view/payment/method-renderer/novalnetInvoiceGuarantee'
+ },
+ {
+ type: 'novalnetSepaGuarantee',
+ component: 'Novalnet_Payment/js/view/payment/method-renderer/novalnetSepaGuarantee'
+ },
+ {
+ type: 'novalnetCashpayment',
+ component: 'Novalnet_Payment/js/view/payment/method-renderer/novalnetCashpayment'
+ },
+ {
+ type: 'novalnetMultibanco',
+ component: 'Novalnet_Payment/js/view/payment/method-renderer/novalnetMultibanco'
+ },
+ {
+ type: 'novalnetPaypal',
+ component: 'Novalnet_Payment/js/view/payment/method-renderer/novalnetPaypal'
+ },
+ {
+ type: 'novalnetBanktransfer',
+ component: 'Novalnet_Payment/js/view/payment/method-renderer/novalnetBanktransfer'
+ },
+ {
+ type: 'novalnetOnlineBanktransfer',
+ component: 'Novalnet_Payment/js/view/payment/method-renderer/novalnetOnlineBanktransfer'
+ },
+ {
+ type: 'novalnetIdeal',
+ component: 'Novalnet_Payment/js/view/payment/method-renderer/novalnetIdeal'
+ },
+ {
+ type: 'novalnetApplepay',
+ component: 'Novalnet_Payment/js/view/payment/method-renderer/novalnetApplepay'
+ },
+ {
+ type: 'novalnetGooglepay',
+ component: 'Novalnet_Payment/js/view/payment/method-renderer/novalnetGooglepay'
+ },
+ {
+ type: 'novalnetBancontact',
+ component: 'Novalnet_Payment/js/view/payment/method-renderer/novalnetBancontact'
+ },
+ {
+ type: 'novalnetEps',
+ component: 'Novalnet_Payment/js/view/payment/method-renderer/novalnetEps'
+ },
+ {
+ type: 'novalnetGiropay',
+ component: 'Novalnet_Payment/js/view/payment/method-renderer/novalnetGiropay'
+ },
+ {
+ type: 'novalnetPrzelewy',
+ component: 'Novalnet_Payment/js/view/payment/method-renderer/novalnetPrzelewy'
+ },
+ {
+ type: 'novalnetPostFinance',
+ component: 'Novalnet_Payment/js/view/payment/method-renderer/novalnetPostFinance'
+ },
+ {
+ type: 'novalnetPostFinanceCard',
+ component: 'Novalnet_Payment/js/view/payment/method-renderer/novalnetPostFinanceCard'
+ },
+ {
+ type: 'novalnetInvoiceInstalment',
+ component: 'Novalnet_Payment/js/view/payment/method-renderer/novalnetInvoiceInstalment'
+ },
+ {
+ type: 'novalnetSepaInstalment',
+ component: 'Novalnet_Payment/js/view/payment/method-renderer/novalnetSepaInstalment'
+ },
+ {
+ type: 'novalnetTrustly',
+ component: 'Novalnet_Payment/js/view/payment/method-renderer/novalnetTrustly'
+ },
+ {
+ type: 'novalnetAlipay',
+ component: 'Novalnet_Payment/js/view/payment/method-renderer/novalnetAlipay'
+ },
+ {
+ type: 'novalnetWechatpay',
+ component: 'Novalnet_Payment/js/view/payment/method-renderer/novalnetWechatpay'
+ },
+ {
+ type: 'novalnetBlik',
+ component: 'Novalnet_Payment/js/view/payment/method-renderer/novalnetBlik'
+ }
+ );
+
+ var novalnetPayments = {
+ initObservable: function () {
+ quote.billingAddress.subscribe(this.onBillingAddressChange, this);
+ quote.totals.subscribe(this.onBillingAddressChange, this);
+ return this;
+ },
+
+ onBillingAddressChange: function (selectedAddress) {
+ var self = this;
+ if (selectedAddress == null) {
+ return;
+ }
+
+ $(document).ready(function(){
+ $.validator.addMethod(
+ "validate-novalnet-date",
+ function (val, elm) {
+ if(!NovalnetUtility.validateDateFormat(val)) {
+ return false;
+ }
+ return true;
+ },
+ $.mage.__("Please Enter valid date of Birth!")
+ );
+
+ var saveInAddressBook = selectedAddress["saveInAddressBook"];
+ delete selectedAddress["saveInAddressBook"];
+
+ setTimeout(function(){
+ if (($('input[id="novalnetSepa"][name="payment[method]"]').length && $('input[id="novalnetSepaGuarantee"][name="payment[method]"]').length)) {
+
+ // check billingAddress and shippingAddress are same and toggle payments
+ if (self.checkBillingShippingAreSame()) {
+ if ($('input[id="novalnetSepa"][name="payment[method]"]:visible').length) {
+ $('input[id="novalnetSepa"][name="payment[method]"]').closest('.payment-method').hide();
+ }
+ if ($('input[id="novalnetSepaGuarantee"][name="payment[method]"]:hidden').length) {
+ $('input[id="novalnetSepaGuarantee"][name="payment[method]"]').closest('.payment-method').show();
+ if (checkoutData.getSelectedPaymentMethod() == 'novalnetSepa') {
+ var methodData = {
+ 'method': 'novalnetSepaGuarantee',
+ 'additional_data': {}
+ };
+ selectPaymentMethodAction(methodData);
+ checkoutData.setSelectedPaymentMethod(methodData.method);
+ }
+ }
+ } else {
+ if ($('input[id="novalnetSepaGuarantee"][name="payment[method]"]:visible').length) {
+ $('input[id="novalnetSepaGuarantee"][name="payment[method]"]').closest('.payment-method').hide();
+ }
+ if ($('input[id="novalnetSepa"][name="payment[method]"]:hidden').length) {
+ $('input[id="novalnetSepa"][name="payment[method]"]').closest('.payment-method').show();
+ if (checkoutData.getSelectedPaymentMethod() == 'novalnetSepaGuarantee') {
+ var methodData = {
+ 'method': 'novalnetSepa',
+ 'additional_data': {}
+ };
+ selectPaymentMethodAction(methodData);
+ checkoutData.setSelectedPaymentMethod(methodData.method);
+ }
+ }
+ }
+ } else if (($('input[id="novalnetSepa"][name="payment[method]"]').length && !$('input[id="novalnetSepaGuarantee"][name="payment[method]"]').length)) {
+ $('input[id="novalnetSepa"][name="payment[method]"]').closest('.payment-method').show();
+ } else if ((!$('input[id="novalnetSepa"][name="payment[method]"]').length && $('input[id="novalnetSepaGuarantee"][name="payment[method]"]').length)) {
+ $('input[id="novalnetSepaGuarantee"][name="payment[method]"]').closest('.payment-method').show();
+ }
+
+ if ($('input[id="novalnetInvoice"][name="payment[method]"]').length && $('input[id="novalnetInvoiceGuarantee"][name="payment[method]"]').length) {
+ if (self.checkBillingShippingAreSame()) {
+ if ($('input[id="novalnetInvoice"][name="payment[method]"]:visible').length) {
+ $('input[id="novalnetInvoice"][name="payment[method]"]').closest('.payment-method').hide();
+ }
+ if ($('input[id="novalnetInvoiceGuarantee"][name="payment[method]"]:hidden').length) {
+ $('input[id="novalnetInvoiceGuarantee"][name="payment[method]"]').closest('.payment-method').show();
+ if (checkoutData.getSelectedPaymentMethod() == 'novalnetInvoice') {
+ var methodData = {
+ 'method': 'novalnetInvoiceGuarantee',
+ 'additional_data': {}
+ };
+ selectPaymentMethodAction(methodData);
+ checkoutData.setSelectedPaymentMethod(methodData.method);
+ }
+ }
+ } else {
+ if ($('input[id="novalnetInvoiceGuarantee"][name="payment[method]"]:visible').length) {
+ $('input[id="novalnetInvoiceGuarantee"][name="payment[method]"]').closest('.payment-method').hide();
+ }
+ if ($('input[id="novalnetInvoice"][name="payment[method]"]:hidden').length) {
+ $('input[id="novalnetInvoice"][name="payment[method]"]').closest('.payment-method').show();
+ if (checkoutData.getSelectedPaymentMethod() == 'novalnetInvoiceGuarantee') {
+ var methodData = {
+ 'method': 'novalnetInvoice',
+ 'additional_data': {}
+ };
+ selectPaymentMethodAction(methodData);
+ checkoutData.setSelectedPaymentMethod(methodData.method);
+ }
+ }
+ }
+ } else if (($('input[id="novalnetInvoice"][name="payment[method]"]').length && !$('input[id="novalnetInvoiceGuarantee"][name="payment[method]"]').length)) {
+ $('input[id="novalnetInvoice"][name="payment[method]"]').closest('.payment-method').show();
+ } else if ((!$('input[id="novalnetInvoice"][name="payment[method]"]').length && $('input[id="novalnetInvoiceGuarantee"][name="payment[method]"]').length)) {
+ $('input[id="novalnetInvoiceGuarantee"][name="payment[method]"]').closest('.payment-method').show();
+ }
+
+ selectedAddress["saveInAddressBook"] = saveInAddressBook;
+ }, 300);
+ });
+ },
+
+ checkBillingShippingAreSame: function() {
+ var billingAddress = quote.billingAddress(),
+ shippingAddress = quote.shippingAddress();
+
+ if (quote.isVirtual()) {
+ return true;
+ }
+
+ if (
+ billingAddress.city == shippingAddress.city &&
+ JSON.stringify(billingAddress.street) == JSON.stringify(shippingAddress.street) &&
+ billingAddress.postcode == shippingAddress.postcode &&
+ billingAddress.countryId == shippingAddress.countryId
+ ) {
+ return true;
+ }
+
+ return false;
+ }
+ };
+
+ return Component.extend(novalnetPayments);
+ }
+);
diff --git a/view/frontend/web/template/checkout/novalnetGuestCheckout.html b/view/frontend/web/template/checkout/novalnetGuestCheckout.html
new file mode 100755
index 0000000..6ba04f3
--- /dev/null
+++ b/view/frontend/web/template/checkout/novalnetGuestCheckout.html
@@ -0,0 +1,25 @@
+
+
diff --git a/view/frontend/web/template/payment/novalnetAlipay.html b/view/frontend/web/template/payment/novalnetAlipay.html
new file mode 100755
index 0000000..a7b5032
--- /dev/null
+++ b/view/frontend/web/template/payment/novalnetAlipay.html
@@ -0,0 +1,81 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/view/frontend/web/template/payment/novalnetApplepay.html b/view/frontend/web/template/payment/novalnetApplepay.html
new file mode 100755
index 0000000..dc3ac93
--- /dev/null
+++ b/view/frontend/web/template/payment/novalnetApplepay.html
@@ -0,0 +1,77 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/view/frontend/web/template/payment/novalnetBancontact.html b/view/frontend/web/template/payment/novalnetBancontact.html
new file mode 100755
index 0000000..6afe765
--- /dev/null
+++ b/view/frontend/web/template/payment/novalnetBancontact.html
@@ -0,0 +1,80 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/view/frontend/web/template/payment/novalnetBanktransfer.html b/view/frontend/web/template/payment/novalnetBanktransfer.html
new file mode 100755
index 0000000..a5c5afe
--- /dev/null
+++ b/view/frontend/web/template/payment/novalnetBanktransfer.html
@@ -0,0 +1,81 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/view/frontend/web/template/payment/novalnetBlik.html b/view/frontend/web/template/payment/novalnetBlik.html
new file mode 100755
index 0000000..3148321
--- /dev/null
+++ b/view/frontend/web/template/payment/novalnetBlik.html
@@ -0,0 +1,81 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/view/frontend/web/template/payment/novalnetCashpayment.html b/view/frontend/web/template/payment/novalnetCashpayment.html
new file mode 100755
index 0000000..849b023
--- /dev/null
+++ b/view/frontend/web/template/payment/novalnetCashpayment.html
@@ -0,0 +1,80 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/view/frontend/web/template/payment/novalnetCc.html b/view/frontend/web/template/payment/novalnetCc.html
new file mode 100755
index 0000000..92f87e7
--- /dev/null
+++ b/view/frontend/web/template/payment/novalnetCc.html
@@ -0,0 +1,181 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/view/frontend/web/template/payment/novalnetEps.html b/view/frontend/web/template/payment/novalnetEps.html
new file mode 100755
index 0000000..a0b3f81
--- /dev/null
+++ b/view/frontend/web/template/payment/novalnetEps.html
@@ -0,0 +1,81 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/view/frontend/web/template/payment/novalnetGiropay.html b/view/frontend/web/template/payment/novalnetGiropay.html
new file mode 100755
index 0000000..1e77934
--- /dev/null
+++ b/view/frontend/web/template/payment/novalnetGiropay.html
@@ -0,0 +1,81 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/view/frontend/web/template/payment/novalnetGooglepay.html b/view/frontend/web/template/payment/novalnetGooglepay.html
new file mode 100755
index 0000000..9c670ee
--- /dev/null
+++ b/view/frontend/web/template/payment/novalnetGooglepay.html
@@ -0,0 +1,77 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/view/frontend/web/template/payment/novalnetIdeal.html b/view/frontend/web/template/payment/novalnetIdeal.html
new file mode 100755
index 0000000..dc7968e
--- /dev/null
+++ b/view/frontend/web/template/payment/novalnetIdeal.html
@@ -0,0 +1,81 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/view/frontend/web/template/payment/novalnetInvoice.html b/view/frontend/web/template/payment/novalnetInvoice.html
new file mode 100755
index 0000000..9477fed
--- /dev/null
+++ b/view/frontend/web/template/payment/novalnetInvoice.html
@@ -0,0 +1,80 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/view/frontend/web/template/payment/novalnetInvoiceGuarantee.html b/view/frontend/web/template/payment/novalnetInvoiceGuarantee.html
new file mode 100755
index 0000000..3198622
--- /dev/null
+++ b/view/frontend/web/template/payment/novalnetInvoiceGuarantee.html
@@ -0,0 +1,107 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/view/frontend/web/template/payment/novalnetInvoiceInstalment.html b/view/frontend/web/template/payment/novalnetInvoiceInstalment.html
new file mode 100755
index 0000000..dab4d12
--- /dev/null
+++ b/view/frontend/web/template/payment/novalnetInvoiceInstalment.html
@@ -0,0 +1,132 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/view/frontend/web/template/payment/novalnetMultibanco.html b/view/frontend/web/template/payment/novalnetMultibanco.html
new file mode 100755
index 0000000..aedc3b9
--- /dev/null
+++ b/view/frontend/web/template/payment/novalnetMultibanco.html
@@ -0,0 +1,80 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/view/frontend/web/template/payment/novalnetOnlineBanktransfer.html b/view/frontend/web/template/payment/novalnetOnlineBanktransfer.html
new file mode 100755
index 0000000..e95e9f9
--- /dev/null
+++ b/view/frontend/web/template/payment/novalnetOnlineBanktransfer.html
@@ -0,0 +1,81 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/view/frontend/web/template/payment/novalnetPaypal.html b/view/frontend/web/template/payment/novalnetPaypal.html
new file mode 100755
index 0000000..9dbe57d
--- /dev/null
+++ b/view/frontend/web/template/payment/novalnetPaypal.html
@@ -0,0 +1,126 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/view/frontend/web/template/payment/novalnetPostFinance.html b/view/frontend/web/template/payment/novalnetPostFinance.html
new file mode 100755
index 0000000..e0bdee7
--- /dev/null
+++ b/view/frontend/web/template/payment/novalnetPostFinance.html
@@ -0,0 +1,81 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/view/frontend/web/template/payment/novalnetPostFinanceCard.html b/view/frontend/web/template/payment/novalnetPostFinanceCard.html
new file mode 100755
index 0000000..e0bdee7
--- /dev/null
+++ b/view/frontend/web/template/payment/novalnetPostFinanceCard.html
@@ -0,0 +1,81 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/view/frontend/web/template/payment/novalnetPrepayment.html b/view/frontend/web/template/payment/novalnetPrepayment.html
new file mode 100755
index 0000000..951e964
--- /dev/null
+++ b/view/frontend/web/template/payment/novalnetPrepayment.html
@@ -0,0 +1,80 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/view/frontend/web/template/payment/novalnetPrzelewy.html b/view/frontend/web/template/payment/novalnetPrzelewy.html
new file mode 100755
index 0000000..7e6842b
--- /dev/null
+++ b/view/frontend/web/template/payment/novalnetPrzelewy.html
@@ -0,0 +1,81 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/view/frontend/web/template/payment/novalnetSepa.html b/view/frontend/web/template/payment/novalnetSepa.html
new file mode 100755
index 0000000..b0bfcd3
--- /dev/null
+++ b/view/frontend/web/template/payment/novalnetSepa.html
@@ -0,0 +1,194 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/view/frontend/web/template/payment/novalnetSepaGuarantee.html b/view/frontend/web/template/payment/novalnetSepaGuarantee.html
new file mode 100755
index 0000000..edaea1e
--- /dev/null
+++ b/view/frontend/web/template/payment/novalnetSepaGuarantee.html
@@ -0,0 +1,212 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/view/frontend/web/template/payment/novalnetSepaInstalment.html b/view/frontend/web/template/payment/novalnetSepaInstalment.html
new file mode 100755
index 0000000..0e930c7
--- /dev/null
+++ b/view/frontend/web/template/payment/novalnetSepaInstalment.html
@@ -0,0 +1,233 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/view/frontend/web/template/payment/novalnetTrustly.html b/view/frontend/web/template/payment/novalnetTrustly.html
new file mode 100755
index 0000000..0c7ea3d
--- /dev/null
+++ b/view/frontend/web/template/payment/novalnetTrustly.html
@@ -0,0 +1,81 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/view/frontend/web/template/payment/novalnetWechatpay.html b/view/frontend/web/template/payment/novalnetWechatpay.html
new file mode 100755
index 0000000..eb9f398
--- /dev/null
+++ b/view/frontend/web/template/payment/novalnetWechatpay.html
@@ -0,0 +1,81 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+