Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add Checkout amountUpdates #488

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions src/Adyen/Service/Checkout.php
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,9 @@ class Checkout extends \Adyen\ApiKeyAuthenticatedService
protected $technicalCancels;

/**
* @var ResourceModel\Checkout\AmountUpdates
*/
protected $amountUpdates;
* @var ResourceModel\Checkout\Recurring
*/
protected $recurring;
Expand Down Expand Up @@ -125,6 +128,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);
$this->recurring = new Recurring($this, null);
}

Expand Down Expand Up @@ -346,6 +350,17 @@ public function technicalCancels($params, $requestOptions = null)
* @return mixed
* @throws \Adyen\AdyenException
*/
public function amountUpdates($params, $requestOptions = null)
{
return $this->amountUpdates->request($params, $requestOptions);
}

/**
* @param array $params
* @param array|null $requestOptions
* @return mixed
* @throws \Adyen\AdyenException
*/
public function getStoredPaymentMethods(array $queryParams = [])
{
return $this->recurring->retrieve($queryParams);
Expand Down
31 changes: 31 additions & 0 deletions src/Adyen/Service/ResourceModel/Checkout/AmountUpdates.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
<?php

namespace Adyen\Service\ResourceModel\Checkout;

class AmountUpdates extends \Adyen\Service\AbstractCheckoutResource
{
/**
* @var string
*/
protected $endpoint;

/**
* Include applicationInfo key in the request parameters
*
* @var bool
*/
protected $allowApplicationInfo = false;

/**
* Payments constructor.
*
* @param \Adyen\Service $service
* @throws \Adyen\AdyenException
*/
public function __construct($service)
{
$this->endpoint = $this->getCheckoutEndpoint($service) .
'/' . $service->getClient()->getApiCheckoutVersion() . '/payments/{paymentPspReference}/amountUpdates';
parent::__construct($service, $this->endpoint, $this->allowApplicationInfo);
}
}
Loading