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

Commit a49a4a1

Browse files
committed
Release 1.0.48
1 parent f6c99ed commit a49a4a1

File tree

4 files changed

+22
-11
lines changed

4 files changed

+22
-11
lines changed

README.md

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

1414
## Documentation
1515

16-
* [English](https://plugin-documentation.wallee.com/wallee-payment/opencart-2.0/1.0.47/docs/en/documentation.html)
16+
* [English](https://plugin-documentation.wallee.com/wallee-payment/opencart-2.0/1.0.48/docs/en/documentation.html)
1717

1818
## Support
1919

2020
Support queries can be issued on the [wallee support site](https://app-wallee.com/space/select?target=/support).
2121

2222
## License
2323

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

docs/en/documentation.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ <h2>Documentation</h2> </div>
2222
</a>
2323
</li>
2424
<li>
25-
<a href="https://github.com/wallee-payment/opencart-2.0/releases/tag/1.0.47/">
25+
<a href="https://github.com/wallee-payment/opencart-2.0/releases/tag/1.0.48/">
2626
Source
2727
</a>
2828
</li>
@@ -49,7 +49,7 @@ <h1>
4949
<div class="olist arabic">
5050
<ol class="arabic">
5151
<li>
52-
<p><a href="https://github.com/wallee-payment/opencart-2.0/releases/tag/1.0.47/">Download</a> the extension.</p>
52+
<p><a href="https://github.com/wallee-payment/opencart-2.0/releases/tag/1.0.48/">Download</a> the extension.</p>
5353
</li>
5454
<li>
5555
<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/view/template/payment/wallee.tpl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -257,14 +257,14 @@
257257
<div class="form-group">
258258
<label class="col-sm-2 control-label"><?php echo $entry_version; ?></label>
259259
<div class="col-sm-10">
260-
<p class="form-control-static">1.0.47</p>
260+
<p class="form-control-static">1.0.48</p>
261261
</div>
262262
</div>
263263

264264
<div class="form-group">
265265
<label class="col-sm-2 control-label"><?php echo $entry_date; ?></label>
266266
<div class="col-sm-10">
267-
<p class="form-control-static">2022/07/22 11:44:13</p>
267+
<p class="form-control-static">2022/08/11 12:58:30</p>
268268
</div>
269269
</div>
270270
</fieldset>

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

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,21 @@ protected function getTransactionId($transaction){
2929

3030
protected function processOrderRelatedInner(array $order_info, $transaction){
3131
/* @var \Wallee\Sdk\Model\Transaction $transaction */
32-
$transaction_info = \Wallee\Entity\TransactionInfo::loadByOrderId($this->registry, $order_info['order_id']);
32+
$transactionInfo = \Wallee\Entity\TransactionInfo::loadByOrderId($this->registry, $order_info['order_id']);
33+
34+
$finalStates = [
35+
\Wallee\Sdk\Model\TransactionState::FAILED,
36+
\Wallee\Sdk\Model\TransactionState::VOIDED,
37+
\Wallee\Sdk\Model\TransactionState::DECLINE,
38+
\Wallee\Sdk\Model\TransactionState::FULFILL
39+
];
40+
3341
\WalleeHelper::instance($this->registry)->ensurePaymentCode($order_info, $transaction);
34-
if ($transaction->getState() != $transaction_info->getState()) {
42+
43+
$transactionInfoState = strtoupper($transactionInfo->getState());
44+
if (!in_array($transactionInfoState, $finalStates)) {
45+
\Wallee\Service\Transaction::instance($this->registry)->updateTransactionInfo($transaction, $order_info['order_id']);
46+
3547
switch ($transaction->getState()) {
3648
case \Wallee\Sdk\Model\TransactionState::CONFIRMED:
3749
$this->processing($transaction, $order_info);
@@ -49,7 +61,8 @@ protected function processOrderRelatedInner(array $order_info, $transaction){
4961
$this->failed($transaction, $order_info);
5062
break;
5163
case \Wallee\Sdk\Model\TransactionState::FULFILL:
52-
if ($transaction_info->getState() != 'AUTHORIZED' && $transaction_info->getState() != 'COMPLETED') {
64+
65+
if (!in_array($transactionInfoState, ['AUTHORIZED', 'COMPLETED'])) {
5366
$this->authorize($transaction, $order_info);
5467
}
5568
$this->fulfill($transaction, $order_info);
@@ -65,8 +78,6 @@ protected function processOrderRelatedInner(array $order_info, $transaction){
6578
break;
6679
}
6780
}
68-
69-
\Wallee\Service\Transaction::instance($this->registry)->updateTransactionInfo($transaction, $order_info['order_id']);
7081
}
7182

7283
protected function processing(\Wallee\Sdk\Model\Transaction $transaction, array $order_info){

0 commit comments

Comments
 (0)