Repository navigation
Expand file tree
/
Copy pathClassicCheckoutSDKApi.php
More file actions
71 lines (64 loc) · 2.47 KB
/
Copy pathClassicCheckoutSDKApi.php
File metadata and controls
71 lines (64 loc) · 2.47 KB
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
<?php
/**
* Adyen Checkout API
*
* The version of the OpenAPI document: 70
* 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\Checkout;
use Adyen\AdyenException;
use Adyen\Client;
use Adyen\Service;
use Adyen\Model\Checkout\ObjectSerializer;
class ClassicCheckoutSDKApi extends Service
{
/**
* @var array|string|string[]
*/
private $baseURL;
/**
* ClassicCheckoutSDKApi 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://checkout-test.adyen.com/v70");
}
/**
* Create a payment session
*
* @param \Adyen\Model\Checkout\PaymentSetupRequest $paymentSetupRequest
* @param array|null $requestOptions
* @return \Adyen\Model\Checkout\PaymentSetupResponse
* @throws AdyenException
*/
public function paymentSession(\Adyen\Model\Checkout\PaymentSetupRequest $paymentSetupRequest, array $requestOptions = null): \Adyen\Model\Checkout\PaymentSetupResponse
{
$endpoint = $this->baseURL . "/paymentSession";
$response = $this->requestHttp($endpoint, strtolower('POST'), (array) $paymentSetupRequest->jsonSerialize(), $requestOptions);
return ObjectSerializer::deserialize($response, \Adyen\Model\Checkout\PaymentSetupResponse::class);
}
/**
* Verify a payment result
*
* @param \Adyen\Model\Checkout\PaymentVerificationRequest $paymentVerificationRequest
* @param array|null $requestOptions
* @return \Adyen\Model\Checkout\PaymentVerificationResponse
* @throws AdyenException
*/
public function verifyPaymentResult(\Adyen\Model\Checkout\PaymentVerificationRequest $paymentVerificationRequest, array $requestOptions = null): \Adyen\Model\Checkout\PaymentVerificationResponse
{
$endpoint = $this->baseURL . "/payments/result";
$response = $this->requestHttp($endpoint, strtolower('POST'), (array) $paymentVerificationRequest->jsonSerialize(), $requestOptions);
return ObjectSerializer::deserialize($response, \Adyen\Model\Checkout\PaymentVerificationResponse::class);
}
}