forked from Adyen/adyen-php-api-library
-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathRecurringApi.php
131 lines (120 loc) · 5.43 KB
/
RecurringApi.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
<?php
/**
* Adyen Recurring API
*
* The version of the OpenAPI document: 68
* Generated by: https://openapi-generator.tech
* OpenAPI Generator version: 6.0.1
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
namespace Adyen\Service;
use Adyen\AdyenException;
use Adyen\Client;
use Adyen\Service;
use Adyen\Model\Recurring\ObjectSerializer;
class RecurringApi extends Service
{
/**
* @var array|string|string[]
*/
private $baseURL;
/**
* RecurringApi constructor.
*
* @param \Adyen\Client $client
* @throws AdyenException
*/
public function __construct(Client $client)
{
parent::__construct($client);
// Create the baseUrl based on live/test and optional live-url-prefix
$this->baseURL = $this->createBaseUrl("https://pal-test.adyen.com/pal/servlet/Recurring/v68");
}
/**
* Create new permits linked to a recurring contract.
*
* @param \Adyen\Model\Recurring\CreatePermitRequest $createPermitRequest
* @param array|null $requestOptions
* @return \Adyen\Model\Recurring\CreatePermitResult
* @throws AdyenException
*/
public function createPermit(\Adyen\Model\Recurring\CreatePermitRequest $createPermitRequest, array $requestOptions = null): \Adyen\Model\Recurring\CreatePermitResult
{
$endpoint = $this->baseURL . "/createPermit";
$response = $this->requestHttp($endpoint, strtolower('POST'), (array) $createPermitRequest->jsonSerialize(), $requestOptions);
return ObjectSerializer::deserialize($response, \Adyen\Model\Recurring\CreatePermitResult::class);
}
/**
* Disable stored payment details
*
* @param \Adyen\Model\Recurring\DisableRequest $disableRequest
* @param array|null $requestOptions
* @return \Adyen\Model\Recurring\DisableResult
* @throws AdyenException
*/
public function disable(\Adyen\Model\Recurring\DisableRequest $disableRequest, array $requestOptions = null): \Adyen\Model\Recurring\DisableResult
{
$endpoint = $this->baseURL . "/disable";
$response = $this->requestHttp($endpoint, strtolower('POST'), (array) $disableRequest->jsonSerialize(), $requestOptions);
return ObjectSerializer::deserialize($response, \Adyen\Model\Recurring\DisableResult::class);
}
/**
* Disable an existing permit.
*
* @param \Adyen\Model\Recurring\DisablePermitRequest $disablePermitRequest
* @param array|null $requestOptions
* @return \Adyen\Model\Recurring\DisablePermitResult
* @throws AdyenException
*/
public function disablePermit(\Adyen\Model\Recurring\DisablePermitRequest $disablePermitRequest, array $requestOptions = null): \Adyen\Model\Recurring\DisablePermitResult
{
$endpoint = $this->baseURL . "/disablePermit";
$response = $this->requestHttp($endpoint, strtolower('POST'), (array) $disablePermitRequest->jsonSerialize(), $requestOptions);
return ObjectSerializer::deserialize($response, \Adyen\Model\Recurring\DisablePermitResult::class);
}
/**
* Get stored payment details
*
* @param \Adyen\Model\Recurring\RecurringDetailsRequest $recurringDetailsRequest
* @param array|null $requestOptions
* @return \Adyen\Model\Recurring\RecurringDetailsResult
* @throws AdyenException
*/
public function listRecurringDetails(\Adyen\Model\Recurring\RecurringDetailsRequest $recurringDetailsRequest, array $requestOptions = null): \Adyen\Model\Recurring\RecurringDetailsResult
{
$endpoint = $this->baseURL . "/listRecurringDetails";
$response = $this->requestHttp($endpoint, strtolower('POST'), (array) $recurringDetailsRequest->jsonSerialize(), $requestOptions);
return ObjectSerializer::deserialize($response, \Adyen\Model\Recurring\RecurringDetailsResult::class);
}
/**
* Ask issuer to notify the shopper
*
* @param \Adyen\Model\Recurring\NotifyShopperRequest $notifyShopperRequest
* @param array|null $requestOptions
* @return \Adyen\Model\Recurring\NotifyShopperResult
* @throws AdyenException
*/
public function notifyShopper(\Adyen\Model\Recurring\NotifyShopperRequest $notifyShopperRequest, array $requestOptions = null): \Adyen\Model\Recurring\NotifyShopperResult
{
$endpoint = $this->baseURL . "/notifyShopper";
$response = $this->requestHttp($endpoint, strtolower('POST'), (array) $notifyShopperRequest->jsonSerialize(), $requestOptions);
return ObjectSerializer::deserialize($response, \Adyen\Model\Recurring\NotifyShopperResult::class);
}
/**
* Schedule running the Account Updater
*
* @param \Adyen\Model\Recurring\ScheduleAccountUpdaterRequest $scheduleAccountUpdaterRequest
* @param array|null $requestOptions
* @return \Adyen\Model\Recurring\ScheduleAccountUpdaterResult
* @throws AdyenException
*/
public function scheduleAccountUpdater(\Adyen\Model\Recurring\ScheduleAccountUpdaterRequest $scheduleAccountUpdaterRequest, array $requestOptions = null): \Adyen\Model\Recurring\ScheduleAccountUpdaterResult
{
$endpoint = $this->baseURL . "/scheduleAccountUpdater";
$response = $this->requestHttp($endpoint, strtolower('POST'), (array) $scheduleAccountUpdaterRequest->jsonSerialize(), $requestOptions);
return ObjectSerializer::deserialize($response, \Adyen\Model\Recurring\ScheduleAccountUpdaterResult::class);
}
}