From 4789228f3188404530056665cb80b5242efbc896 Mon Sep 17 00:00:00 2001 From: Tam Date: Thu, 3 Feb 2022 16:55:45 +0000 Subject: [PATCH] Use line item price rather than purchasable Fixes #27 --- CHANGELOG.md | 4 ++++ composer.json | 2 +- src/services/StripeService.php | 2 +- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e52c305..01c8a2b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,7 @@ +## 1.0.9.2 - 2022-02-03 +### Fixed +- Use line item price rather than purchasable (Fixes #27) + ## 1.0.9 - 2021-10-13 ### Added - Add support for Guzzle 7 diff --git a/composer.json b/composer.json index 29070d9..81f41dc 100644 --- a/composer.json +++ b/composer.json @@ -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.9.1", + "version": "1.0.9.2", "type": "craft-plugin", "keywords": [ "payments", diff --git a/src/services/StripeService.php b/src/services/StripeService.php index 1577589..a80de9e 100644 --- a/src/services/StripeService.php +++ b/src/services/StripeService.php @@ -154,7 +154,7 @@ public function orderToPaymentRequest (Order $order, $includeItems = false) foreach ($order->lineItems as $item) { - $amount = round($item->purchasable->salePrice * $item->qty * 100); + $amount = round($item->salePrice * $item->qty * 100); $items[] = [ 'id' => $item->purchasableId,