-
Notifications
You must be signed in to change notification settings - Fork 101
/
PaymentsApi.php
116 lines (106 loc) · 4.58 KB
/
PaymentsApi.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
<?php
/**
* Adyen Payment API
*
* The version of the OpenAPI document: 68
* Generated by: https://openapi-generator.tech
* OpenAPI Generator version: 6.4.0
*
* 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\Payments;
use Adyen\AdyenException;
use Adyen\Client;
use Adyen\Service;
use Adyen\Model\Payments\ObjectSerializer;
class PaymentsApi extends Service
{
/**
* @var array|string|string[]
*/
private $baseURL;
/**
* PaymentsApi 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/Payment/v68");
}
/**
* Create an authorisation
*
* @param \Adyen\Model\Payments\PaymentRequest $paymentRequest
* @param array|null $requestOptions
* @return \Adyen\Model\Payments\PaymentResult
* @throws AdyenException
*/
public function authorise(\Adyen\Model\Payments\PaymentRequest $paymentRequest, array $requestOptions = null): \Adyen\Model\Payments\PaymentResult
{
$endpoint = $this->baseURL . "/authorise";
$response = $this->requestHttp($endpoint, strtolower('POST'), (array) $paymentRequest->jsonSerialize(), $requestOptions);
return ObjectSerializer::deserialize($response, \Adyen\Model\Payments\PaymentResult::class);
}
/**
* Complete a 3DS authorisation
*
* @param \Adyen\Model\Payments\PaymentRequest3d $paymentRequest3d
* @param array|null $requestOptions
* @return \Adyen\Model\Payments\PaymentResult
* @throws AdyenException
*/
public function authorise3d(\Adyen\Model\Payments\PaymentRequest3d $paymentRequest3d, array $requestOptions = null): \Adyen\Model\Payments\PaymentResult
{
$endpoint = $this->baseURL . "/authorise3d";
$response = $this->requestHttp($endpoint, strtolower('POST'), (array) $paymentRequest3d->jsonSerialize(), $requestOptions);
return ObjectSerializer::deserialize($response, \Adyen\Model\Payments\PaymentResult::class);
}
/**
* Complete a 3DS2 authorisation
*
* @param \Adyen\Model\Payments\PaymentRequest3ds2 $paymentRequest3ds2
* @param array|null $requestOptions
* @return \Adyen\Model\Payments\PaymentResult
* @throws AdyenException
*/
public function authorise3ds2(\Adyen\Model\Payments\PaymentRequest3ds2 $paymentRequest3ds2, array $requestOptions = null): \Adyen\Model\Payments\PaymentResult
{
$endpoint = $this->baseURL . "/authorise3ds2";
$response = $this->requestHttp($endpoint, strtolower('POST'), (array) $paymentRequest3ds2->jsonSerialize(), $requestOptions);
return ObjectSerializer::deserialize($response, \Adyen\Model\Payments\PaymentResult::class);
}
/**
* Get the 3DS authentication result
*
* @param \Adyen\Model\Payments\AuthenticationResultRequest $authenticationResultRequest
* @param array|null $requestOptions
* @return \Adyen\Model\Payments\AuthenticationResultResponse
* @throws AdyenException
*/
public function getAuthenticationResult(\Adyen\Model\Payments\AuthenticationResultRequest $authenticationResultRequest, array $requestOptions = null): \Adyen\Model\Payments\AuthenticationResultResponse
{
$endpoint = $this->baseURL . "/getAuthenticationResult";
$response = $this->requestHttp($endpoint, strtolower('POST'), (array) $authenticationResultRequest->jsonSerialize(), $requestOptions);
return ObjectSerializer::deserialize($response, \Adyen\Model\Payments\AuthenticationResultResponse::class);
}
/**
* Get the 3DS2 authentication result
*
* @param \Adyen\Model\Payments\ThreeDS2ResultRequest $threeDS2ResultRequest
* @param array|null $requestOptions
* @return \Adyen\Model\Payments\ThreeDS2ResultResponse
* @throws AdyenException
*/
public function retrieve3ds2Result(\Adyen\Model\Payments\ThreeDS2ResultRequest $threeDS2ResultRequest, array $requestOptions = null): \Adyen\Model\Payments\ThreeDS2ResultResponse
{
$endpoint = $this->baseURL . "/retrieve3ds2Result";
$response = $this->requestHttp($endpoint, strtolower('POST'), (array) $threeDS2ResultRequest->jsonSerialize(), $requestOptions);
return ObjectSerializer::deserialize($response, \Adyen\Model\Payments\ThreeDS2ResultResponse::class);
}
}