Skip to content

Commit

Permalink
Add files via upload
Browse files Browse the repository at this point in the history
Module updates, bug fixes and module improvements
  • Loading branch information
NochexDevTeam authored Sep 22, 2020
1 parent 4db53ce commit 9690f57
Show file tree
Hide file tree
Showing 5 changed files with 48 additions and 45 deletions.
10 changes: 5 additions & 5 deletions admin/controller/payment/nochex.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,8 @@ public function index() {
$data['text_all_zones'] = $this->language->get('text_all_zones');
$data['text_yes'] = $this->language->get('text_yes');
$data['text_no'] = $this->language->get('text_no');

$data['text_merchant'] = $this->language->get('text_merchant');

$data['entry_merchant'] = $this->language->get('entry_merchant');
$data['entry_template'] = $this->language->get('entry_template');
$data['entry_test'] = $this->language->get('entry_test');
Expand All @@ -58,7 +59,6 @@ public function index() {
$data['help_debug'] = $this->language->get('help_debug');
$data['help_postage'] = $this->language->get('help_postage');
$data['help_xml'] = $this->language->get('help_xml');

$data['help_merchantid'] = $this->language->get('help_merchantid');
$data['help_total'] = $this->language->get('help_total');

Expand Down Expand Up @@ -99,7 +99,7 @@ public function index() {
$data['action'] = $this->url->link('payment/nochex', 'token=' . $this->session->data['token'], 'SSL');

$data['cancel'] = $this->url->link('extension/payment', 'token=' . $this->session->data['token'], 'SSL');

if (isset($this->request->post['nochex_merchant'])) {
$data['nochex_merchant'] = $this->request->post['nochex_merchant'];
} else {
Expand All @@ -117,7 +117,7 @@ public function index() {
} else {
$data['nochex_test'] = $this->config->get('nochex_test');
}

if (isset($this->request->post['nochex_xmlcollection'])) {
$data['nochex_xmlcollection'] = $this->request->post['nochex_xmlcollection'];
} else {
Expand Down Expand Up @@ -197,4 +197,4 @@ protected function validate() {

return !$this->error;
}
}
}
21 changes: 12 additions & 9 deletions admin/language/en-GB/payment/nochex.php
Original file line number Diff line number Diff line change
@@ -1,16 +1,20 @@
<?php
// Heading
$_['heading_title'] = 'NOCHEX';

// Text
$_['text_payment'] = 'Payment';
$_['text_success'] = 'Success: You have modified NOCHEX account details!';
$_['text_edit'] = 'Edit NOCHEX';
$_['text_nochex'] = '<img src="view/image/payment/nochex.png" alt="NOCHEX" title="NOCHEX" style="border: 1px solid #EEEEEE;" />';
$_['text_nochex'] = '<a href="https://secure.nochex.com/apply/merchant_info.aspx" target="_blank"><img src="view/image/payment/nochex.png" alt="NOCHEX" title="NOCHEX" style="border: 1px solid #EEEEEE;" /></a>';
$_['text_merchant'] = 'Merchant Account';

// Entry
$_['entry_merchant'] = 'Nochex Email Address <br/>or Merchant ID';
$_['entry_test'] = 'Test';
$_['entry_xmlcollection'] = 'Product Details';
$_['entry_email'] = 'E-Mail';
$_['entry_account'] = 'Account Type';
$_['entry_merchant'] = 'Nochex Merchant ID or Email Address';
$_['entry_test'] = 'Test Mode';
$_['entry_xmlcollection'] = 'Detailed Product Information';
$_['entry_debug'] = 'Debug';
$_['entry_postage'] = 'Postage';
$_['entry_hide'] = 'Hide Billing Details:';
Expand All @@ -23,14 +27,13 @@
// Help
$_['help_total'] = 'The checkout total the order must reach before this payment method becomes active.';
$_['help_merchantid'] = 'Your Nochex Merchant ID, for example [email protected] or Test_ID';
$_['help_test'] = 'Testing Mode, Used to test that your shopping cart is working. Leave disabled for live transactions.';
$_['help_callback'] = 'To use the callback functionality, please contact Nochex Support to enable this functionality on your merchant account otherwise this function wont work.';
$_['help_billing'] = 'Hide Billing Details Option, Used to hide the billing details.';
$_['help_test'] = 'Enable this feature to allow test transactions. Note: Ensure this option is disabled to accept live payments.';
$_['help_billing'] = 'Hide Billing Details Option, Used to hide the billing details on your Nochex Payment Page.';
$_['help_xml'] = 'Display your product details in a structured format on your Nochex Payment Page.';
$_['help_postage'] = 'Postage Option is to separate the postage from the total amount';
$_['help_postage'] = 'Postage Option is to separate the postage from the total amount on your Nochex Payment Page';
$_['help_debug'] = 'Debug mode is to test and make sure the module is working correctly, and if there is any faults being caused in your Nochex module.';

// Error
$_['error_permission'] = 'Warning: You do not have permission to modify payment NOCHEX!';
$_['error_email'] = 'E-Mail Required!';
$_['error_merchant'] = 'Merchant ID Required!';
$_['error_merchant'] = 'Merchant ID Required!';
21 changes: 7 additions & 14 deletions admin/view/template/payment/nochex.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
<div class="pull-right">
<button type="submit" form="form-nochex" data-toggle="tooltip" title="<?php echo $button_save; ?>" class="btn btn-primary"><i class="fa fa-save"></i></button>
<a href="<?php echo $cancel; ?>" data-toggle="tooltip" title="<?php echo $button_cancel; ?>" class="btn btn-default"><i class="fa fa-reply"></i></a></div>
<!--h1>< ?php echo $heading_title; ?></h1--->
<img src="https://www.nochex.com/logobase-secure-images/nochex_standard_logo_190x50.gif" alt="" />
<ul class="breadcrumb">
<?php foreach ($breadcrumbs as $breadcrumb) { ?>
Expand Down Expand Up @@ -34,8 +33,7 @@
<div class="text-danger"><?php echo $error_merchant; ?></div>
<?php } ?>
</div>
</div>

</div>
<div class="form-group">
<label class="col-sm-2 control-label"><?php echo $entry_test; ?><span data-toggle="tooltip" title="<?php echo $help_test; ?>"></label>
<div class="col-sm-10">
Expand All @@ -58,8 +56,7 @@
<?php } ?>
</label>
</div>
</div>

</div>
<div class="form-group">
<label class="col-sm-2 control-label"><?php echo $entry_xmlcollection; ?><span data-toggle="tooltip" title="<?php echo $help_xml; ?>"></label>
<div class="col-sm-10">
Expand All @@ -82,8 +79,7 @@
<?php } ?>
</label>
</div>
</div>

</div>
<div class="form-group">
<label class="col-sm-2 control-label"><?php echo $entry_debug; ?><span data-toggle="tooltip" title="<?php echo $help_debug; ?>"></label>
<div class="col-sm-10">
Expand All @@ -106,8 +102,7 @@
<?php } ?>
</label>
</div>
</div>

</div>
<div class="form-group">
<label class="col-sm-2 control-label"><?php echo $entry_postage; ?><span data-toggle="tooltip" title="<?php echo $help_postage; ?>"></label>
<div class="col-sm-10">
Expand All @@ -131,8 +126,7 @@
</label>
</div>
</div>

<div class="form-group">
<div class="form-group">
<label class="col-sm-2 control-label"><?php echo $entry_hide; ?><span data-toggle="tooltip" title="<?php echo $help_billing; ?>"></label>
<div class="col-sm-10">
<label class="radio-inline">
Expand All @@ -154,8 +148,7 @@
<?php } ?>
</label>
</div>
</div>

</div>
<div class="form-group">
<label class="col-sm-2 control-label" for="input-total"><span data-toggle="tooltip" title="<?php echo $help_total; ?>"><?php echo $entry_total; ?></span></label>
<div class="col-sm-10">
Expand Down Expand Up @@ -216,4 +209,4 @@
</div>
</div>
</div>
<?php echo $footer; ?>
<?php echo $footer; ?>
18 changes: 12 additions & 6 deletions catalog/controller/payment/nochex.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,23 +16,25 @@ public function index() {

$data['merchant_id'] = $this->config->get('nochex_merchant');


if($this->config->get('nochex_debug')==1){

$logger = new Log('nochex.log');
$logger->write('Nochex - Log');

}


$data['amount'] = $this->currency->format($order_info['total'], 'GBP', false, false);
$data['order_id'] = $this->session->data['order_id'];

$products = $this->cart->getProducts();


if($this->config->get('nochex_xmlcollection') == 1){

$xmlCollection = "<items>";

foreach ($products as $product) {
foreach ($this->cart->getProducts() as $product) {

$xmlCollection .= "<item><id>".$product['product_id']."</id><name>".$product['name']."</name><description>".$product['model']."</description><quantity>".$product['quantity']."</quantity><price>" . $product['price'] . "</price></item>";
}
Expand All @@ -46,7 +48,7 @@ public function index() {
$xmlCollection = "";
$description = "Product Details: ";

foreach ($products as $product) {
foreach ($this->cart->getProducts() as $product) {
$description .= " Product ID: ".$product['product_id'].", Product Name: ".$product['name'].", Product Description: ".$product['model'].", Product Quantity: ".$product['quantity'].", Product Price: &pound;" . $product['price'] . " ";
}

Expand All @@ -56,13 +58,13 @@ public function index() {
if($this->config->get('nochex_debug')==1){

$logger->write('XMl Collection'.$xmlCollection);
$logger->write('Description'.$description);
$logger->write('Description'.$xmlCollection);

}

if($this->config->get('nochex_postage') == 1){
$data['postage'] = $this->currency->format($this->session->data['shipping_method']['cost'], $this->currency->getCode(), false, false);
$data['amount'] = $this->currency->format($order_info['total'], $currency, FALSE, FALSE) - $this->currency->format($this->session->data['shipping_method']['cost'], $this->currency->getCode(), false, false);
$data['amount'] = $this->currency->format($order_info['total'], $this->currency->getCode(), FALSE, FALSE) - $this->currency->format($this->session->data['shipping_method']['cost'], $this->currency->getCode(), false, false);
}else{
$data['postage'] = "";
$data['amount'] = $this->currency->format($order_info['total'], 'GBP', false, false);
Expand Down Expand Up @@ -117,15 +119,19 @@ public function index() {
$data['test'] = $this->config->get('nochex_test');
$data['success_url'] = $this->url->link('checkout/success', '', 'SSL');
$data['cancel_url'] = $this->url->link('checkout/payment', '', 'SSL');
$data['declined_url'] = $this->url->link('payment/nochex/callback', 'method=decline', 'SSL');
$data['callback_url'] = $this->url->link('payment/nochex/callback', 'order=' . $this->session->data['order_id'], 'SSL');

$data['hide_billing_details'] = $this->config->get('nochex_hide');

$data['optional_2'] = "Enabled";


if($this->config->get('nochex_debug')==1){

$logger->write('Success URL: '. $data['success_url']);
$logger->write('Cancel URL: '. $data['cancel_url']);
$logger->write('Declined URL: '. $data['declined_url']);
$logger->write('APC / Callback URL: '. $data['callback_url']);

}
Expand Down Expand Up @@ -231,4 +237,4 @@ public function callback() {

}
}
}
}
23 changes: 12 additions & 11 deletions catalog/view/theme/default/template/payment/nochex.tpl
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
<form action="<?php echo $action; ?>" method="post">
<?php if ($test) { ?>
<input type="hidden" name="test_transaction" value="100" />
<?php } ?>

<input type="hidden" name="test_success_url" value="<?php echo $success_url; ?>" />
<?php if (!$test) { ?>
<input type="hidden" name="success_url" value="<?php echo $success_url; ?>" />
<input type="hidden" name="cancel_url" value="<?php echo $cancel_url; ?>" />
<input type="hidden" name="declined_url" value="<?php echo $declined_url; ?>" />
<input type="hidden" name="callback_url" value="<?php echo $callback_url; ?>" />
<input type="hidden" name="declined_url" value="<?php echo $declined_url; ?>" />
<?php } else { ?>
<input type="hidden" name="test_transaction" value="100" />
<input type="hidden" name="test_success_url" value="<?php echo $success_url; ?>" />
<input type="hidden" name="test_cancel_url" value="<?php echo $cancel_url; ?>" />
<input type="hidden" name="test_declined_url" value="<?php echo $declined_url; ?>" />
<?php } ?>

<input type="hidden" name="callback_url" value="<?php echo $callback_url; ?>" />
<input type="hidden" name="merchant_id" value="<?php echo $merchant_id; ?>" />
<input type="hidden" name="amount" value="<?php echo $amount; ?>" />

Expand All @@ -30,13 +32,12 @@
<input type="hidden" name="email_address" value="<?php echo $email_address; ?>" />
<input type="hidden" name="optional_2" value="<?php echo $optional_2; ?>" />

<?php if($hide_billing_details == 1){ ?>
<p style="text-align:right; font-weight:bold; color:red;">Please check your Billing Details match the Details on your card that you are going to use.</p>
<?php if($hide_billing_details == 1){ ?>
<p style="text-align:right; font-weight:bold; color:red;">Please check your Billing Details match the Details on your card that you are going to use.</p>
<?php } ?>

<div class="buttons">
<div class="pull-right">
<input type="submit" value="<?php echo $button_confirm; ?>" class="btn btn-primary" />
</div>
</div>
</form>
</form>

0 comments on commit 9690f57

Please sign in to comment.