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

Commit

Permalink
Release 1.0.49
Browse files Browse the repository at this point in the history
  • Loading branch information
edgaraswallee committed Aug 11, 2022
1 parent 9bf2af9 commit d0a869d
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 11 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@ This repository contains the OpenCart wallee payment module that enables the sh

## Documentation

* [English](https://plugin-documentation.wallee.com/wallee-payment/opencart-2.1/1.0.46/docs/en/documentation.html)
* [English](https://plugin-documentation.wallee.com/wallee-payment/opencart-2.1/1.0.49/docs/en/documentation.html)

## Support

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

## License

Please see the [license file](https://github.com/wallee-payment/opencart-2.1/blob/1.0.46/LICENSE) for more information.
Please see the [license file](https://github.com/wallee-payment/opencart-2.1/blob/1.0.49/LICENSE) for more information.
4 changes: 2 additions & 2 deletions docs/en/documentation.html
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ <h2>Documentation</h2> </div>
</a>
</li>
<li>
<a href="https://github.com/wallee-payment/opencart-2.1/releases/tag/1.0.46/">
<a href="https://github.com/wallee-payment/opencart-2.1/releases/tag/1.0.49/">
Source
</a>
</li>
Expand All @@ -49,7 +49,7 @@ <h1>
<div class="olist arabic">
<ol class="arabic">
<li>
<p><a href="https://github.com/wallee-payment/opencart-2.1/releases/tag/1.0.46/">Download</a> the extension.</p>
<p><a href="https://github.com/wallee-payment/opencart-2.1/releases/tag/1.0.49/">Download</a> the extension.</p>
</li>
<li>
<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>
Expand Down
4 changes: 2 additions & 2 deletions upload/admin/view/template/payment/wallee.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -257,14 +257,14 @@
<div class="form-group">
<label class="col-sm-2 control-label"><?php echo $entry_version; ?></label>
<div class="col-sm-10">
<p class="form-control-static">1.0.46</p>
<p class="form-control-static">1.0.49</p>
</div>
</div>

<div class="form-group">
<label class="col-sm-2 control-label"><?php echo $entry_date; ?></label>
<div class="col-sm-10">
<p class="form-control-static">2022/07/22 11:44:56</p>
<p class="form-control-static">2022/08/11 13:03:33</p>
</div>
</div>
</fieldset>
Expand Down
21 changes: 16 additions & 5 deletions upload/system/library/wallee/webhook/transaction.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,21 @@ protected function getTransactionId($transaction){

protected function processOrderRelatedInner(array $order_info, $transaction){
/* @var \Wallee\Sdk\Model\Transaction $transaction */
$transaction_info = \Wallee\Entity\TransactionInfo::loadByOrderId($this->registry, $order_info['order_id']);
$transactionInfo = \Wallee\Entity\TransactionInfo::loadByOrderId($this->registry, $order_info['order_id']);

$finalStates = [
\Wallee\Sdk\Model\TransactionState::FAILED,
\Wallee\Sdk\Model\TransactionState::VOIDED,
\Wallee\Sdk\Model\TransactionState::DECLINE,
\Wallee\Sdk\Model\TransactionState::FULFILL
];

\WalleeHelper::instance($this->registry)->ensurePaymentCode($order_info, $transaction);
if ($transaction->getState() != $transaction_info->getState()) {

$transactionInfoState = strtoupper($transactionInfo->getState());
if (!in_array($transactionInfoState, $finalStates)) {
\Wallee\Service\Transaction::instance($this->registry)->updateTransactionInfo($transaction, $order_info['order_id']);

switch ($transaction->getState()) {
case \Wallee\Sdk\Model\TransactionState::CONFIRMED:
$this->processing($transaction, $order_info);
Expand All @@ -49,7 +61,8 @@ protected function processOrderRelatedInner(array $order_info, $transaction){
$this->failed($transaction, $order_info);
break;
case \Wallee\Sdk\Model\TransactionState::FULFILL:
if ($transaction_info->getState() != 'AUTHORIZED' && $transaction_info->getState() != 'COMPLETED') {

if (!in_array($transactionInfoState, ['AUTHORIZED', 'COMPLETED'])) {
$this->authorize($transaction, $order_info);
}
$this->fulfill($transaction, $order_info);
Expand All @@ -65,8 +78,6 @@ protected function processOrderRelatedInner(array $order_info, $transaction){
break;
}
}

\Wallee\Service\Transaction::instance($this->registry)->updateTransactionInfo($transaction, $order_info['order_id']);
}

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

0 comments on commit d0a869d

Please sign in to comment.