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

Commit d19a3e0

Browse files
committed
Release 1.0.21
1 parent ab64bf5 commit d19a3e0

File tree

7 files changed

+57
-12
lines changed

7 files changed

+57
-12
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.20/docs/en/documentation.html)
14+
* [English](https://plugin-documentation.wallee.com/wallee-payment/opencart-2.0/1.0.21/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.20/LICENSE) for more information.
18+
Please see the [license file](https://github.com/wallee-payment/opencart-2.0/blob/1.0.21/LICENSE) for more information.

docs/en/documentation.html

Lines changed: 36 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.20/">
24+
<a href="https://github.com/wallee-payment/opencart-2.0/releases/tag/1.0.21/">
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.20/">Download</a> the extension.</p>
51+
<p><a href="https://github.com/wallee-payment/opencart-2.0/releases/tag/1.0.21/">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>
@@ -157,6 +157,40 @@ <h2>
157157
<div class="content">
158158
<img src="resource/state_graph.svg" alt="state graph"/>
159159
</div>
160+
</div><div class="olist glossary">
161+
<ol class="glossary">
162+
<li>
163+
<p>When the transaction is marked as <code>authorized</code> in wallee the order within OpenCart will be marked as <code>Processed</code>. The amount is only reserved at this point. The order is not yet ready to be fulfilled.</p>
164+
</li>
165+
<li>
166+
<p>When the transaction fails during the authorization process the OpenCart order is marked as <code>Failed</code>.</p>
167+
</li>
168+
<li>
169+
<p>In case the delivery indication is pending, the order within OpenCart will move into <code>Processing</code> (in thise case you have to decide the outcome of the delivery indication e.g. You have configured to manually check transactions without 3d Secure). In such situations a manual task is created and an alert appears in the wallee &amp; OpenCart backends. You can then resolve the manual task within the wallee backend. This changes the transaction status, which is transmitted back to OpenCart. See more details in <a href="#_on_hold_orders">On hold orders</a>.</p>
170+
</li>
171+
<li>
172+
<p>In case the decision about the fulfillment is negative, the order within OpenCart will be marked as <code>Declined</code> and should not be fulfilled.</p>
173+
</li>
174+
<li>
175+
<p>If you decide to void an authorized transaction (in case for example the products ordered are no longer in stock), the order within OpenCart will be marked as <code>Voided</code>.</p>
176+
</li>
177+
<li>
178+
<p>When the transaction is marked in wallee as <code>fulfill</code> the order within OpenCart will be be marked as <code>Complete</code>. This is when you can start the fulfillment process. The plugin will in this case not change the status anymore.</p>
179+
</li>
180+
</ol>
181+
</div><div class="admonitionblock note">
182+
<table>
183+
<tr>
184+
<td class="icon">
185+
<div class="title">Note</div>
186+
</td>
187+
<td class="content">
188+
This describes the default state machine of OpenCart orders, however you have the option in the wallee plugin configuration to define different order status.
189+
</td>
190+
</tr>
191+
</table>
192+
</div><div class="paragraph">
193+
<p>For information about deferred completion, see <a href="#_complete_capture_an_order">Complete (capture) an order</a></p>
160194
</div> </div>
161195
</div> </div>
162196
</div> <div class="chapter" id="_transaction_management">

docs/en/resource/state_graph.svg

Lines changed: 1 addition & 1 deletion
Loading

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,9 @@ public function index(){
99
return '';
1010
}
1111
$this->load->language('payment/wallee');
12+
$data = array();
1213

13-
$data['configuration_id'] = substr($this->getCode(), strlen('wallee_'));
14+
$data['configuration_id'] = \WalleeHelper::extractPaymentMethodId($this->getCode());
1415

1516
$data['button_confirm'] = $this->language->get('button_confirm');
1617
$data['text_loading'] = $this->language->get('text_loading');

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(), strlen('wallee_'));
48+
$configuration_id = substr($this->getCode(), \WalleeHelper::extractPaymentMethodId($this->getCode()));
4949

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

upload/system/library/wallee/helper.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -648,6 +648,10 @@ public static function instance(Registry $registry){
648648
}
649649
return self::$instance;
650650
}
651+
652+
public static function extractPaymentMethodId($code) {
653+
return substr($code, strlen('wallee_'));
654+
}
651655

652656
public static function exceptionErrorHandler($severity, $message, $file, $line){
653657
if (!(error_reporting() & $severity)) {

upload/system/library/wallee/service/transaction.php

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -44,10 +44,17 @@ public function getJavascriptUrl(){
4444
}
4545

4646
public function getPaymentPageUrl(\Wallee\Sdk\Model\Transaction $transaction, $paymentCode){
47-
$paymentMethodId = substr($paymentCode, strlen('wallee_'));
47+
$paymentMethodId = \WalleeHelper::extractPaymentMethodId($paymentCode);
4848
return $this->getTransactionService()->buildPaymentPageUrl($transaction->getLinkedSpaceId(), $transaction->getId()) .
4949
'&paymentMethodConfigurationId=' . $paymentMethodId;
5050
}
51+
52+
protected function getAllowedPaymentMethodConfigurations(array $order_info) {
53+
if(isset($order_info['payment_method']) && isset($order_info['payment_method']['code'])){
54+
return array(\WalleeHelper::extractPaymentMethodId($order_info['payment_method']['code']));
55+
}
56+
return null;
57+
}
5158

5259
public function update(array $order_info, $confirm = false){
5360
$last = null;
@@ -156,11 +163,9 @@ public function getTransaction($order_info = array(), $cache = true, $allowed_st
156163
}
157164

158165
private function persist($transaction, array $order_info){
159-
$id = null;
160166
if (isset($order_info['order_id'])) {
161-
$id = $order_info['order_id']; // Todo test
167+
$this->updateTransactionInfo($transaction, $order_info['order_id']);
162168
}
163-
$this->updateTransactionInfo($transaction, $id);
164169
$this->storeTransactionIdsInSession($transaction);
165170
$this->storeShipping($transaction);
166171
}
@@ -219,7 +224,8 @@ private function assembleTransaction(\Wallee\Sdk\Model\AbstractTransactionPendin
219224

220225
$transaction->setLineItems(LineItem::instance($this->registry)->getItemsFromSession());
221226
$transaction->setSuccessUrl(\WalleeHelper::instance($this->registry)->getSuccessUrl());
222-
227+
$transaction->setAllowedPaymentMethodConfigurations($this->getAllowedPaymentMethodConfigurations($order_info));
228+
223229
if ($order_id) {
224230
$transaction->setMerchantReference($order_id);
225231
$transaction->setFailedUrl(\WalleeHelper::instance($this->registry)->getFailedUrl($order_id));

0 commit comments

Comments
 (0)