1: <?php
2: /*
3: * This file was automatically generated.
4: */
5: namespace Worldline\Acquiring\Sdk\V1\Acquirer\Merchant\Accountverifications;
6:
7: use Worldline\Acquiring\Sdk\ApiResource;
8: use Worldline\Acquiring\Sdk\CallContext;
9: use Worldline\Acquiring\Sdk\Communication\ErrorResponseException;
10: use Worldline\Acquiring\Sdk\Communication\InvalidResponseException;
11: use Worldline\Acquiring\Sdk\Communication\ResponseClassMap;
12: use Worldline\Acquiring\Sdk\V1\ApiException;
13: use Worldline\Acquiring\Sdk\V1\AuthorizationException;
14: use Worldline\Acquiring\Sdk\V1\Domain\ApiAccountVerificationRequest;
15: use Worldline\Acquiring\Sdk\V1\Domain\ApiAccountVerificationResponse;
16: use Worldline\Acquiring\Sdk\V1\ExceptionFactory;
17: use Worldline\Acquiring\Sdk\V1\PlatformException;
18: use Worldline\Acquiring\Sdk\V1\ReferenceException;
19: use Worldline\Acquiring\Sdk\V1\ValidationException;
20:
21: /**
22: * AccountVerifications client.
23: */
24: class AccountVerificationsClient extends ApiResource
25: {
26: /** @var ExceptionFactory|null */
27: private $responseExceptionFactory = null;
28:
29: /**
30: * Resource /processing/v1/{acquirerId}/{merchantId}/account-verifications - Verify account
31: *
32: * @param ApiAccountVerificationRequest $body
33: * @param CallContext|null $callContext
34: * @return ApiAccountVerificationResponse
35: *
36: * @throws ValidationException
37: * @throws AuthorizationException
38: * @throws ReferenceException
39: * @throws PlatformException
40: * @throws ApiException
41: * @throws InvalidResponseException
42: * @link https://docs.acquiring.worldline-solutions.com/api-reference#tag/Account-Verifications/operation/processAccountVerification Verify account
43: */
44: public function processAccountVerification(ApiAccountVerificationRequest $body, CallContext $callContext = null)
45: {
46: $responseClassMap = new ResponseClassMap();
47: $responseClassMap->defaultSuccessResponseClassName = '\Worldline\Acquiring\Sdk\V1\Domain\ApiAccountVerificationResponse';
48: $responseClassMap->defaultErrorResponseClassName = '\Worldline\Acquiring\Sdk\V1\Domain\ApiPaymentErrorResponse';
49: try {
50: return $this->getCommunicator()->post(
51: $responseClassMap,
52: $this->instantiateUri('/processing/v1/{acquirerId}/{merchantId}/account-verifications'),
53: $body,
54: null,
55: $callContext
56: );
57: } catch (ErrorResponseException $e) {
58: throw $this->getResponseExceptionFactory()->createException(
59: $e->getHttpStatusCode(),
60: $e->getErrorResponse(),
61: $callContext
62: );
63: }
64: }
65:
66: /** @return ExceptionFactory */
67: private function getResponseExceptionFactory()
68: {
69: if (is_null($this->responseExceptionFactory)) {
70: $this->responseExceptionFactory = new ExceptionFactory();
71: }
72: return $this->responseExceptionFactory;
73: }
74: }
75: