Skip to content

Commit

Permalink
Fix included tax being added to total
Browse files Browse the repository at this point in the history
Fixes #6
  • Loading branch information
Tam committed Feb 27, 2020
1 parent 366039e commit 20daa3c
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 9 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 1.0.4 - 2020-02-27
### Fixed
- Fix included tax being added to total (Fixes #6)

## 1.0.3 - 2019-08-23
### Added
- Add `reload` function to button JS object (Closes #3)
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "ether/web-payments",
"description": "Use the Web Payments API and Google / Apply Pay to vastly improve your checkout process!",
"version": "1.0.3",
"version": "1.0.4",
"type": "craft-plugin",
"keywords": [
"payments",
Expand Down
17 changes: 9 additions & 8 deletions src/services/StripeService.php
Original file line number Diff line number Diff line change
Expand Up @@ -170,16 +170,17 @@ public function orderToPaymentRequest (Order $order, $includeItems = false)
}

foreach ($order->adjustments as $adjustment)
{
$amount = $adjustment->amount * 100;
if (!$adjustment->included)
{
$amount = $adjustment->amount * 100;

$displayItems[] = [
'label' => $adjustment->name,
'amount' => $amount,
];
$displayItems[] = [
'label' => $adjustment->name,
'amount' => $amount,
];

$total += $amount;
}
$total += $amount;
}

$ret = [
'id' => $order->id,
Expand Down

0 comments on commit 20daa3c

Please sign in to comment.