Skip to content

Commit

Permalink
Release 1.0.21
Browse files Browse the repository at this point in the history
  • Loading branch information
edgaraswallee committed Apr 11, 2024
1 parent 87329b6 commit 9e29f5b
Show file tree
Hide file tree
Showing 4 changed files with 44 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,11 @@ private function confirmTransaction(Transaction $transaction, string $orderId, S
$lineItems[] = $discountLineItem;
}

$giftCouponLineItem = $this->getGiftVoucherLineItem();
if ($giftCouponLineItem) {
$lineItems[] = $giftCouponLineItem;
}

$pendingTransaction = new TransactionPending();
$pendingTransaction->setId($transaction->getId());
$pendingTransaction->setVersion($transaction->getVersion());
Expand Down Expand Up @@ -239,6 +244,39 @@ private function getDiscountLineItem(): ?LineItemCreate
return null;
}

/**
* @return LineItemCreate|null
*/
private function getGiftVoucherLineItem(): ?LineItemCreate
{
$orderTotals = $GLOBALS['order_totals'] ?? null;
if (empty($orderTotals)) {
return null;
}

$customerCredit = null;
foreach ($orderTotals as $orderItem) {
if ($orderItem['code'] === 'ot_gv') {
$customerCredit = $orderItem;
break;
}
}

if ($customerCredit) {
$amount = $customerCredit['value'];
$lineItem = new LineItemCreate();
$lineItem->setName('Gift Voucher');
$lineItem->setUniqueId('gift-voucher-' . $amount);
$lineItem->setSku('gift-voucher-' . $amount);
$lineItem->setQuantity(1);
$lineItem->setAmountIncludingTax(-1 * $amount);
$lineItem->setType(LineItemType::DISCOUNT);
return $lineItem;
}

return null;
}

/**
* @return string
*/
Expand Down
4 changes: 2 additions & 2 deletions GXModules/Wallee/WalleePayment/vendor/composer/installed.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
'name' => '__root__',
'pretty_version' => 'dev-master',
'version' => 'dev-master',
'reference' => '14dae8e010e392080b50e5974e115007a7c04f62',
'reference' => 'd4d0d2c742a57567a20711446e559752cecfb0b9',
'type' => 'library',
'install_path' => __DIR__ . '/../../',
'aliases' => array(),
Expand All @@ -13,7 +13,7 @@
'__root__' => array(
'pretty_version' => 'dev-master',
'version' => 'dev-master',
'reference' => '14dae8e010e392080b50e5974e115007a7c04f62',
'reference' => 'd4d0d2c742a57567a20711446e559752cecfb0b9',
'type' => 'library',
'install_path' => __DIR__ . '/../../',
'aliases' => array(),
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ account dashboard.

## Documentation

[Documentation](https://plugin-documentation.wallee.com/wallee-payment/gambio-4/1.0.20/docs/en/documentation.html)
[Documentation](https://plugin-documentation.wallee.com/wallee-payment/gambio-4/1.0.21/docs/en/documentation.html)

## License

Expand Down
5 changes: 3 additions & 2 deletions docs/en/documentation.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
<meta name="keywords" value="Wallee, Gambio, Gambio Plugin, Payment, Payment Integration, Documentation"><meta name="description" value="The documentation for the Gambio plugin that enables processing payments with wallee."> <link rel="canonical" href="https://plugin-documentation.wallee.com/wallee-payment/gambio-4/master/wallee/docs/en/documentation.html" />
<meta name="keywords" value="Wallee, Gambio, Gambio Plugin, Payment, Payment Integration, Documentation"><meta name="description" value="The documentation for the Gambio plugin that enables processing payments with wallee.">
<link rel="canonical" href="https://plugin-documentation.wallee.com/wallee-payment/gambio-4/master/wallee/docs/en/documentation.html" />
<title>Wallee Gambio Documentation</title>
<link href="assets/monokai-sublime.css" rel="stylesheet" />
<link href="assets/base.css" rel="stylesheet" />
Expand All @@ -22,7 +23,7 @@ <h2>Documentation</h2> </div>
</a>
</li>
<li>
<a href="https://github.com/wallee-payment/gambio-4/releases/tag/1.0.20/">
<a href="https://github.com/wallee-payment/gambio-4/releases/tag/1.0.21/">
Source
</a>
</li>
Expand Down

0 comments on commit 9e29f5b

Please sign in to comment.