forked from Adyen/adyen-php-api-library
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathTermsOfServiceApi.php
104 lines (95 loc) · 4.6 KB
/
TermsOfServiceApi.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
<?php
/**
* Legal Entity Management API
*
* The version of the OpenAPI document: 3
* 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\LegalEntityManagement;
use Adyen\AdyenException;
use Adyen\Client;
use Adyen\Service;
use Adyen\Model\LegalEntityManagement\ObjectSerializer;
class TermsOfServiceApi extends Service
{
/**
* @var array|string|string[]
*/
private $baseURL;
/**
* TermsOfServiceApi 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://kyc-test.adyen.com/lem/v3");
}
/**
* Accept Terms of Service
*
* @param string $id
* @param string $termsofservicedocumentid
* @param \Adyen\Model\LegalEntityManagement\AcceptTermsOfServiceRequest $acceptTermsOfServiceRequest
* @param array|null $requestOptions
* @return \Adyen\Model\LegalEntityManagement\AcceptTermsOfServiceResponse
* @throws AdyenException
*/
public function acceptTermsOfService(string $id, string $termsofservicedocumentid, \Adyen\Model\LegalEntityManagement\AcceptTermsOfServiceRequest $acceptTermsOfServiceRequest, array $requestOptions = null): \Adyen\Model\LegalEntityManagement\AcceptTermsOfServiceResponse
{
$endpoint = $this->baseURL . str_replace(['{id}', '{termsofservicedocumentid}'], [$id, $termsofservicedocumentid], "/legalEntities/{id}/termsOfService/{termsofservicedocumentid}");
$response = $this->requestHttp($endpoint, strtolower('PATCH'), (array) $acceptTermsOfServiceRequest->jsonSerialize(), $requestOptions);
return ObjectSerializer::deserialize($response, \Adyen\Model\LegalEntityManagement\AcceptTermsOfServiceResponse::class);
}
/**
* Get Terms of Service document
*
* @param string $id
* @param \Adyen\Model\LegalEntityManagement\GetTermsOfServiceDocumentRequest $getTermsOfServiceDocumentRequest
* @param array|null $requestOptions
* @return \Adyen\Model\LegalEntityManagement\GetTermsOfServiceDocumentResponse
* @throws AdyenException
*/
public function getTermsOfServiceDocument(string $id, \Adyen\Model\LegalEntityManagement\GetTermsOfServiceDocumentRequest $getTermsOfServiceDocumentRequest, array $requestOptions = null): \Adyen\Model\LegalEntityManagement\GetTermsOfServiceDocumentResponse
{
$endpoint = $this->baseURL . str_replace(['{id}'], [$id], "/legalEntities/{id}/termsOfService");
$response = $this->requestHttp($endpoint, strtolower('POST'), (array) $getTermsOfServiceDocumentRequest->jsonSerialize(), $requestOptions);
return ObjectSerializer::deserialize($response, \Adyen\Model\LegalEntityManagement\GetTermsOfServiceDocumentResponse::class);
}
/**
* Get Terms of Service information for a legal entity
*
* @param string $id
* @param array|null $requestOptions
* @return \Adyen\Model\LegalEntityManagement\GetTermsOfServiceAcceptanceInfosResponse
* @throws AdyenException
*/
public function getTermsOfServiceInformationForLegalEntity(string $id, array $requestOptions = null): \Adyen\Model\LegalEntityManagement\GetTermsOfServiceAcceptanceInfosResponse
{
$endpoint = $this->baseURL . str_replace(['{id}'], [$id], "/legalEntities/{id}/termsOfServiceAcceptanceInfos");
$response = $this->requestHttp($endpoint, strtolower('GET'), null, $requestOptions);
return ObjectSerializer::deserialize($response, \Adyen\Model\LegalEntityManagement\GetTermsOfServiceAcceptanceInfosResponse::class);
}
/**
* Get Terms of Service status
*
* @param string $id
* @param array|null $requestOptions
* @return \Adyen\Model\LegalEntityManagement\CalculateTermsOfServiceStatusResponse
* @throws AdyenException
*/
public function getTermsOfServiceStatus(string $id, array $requestOptions = null): \Adyen\Model\LegalEntityManagement\CalculateTermsOfServiceStatusResponse
{
$endpoint = $this->baseURL . str_replace(['{id}'], [$id], "/legalEntities/{id}/termsOfServiceStatus");
$response = $this->requestHttp($endpoint, strtolower('GET'), null, $requestOptions);
return ObjectSerializer::deserialize($response, \Adyen\Model\LegalEntityManagement\CalculateTermsOfServiceStatusResponse::class);
}
}