From b3d3da5d240efcb13ec58f07a6efbc3182064270 Mon Sep 17 00:00:00 2001 From: Guillaume Ferrand Date: Thu, 23 Mar 2023 10:38:25 +0100 Subject: [PATCH 1/2] add Checkout amountUpdates --- src/Adyen/Service/Checkout.php | 6 ++++ .../ResourceModel/Checkout/AmountUpdates.php | 31 +++++++++++++++++++ 2 files changed, 37 insertions(+) create mode 100644 src/Adyen/Service/ResourceModel/Checkout/AmountUpdates.php diff --git a/src/Adyen/Service/Checkout.php b/src/Adyen/Service/Checkout.php index 0adc9b7d1..415c5d506 100644 --- a/src/Adyen/Service/Checkout.php +++ b/src/Adyen/Service/Checkout.php @@ -84,6 +84,11 @@ class Checkout extends \Adyen\ApiKeyAuthenticatedService */ protected $technicalCancels; + /** + * @var ResourceModel\Checkout\AmountUpdates + */ + protected $amountUpdates; + /** * Checkout constructor. * @@ -109,6 +114,7 @@ public function __construct(\Adyen\Client $client) $this->captures = new \Adyen\Service\ResourceModel\Checkout\Captures($this); $this->cancels = new \Adyen\Service\ResourceModel\Checkout\Cancels($this); $this->technicalCancels = new \Adyen\Service\ResourceModel\Checkout\TechnicalCancels($this); + $this->amountUpdates = new \Adyen\Service\ResourceModel\Checkout\AmountUpdates($this); } /** diff --git a/src/Adyen/Service/ResourceModel/Checkout/AmountUpdates.php b/src/Adyen/Service/ResourceModel/Checkout/AmountUpdates.php new file mode 100644 index 000000000..5a2303a13 --- /dev/null +++ b/src/Adyen/Service/ResourceModel/Checkout/AmountUpdates.php @@ -0,0 +1,31 @@ +endpoint = $this->getCheckoutEndpoint($service) . + '/' . $service->getClient()->getApiCheckoutVersion() . '/payments/{paymentPspReference}/amountUpdates'; + parent::__construct($service, $this->endpoint, $this->allowApplicationInfo); + } +} From 293afe487e435941758ecc85fd2155ab7dffd33b Mon Sep 17 00:00:00 2001 From: Guillaume Ferrand Date: Thu, 23 Mar 2023 11:41:26 +0100 Subject: [PATCH 2/2] missing method --- src/Adyen/Service/Checkout.php | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/Adyen/Service/Checkout.php b/src/Adyen/Service/Checkout.php index 415c5d506..097e2a534 100644 --- a/src/Adyen/Service/Checkout.php +++ b/src/Adyen/Service/Checkout.php @@ -294,4 +294,15 @@ public function technicalCancels($params, $requestOptions = null) { return $this->technicalCancels->request($params, $requestOptions); } + + /** + * @param array $params + * @param array|null $requestOptions + * @return mixed + * @throws \Adyen\AdyenException + */ + public function amountUpdates($params, $requestOptions = null) + { + return $this->amountUpdates->request($params, $requestOptions); + } }