From 8108d6a253decaaca2257d508cfd5a141ec2dbd6 Mon Sep 17 00:00:00 2001 From: Shishir Labhubhai Dabhi Date: Thu, 8 Sep 2022 12:10:37 +0530 Subject: [PATCH] Custom Payment Name and Display payment name with payment method and Improved A2A Payment Methods compatibility. --- CHANGELOG.md | 8 +- README.md | 4 +- config.xml | 8 +- .../admin/AdminNetseasyOrderController.php | 94 +++- controllers/front/return.php | 121 +++-- netseasy.php | 45 +- translations/DE.php | 8 +- translations/EN.php | 6 + translations/NN.php | 8 +- ...dulesNetseasyAdmin_content_order.da-DK.xlf | 213 ++++---- .../da-DK/ModulesNetseasyConfig.da-DK.xlf | 114 +++-- .../da-DK/ModulesNetseasyNetseasy.da-DK.xlf | 33 +- .../ModulesNetseasyPayment_error.da-DK.xlf | 18 +- translations/da.php | 8 +- ...dulesNetseasyAdmin_content_order.de-DE.xlf | 208 ++++---- .../de-DE/ModulesNetseasyConfig.de-DE.xlf | 348 +++++++------ .../de-DE/ModulesNetseasyNetseasy.de-DE.xlf | 7 +- .../ModulesNetseasyPayment_error.de-DE.xlf | 18 +- ...dulesNetseasyAdmin_content_order.en-US.xlf | 208 ++++---- .../en-US/ModulesNetseasyConfig.en-US.xlf | 32 +- .../en-US/ModulesNetseasyNetseasy.en-US.xlf | 38 +- .../nn-NO/ModulesNetseasyConfig.nn-NO.xlf | 24 +- .../ModulesNetseasyPayment_error.nn-NO.xlf | 18 +- views/css/order.css | 475 +++++++++++++----- views/js/back.js | 8 +- views/js/nets_checkout.js | 25 +- views/templates/admin/config.tpl | 76 +-- views/templates/hook/paymentEmbedded.tpl | 2 +- 28 files changed, 1302 insertions(+), 873 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ef547d7..ac75fb5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,12 +6,18 @@ |Author | `Nets eCom` |Prefix | `EASY-PS1.7` |Shop Version | `1.7+` -|Version | `1.1.2` +|Version | `1.1.3` |Guide | https://tech.nets.eu/shopmodules |Github | https://github.com/Nets-eCom/prestashop-PS1.7 ## CHANGELOG +### Version 1.1.3 - Released 2022-09-08 +* New : Custom Payment Name display on checkout page. +* New : Display payment name with payment method in Admin Order List. +* Fixed : Improved A2A Payment Methods compatibility. +* Fixed : Improved Nets plugin latest version notification on configure page. + ### Version 1.1.2 - Released 2022-06-27 * Fixed : Admin Order Nets Easy details cancel button issue has been fixed. * Fixed : Payment Nets Checkout issue for norwegian language locale has been fixed. diff --git a/README.md b/README.md index e296fc4..6181312 100644 --- a/README.md +++ b/README.md @@ -6,8 +6,8 @@ |Author | `Nets eCom` |Prefix | `EASY-PS1.7` |Shop Version | `1.7+` -|Version | `1.1.2` -|Guide | [https://tech.nets.eu/shopmodules](https://developers.nets.eu/nets-easy/en-EU/docs/nets-easy-for-prestashop/nets-easy-for-prestashop-prestashop-17/) +|Version | `1.1.3` +|Guide | (https://developers.nets.eu/nets-easy/en-EU/docs/nets-easy-for-prestashop/nets-easy-for-prestashop-prestashop-17/) |Github | https://github.com/Nets-eCom/prestashop1.7_easy ## INSTALLATION diff --git a/config.xml b/config.xml index 6934577..ebb6fc9 100644 --- a/config.xml +++ b/config.xml @@ -1,13 +1,13 @@ netseasy - - + + - + 1 1 - + \ No newline at end of file diff --git a/controllers/admin/AdminNetseasyOrderController.php b/controllers/admin/AdminNetseasyOrderController.php index c11d159..adbfac1 100644 --- a/controllers/admin/AdminNetseasyOrderController.php +++ b/controllers/admin/AdminNetseasyOrderController.php @@ -74,6 +74,7 @@ public function getOrderItems($orderId) { $product_query = DB::getInstance()->executeS( "SELECT product_id,product_reference,product_name,product_price,tax_rate,product_quantity,total_price_tax_incl,total_shipping_price_tax_incl FROM " . _DB_PREFIX_ . "order_detail WHERE id_order = '" . (int) $orderId . "'" ); + if (!empty(DB::getInstance()->numRows($product_query))) { foreach ($product_query as $prows) { //get product tax rate @@ -159,6 +160,7 @@ public function getOrderItems($orderId) { public function checkPartialItems($orderId) { $orderItems = $this->getOrderItems($orderId); + $products = []; $chargedItems = []; $refundedItems = []; @@ -182,6 +184,7 @@ public function checkPartialItems($orderId) { $api_return = $this->getCurlResponse($this->getApiUrl() . $this->paymentId, 'GET'); $response = json_decode($api_return, true); + $paymentType = isset($response['payment']['paymentDetails']['paymentType']) ? $response['payment']['paymentDetails']['paymentType'] : ''; if (!empty($response['payment']['charges'])) { $qty = 0; @@ -189,9 +192,7 @@ public function checkPartialItems($orderId) { $grossprice = 0; foreach ($response['payment']['charges'] as $key => $values) { - for ($i = 0; $i < count($values['orderItems']); $i++) { - if (array_key_exists($values['orderItems'][$i]['reference'], $chargedItems)) { $qty = $chargedItems[$values['orderItems'][$i]['reference']]['quantity'] + $values['orderItems'][$i]['quantity']; $price = $chargedItems[$values['orderItems'][$i]['reference']]['grossprice'] + number_format((float) ($values['orderItems'][$i]['grossTotalAmount'] / 100), 2, '.', ''); @@ -240,12 +241,12 @@ public function checkPartialItems($orderId) { if (array_key_exists($values['orderItems'][$i]['reference'], $refundedItems)) { $qty = $refundedItems[$values['orderItems'][$i]['reference']]['quantity'] + $values['orderItems'][$i]['quantity']; $netprice = $values['orderItems'][$i]['unitPrice'] * $qty; - $grossprice = ($refundedItems[$values['orderItems'][$i]['reference']]['grossprice'] + ($values['orderItems'][$i]['grossTotalAmount'] / 100 )); + $grossprice = ($refundedItems[$values['orderItems'][$i]['reference']]['grossprice'] + ($values['orderItems'][$i]['grossTotalAmount'] / 100)); $refundedItems[$values['orderItems'][$i]['reference']] = array( 'reference' => $values['orderItems'][$i]['reference'], 'name' => $values['orderItems'][$i]['name'], 'quantity' => $qty, - 'grossprice' => number_format((float) (($grossprice )), 2, '.', ''), + 'grossprice' => number_format((float) (($grossprice)), 2, '.', ''), 'currency' => $response['payment']['orderDetails']['currency'] ); } else { @@ -282,7 +283,7 @@ public function checkPartialItems($orderId) { ); } } - if (!isset($response['payment']['summary']['reservedAmount'])) { + if (!isset($response['payment']['summary']['reservedAmount']) && $paymentType != 'A2A') { foreach ($orderItems['order']['items'] as $items) { $failedItems[$items['reference']] = array( 'name' => $items['name'], @@ -351,6 +352,11 @@ public function checkPartialItems($orderId) { if (count($chargedItems) > 0 && $reserved === $charged) { $lists['chargedItems'] = $chargedItems; } + + if (count($chargedItems) > 0 && $paymentType == "A2A") { + $lists['chargedItems'] = $chargedItems; + } + if ($reserved != $charged && $reserved != $cancelled) { $lists['chargedItemsOnly'] = $chargedItems; } @@ -401,6 +407,8 @@ public function is_easy($oder_id) { } $dbPayStatus = ''; $paymentStatus = $cancelled = $reserved = $charged = $refunded = $pending = $chargeid = $chargedate = ''; + $paymentType = isset($response['payment']['paymentDetails']['paymentType']) ? $response['payment']['paymentDetails']['paymentType'] : ''; + if (isset($response['payment']['summary']['cancelledAmount'])) { $cancelled = $response['payment']['summary']['cancelledAmount']; } @@ -425,22 +433,25 @@ public function is_easy($oder_id) { $chargedate = $response['payment']['charges'][0]['created']; } - if ($reserved) { + if ($reserved || $paymentType == "A2A") { if ($cancelled) { $langStatus = "cancel"; $paymentStatus = "Canceled"; $dbPayStatus = 1; // For payment status as cancelled in psnets_payment db table } elseif ($charged && $pending !== 'Pending') { - - if ($reserved != $charged) { + if ($reserved != $charged && $paymentType != "A2A") { $paymentStatus = "Partial Charged"; $langStatus = "partial_charge"; $dbPayStatus = 3; // For payment status as Partial Charged in psnets_payment db table } else if ($refunded) { - if ($reserved != $refunded) { + if ($reserved != $refunded && $paymentType != "A2A") { $paymentStatus = "Partial Refunded"; $langStatus = "partial_refund"; $dbPayStatus = 5; // For payment status as Partial Charged in psnets_payment db table + } else if ($paymentType == "A2A" && $refunded != $charged) { + $paymentStatus = "Partial Refunded"; + $langStatus = "partial_refund"; + $dbPayStatus = 5; } else { $paymentStatus = "Refunded"; $langStatus = "refunded"; @@ -487,6 +498,7 @@ public function processCharge() { $taxRate = (int) Tools::getValue('taxrate'); $payment_id = $this->getPaymentId($orderid); $data = $this->getOrderItems($orderid); + // call charge api here $chargeUrl = $this->getChargePaymentUrl($payment_id); if (!empty($ref) && !empty($chargeQty)) { @@ -515,13 +527,14 @@ public function processCharge() { 'orderItems' => $data['order']['items'] ]; } + $this->logger->logInfo("[" . $payment_id . "] Nets_Order_Overview getorder charge request sent"); $api_return = $this->getCurlResponse($chargeUrl, 'POST', json_encode($body)); $response = json_decode($api_return, true); $this->logger->logInfo("[" . $payment_id . "] Nets_Order_Overview getorder charge response" . $api_return); //save charge details in db for partial refund - if (isset($ref) && isset($response['chargeId'])) { + if ((isset($ref) && !empty($ref)) && isset($response['chargeId'])) { $charge_query = "insert into " . _DB_PREFIX_ . "nets_payment (`payment_id`, `charge_id`, `product_ref`, `charge_qty`, `charge_left_qty`,`created`) " . "values ('" . $this->paymentId . "', '" . $response['chargeId'] . "', '" . $ref . "', '" . $chargeQty . "', '" . $chargeQty . "',now())"; DB::getInstance()->execute($charge_query); @@ -553,6 +566,7 @@ public function processRefund() { $taxRate = (int) Tools::getValue('taxrate'); $payment_id = $this->getPaymentId($orderid); $data = $this->getOrderItems($orderid); + $api_return = $this->getCurlResponse($this->getApiUrl() . $this->getPaymentId($orderid), 'GET'); $chargeResponse = json_decode($api_return, true); $refundEachQtyArr = array(); @@ -565,29 +579,34 @@ public function processRefund() { $refExist = true; } } + if ($refExist) { - //from charge tabe deside charge id for refund $charge_query = DB::getInstance()->executeS( "SELECT `payment_id`, `charge_id`, `product_ref`, `charge_qty`, `charge_left_qty` FROM " . _DB_PREFIX_ . "nets_payment WHERE payment_id = '" . $this->paymentId . "' AND charge_id = '" . $val['chargeId'] . "' AND product_ref = '" . $ref . "' AND charge_left_qty !=0" ); + if (!empty(DB::getInstance()->numRows($charge_query))) { foreach ($charge_query as $crows) { $table_charge_left_qty = $refundEachQtyArr[$val['chargeId']] = $crows['charge_left_qty']; } } + if ($refundQty <= array_sum($refundEachQtyArr)) { $leftqtyFromArr = array_sum($refundEachQtyArr) - $refundQty; $leftqty = $table_charge_left_qty - $leftqtyFromArr; $refundEachQtyArr[$val['chargeId']] = $leftqty; $breakloop = true; } + if ($breakloop) { + foreach ($refundEachQtyArr as $key => $value) { $body = $this->getItemForRefund($ref, $value, $data); - $refundUrl = $this->getRefundPaymentUrl($key); + + $this->logger->logInfo('body' . json_encode($body)); $this->logger->logInfo("[" . $payment_id . "] Nets_Order_Overview getorder refund request sent"); - $api_return = $this->getCurlResponse($refundUrl, 'POST', json_encode($body)); + $api_return = $this->getCurlResponse1($refundUrl, 'POST', json_encode($body)); $this->logger->logInfo("[" . $payment_id . "] Nets_Order_Overview getorder refund response" . $api_return); //update for left charge quantity $singlecharge_query = DB::getInstance()->executeS( @@ -611,9 +630,10 @@ public function processRefund() { } } } else { - //update for left charge quantity + //update for left charge quantity foreach ($chargeResponse['payment']['charges'] as $ky => $val) { $itemsArray = array(); + foreach ($val['orderItems'] as $key => $value) { $itemsArray[] = array( 'reference' => $value['reference'], @@ -640,6 +660,7 @@ public function processRefund() { ]; //For Refund all $refundUrl = $this->getRefundPaymentUrl($val['chargeId']); + $this->logger->logInfo("[" . $payment_id . "] Nets_Order_Overview getorder refund request sent"); $api_return = $this->getCurlResponse($refundUrl, 'POST', json_encode($body)); $response = json_decode($api_return, true); @@ -659,7 +680,7 @@ public function getItemForRefund($ref, $refundQty, $data) { $unitPrice = $value['unitPrice']; $taxAmountPerProduct = $value['taxAmount'] / $value['quantity']; - $value['taxAmount'] = $taxAmountPerProduct * $refundQty; + $value['taxAmount'] = round($taxAmountPerProduct * $refundQty); $netAmount = $refundQty * $unitPrice; $grossAmount = $netAmount + $value['taxAmount']; @@ -675,7 +696,6 @@ public function getItemForRefund($ref, $refundQty, $data) { 'amount' => $totalAmount, 'orderItems' => $itemList ]; - return $body; } @@ -700,6 +720,44 @@ public function processCancel() { Tools::redirectAdmin('sell/orders/' . $orderid . '/view?_token=' . $token); } + public function getCurlResponse1($url, $method = "POST", $bodyParams = NULL) { + $result = ''; + // initiating curl request to call api's + $oCurl = curl_init(); + curl_setopt($oCurl, CURLOPT_URL, $url); + curl_setopt($oCurl, CURLOPT_CUSTOMREQUEST, $method); + curl_setopt($oCurl, CURLOPT_RETURNTRANSFER, 1); + curl_setopt($oCurl, CURLOPT_HTTPHEADER, $this->getHeaders()); + if ($method == "POST" || $method == "PUT") { + curl_setopt($oCurl, CURLOPT_POSTFIELDS, $bodyParams); + } + + $result = curl_exec($oCurl); + $info = curl_getinfo($oCurl); + + switch ($info['http_code']) { + case 401: + $message = 'NETS Easy authorization failed. Check your keys'; + break; + case 400: + $message = 'NETS Easy. Bad request: ' . $result; + break; + case 404: + $message = 'Payment or charge not found'; + break; + case 500: + $message = 'Unexpected error'; + break; + } + if (!empty($message)) { + $this->logger->logError("Response Error : " . $message); + } + + curl_close($oCurl); + + return $result; + } + public function getCurlResponse($url, $method = "POST", $bodyParams = NULL) { $result = ''; // initiating curl request to call api's @@ -806,7 +864,7 @@ public function getSecretKey() { */ public function getChargePaymentUrl($paymentId) { - return (Configuration::get('NETS_TEST_MODE') ) ? self::ENDPOINT_TEST . $paymentId . '/charges' : self::ENDPOINT_LIVE . $paymentId . '/charges'; + return (Configuration::get('NETS_TEST_MODE')) ? self::ENDPOINT_TEST . $paymentId . '/charges' : self::ENDPOINT_LIVE . $paymentId . '/charges'; } /* @@ -816,7 +874,7 @@ public function getChargePaymentUrl($paymentId) { */ public function getVoidPaymentUrl($paymentId) { - return (Configuration::get('NETS_TEST_MODE') ) ? self::ENDPOINT_TEST . $paymentId . '/cancels' : self::ENDPOINT_LIVE . $paymentId . '/cancels'; + return (Configuration::get('NETS_TEST_MODE')) ? self::ENDPOINT_TEST . $paymentId . '/cancels' : self::ENDPOINT_LIVE . $paymentId . '/cancels'; } /* diff --git a/controllers/front/return.php b/controllers/front/return.php index f5edf7f..576ed66 100644 --- a/controllers/front/return.php +++ b/controllers/front/return.php @@ -13,80 +13,95 @@ public function setMedia() { public function init() { parent::init(); $nets = new Netseasy(); + if (isset($_GET['id_cart']) && ( isset($_GET['paymentId']) || isset($_GET['paymentid']) )) { + $cartId = (int) ($_GET['id_cart']); + $paymentId = isset($_GET['paymentid']) ? $_GET['paymentid'] : $_GET['paymentId']; - $cartId = (int) (@$_GET['id_cart']); - $paymentId = @$_GET['paymentid']; + if (!isset($cartId) || $cartId <= 0) { + $nets->logger->logError('Cart id empty found at time of payment return page'); + Tools::redirect('index.php'); + } - if (!isset($cartId) || $cartId <= 0) { - $nets->logger->logError('Cart id empty found at time of payment return page'); - Tools::redirect('index.php'); - } + $cart = new Cart($cartId); + $customer = new Customer($cart->id_customer); - $cart = new Cart($cartId); - $customer = new Customer($cart->id_customer); + if (!Validate::isLoadedObject($customer)) { + $nets->logger->logError('Envalid customer found at time of payment return page'); + Tools::redirect('index.php'); + } - if (!Validate::isLoadedObject($customer)) { - $nets->logger->logError('Envalid customer found at time of payment return page'); - Tools::redirect('index.php'); - } + if ($cart->OrderExists() == false) { + $paymentDetails = $nets->MakeCurl($nets->getApiUrl()['backend'] . $paymentId, array(), 'GET'); + $payment_name = "Nets Easy"; + if (isset($paymentDetails->payment->paymentDetails->paymentMethod)) { + if (!empty($paymentDetails->payment->paymentDetails->paymentMethod)) { + $payment_name .= ' - ' . $paymentDetails->payment->paymentDetails->paymentMethod; + } + } + $this->module->validateOrder( + (int) $cartId, + Configuration::get('PS_OS_PAYMENT'), + (float) $this->context->cart->getOrderTotal(true, Cart::BOTH), + $payment_name, + null, + null, + (int) $this->context->currency->id, + false, + $customer->secure_key + ); + $orderId = Order::getOrderByCartId((int) $cart->id); + } else { + // echo $_GET['paymentid'] ? $_GET['paymentid'] : $_GET['paymentId']; - if ($cart->OrderExists() == false) { - $this->module->validateOrder( - (int) $cartId, - Configuration::get('PS_OS_PAYMENT'), - (float) $this->context->cart->getOrderTotal(true, Cart::BOTH), - $this->module->displayName, - null, - null, - (int) $this->context->currency->id, - false, - $customer->secure_key - ); - $orderId = Order::getOrderByCartId((int) $cart->id); - } else { - $orderId = Order::getOrderByCartId((int) $cart->id); - } + $orderId = Order::getOrderByCartId((int) $cart->id); + } - if (isset($orderId) && $orderId > 0) { - $orderDetails = new Order((int) $orderId); - $orderReference = $orderDetails->reference; - DB::getInstance()->execute('INSERT INTO ' . _DB_PREFIX_ . 'nets_payment_id (`id_order`, `order_reference_id`, `payment_id`) VALUES (' . $orderId . ', "' . $orderReference . '", "' . $paymentId . '")'); - //save charge payment details in ps_nets_payment if auto capture is enabled - if (Configuration::get('NETS_AUTO_CAPTURE')) { - $chargeResponse = $nets->MakeCurl($nets->getApiUrl()['backend'] . $paymentId, array(), 'GET'); - if (isset($chargeResponse)) { - foreach ($chargeResponse->payment->charges as $ky => $val) { - foreach ($val->orderItems as $key => $value) { - if (isset($val->chargeId)) { - $charge_query = "insert into " . _DB_PREFIX_ . "nets_payment (`payment_id`, `charge_id`, `product_ref`, `charge_qty`, `charge_left_qty`,`created`) " - . "values ('" . $paymentId . "', '" . $val->chargeId . "', '" . $value->reference . "', '" . $value->quantity . "', '" . $value->quantity . "',now())"; - DB::getInstance()->execute($charge_query); + if (isset($orderId) && $orderId > 0) { + $orderDetails = new Order((int) $orderId); + $orderReference = $orderDetails->reference; + DB::getInstance()->execute('INSERT INTO ' . _DB_PREFIX_ . 'nets_payment_id (`id_order`, `order_reference_id`, `payment_id`) VALUES (' . $orderId . ', "' . $orderReference . '", "' . $paymentId . '")'); + //save charge payment details in ps_nets_payment if auto capture is enabled + if (Configuration::get('NETS_AUTO_CAPTURE')) { + $chargeResponse = $nets->MakeCurl($nets->getApiUrl()['backend'] . $paymentId, array(), 'GET'); + if (isset($chargeResponse)) { + foreach ($chargeResponse->payment->charges as $ky => $val) { + foreach ($val->orderItems as $key => $value) { + if (isset($val->chargeId)) { + $charge_query = "insert into " . _DB_PREFIX_ . "nets_payment (`payment_id`, `charge_id`, `product_ref`, `charge_qty`, `charge_left_qty`,`created`) " + . "values ('" . $paymentId . "', '" . $val->chargeId . "', '" . $value->reference . "', '" . $value->quantity . "', '" . $value->quantity . "',now())"; + DB::getInstance()->execute($charge_query); + } } } } } + //update refre in portal + $refResponse = $this->OrderRefUpdate($orderId, $paymentId); + + setcookie("nets_payment_selected", "", time() - 3600); + Tools::redirect('index.php?controller=order-confirmation&id_cart=' . $cartId . '&id_module=' . $this->module->id . '&id_order=' . $orderId . '&key=' . $customer->secure_key); + } else { + $this->context->smarty->assign(array( + 'paymentId' => $paymentId + )); + return $this->setTemplate('module:' . $this->module->name . '/views/templates/front/payment_error.tpl'); } - //update refre in portal - $refResponse = $this->OrderRefUpdate($orderId, $paymentId); - setcookie("nets_payment_selected", "", time() - 3600); - Tools::redirect('index.php?controller=order-confirmation&id_cart=' . $cartId . '&id_module=' . $this->module->id . '&id_order=' . $orderId . '&key=' . $customer->secure_key); } else { - $this->context->smarty->assign(array( - 'paymentId' => $paymentId - )); - return $this->setTemplate('module:' . $this->module->name . '/views/templates/front/payment_error.tpl'); + $nets->logger->logError('Cart id empty found at time of payment return page'); + Tools::redirect('index.php'); } } - public function OrderRefUpdate($orderId, $paymentId) - { + + public function OrderRefUpdate($orderId, $paymentId) { $returnResponse = false; $NetsEasy = new Netseasy(); //To fetch complet order details with order id. $orderDetails = new Order((int) $orderId); $orderReference = ''; if (!empty($orderDetails)) { - $orderReference = $orderDetails->reference; + $orderReference = $orderDetails->reference; $payIdResponse = $NetsEasy->MakeCurl($NetsEasy->getApiUrl()['backend'] . $paymentId, array(), 'GET'); + if (!empty($payIdResponse) && !empty($orderReference)) { $requestData = array('checkoutUrl' => $payIdResponse->payment->checkout->url, 'reference' => $orderReference); $NetsEasy->MakeCurl($NetsEasy->getUpdateRefUrl($paymentId), $requestData, 'PUT'); diff --git a/netseasy.php b/netseasy.php index 3555cca..012e37f 100644 --- a/netseasy.php +++ b/netseasy.php @@ -30,13 +30,13 @@ class Netseasy extends PaymentModule { public function __construct() { $this->name = 'netseasy'; $this->tab = 'payments_gateways'; - $this->version = '1.1.2'; + $this->version = '1.1.3'; $this->author = 'Nets Easy'; $this->controllers = array('hostedPayment', 'return'); $this->currencies = true; $this->currencies_mode = 'checkbox'; $this->bootstrap = true; - $this->displayName = 'Nets Payment'; + $this->displayName = Configuration::get('NETS_PAYMENT_NAME'); $this->description = 'Nets Secure Payment Made Easy'; $this->confirmUninstall = 'Are you sure you want to uninstall this module?'; $this->ps_versions_compliancy = array('min' => '1.7.0', 'max' => _PS_VERSION_); @@ -108,7 +108,7 @@ public function getContent() { $this->context->smarty->assign($this->getConfigFormValues()); // Call api for fetching latest plugin version. - if (Configuration::get('NETS_MERCHANT_ID')) { + if (Configuration::get('NETS_MERCHANT_ID') && Configuration::get('NETS_MERCHANT_EMAIL_ID')) { $returnResponse = $this->CallApi(); if (!empty($returnResponse)) { $this->context->smarty->assign(['customData' => $returnResponse]); @@ -125,14 +125,17 @@ public function CallApi() { $headers[] = 'Content-Type: application/json'; $headers[] = 'Accept: application/json'; - $dataArray = array('merchant_id' => Configuration::get('NETS_MERCHANT_ID'), - 'plugin_name' => 'Prestashop', - 'plugin_version' => $this->version, - 'shop_url' => (_PS_BASE_URL_SSL_), - 'timestamp' => date('Y-m-d H:i:s') - ); + $dataArray = [ + "merchant_id" => Configuration::get('NETS_MERCHANT_ID'), + "merchant_email_id" => Configuration::get('NETS_MERCHANT_EMAIL_ID'), + "plugin_name" => "Prestashop", + "plugin_version" => $this->version, + "shop_url" => (_PS_BASE_URL_SSL_), + "timestamp" => date('Y-m-d H:i:s') + ]; $postData = json_encode($dataArray); + $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, "https://ps17.sokoni.it/module/api/enquiry"); curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'POST'); @@ -152,7 +155,7 @@ public function CallApi() { if ($info['http_code'] == 200) { if ($response) { - $this->logger->logInfo("API Response Data : " . $response); + $this->logger->logInfo("API Response Data : " . stripslashes($response)); $responseDecoded = json_decode($response); if ($responseDecoded->status == '00' || $responseDecoded->status == '11') { $responseData = array('status' => $responseDecoded->status, 'data' => json_decode($responseDecoded->data, true)); @@ -186,7 +189,7 @@ public function hookPaymentOptions() { ->setCallToActionText($this->trans($this->displayName, array())) ->setAction($this->context->link->getModuleLink($this->name, 'hostedPayment', array(), true)); } else { - $newOption->setModuleName($this->displayName) + $newOption->setModuleName($this->name) ->setCallToActionText($this->trans($this->displayName, array())); } $paymentOptions = array( @@ -222,6 +225,8 @@ protected function postProcess() { public function getConfigFormValues() { return array( 'NETS_MERCHANT_ID' => Configuration::get('NETS_MERCHANT_ID'), + 'NETS_MERCHANT_EMAIL_ID' => Configuration::get('NETS_MERCHANT_EMAIL_ID'), + 'NETS_PAYMENT_NAME' => Configuration::get('NETS_PAYMENT_NAME'), 'NETS_TEST_MODE' => Configuration::get('NETS_TEST_MODE'), 'NETS_TEST_CHECKOUT_KEY' => Configuration::get('NETS_TEST_CHECKOUT_KEY'), 'NETS_TEST_SECRET_KEY' => Configuration::get('NETS_TEST_SECRET_KEY'), @@ -260,7 +265,7 @@ public function MakeCurl($url, $data, $method = 'POST') { if ($postData) { curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($postData)); } - $this->logger->logInfo("Payment Request Data : " . json_encode($postData)); + $this->logger->logInfo("Request Data : " . json_encode($postData)); $response = curl_exec($ch); $info = curl_getinfo($ch); switch ($info['http_code']) { @@ -278,16 +283,16 @@ public function MakeCurl($url, $data, $method = 'POST') { break; } if (!empty($message)) { - $this->logger->logError("Payment Response Error : " . $message); + $this->logger->logError("Response Error : " . $message); } if (curl_error($ch)) { - $this->logger->logError(curl_error("Payment Response Error : " . $ch)); + $this->logger->logError(curl_error("Response Error : " . $ch)); } if ($info['http_code'] == 200 || $info['http_code'] == 201 || $info['http_code'] == 400) { if ($response) { $responseDecoded = json_decode($response); - $this->logger->logInfo("Payment Response Data : " . $response); + $this->logger->logInfo("Response Data : " . $response); return ($responseDecoded) ? $responseDecoded : null; } } @@ -499,6 +504,16 @@ public function createRequestObject($cartId) { 'eventName' => 'payment.cancel.created', 'url' => $webHookUrl, 'authorization' => $authKey + ), + array( + 'eventName' => 'payment.charge.created.v2', + 'url' => $webHookUrl, + 'authorization' => $authKey + ), + array( + 'eventName' => 'payment.refund.initiated.v2', + 'url' => $webHookUrl, + 'authorization' => $authKey ) ) ); diff --git a/translations/DE.php b/translations/DE.php index a267dfa..0a7e489 100644 --- a/translations/DE.php +++ b/translations/DE.php @@ -24,6 +24,12 @@ $_MODULE["<{netseasy}prestashop>admin_content_order_b8d0ad0ec8f46388da378d3c8906c4b1"] = "gebuchte Produkte"; $_MODULE["<{netseasy}prestashop>admin_content_order_2d6a11bb3ac52a0eb1586ca9f55a7165"] = "rückerstattete Produkte"; +$_MODULE["<{netseasy}prestashop>config_e6928937d511fc7622abbc1cd4e599dc"] = "Name des Zahlungsgateways ist erforderlich"; +$_MODULE["<{netseasy}prestashop>config_7c1a38f104c2a7d733ac766a635f9e08"] = "Name des Zahlungsgateways"; +$_MODULE["<{netseasy}prestashop>config_2bfddeac754c1b6067251ed1748e407d"] = "Merchant ID"; +$_MODULE["<{netseasy}prestashop>config_253cc62c5f7636f9ae639c96792992b3"] = "Merchant ID ist erforderlich"; +$_MODULE["<{netseasy}prestashop>config_5c34078823b68654064c5d7a105a4cb0"] = "Merchant Email Id ist erforderlich"; +$_MODULE["<{netseasy}prestashop>config_91aa9c707c962ade8e2c34ade2923037"] = "Merchant Email Id"; $_MODULE["<{netseasy}prestashop>config_7529b2051321b1171b6e70ff6ff63b81"] = "Tragen Sie bitte die Webhookauthorisierung ein "; $_MODULE["<{netseasy}prestashop>config_8a625ee9b5bfe7c26e1b6920d13f3352"] = "Tragen Sie bitte die Webhookadresse ein"; $_MODULE["<{netseasy}prestashop>config_abdf09e77f67f3ce8e10ec179571bafd"] = "Tragen Sie bitte die URL der Händlerbedingungen ein "; @@ -58,4 +64,4 @@ $_MODULE["<{netseasy}prestashop>netseasy_ea9cf7e47ff33b2be14e6dd07cbcefc6"] = "Versand"; $_MODULE["<{netseasy}prestashop>netseasy_e2b7dec8fa4b498156dfee6e4c84b156"] = "Dieses Zahlungsmittel ist nicht verfügbar."; -$_MODULE["<{netseasy}prestashop>payment_error_f8d8e2649e1a97116a5bf28e9d066e5d"] = "Erstellung des Zahlung IDs nicht möglich"; \ No newline at end of file +$_MODULE["<{netseasy}prestashop>payment_error_f8d8e2649e1a97116a5bf28e9d066e5d"] = "Erstellung des Zahlung IDs nicht möglich"; diff --git a/translations/EN.php b/translations/EN.php index c2a720a..94a6242 100644 --- a/translations/EN.php +++ b/translations/EN.php @@ -24,6 +24,12 @@ $_MODULE["<{netseasy}prestashop>admin_content_order_b8d0ad0ec8f46388da378d3c8906c4b1"] = "charged products"; $_MODULE["<{netseasy}prestashop>admin_content_order_2d6a11bb3ac52a0eb1586ca9f55a7165"] = "refunded products"; +$_MODULE["<{netseasy}prestashop>config_e6928937d511fc7622abbc1cd4e599dc"] = "Name of Payment Gateway is required"; +$_MODULE["<{netseasy}prestashop>config_7c1a38f104c2a7d733ac766a635f9e08"] = "Name of Payment Gateway"; +$_MODULE["<{netseasy}prestashop>config_2bfddeac754c1b6067251ed1748e407d"] = "Merchant Id"; +$_MODULE["<{netseasy}prestashop>config_253cc62c5f7636f9ae639c96792992b3"] = "Merchant Id is required"; +$_MODULE["<{netseasy}prestashop>config_5c34078823b68654064c5d7a105a4cb0"] = "Merchant Email Id is required"; +$_MODULE["<{netseasy}prestashop>config_91aa9c707c962ade8e2c34ade2923037"] = "Merchant Email Id"; $_MODULE["<{netseasy}prestashop>config_7529b2051321b1171b6e70ff6ff63b81"] = "Please add Webhook authorization "; $_MODULE["<{netseasy}prestashop>config_8a625ee9b5bfe7c26e1b6920d13f3352"] = "Please add webhook URL"; $_MODULE["<{netseasy}prestashop>config_abdf09e77f67f3ce8e10ec179571bafd"] = "Please add merchant terms URL "; diff --git a/translations/NN.php b/translations/NN.php index aff1671..345a3a9 100644 --- a/translations/NN.php +++ b/translations/NN.php @@ -24,6 +24,12 @@ $_MODULE["<{netseasy}prestashop>admin_content_order_b8d0ad0ec8f46388da378d3c8906c4b1"] = "Gjennomførte produkter"; $_MODULE["<{netseasy}prestashop>admin_content_order_2d6a11bb3ac52a0eb1586ca9f55a7165"] = "Refunderte produkter"; +$_MODULE["<{netseasy}prestashop>config_e6928937d511fc7622abbc1cd4e599dc"] = "Navn på betalingsgateway kreves"; +$_MODULE["<{netseasy}prestashop>config_7c1a38f104c2a7d733ac766a635f9e08"] = "Navn på betalingsgateway"; +$_MODULE["<{netseasy}prestashop>config_2bfddeac754c1b6067251ed1748e407d"] = "Merchant Id"; +$_MODULE["<{netseasy}prestashop>config_253cc62c5f7636f9ae639c96792992b3"] = "Merchant Id kreves"; +$_MODULE["<{netseasy}prestashop>config_5c34078823b68654064c5d7a105a4cb0"] = "Merchant Email Id kreves"; +$_MODULE["<{netseasy}prestashop>config_91aa9c707c962ade8e2c34ade2923037"] = "Merchant Email Id"; $_MODULE["<{netseasy}prestashop>config_7529b2051321b1171b6e70ff6ff63b81"] = "Vennligst legg til webhook authentisering"; $_MODULE["<{netseasy}prestashop>config_8a625ee9b5bfe7c26e1b6920d13f3352"] = "Vennligst spesifiser webhook URL"; $_MODULE["<{netseasy}prestashop>config_abdf09e77f67f3ce8e10ec179571bafd"] = "Vennligst spesifiser brukerstedets kjøpsbetingelser "; @@ -58,4 +64,4 @@ $_MODULE["<{netseasy}prestashop>netseasy_ea9cf7e47ff33b2be14e6dd07cbcefc6"] = "Shipping"; $_MODULE["<{netseasy}prestashop>netseasy_e2b7dec8fa4b498156dfee6e4c84b156"] = "Betalingsmetoden er ikke tilgjengelig."; -$_MODULE["<{netseasy}prestashop>payment_error_f8d8e2649e1a97116a5bf28e9d066e5d"] = "ikke mulig å opprette payment ID"; \ No newline at end of file +$_MODULE["<{netseasy}prestashop>payment_error_f8d8e2649e1a97116a5bf28e9d066e5d"] = "ikke mulig å opprette payment ID"; diff --git a/translations/da-DK/ModulesNetseasyAdmin_content_order.da-DK.xlf b/translations/da-DK/ModulesNetseasyAdmin_content_order.da-DK.xlf index 0513e2c..0b9d684 100644 --- a/translations/da-DK/ModulesNetseasyAdmin_content_order.da-DK.xlf +++ b/translations/da-DK/ModulesNetseasyAdmin_content_order.da-DK.xlf @@ -1,112 +1,107 @@ - - - - nets_refunded_products - refunderede varer - Line: - - - nets_charged_products - betalte varer - Line: - - - nets_payment_failed - mislykkedes - Line: - - - nets_payment_cancelled - anullerede - Line: - - - nets_payment_refund_pending - refundering afventer - Line: - - - nets_payment_refunded - refunderet - Line: - - - nets_refund_all - Refunder alle - Line: - - - nets_payment_charged - betaling gennemført - Line: - - - nets_charge_all - gennemfør alle - Line: - - - nets_payment_reserved - betaling reserveret - Line: - - - nets_cancel_payment - Annuller - Line: - - - nets_refund - Refunder - Line: - - - nets_charge - Gennemfør - Line: - - - nets_action - Funktion - Line: - - - nets_price - Pris - Line: - - - nets_product - Vare - Line: - - - nets_model - Model - Line: - - - nets_quantity - Antal - Line: - - - nets_payment_id - Payment-ID - Line: - - - nets_payment_status - Betalingsstatus - Line: - - - Test - Test - Line: - - - + + + + nets_payment_status + Betalingsstatus + Line: + + + nets_payment_id + Payment-ID + Line: + + + nets_quantity + Antal + Line: + + + nets_model + Model + Line: + + + nets_product + Vare + Line: + + + nets_price + Pris + Line: + + + nets_action + Funktion + Line: + + + nets_charge + Gennemfør + Line: + + + nets_refund + Refunder + Line: + + + nets_cancel_payment + Annuller + Line: + + + nets_payment_reserved + betaling reserveret + Line: + + + nets_charge_all + gennemfør alle + Line: + + + nets_payment_charged + betaling gennemført + Line: + + + nets_refund_all + Refunder alle + Line: + + + nets_payment_refunded + refunderet + Line: + + + nets_payment_refund_pending + refundering afventer + Line: + + + nets_payment_cancelled + anullerede + Line: + + + nets_payment_failed + mislykkedes + Line: + + + nets_charged_products + betalte varer + Line: + + + nets_refunded_products + refunderede varer + Line: + + + diff --git a/translations/da-DK/ModulesNetseasyConfig.da-DK.xlf b/translations/da-DK/ModulesNetseasyConfig.da-DK.xlf index 60709cb..ad5b0db 100644 --- a/translations/da-DK/ModulesNetseasyConfig.da-DK.xlf +++ b/translations/da-DK/ModulesNetseasyConfig.da-DK.xlf @@ -1,15 +1,15 @@ - + - - nets_merchant_id_error - Merchant Id er påkrævet + + nets_payment_name_error + Navn på betalingsgateway er påkrævet Line: - - merchant_id - Merchant Id + + payment_name + Navn på betalingsgateway Line: @@ -17,46 +17,6 @@ Vellykket opdatering Line: - - nets_webhook_authorization_error - Opret venligst en Webhook-autorisation nøgle - Line: - - - nets_webhook_url_error - Tilføj webhook-URL - Line: - - - nets_merchant_terms_url_error - Indsæt venligst URL til betingelser - Line: - - - nets_terms_url_error - Indsæt venligst URL til privatpolitik - Line: - - - nets_live_secret_key_error - Live Secret-Key er påkrævet - Line: - - - nets_live_checkout_key_error - Live Checkout-Key er påkrævet - Line: - - - nets_test_secret_key_error - Test Secret-Key er påkrævet - Line: - - - nets_test_checkout_key_error - Test Checkout-Key er påkrævet - Line: - configuration Konfiguration @@ -82,26 +42,66 @@ Aktiver test mode og indstil alle betalinger i test miljø Line: + + merchant_id + Merchant ID + Line: + + + nets_merchant_id_error + Merchant ID er påkrævet + Line: + + + nets_merchant_email_id_error + Merchant Email Id er påkrævet + Line: + + + merchant_email_id + Merchant Email Id + Line: + test_checkout_key Test Checkout-Key Line: + + nets_test_checkout_key_error + Test Checkout-Key er påkrævet + Line: + test_secret_key Test Secret-Key Line: + + nets_test_secret_key_error + Test Secret-Key er påkrævet + Line: + production_checkout_key Live Checkout-Key Line: + + nets_live_checkout_key_error + Live Checkout-Key er påkrævet + Line: + production_secret_key Live Secret-Key Line: + + nets_live_secret_key_error + Live Secret-Key er påkrævet + Line: + integration_type Intergrationstype @@ -122,11 +122,21 @@ Handelsbetingelser URL Line: + + nets_terms_url_error + Indsæt venligst URL til privatpolitik + Line: + merchant_terms_url Privatpolitik URL Line: + + nets_merchant_terms_url_error + Indsæt venligst URL til betingelser + Line: + icon_url Iconbar URL @@ -152,11 +162,21 @@ webhook url Line: + + nets_webhook_url_error + Tilføj webhook-URL + Line: + webhook_authorization Webhook-autorisation Line: + + nets_webhook_authorization_error + Opret venligst en Webhook-autorisation nøgle + Line: + save Gem diff --git a/translations/da-DK/ModulesNetseasyNetseasy.da-DK.xlf b/translations/da-DK/ModulesNetseasyNetseasy.da-DK.xlf index 08147f9..a1926a5 100644 --- a/translations/da-DK/ModulesNetseasyNetseasy.da-DK.xlf +++ b/translations/da-DK/ModulesNetseasyNetseasy.da-DK.xlf @@ -1,17 +1,22 @@ - - - - Shipping - Fragt/Forsendelse - Line: - - - This payment method is not available. - Denne betalingsmetode er ikke gyldig. - Line: - - - + + + + Test - text string one. + Test - text string one. + Line: + + + This payment method is not available. + Denne betalingsmetode er ikke gyldig. + Line: + + + Shipping + Fragt/Forsendelse + Line: + + + diff --git a/translations/da-DK/ModulesNetseasyPayment_error.da-DK.xlf b/translations/da-DK/ModulesNetseasyPayment_error.da-DK.xlf index 83bf42f..1aaa995 100644 --- a/translations/da-DK/ModulesNetseasyPayment_error.da-DK.xlf +++ b/translations/da-DK/ModulesNetseasyPayment_error.da-DK.xlf @@ -1,12 +1,12 @@ - - - - payment_id_error - Kan ikke oprette Payment-ID - Line: - - - + + + + payment_id_error + Kan ikke oprette Payment-ID + Line: + + + diff --git a/translations/da.php b/translations/da.php index 76fde0f..54de012 100644 --- a/translations/da.php +++ b/translations/da.php @@ -25,6 +25,12 @@ $_MODULE["<{netseasy}prestashop>admin_content_order_783ece8f8481f85a66730fe0e209cebf"] = "Betalingsstatus"; $_MODULE["<{netseasy}prestashop>admin_content_order_0cbc6611f5540bd0809a388dc95a615b"] = "Test"; +$_MODULE["<{netseasy}prestashop>config_e6928937d511fc7622abbc1cd4e599dc"] = "Navn på betalingsgateway er påkrævet"; +$_MODULE["<{netseasy}prestashop>config_7c1a38f104c2a7d733ac766a635f9e08"] = "Navn på betalingsgateway"; +$_MODULE["<{netseasy}prestashop>config_2bfddeac754c1b6067251ed1748e407d"] = "Merchant ID"; +$_MODULE["<{netseasy}prestashop>config_253cc62c5f7636f9ae639c96792992b3"] = "Merchant ID er påkrævet"; +$_MODULE["<{netseasy}prestashop>config_5c34078823b68654064c5d7a105a4cb0"] = "Merchant Email Id er påkrævet"; +$_MODULE["<{netseasy}prestashop>config_91aa9c707c962ade8e2c34ade2923037"] = "Merchant Email Id"; $_MODULE["<{netseasy}prestashop>config_7529b2051321b1171b6e70ff6ff63b81"] = "Opret venligst en Webhook-autorisation nøgle"; $_MODULE["<{netseasy}prestashop>config_8a625ee9b5bfe7c26e1b6920d13f3352"] = "Tilføj webhook-URL"; $_MODULE["<{netseasy}prestashop>config_abdf09e77f67f3ce8e10ec179571bafd"] = "Indsæt venligst URL til betingelser"; @@ -59,4 +65,4 @@ $_MODULE["<{netseasy}prestashop>netseasy_ea9cf7e47ff33b2be14e6dd07cbcefc6"] = "Fragt/Forsendelse"; $_MODULE["<{netseasy}prestashop>netseasy_e2b7dec8fa4b498156dfee6e4c84b156"] = "Denne betalingsmetode er ikke gyldig."; -$_MODULE["<{netseasy}prestashop>payment_error_f8d8e2649e1a97116a5bf28e9d066e5d"] = "Kan ikke oprette Payment-ID"; \ No newline at end of file +$_MODULE["<{netseasy}prestashop>payment_error_f8d8e2649e1a97116a5bf28e9d066e5d"] = "Kan ikke oprette Payment-ID"; diff --git a/translations/de-DE/ModulesNetseasyAdmin_content_order.de-DE.xlf b/translations/de-DE/ModulesNetseasyAdmin_content_order.de-DE.xlf index d69be25..05666f2 100644 --- a/translations/de-DE/ModulesNetseasyAdmin_content_order.de-DE.xlf +++ b/translations/de-DE/ModulesNetseasyAdmin_content_order.de-DE.xlf @@ -1,107 +1,107 @@ - - - - nets_payment_status - Bezahlstatus - Line: - - - nets_payment_id - Nets Payment-ID - Line: - - - nets_quantity - Anzahl - Line: - - - nets_model - Model - Line: - - - nets_product - Produkt - Line: - - - nets_price - Preis - Line: - - - nets_action - Action - Line: - - - nets_charge - Abbuchen - Line: - - - nets_refund - Rückerstatten - Line: - - - nets_cancel_payment - Abbrechen - Line: - - - nets_payment_reserved - Zahlung reserviert - Line: - - - nets_charge_all - Alle abbuchen - Line: - - - nets_payment_charged - Zahlung abgebucht - Line: - - - nets_refund_all - Alle rückerstatten - Line: - - - nets_payment_refunded - rückerstattet - Line: - - - nets_payment_refund_pending - Rückerstattung ausstehend - Line: - - - nets_payment_cancelled - storniert - Line: - - - nets_payment_failed - fehlgeschlagen - Line: - - - nets_charged_products - gebuchte Produkte - Line: - - - nets_refunded_products - rückerstattete Produkte - Line: - - - + + + + nets_payment_status + Bezahlstatus + Line: + + + nets_payment_id + Nets Payment-ID + Line: + + + nets_quantity + Anzahl + Line: + + + nets_model + Model + Line: + + + nets_product + Produkt + Line: + + + nets_price + Preis + Line: + + + nets_action + Action + Line: + + + nets_charge + Abbuchen + Line: + + + nets_refund + Rückerstatten + Line: + + + nets_cancel_payment + Abbrechen + Line: + + + nets_payment_reserved + Zahlung reserviert + Line: + + + nets_charge_all + Alle abbuchen + Line: + + + nets_payment_charged + Zahlung abgebucht + Line: + + + nets_refund_all + Alle rückerstatten + Line: + + + nets_payment_refunded + rückerstattet + Line: + + + nets_payment_refund_pending + Rückerstattung ausstehend + Line: + + + nets_payment_cancelled + storniert + Line: + + + nets_payment_failed + fehlgeschlagen + Line: + + + nets_charged_products + gebuchte Produkte + Line: + + + nets_refunded_products + rückerstattete Produkte + Line: + + + diff --git a/translations/de-DE/ModulesNetseasyConfig.de-DE.xlf b/translations/de-DE/ModulesNetseasyConfig.de-DE.xlf index ec6a9f1..78c64f0 100644 --- a/translations/de-DE/ModulesNetseasyConfig.de-DE.xlf +++ b/translations/de-DE/ModulesNetseasyConfig.de-DE.xlf @@ -1,167 +1,187 @@ - - - - nets_merchant_id_error - Merchant Id ist erforderlich - Line: - - - merchant_id - Merchant Id - Line: - - - nets_config_success - Erfolgreiche Aktualisierung - Line: - - - configuration - Einstellungen - Line: - - - test_mode - Testmoduls - Line: - - - active - Aktiv - Line: - - - inactive - Inaktiv - Line: - - - test_help - Dieses Modul im Testmodus benutzen - Line: - - - test_checkout_key - Test Checkout-Key - Line: - - - nets_test_checkout_key_error - Test Checkout-Key ist erforderlich - Line: - - - test_secret_key - Test Secret-Key - Line: - - - nets_test_secret_key_error - Test Secret-Key ist erforderlich - Line: - - - production_checkout_key - Live Checkout-Key - Line: - - - nets_live_checkout_key_error - Live Checkout-Key ist erforderlich - Line: - - - production_secret_key - Live Secret-Key - Line: - - - nets_live_secret_key_error - Live Secret-Key ist erforderlich - Line: - - - integration_type - Integrationsart - Line: - - - redirect - Hosted - Line: - - - embedded - Embedded - Line: - - - terms_url - URL der allgemeinen Geschäftsbedingungen - Line: - - - nets_terms_url_error - Tragen Sie bitte die URL der allgemeinen Geschäftsbedingungen ein - Line: - - - merchant_terms_url - URL der Händlerbedingungen - Line: - - - nets_merchant_terms_url_error - Tragen Sie bitte die URL der Händlerbedingungen ein - Line: - - - icon_url - Symbol-URL - Line: - - - auto_capture - Automatische Buchung - Line: - - - admin_debug_mode - Admin Debugmodus - Line: - - - frontend_debug_mode - Frontend Debugmodus - Line: - - - webhook_url - Webhook-URL - Line: - - - nets_webhook_url_error - Tragen Sie bitte die Webhookadresse ein - Line: - - - webhook_authorization - Webhookauthorisierung - Line: - - - nets_webhook_authorization_error - Tragen Sie bitte die Webhookauthorisierung ein - Line: - - - save - Speichern - Line: - - - + + + + nets_payment_name_error + Name des Zahlungsgateways ist erforderlich + Line: + + + payment_name + Name des Zahlungsgateways + Line: + + + nets_config_success + Erfolgreiche Aktualisierung + Line: + + + configuration + Einstellungen + Line: + + + test_mode + Testmoduls + Line: + + + active + Aktiv + Line: + + + inactive + Inaktiv + Line: + + + test_help + Dieses Modul im Testmodus benutzen + Line: + + + merchant_id + Merchant Id + Line: + + + nets_merchant_id_error + Merchant Id ist erforderlich + Line: + + + nets_merchant_email_id_error + Merchant Email Id ist erforderlich + Line: + + + merchant_email_id + Merchant Email Id + Line: + + + test_checkout_key + Test Checkout-Key + Line: + + + nets_test_checkout_key_error + Test Checkout-Key ist erforderlich + Line: + + + test_secret_key + Test Secret-Key + Line: + + + nets_test_secret_key_error + Test Secret-Key ist erforderlich + Line: + + + production_checkout_key + Live Checkout-Key + Line: + + + nets_live_checkout_key_error + Live Checkout-Key ist erforderlich + Line: + + + production_secret_key + Live Secret-Key + Line: + + + nets_live_secret_key_error + Live Secret-Key ist erforderlich + Line: + + + integration_type + Integrationsart + Line: + + + redirect + Hosted + Line: + + + embedded + Embedded + Line: + + + terms_url + URL der allgemeinen Geschäftsbedingungen + Line: + + + nets_terms_url_error + Tragen Sie bitte die URL der allgemeinen Geschäftsbedingungen ein + Line: + + + merchant_terms_url + URL der Händlerbedingungen + Line: + + + nets_merchant_terms_url_error + Tragen Sie bitte die URL der Händlerbedingungen ein + Line: + + + icon_url + Symbol-URL + Line: + + + auto_capture + Automatische Buchung + Line: + + + admin_debug_mode + Admin Debugmodus + Line: + + + frontend_debug_mode + Frontend Debugmodus + Line: + + + webhook_url + Webhook-URL + Line: + + + nets_webhook_url_error + Tragen Sie bitte die Webhookadresse ein + Line: + + + webhook_authorization + Webhookauthorisierung + Line: + + + nets_webhook_authorization_error + Tragen Sie bitte die Webhookauthorisierung ein + Line: + + + save + Speichern + Line: + + + diff --git a/translations/de-DE/ModulesNetseasyNetseasy.de-DE.xlf b/translations/de-DE/ModulesNetseasyNetseasy.de-DE.xlf index b0870f5..565445c 100644 --- a/translations/de-DE/ModulesNetseasyNetseasy.de-DE.xlf +++ b/translations/de-DE/ModulesNetseasyNetseasy.de-DE.xlf @@ -1,7 +1,12 @@ - + + + Test - text string one. + Test - text string one. + Line: + This payment method is not available. Dieses Zahlungsmittel ist nicht verfügbar. diff --git a/translations/de-DE/ModulesNetseasyPayment_error.de-DE.xlf b/translations/de-DE/ModulesNetseasyPayment_error.de-DE.xlf index 2129df0..eb925ae 100644 --- a/translations/de-DE/ModulesNetseasyPayment_error.de-DE.xlf +++ b/translations/de-DE/ModulesNetseasyPayment_error.de-DE.xlf @@ -1,12 +1,12 @@ - - - - payment_id_error - Erstellung des Zahlung IDs nicht möglich - Line: - - - + + + + payment_id_error + Erstellung des Zahlung IDs nicht möglich + Line: + + + diff --git a/translations/en-US/ModulesNetseasyAdmin_content_order.en-US.xlf b/translations/en-US/ModulesNetseasyAdmin_content_order.en-US.xlf index 02a15a1..7b65ad8 100644 --- a/translations/en-US/ModulesNetseasyAdmin_content_order.en-US.xlf +++ b/translations/en-US/ModulesNetseasyAdmin_content_order.en-US.xlf @@ -1,107 +1,107 @@ - - - - nets_payment_status - Payment Status - Line: - - - nets_payment_id - Payment ID - Line: - - - nets_quantity - Quantity - Line: - - - nets_model - Model - Line: - - - nets_product - Product - Line: - - - nets_price - Price - Line: - - - nets_action - Action - Line: - - - nets_charge - Charge - Line: - - - nets_refund - Refund - Line: - - - nets_cancel_payment - Cancel - Line: - - - nets_payment_reserved - payment reserved - Line: - - - nets_charge_all - Charge All - Line: - - - nets_payment_charged - payment charged - Line: - - - nets_refund_all - Refund All - Line: - - - nets_payment_refunded - refunded - Line: - - - nets_payment_refund_pending - refund pending - Line: - - - nets_payment_cancelled - cancelled - Line: - - - nets_payment_failed - failed - Line: - - - nets_charged_products - charged products - Line: - - - nets_refunded_products - refunded products - Line: - - - + + + + nets_payment_status + Payment Status + Line: + + + nets_payment_id + Payment ID + Line: + + + nets_quantity + Quantity + Line: + + + nets_model + Model + Line: + + + nets_product + Product + Line: + + + nets_price + Price + Line: + + + nets_action + Action + Line: + + + nets_charge + Charge + Line: + + + nets_refund + Refund + Line: + + + nets_cancel_payment + Cancel + Line: + + + nets_payment_reserved + payment reserved + Line: + + + nets_charge_all + Charge All + Line: + + + nets_payment_charged + payment charged + Line: + + + nets_refund_all + Refund All + Line: + + + nets_payment_refunded + refunded + Line: + + + nets_payment_refund_pending + refund pending + Line: + + + nets_payment_cancelled + cancelled + Line: + + + nets_payment_failed + failed + Line: + + + nets_charged_products + charged products + Line: + + + nets_refunded_products + refunded products + Line: + + + diff --git a/translations/en-US/ModulesNetseasyConfig.en-US.xlf b/translations/en-US/ModulesNetseasyConfig.en-US.xlf index 43c66f3..521b536 100644 --- a/translations/en-US/ModulesNetseasyConfig.en-US.xlf +++ b/translations/en-US/ModulesNetseasyConfig.en-US.xlf @@ -2,14 +2,24 @@ - - nets_merchant_id_error - Merchant Id is required + + nets_payment_name_error + Name of Payment Gateway is required Line: - - merchant_id - Merchant Id + + payment_name + Name of Payment Gateway + Line: + + + nets_merchant_email_id_error + Merchant Email Id is required + Line: + + + merchant_email_id + Merchant Email Id Line: @@ -42,6 +52,16 @@ Use this module for test mode Line: + + merchant_id + Merchant Id + Line: + + + nets_merchant_id_error + Merchant Id is required + Line: + test_checkout_key Test Checkout Key diff --git a/translations/en-US/ModulesNetseasyNetseasy.en-US.xlf b/translations/en-US/ModulesNetseasyNetseasy.en-US.xlf index f52f463..6c9c22d 100644 --- a/translations/en-US/ModulesNetseasyNetseasy.en-US.xlf +++ b/translations/en-US/ModulesNetseasyNetseasy.en-US.xlf @@ -1,22 +1,22 @@ - - - - Test - text string one. - Test - text string one. - Line: - - - This payment method is not available. - This payment method is not available. - Line: - - - Shipping - Shipping - Line: - - - + + + + This payment method is not available. + This payment method is not available. + Line: + + + Shipping + Shipping + Line: + + + Test - text string one. + Test - text string one. + Line: + + + diff --git a/translations/nn-NO/ModulesNetseasyConfig.nn-NO.xlf b/translations/nn-NO/ModulesNetseasyConfig.nn-NO.xlf index 1ffe795..c527f12 100644 --- a/translations/nn-NO/ModulesNetseasyConfig.nn-NO.xlf +++ b/translations/nn-NO/ModulesNetseasyConfig.nn-NO.xlf @@ -2,14 +2,34 @@ + + nets_payment_name_error + Navn på betalingsgateway kreves + Line: + + + payment_name + Navn på betalingsgateway + Line: + nets_merchant_id_error - Selger-ID er påkrevd + Merchant Id kreves Line: merchant_id - Selger-ID + Merchant Id + Line: + + + nets_merchant_email_id_error + Merchant Email Id kreves + Line: + + + merchant_email_id + Merchant Email Id Line: diff --git a/translations/nn-NO/ModulesNetseasyPayment_error.nn-NO.xlf b/translations/nn-NO/ModulesNetseasyPayment_error.nn-NO.xlf index b8af792..106f0d9 100644 --- a/translations/nn-NO/ModulesNetseasyPayment_error.nn-NO.xlf +++ b/translations/nn-NO/ModulesNetseasyPayment_error.nn-NO.xlf @@ -1,12 +1,12 @@ - - - - payment_id_error - ikke mulig å opprette payment ID - Line: - - - + + + + payment_id_error + ikke mulig å opprette payment ID + Line: + + + diff --git a/views/css/order.css b/views/css/order.css index 88abcf6..114d032 100644 --- a/views/css/order.css +++ b/views/css/order.css @@ -1,161 +1,374 @@ -#orderNetsOriginalPosition { width:100%; } -#orderNetsPanel.card { border: 1px solid #86bdcc !important; } +#orderNetsOriginalPosition { + width:100%; +} +#orderNetsPanel.card { + border: 1px solid #86bdcc !important; +} -.frame-wrapper.nets { border: 1px solid #abbedb; } -.frame-wrapper.nets .frame-content { padding: 0px; } -.frame-head.nets { background-color: #3473aa !important; } -.frame-head.nets > .title { color: #fff !important; } -.nets-container { margin-top: -10px; padding: 0px; border: 0px solid #ddd; text-align:left; } -.nets-container li { list-style:none; } +.frame-wrapper.nets { + border: 1px solid #abbedb; +} +.frame-wrapper.nets .frame-content { + padding: 0px; +} +.frame-head.nets { + background-color: #3473aa !important; +} +.frame-head.nets > .title { + color: #fff !important; +} +.nets-container { + margin-top: -10px; + padding: 0px; + border: 0px solid #ddd; + text-align:left; +} +.nets-container li { + list-style:none; +} -pre { margin: 20px -5px 25px 15px; padding: 15px; background: #455468; color: #fff; } +pre { + margin: 20px -5px 25px 15px; + padding: 15px; + background: #455468; + color: #fff; +} .gx-compatibility .main-page-content button, .gx-compatibility .main-page-content input[type="button"], -.gx-container input[type="button"] { min-width:36px; } - -td.edittext:first-child { width:30% !important; } - -.left{ text-align: left !important; } -.right{ text-align: right !important; } -.center{ text-align: center !important; } -.pl{ padding-left: 10px !important; } -.pr{ padding-right: 10px !important; } - -.nets-logo { padding-bottom: 15px; text-align: right; } -.nets-logo .status { float: left; text-transform: uppercase; color: #424242; font-size: 14px; line-height: 32px; } -.nets-logo span { color: #055b79; } -.nets-logo span.fail { color: #bb3805; } -.nets-header { padding: 10px; background: #eee; } -.nets-body { display: flex; padding: 15px 2px; } -.nets-block { width: 100%; margin-top: 10px; padding: 10px; background: #eee; text-transform: uppercase; } -#cancelorder { width: 50%; padding-right: 5px; } -#captureorder { width: 50%; padding-left: 5px; } -#refundorder { width: 100%; } +.gx-container input[type="button"] { + min-width:36px; +} + +td.edittext:first-child { + width:30% !important; +} + +.left{ + text-align: left !important; +} +.right{ + text-align: right !important; +} +.center{ + text-align: center !important; +} +.pl{ + padding-left: 10px !important; +} +.pr{ + padding-right: 10px !important; +} + +.nets-logo { + padding-bottom: 15px; + text-align: right; +} +.nets-logo .status { + float: left; + text-transform: uppercase; + color: #424242; + font-size: 14px; + line-height: 32px; +} +.nets-logo span { + color: #055b79; +} +.nets-logo span.fail { + color: #bb3805; +} +.nets-header { + padding: 10px; + background: #eee; +} +.nets-body { + display: flex; + padding: 15px 2px; +} +.nets-block { + width: 100%; + margin-top: 10px; + padding: 10px; + background: #eee; + text-transform: uppercase; +} +#cancelorder { + width: 50%; + padding-right: 5px; +} +#captureorder { + width: 50%; + padding-left: 5px; +} +#refundorder { + width: 100%; +} .nets-btn { - margin: 0 !important; - padding: 6px 16px !important; - line-height: 20px; - color:#fff !important; - border: 0px !important; - border-radius: 3px !important; - cursor: pointer !important; - text-transform: uppercase; -} -.nets-btn img { height: 12px; } -.nets-btn.cancel { background:#e37e12 !important; } -.nets-btn.capture { background:#00f0b8 !important; } -.nets-btn.capture-all { background:#00f03c !important; } -.nets-btn.refund { background:#00bef0 !important; } -.nets-btn.refund-all { background:#0096f0 !important; } -.nets-status { padding: 0px; color: #055b79; font-size: 14px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; } - -#testorder { width: 100%; padding-top: 15px; } -#testput { width: calc(100% - 20px); padding: 6px 8px; background: #f1f1f1; color: #188cb5; border: 1px solid #ddd; border-radius: 3px; letter-spacing: .05em; } -#testput:focus { outline: none; border: 1px solid #a4d0db; } -textarea { - display: block; - margin-top: 30px; - min-height: 200px; - width: calc(100% - 25px); - padding: 10px; - background: #4c646a; - color: #fff; - letter-spacing: .05em; - line-height: 1.3em; - border: 1px solid #fff; - border-radius: 5px; -} -.nets-block thead th{ border-bottom: 1px solid #dfdfdf !important;padding-right: 20px; } -td.listing { padding: 5px 20px 0px 0px; font-size: 11px; } -td.listing.bottom { background-color: #f9f9f9; border-bottom: 1px solid #b6b6b6; } -td.listing.top { border-top: 1px solid #b6b6b6; } - -td.listing.top.reserve .nets-status { color: #2da1ca; } -td.listing.top.charge .nets-status { color: #399b15; } - -td.listing.top.refund { background: #aecdff; } -td.listing.top.refund .nets-status { color: #055b79; } - -td.listing.top.cancel { background: #e8acac; } -td.listing.top.cancel .nets-status { color: #952828; } - -td.listing.top.fail { background: #323232; } -td.listing.top.fail .nets-status { color: #fff; } - -td.listing.top.partial-charge { background: #f0f7ea; } -td.listing.top.partial-charge .nets-status { color: #399b15; } -td.listing.partial-charge { padding: 0px 12px; background: #f6ffee; border-top: 1px solid #e9f0e1; } - -.qty-box { width: 100%; margin:0; padding:0px; text-transform:uppercase; } - -.quantity{ left:0; padding: 0; display: inline-flex; } -.quantity .value{ width:35px; margin: 0; text-align:center; border:1px solid #b6b6b6; border-left:0px; border-right:0px; border-radius:0; background:#fff; } -.amount{ border:0 !important; color:#323232 !important; font-weight:bold;text-align:center;padding: 0 !important;height: 21px !important; text-transform:uppercase; } + margin: 0 !important; + padding: 6px 16px !important; + line-height: 20px; + color:#fff !important; + border: 0px !important; + border-radius: 3px !important; + cursor: pointer !important; + text-transform: uppercase; +} +.nets-btn img { + height: 12px; +} +.nets-btn.cancel { + background:#e37e12 !important; +} +.nets-btn.capture { + background:#00f0b8 !important; +} +.nets-btn.capture-all { + background:#00f03c !important; +} +.nets-btn.refund { + background:#00bef0 !important; +} +.nets-btn.refund-all { + background:#0096f0 !important; +} +.nets-status { + padding: 0px; + color: #055b79; + font-size: 14px; + font-weight: 600; + text-transform: uppercase; + letter-spacing: .05em; +} + +#testorder { + width: 100%; + padding-top: 15px; +} +#testput { + width: calc(100% - 20px); + padding: 6px 8px; + background: #f1f1f1; + color: #188cb5; + border: 1px solid #ddd; + border-radius: 3px; + letter-spacing: .05em; +} +#testput:focus { + outline: none; + border: 1px solid #a4d0db; +} +textarea { + display: block; + margin-top: 30px; + min-height: 200px; + width: calc(100% - 25px); + padding: 10px; + background: #4c646a; + color: #fff; + letter-spacing: .05em; + line-height: 1.3em; + border: 1px solid #fff; + border-radius: 5px; +} +.nets-block thead th{ + border-bottom: 1px solid #dfdfdf !important; + padding-right: 20px; +} +td.listing { + padding: 5px 20px 0px 0px; + font-size: 11px; +} +td.listing.bottom { + background-color: #f9f9f9; + border-bottom: 1px solid #b6b6b6; +} +td.listing.top { + border-top: 1px solid #b6b6b6; +} + +td.listing.top.reserve .nets-status { + color: #2da1ca; +} +td.listing.top.charge .nets-status { + color: #399b15; +} + +td.listing.top.refund { + background: #aecdff; +} +td.listing.top.refund .nets-status { + color: #055b79; +} + +td.listing.top.cancel { + background: #e8acac; +} +td.listing.top.cancel .nets-status { + color: #952828; +} + +td.listing.top.fail { + background: #323232; +} +td.listing.top.fail .nets-status { + color: #fff; +} + +td.listing.top.partial-charge { + background: #f0f7ea; +} +td.listing.top.partial-charge .nets-status { + color: #399b15; +} +td.listing.partial-charge { + padding: 0px 12px; + background: #f6ffee; + border-top: 1px solid #e9f0e1; +} + +.qty-box { + width: 100%; + margin:0; + padding:0px; + text-transform:uppercase; +} + +.quantity{ + left:0; + padding: 0; + display: inline-flex; +} +.quantity .value{ + width:35px; + margin: 0; + text-align:center; + border:1px solid #b6b6b6; + border-left:0px; + border-right:0px; + border-radius:0; + background:#fff; +} +.amount{ + border:0 !important; + color:#323232 !important; + font-weight:bold; + text-align:center; + padding: 0 !important; + height: 21px !important; + text-transform:uppercase; +} input#single.amount, -input#box.amount { background: #efefef !important;width: 50%; } +input#box.amount { + background: #efefef !important; + width: 50%; +} input[class*="minus"], input[class*="plus"] { - width: 30px; - margin: 0 !important; - padding: 0 !important; - background: #f6f7f8 !important; - border: 1px solid #b6b6b6 !important; - font-size: 24px !important; - line-height: 24px; - text-align: center !important; -} -input.single.qty.value:focus-visible { border: 1px solid #b6b6b6; border-left: 0px; border-right: 0px; outline: none !important; } - -.qty-box.charge input[class*="minus"], .qty-box.charge input[class*="plus"] { color: #00bef0; } -.qty-box.refund input[class*="minus"], .qty-box.refund input[class*="plus"] { color: #e37e12; } - -input[class*="minus"] { border-radius:3px 0px 0px 3px !important; border-right: 0px !important; } -input[class*="plus"] { border-radius:0px 3px 3px 0px !important; border-left: 0px !important; } + width: 30px; + margin: 0 !important; + padding: 0 !important; + background: #f6f7f8 !important; + border: 1px solid #b6b6b6 !important; + font-size: 24px !important; + line-height: 24px; + text-align: center !important; +} +input.single.qty.value:focus-visible { + border: 1px solid #b6b6b6; + border-left: 0px; + border-right: 0px; + outline: none !important; +} + +.qty-box.charge input[class*="minus"], .qty-box.charge input[class*="plus"] { + color: #00bef0; +} +.qty-box.refund input[class*="minus"], .qty-box.refund input[class*="plus"] { + color: #e37e12; +} + +input[class*="minus"] { + border-radius:3px 0px 0px 3px !important; + border-right: 0px !important; +} +input[class*="plus"] { + border-radius:0px 3px 3px 0px !important; + border-left: 0px !important; +} .is-disabled, .is-disabled:hover, .is-disabled:focus, .is-disabled:active, .minus.is-disabled, -.plus.is-disabled { color: #ddd !important; cursor:default; } -.basket_btn.is-disabled { background: red !important; color:#fff !important; } -input[type="button"].is-disabled { color: #ddd; cursor:default; } -input[type="button"]:hover { background: #fbfbfb; } -.item-listing { background: #f6f7f8; padding: 6px 10px; margin: 15px 0px 10px 0px; border-radius: 3px; } -.item-listing.charged { border: 1px solid #bce2ec; } -.item-listing.refunded { border: 1px solid #eec293; } -.pid { color: #5159ce; } +.plus.is-disabled { + color: #ddd !important; + cursor:default; +} +.basket_btn.is-disabled { + background: red !important; + color:#fff !important; +} +input[type="button"].is-disabled { + color: #ddd; + cursor:default; +} +input[type="button"]:hover { + background: #fbfbfb; +} +.item-listing { + background: #f6f7f8; + padding: 6px 10px; + margin: 15px 0px 10px 0px; + border-radius: 3px; +} +.item-listing.charged { + border: 1px solid #bce2ec; +} +.item-listing.refunded { + border: 1px solid #eec293; +} +.pid { + color: #5159ce; +} .grid { - width: 100%; - box-sizing: border-box; - display: inline-block + width: 100%; + box-sizing: border-box; + display: inline-block } remove-padding { - padding: 0 !important; + padding: 0 !important; } .frame-wrapper.nets { - border: 1px solid #abbedb; - border-radius: 2px; - + border: 1px solid #abbedb; + border-radius: 2px; + } .frame-wrapper .frame-head { - background-color: #e4e4e4; - padding: 8px 24px; - height: 36px; + background-color: #e4e4e4; + padding: 8px 24px; + height: 36px; +} +.lining td{ + height:33px; +} +.nets-block table tr{ + height:56px; + background-color: #f9f9f9; } -.lining td{height:33px;} -.nets-block table tr{height:56px;background-color: #f9f9f9;} .nets-block table td:first-of-type, .gx-container table th:first-of-type { - padding-left: 24px;padding-right: 24px; + padding-left: 24px; + padding-right: 24px; } .nets-block table tbody tr td { - padding: 6px 12px; - color: #212121; - height: 48px; + padding: 6px 12px; + color: #212121; + height: 48px; } .topbg{ - background-color: #f0f7ea !important; + background-color: #f0f7ea !important; } -.span12{width:100%} \ No newline at end of file +.span12{ + width:100% +} \ No newline at end of file diff --git a/views/js/back.js b/views/js/back.js index 94a3b51..973e838 100644 --- a/views/js/back.js +++ b/views/js/back.js @@ -6,6 +6,8 @@ $(document).ready(function () { $('#module_form').on('submit', function (e) { e.preventDefault(); merchant_id = $.trim($('#NETS_MERCHANT_ID').val()); + merchant_email_id = $.trim($('#NETS_MERCHANT_EMAIL_ID').val()); + payment_name = $.trim($('#NETS_PAYMENT_NAME').val()); test_mode = $('#NETS_TEST_MODE_on').prop('checked'); test_checkout_key = $.trim($('#NETS_TEST_CHECKOUT_KEY').val()); test_secret_key = $.trim($('#NETS_TEST_SECRET_KEY').val()); @@ -17,6 +19,10 @@ $(document).ready(function () { webhook_authorization = $.trim($('#NETS_WEBHOOK_AUTHORIZATION').val()); if (merchant_id == '') { $('#NETS_MERCHANT_ID').focus().next('.error').css('display', 'inline-block'); + } else if (merchant_email_id == '') { + $('#NETS_MERCHANT_EMAIL_ID').focus().next('.error').css('display', 'inline-block'); + } else if (payment_name == '') { + $('#NETS_PAYMENT_NAME').focus().next('.error').css('display', 'inline-block'); } else if (test_mode == true && test_checkout_key == '') { $('#NETS_TEST_CHECKOUT_KEY').focus().next('.error').css('display', 'inline-block'); } else if (test_mode == true && test_secret_key == '') { @@ -54,4 +60,4 @@ function validateAUTH(data) // return true or false. var regexp = /^[a-zA-Z0-9-]{8,32}$/ return regexp.test(data); -} \ No newline at end of file +} diff --git a/views/js/nets_checkout.js b/views/js/nets_checkout.js index 9a77e18..c7ea109 100644 --- a/views/js/nets_checkout.js +++ b/views/js/nets_checkout.js @@ -3,16 +3,16 @@ $(document).ready(function () { var frame = document.getElementById('nets-checkout-iframe'); var payment_option = document.querySelectorAll('input[type=radio][name="payment-option"]'); var promo_code_applied = getUrlParameter('updatedTransaction'); - + if (checkCookie('nets_payment_selected')) { deleteCookie("nets_payment_selected"); } - if(place_button.length != 0 ){ + if (place_button.length != 0) { place_button[0].addEventListener('click', function (e) { var disabled = $('#payment-confirmation button[type="submit"]').hasClass('disabled'); if (!disabled) { var name = $('input[type=radio][name="payment-option"]:checked').attr("data-module-name"); - if (name == "Nets Payment") { + if (name == "netseasy") { setCookie('nets_payment_selected', true, 1); if (frame) { frame.style.display = ''; @@ -29,11 +29,11 @@ $(document).ready(function () { }, false); } - if(payment_option.length != 0 ){ - for (var i = 0; i < payment_option.length; i++) { + if (payment_option.length != 0) { + for (var i = 0; i < payment_option.length; i++) { payment_option[i].addEventListener('change', function (e) { var name = e.srcElement.getAttribute('data-module-name'); - if (name == "Nets Payment") { + if (name == "netseasy") { if (frame) { frame.style.display = ''; } @@ -47,21 +47,20 @@ $(document).ready(function () { } prestashop.on('updatedCart', function (event) { var disabled = $(place_button).hasClass('disabled'); - var netseasy_selected = $("[data-module-name='Nets Payment']").prop('checked'); + var netseasy_selected = $("[data-module-name='netseasy']").prop('checked'); if (netseasy_selected && disabled == false) { setCookie('nets_payment_selected', true, 1); } }); - - var container = $('input[type=radio][data-module-name="Nets Payment"]').closest('.payment-option'); - $('#netseasy_payment_container').appendTo(container); + + $('#netseasy_payment_container').appendTo($('input[type=radio][data-module-name="netseasy"]').closest('.payment-option')); }); var getUrlParameter = function getUrlParameter(sParam) { var sPageURL = window.location.search.substring(1), - sURLVariables = sPageURL.split('&'), - sParameterName, - i; + sURLVariables = sPageURL.split('&'), + sParameterName, + i; for (i = 0; i < sURLVariables.length; i++) { sParameterName = sURLVariables[i].split('='); if (sParameterName[0] === sParam) { diff --git a/views/templates/admin/config.tpl b/views/templates/admin/config.tpl index cc50889..dc6e9f7 100644 --- a/views/templates/admin/config.tpl +++ b/views/templates/admin/config.tpl @@ -10,34 +10,34 @@ - + +
+ +
+ +

{l s="nets_merchant_email_id_error" d="Modules.Netseasy.Config"}

+
+
+
+ +
+ +

{l s="nets_payment_name_error" d="Modules.Netseasy.Config"}

+
+
@@ -124,25 +138,19 @@
- +

{l s="nets_terms_url_error" d="Modules.Netseasy.Config"}

- +

{l s="nets_merchant_terms_url_error" d="Modules.Netseasy.Config"}

-
diff --git a/views/templates/hook/paymentEmbedded.tpl b/views/templates/hook/paymentEmbedded.tpl index d38926f..db440f6 100644 --- a/views/templates/hook/paymentEmbedded.tpl +++ b/views/templates/hook/paymentEmbedded.tpl @@ -25,7 +25,7 @@ window.location = '{$returnUrl}&paymentid={$paymentId}'; }); $(document).ready(function(){ - $('input[type=radio][data-module-name="Nets Payment"]').prop('checked',true); + $('input[type=radio][data-module-name="{$module}"]').prop('checked',true); $('#payment-confirmation button[type="submit"]').removeClass('disabled'); });