D7net
Home
Console
Upload
information
Create File
Create Folder
About
Tools
:
/
home
/
tattooscyy
/
test
/
app
/
Libs
/
OnlinePayments
/
Sdk
/
Merchant
/
Products
/
Filename :
ProductsClient.php
back
Copy
<?php /* * This file was automatically generated. */ namespace App\Libs\OnlinePayments\Sdk\Merchant\Products; use App\Libs\OnlinePayments\Sdk\Domain\GetPaymentProductsResponse; use App\Libs\OnlinePayments\Sdk\Domain\PaymentProduct; use App\Libs\OnlinePayments\Sdk\Domain\PaymentProductNetworksResponse; use App\Libs\OnlinePayments\Sdk\Domain\ProductDirectory; use App\Libs\OnlinePayments\Sdk\ExceptionFactory; use App\Libs\Sdk\ApiResource; use App\Libs\Sdk\CallContext; use App\Libs\Sdk\Communication\ErrorResponseException; use App\Libs\Sdk\Communication\ResponseClassMap; /** * Products client. */ class ProductsClient extends ApiResource implements ProductsClientInterface { /** @var ExceptionFactory|null */ private ?ExceptionFactory $responseExceptionFactory = null; /** * @inheritdoc */ public function getPaymentProducts(GetPaymentProductsParams $query, ?CallContext $callContext = null): GetPaymentProductsResponse { $responseClassMap = new ResponseClassMap(); $responseClassMap->defaultSuccessResponseClassName = '\App\Libs\OnlinePayments\Sdk\Domain\GetPaymentProductsResponse'; $responseClassMap->defaultErrorResponseClassName = '\App\Libs\OnlinePayments\Sdk\Domain\ErrorResponse'; try { return $this->getCommunicator()->get( $responseClassMap, $this->instantiateUri('/v2/{merchantId}/products'), $this->getClientMetaInfo(), $query, $callContext ); } catch (ErrorResponseException $e) { throw $this->getResponseExceptionFactory()->createException( $e->getHttpStatusCode(), $e->getErrorResponse(), $callContext ); } } /** * @inheritdoc */ public function getPaymentProduct(int $paymentProductId, GetPaymentProductParams $query, ?CallContext $callContext = null): PaymentProduct { $this->context['paymentProductId'] = $paymentProductId; $responseClassMap = new ResponseClassMap(); $responseClassMap->defaultSuccessResponseClassName = '\App\Libs\OnlinePayments\Sdk\Domain\PaymentProduct'; $responseClassMap->defaultErrorResponseClassName = '\App\Libs\OnlinePayments\Sdk\Domain\ErrorResponse'; try { return $this->getCommunicator()->get( $responseClassMap, $this->instantiateUri('/v2/{merchantId}/products/{paymentProductId}'), $this->getClientMetaInfo(), $query, $callContext ); } catch (ErrorResponseException $e) { throw $this->getResponseExceptionFactory()->createException( $e->getHttpStatusCode(), $e->getErrorResponse(), $callContext ); } } /** * @inheritdoc */ public function getPaymentProductNetworks(int $paymentProductId, GetPaymentProductNetworksParams $query, ?CallContext $callContext = null): PaymentProductNetworksResponse { $this->context['paymentProductId'] = $paymentProductId; $responseClassMap = new ResponseClassMap(); $responseClassMap->defaultSuccessResponseClassName = '\App\Libs\OnlinePayments\Sdk\Domain\PaymentProductNetworksResponse'; $responseClassMap->defaultErrorResponseClassName = '\App\Libs\OnlinePayments\Sdk\Domain\ErrorResponse'; try { return $this->getCommunicator()->get( $responseClassMap, $this->instantiateUri('/v2/{merchantId}/products/{paymentProductId}/networks'), $this->getClientMetaInfo(), $query, $callContext ); } catch (ErrorResponseException $e) { throw $this->getResponseExceptionFactory()->createException( $e->getHttpStatusCode(), $e->getErrorResponse(), $callContext ); } } /** * @inheritdoc */ public function getProductDirectory(int $paymentProductId, GetProductDirectoryParams $query, ?CallContext $callContext = null): ProductDirectory { $this->context['paymentProductId'] = $paymentProductId; $responseClassMap = new ResponseClassMap(); $responseClassMap->defaultSuccessResponseClassName = '\App\Libs\OnlinePayments\Sdk\Domain\ProductDirectory'; $responseClassMap->defaultErrorResponseClassName = '\App\Libs\OnlinePayments\Sdk\Domain\ErrorResponse'; try { return $this->getCommunicator()->get( $responseClassMap, $this->instantiateUri('/v2/{merchantId}/products/{paymentProductId}/directory'), $this->getClientMetaInfo(), $query, $callContext ); } catch (ErrorResponseException $e) { throw $this->getResponseExceptionFactory()->createException( $e->getHttpStatusCode(), $e->getErrorResponse(), $callContext ); } } /** @return ExceptionFactory */ private function getResponseExceptionFactory(): ExceptionFactory { if (is_null($this->responseExceptionFactory)) { $this->responseExceptionFactory = new ExceptionFactory(); } return $this->responseExceptionFactory; } }