Skip to content
This repository was archived by the owner on Jan 25, 2024. It is now read-only.

Commit 5341b45

Browse files
committed
Release 1.0.26
1 parent c064d6e commit 5341b45

File tree

11 files changed

+189
-131
lines changed

11 files changed

+189
-131
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ This repository contains the OpenCart wallee payment module that enables the sh
1111

1212
## Documentation
1313

14-
* [English](https://plugin-documentation.wallee.com/wallee-payment/opencart-2.0/1.0.24/docs/en/documentation.html)
14+
* [English](https://plugin-documentation.wallee.com/wallee-payment/opencart-2.0/1.0.26/docs/en/documentation.html)
1515

1616
## License
1717

18-
Please see the [license file](https://github.com/wallee-payment/opencart-2.0/blob/1.0.24/LICENSE) for more information.
18+
Please see the [license file](https://github.com/wallee-payment/opencart-2.0/blob/1.0.26/LICENSE) for more information.

docs/en/documentation.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ <h2>Documentation</h2> </div>
2121
</a>
2222
</li>
2323
<li>
24-
<a href="https://github.com/wallee-payment/opencart-2.0/releases/tag/1.0.24/">
24+
<a href="https://github.com/wallee-payment/opencart-2.0/releases/tag/1.0.26/">
2525
Source
2626
</a>
2727
</li>
@@ -48,7 +48,7 @@ <h1>
4848
<div class="olist arabic">
4949
<ol class="arabic">
5050
<li>
51-
<p><a href="https://github.com/wallee-payment/opencart-2.0/releases/tag/1.0.24/">Download</a> the extension.</p>
51+
<p><a href="https://github.com/wallee-payment/opencart-2.0/releases/tag/1.0.26/">Download</a> the extension.</p>
5252
</li>
5353
<li>
5454
<p>Extract the files and upload the content of the <code>Upload</code> directory into the root directory of your store using FTP/SSH.</p>

upload/admin/controller/payment/wallee.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,8 @@ private function persistStoreSettings(array $global, array $store){
125125
$newSettings['wallee_download_invoice'] = isset($store['wallee_download_invoice']);
126126
$newSettings['wallee_download_packaging'] = isset($store['wallee_download_packaging']);
127127

128+
$newSettings['wallee_rounding_adjustment'] = isset($store['wallee_rounding_adjustment']);
129+
128130
WalleeVersionHelper::persistPluginStatus($this->registry, $newSettings);
129131

130132
$this->model_setting_setting->editSetting('wallee', $newSettings, $store['id']);
@@ -240,6 +242,10 @@ private function getSettingsPageTranslatedVariables(){
240242
$data['help_log_level'] = $this->language->get('help_log_level');
241243
$data['log_levels'] = $this->getLogLevels();
242244

245+
$data['title_rounding_adjustment'] = $this->language->get('title_rounding_adjustment');
246+
$data['entry_rounding_adjustment'] = $this->language->get('entry_rounding_adjustment');
247+
$data['description_rounding_adjustment'] = $this->language->get('description_rounding_adjustment');
248+
243249
$data['entry_email'] = $this->language->get("entry_email");
244250
$data['description_email'] = $this->language->get("description_email");
245251
$data['entry_alerts'] = $this->language->get("entry_alerts");
@@ -432,6 +438,8 @@ private function getSettingsDefaults(){
432438

433439
"wallee_notification_url" => null,
434440

441+
"wallee_rounding_adjustment" => 0,
442+
435443
"wallee_download_packaging" => 1,
436444
"wallee_download_invoice" => 1,
437445
\Wallee\Service\ManualTask::CONFIG_KEY => 0

upload/admin/language/english/payment/wallee.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,11 @@
3636
$_['log_level_error'] = 'Error';
3737
$_['log_level_debug'] = 'Debug';
3838

39+
// Rounding
40+
$_['title_rounding_adjustment'] = 'Rounding adjustments';
41+
$_['entry_rounding_adjustment'] = 'Send Item';
42+
$_['description_rounding_adjustment'] = 'If we cannot map the Opencart totals to wallee line items exactly, instead of disabling the payment methods you can instead choose to send an Adjustment Item which contains the difference. In this case tax amounts may no longer be exact, and features such as reconciliation in wallee and refunds from the Opencart backend may not fully work.';
43+
3944
// Status
4045
$_['title_payment_status'] = "Status mapping";
4146
$_['entry_processing_status'] = "Processing status";
@@ -252,6 +257,8 @@
252257
$_['entry_sku'] = 'SKU';
253258
$_['entry_id'] = 'Unique ID';
254259

260+
$_['rounding_adjustment_item_name'] = 'Rounding Adjustment';
261+
255262
$_['entry_restock'] = 'Restock products';
256263
$_['button_reset'] = 'Reset';
257264
$_['button_full'] = 'Full order';

upload/admin/model/extension/wallee/migration.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
<?php
2+
23
require_once modification(DIR_SYSTEM . 'library/wallee/helper.php');
34

45
class ModelExtensionWalleeMigration extends Model {
@@ -16,33 +17,39 @@ class ModelExtensionWalleeMigration extends Model {
1617
);
1718

1819
public function migrate(){
20+
\WalleeHelper::instance($this->registry)->log("Starting migration");
1921
$currentVersion = '0.0.0';
2022
if ($this->config->has('wallee_migration_version')) {
2123
$currentVersion = $this->config->get('wallee_migration_version');
24+
\WalleeHelper::instance($this->registry)->log("Current version: $currentVersion");
2225
}
2326
$startingVersion = $currentVersion;
2427

2528
foreach (self::$migrations as $migration) {
2629
\WalleeHelper::instance($this->registry)->dbTransactionStart();
2730
try {
2831
if (version_compare($currentVersion, $migration['version']) === -1) {
32+
\WalleeHelper::instance($this->registry)->log("Running {$migration['name']}");
2933
$this->{$migration['function']}();
3034
\WalleeHelper::instance($this->registry)->dbTransactionCommit();
3135
$currentVersion = $migration['version'];
3236
}
3337
}
3438
catch (Exception $e) {
39+
\WalleeHelper::instance($this->registry)->log($e->getMessage());
3540
\WalleeHelper::instance($this->registry)->dbTransactionRollback();
3641
break;
3742
}
3843
}
3944

4045
// update version if required
4146
if (version_compare($startingVersion, $currentVersion) !== 0) {
47+
\WalleeHelper::instance($this->registry)->log("Updating version");
4248
$this->load->model('setting/setting');
4349
$settings = $this->model_setting_setting->getSetting('wallee');
4450
$settings['wallee_migration_version'] = self::$migrations[$currentVersion]['version'];
4551
$settings['wallee_migration_name'] = self::$migrations[$currentVersion]['name'];
52+
\WalleeHelper::instance($this->registry)->log("Currently at ". self::$migrations[$currentVersion]['version'].": ".self::$migrations[$currentVersion]['name']);
4653
$this->model_setting_setting->editSetting('wallee', $settings);
4754
}
4855
}

upload/admin/view/template/extension/wallee/refund.tpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ function echoAmount($amount, $currency_decimals){
110110
</dl>
111111
</td>
112112
<td>
113-
<?php if (count($line_item->getTaxes()) >= 1) : ?>
113+
<?php if (!empty($line_item->getTaxes())) : ?>
114114
<dl class="row" style="margin-right: 0px">
115115
<?php foreach ($line_item->getTaxes() as $tax_rate) :?>
116116
<dt class="col-sm-6"><?php echo $tax_rate->getTitle(); ?></dt>

upload/admin/view/template/payment/wallee.tpl

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -225,6 +225,21 @@
225225
</div>
226226
</div>
227227
</fieldset>
228+
229+
<fieldset>
230+
<legend><?php echo htmlspecialchars($title_rounding_adjustment) ?></legend>
231+
<div class="form-group">
232+
<label class="col-sm-2 control-label"><?php echo htmlspecialchars($entry_rounding_adjustment) ?></label>
233+
234+
<div class="col-sm-10">
235+
<input type="checkbox"
236+
name="stores[<?php echo $store['id'] ?>][wallee_rounding_adjustment]"
237+
<?php if($stores[$store['id']]['wallee_rounding_adjustment']) { ?>
238+
checked <?php } ?> value="1"/>
239+
<p class="form-control-static"><?php echo $description_rounding_adjustment ?></p>
240+
</div>
241+
</div>
242+
</fieldset>
228243
</div>
229244
</div>
230245
</div>

upload/catalog/language/english/payment/wallee.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@
1212
$_['error_not_pending'] = 'Transaction exists and is not in state pending.';
1313
$_['error_confirmation'] = 'The transaction could not be confirmed. Please check to see if any payment has been made from your account, and retry if no charge has taken place.';
1414

15+
$_['rounding_adjustment_item_name'] = 'Rounding Adjustment';
16+
1517
// Order overview / download buttons
1618
$_['button_invoice'] = 'Invoice';
1719
$_['button_packing_slip'] = 'Packing slip';
@@ -27,4 +29,4 @@
2729
$_['message_webhook_voided'] = 'Transaction has been voided via webhook.';
2830

2931
$_['message_webhook_manual'] = 'A manual decision about whether to accept the payment is required.';
30-
$_['message_refund_successful'] = 'The refund \'%s\' over amount %s was successful.';
32+
$_['message_refund_successful'] = 'The refund \'%s\' over amount %s was successful.';

upload/system/library/wallee/dynamic/catalog/model.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ public function getMethod($address, $total){
4545
}
4646

4747
$available_methods = \Wallee\Service\Transaction::instance($this->registry)->getPaymentMethods($order_info);
48-
$configuration_id = substr($this->getCode(), \WalleeHelper::extractPaymentMethodId($this->getCode()));
48+
$configuration_id = \WalleeHelper::extractPaymentMethodId($this->getCode());
4949

5050
foreach ($available_methods as $method) {
5151
if ($method->getId() == $configuration_id) {

0 commit comments

Comments
 (0)