1
0

Beta Release 0.5.0 (#3)

* Automated commit message

* Automated commit message

* Automated commit message

* Automated commit message

---------

Co-authored-by: PayPalServerSDKs <server-sdks@paypal.com>
This commit is contained in:
Dani Kirby
2024-09-09 12:10:34 -05:00
committed by GitHub
parent c9cb1ad04a
commit 6b43a4225b
732 changed files with 73569 additions and 1 deletions

114
src/ApiHelper.php Normal file
View File

@@ -0,0 +1,114 @@
<?php
declare(strict_types=1);
/*
* PaypalServerSDKLib
*
* This file was automatically generated by APIMATIC v3.0 ( https://www.apimatic.io ).
*/
namespace PaypalServerSDKLib;
use Core\Utils\CoreHelper;
use Core\Utils\JsonHelper;
use InvalidArgumentException;
use stdClass;
/**
* API utility class.
*/
class ApiHelper
{
/**
* @var JsonHelper
*/
private static $jsonHelper;
public static function getJsonHelper(): JsonHelper
{
if (self::$jsonHelper == null) {
self::$jsonHelper = new JsonHelper([], [], null, 'PaypalServerSDKLib\\Models');
}
return self::$jsonHelper;
}
/**
* Serialize any given mixed value.
*
* @param mixed $value Any value to be serialized
*
* @return string|null serialized value
*/
public static function serialize($value): ?string
{
return CoreHelper::serialize($value);
}
/**
* Deserialize a Json string.
*
* @param string $json A valid Json string
*
* @return mixed Decoded Json
*/
public static function deserialize(string $json)
{
return CoreHelper::deserialize($json);
}
/**
* Decodes a valid json string into an array to send in Api calls.
*
* @param mixed $json Must be null or array or a valid string json to be translated into a php array.
* @param string $name Name of the argument whose value is being validated in $json parameter.
* @param bool $associative Should check for associative? Default: true.
*
* @return array|null Returns an array made up of key-value pairs in the provided json string
* or throws exception, if the provided json is not valid.
* @throws InvalidArgumentException
*/
public static function decodeJson($json, string $name, bool $associative = true): ?array
{
if (is_null($json) || (is_array($json) && (!$associative || CoreHelper::isAssociative($json)))) {
return $json;
}
if ($json instanceof stdClass) {
$json = json_encode($json);
}
if (is_string($json)) {
$decoded = json_decode($json, true);
if (is_array($decoded) && (!$associative || CoreHelper::isAssociative($decoded))) {
return $decoded;
}
}
throw new InvalidArgumentException("Invalid json value for argument: '$name'");
}
/**
* Decodes a valid jsonArray string into an array to send in Api calls.
*
* @param mixed $json Must be null or array or a valid string jsonArray to be translated into a php array.
* @param string $name Name of the argument whose value is being validated in $json parameter.
* @param bool $asMap Should decode as map? Default: false.
*
* @return array|null Returns an array made up of key-value pairs in the provided jsonArray string
* or throws exception, if the provided json is not valid.
* @throws InvalidArgumentException
*/
public static function decodeJsonArray($json, string $name, bool $asMap = false): ?array
{
$decoded = self::decodeJson($json, $name, false);
if (is_null($decoded)) {
return null;
}
$isAssociative = CoreHelper::isAssociative($decoded);
if (($asMap && $isAssociative) || (!$asMap && !$isAssociative)) {
return array_map(function ($v) use ($name) {
return self::decodeJson($v, $name);
}, $decoded);
}
$type = $asMap ? 'map' : 'array';
throw new InvalidArgumentException("Invalid json $type value for argument: '$name'");
}
}

View File

@@ -0,0 +1,127 @@
<?php
declare(strict_types=1);
/*
* PaypalServerSDKLib
*
* This file was automatically generated by APIMATIC v3.0 ( https://www.apimatic.io ).
*/
namespace PaypalServerSDKLib\Authentication;
use Core\Utils\CoreHelper;
use PaypalServerSDKLib\Models\OAuthToken;
/**
* Utility class for initializing ClientCredentialsAuth security credentials.
*/
class ClientCredentialsAuthCredentialsBuilder
{
/**
* @var array
*/
private $config;
private function __construct(array $config)
{
$this->config = $config;
}
/**
* Initializer for ClientCredentialsAuthCredentialsBuilder
*
* @param string $oAuthClientId
* @param string $oAuthClientSecret
*/
public static function init(string $oAuthClientId, string $oAuthClientSecret): self
{
return new self(['oAuthClientId' => $oAuthClientId, 'oAuthClientSecret' => $oAuthClientSecret]);
}
/**
* Setter for OAuthClientId.
*
* @param string $oAuthClientId
*
* @return $this
*/
public function oAuthClientId(string $oAuthClientId): self
{
$this->config['oAuthClientId'] = $oAuthClientId;
return $this;
}
/**
* Setter for OAuthClientSecret.
*
* @param string $oAuthClientSecret
*
* @return $this
*/
public function oAuthClientSecret(string $oAuthClientSecret): self
{
$this->config['oAuthClientSecret'] = $oAuthClientSecret;
return $this;
}
/**
* Setter for OAuthToken.
*
* @param OAuthToken|null $oAuthToken
*
* @return $this
*/
public function oAuthToken(?OAuthToken $oAuthToken): self
{
$this->config['oAuthToken'] = $oAuthToken;
return $this;
}
/**
* Setter for clock skew time in seconds applied while checking the OAuth Token expiry.
*
* @param int $oAuthClockSkew
*
* @return $this
*/
public function oAuthClockSkew(int $oAuthClockSkew): self
{
$this->config['Oauth2-ClockSkew'] = $oAuthClockSkew;
return $this;
}
/**
* Setter for the OAuthTokenProvider callable with 2 arguments. Arg1 will be the last OAuthToken
* instance, while Arg2 will be an instance of ClientCredentialsAuthManager. The return type of
* callable should be an instance of OAuthToken model.
*
* @param callable(OAuthToken, ClientCredentialsAuthManager): OAuthToken $oAuthTokenProvider
*
* @return $this
*/
public function oAuthTokenProvider(callable $oAuthTokenProvider): self
{
$this->config['Oauth2-TokenProvider'] = $oAuthTokenProvider;
return $this;
}
/**
* Setter for the OAuthOnTokenUpdate callable with the updated OAuthToken instance as the only argument.
* Here the return type of callable should be void
*
* @param callable(OAuthToken): void $oAuthOnTokenUpdate
*
* @return $this
*/
public function oAuthOnTokenUpdate(callable $oAuthOnTokenUpdate): self
{
$this->config['Oauth2-OnTokenUpdate'] = $oAuthOnTokenUpdate;
return $this;
}
public function getConfiguration(): array
{
return CoreHelper::clone($this->config);
}
}

View File

@@ -0,0 +1,206 @@
<?php
declare(strict_types=1);
/*
* PaypalServerSDKLib
*
* This file was automatically generated by APIMATIC v3.0 ( https://www.apimatic.io ).
*/
namespace PaypalServerSDKLib\Authentication;
use Closure;
use Exception;
use CoreInterfaces\Core\Request\TypeValidatorInterface;
use Core\Authentication\CoreAuth;
use Core\Client;
use Core\Request\Parameters\HeaderParam;
use Core\Utils\CoreHelper;
use InvalidArgumentException;
use PaypalServerSDKLib\Models\OAuthToken;
use PaypalServerSDKLib\Controllers\OAuthAuthorizationController;
use PaypalServerSDKLib\ConfigurationDefaults;
use PaypalServerSDKLib\ClientCredentialsAuth;
/**
* Utility class for OAuth 2 authorization and token management
*/
class ClientCredentialsAuthManager extends CoreAuth implements ClientCredentialsAuth
{
/**
* Singleton instance of OAuth 2 API controller
* @var OAuthAuthorizationController
*/
private $oAuthApi;
/**
* @var array
*/
private $config;
/**
* @var OAuthToken|null
*/
private $internalOAuthToken;
public function __construct(array $config)
{
parent::__construct();
$this->config = $config;
$this->internalOAuthToken = $this->getOAuthToken();
}
public function setClient(Client $client): void
{
$this->oAuthApi = new OAuthAuthorizationController($client);
}
/**
* String value for oAuthClientId.
*/
public function getOAuthClientId(): string
{
return $this->config['oAuthClientId'] ?? ConfigurationDefaults::O_AUTH_CLIENT_ID;
}
/**
* String value for oAuthClientSecret.
*/
public function getOAuthClientSecret(): string
{
return $this->config['oAuthClientSecret'] ?? ConfigurationDefaults::O_AUTH_CLIENT_SECRET;
}
/**
* OAuthToken value for oAuthToken.
*/
public function getOAuthToken(): ?OAuthToken
{
$oAuthToken = $this->config['oAuthToken'];
if ($oAuthToken instanceof OAuthToken) {
return clone $oAuthToken;
}
return ConfigurationDefaults::O_AUTH_TOKEN;
}
/**
* Checks if provided credentials match with existing ones.
*
* @param string $oAuthClientId OAuth 2 Client ID
* @param string $oAuthClientSecret OAuth 2 Client Secret
*/
public function equals(string $oAuthClientId, string $oAuthClientSecret): bool
{
return $oAuthClientId == $this->getOAuthClientId() &&
$oAuthClientSecret == $this->getOAuthClientSecret();
}
/**
* Clock skew time in seconds applied while checking the OAuth Token expiry.
*/
public function getOAuthClockSkew(): int
{
return $this->config['Oauth2-ClockSkew'] ?? ConfigurationDefaults::OAUTH_2_CLOCK_SKEW;
}
/**
* Fetch the OAuth token.
* @param array|null $additionalParams Additional parameters to send during authorization
*/
public function fetchToken(?array $additionalParams = null): OAuthToken
{
//send request for access token
$oAuthToken = $this->oAuthApi->requestToken(
[
'authorization' => $this->buildBasicHeader(),
'scope' => null,
],
$additionalParams
)->getResult();
$this->addExpiryTime($oAuthToken);
return $oAuthToken;
}
/**
* Has the OAuth token expired? If the token argument is not provided then this function will check the expiry of
* the initial oauthToken, that's set in the client initialization.
*/
public function isTokenExpired(?OAuthToken $token = null): bool
{
$token = $token ?? $this->getOAuthToken();
if ($token == null || empty($token->getExpiry())) {
return true;
}
return $token->getExpiry() < time() + $this->getOAuthClockSkew();
}
private function getTokenFromProvider(): ?OAuthToken
{
if ($this->internalOAuthToken != null && !$this->isTokenExpired($this->internalOAuthToken)) {
return $this->internalOAuthToken;
}
$provider = $this->config['Oauth2-TokenProvider'];
if (is_callable($provider)) {
$token = Closure::fromCallable($provider)($this->internalOAuthToken, $this);
} else {
try {
$token = $this->fetchToken();
} catch (Exception $exp) {
return $this->internalOAuthToken;
}
}
$updateCallback = $this->config['Oauth2-OnTokenUpdate'];
if (is_callable($updateCallback)) {
Closure::fromCallable($updateCallback)($token);
}
return $token;
}
/**
* Check if client is authorized, throws exceptions when token is null or expired.
*
* @throws InvalidArgumentException
*/
public function validate(TypeValidatorInterface $validator): void
{
$this->internalOAuthToken = $this->getTokenFromProvider();
if ($this->internalOAuthToken == null) {
throw new InvalidArgumentException('Client is not authorized. An OAuth token is needed to make API calls.');
}
if ($this->isTokenExpired($this->internalOAuthToken)) {
throw new InvalidArgumentException('OAuth token is expired. A valid token is needed to make API calls.');
}
parent::__construct(
HeaderParam::init(
'Authorization',
CoreHelper::getBearerAuthString($this->internalOAuthToken->getAccessToken())
)->requiredNonEmpty()
);
parent::validate($validator);
}
/**
* Build authorization header value for basic auth.
*/
private function buildBasicHeader(): string
{
return 'Basic ' . base64_encode(
$this->getOAuthClientId() . ':' . $this->getOAuthClientSecret()
);
}
/**
* Adds the expiry time to the given oAuthToken instance.
*/
private function addExpiryTime(OAuthToken $oAuthToken): void
{
$expiresIn = $oAuthToken->getExpiresIn();
if (empty($expiresIn)) {
return;
}
$oAuthToken->setExpiry(time() + $expiresIn);
}
}

View File

@@ -0,0 +1,55 @@
<?php
declare(strict_types=1);
/*
* PaypalServerSDKLib
*
* This file was automatically generated by APIMATIC v3.0 ( https://www.apimatic.io ).
*/
namespace PaypalServerSDKLib;
use PaypalServerSDKLib\Models\OAuthToken;
/**
* Interface for defining the behavior of Authentication.
*/
interface ClientCredentialsAuth
{
/**
* String value for oAuthClientId.
*/
public function getOAuthClientId(): string;
/**
* String value for oAuthClientSecret.
*/
public function getOAuthClientSecret(): string;
/**
* OAuthToken value for oAuthToken.
*/
public function getOAuthToken(): ?OAuthToken;
/**
* Checks if provided credentials match with existing ones.
*
* @param string $oAuthClientId OAuth 2 Client ID
* @param string $oAuthClientSecret OAuth 2 Client Secret
*/
public function equals(string $oAuthClientId, string $oAuthClientSecret): bool;
/**
* Fetch the OAuth token.
*
* @param array|null $additionalParams Additional parameters to be sent.
*/
public function fetchToken(?array $additionalParams = null): OAuthToken;
/**
* Has the OAuth token expired? If the token argument is not provided then this function will check the
* expiry of the initial oauthToken, that's set in the client initialization.
*/
public function isTokenExpired(?OAuthToken $token = null): bool;
}

View File

@@ -0,0 +1,97 @@
<?php
declare(strict_types=1);
/*
* PaypalServerSDKLib
*
* This file was automatically generated by APIMATIC v3.0 ( https://www.apimatic.io ).
*/
namespace PaypalServerSDKLib;
use Psr\Log\LogLevel;
/**
* Default values for the configuration parameters of the client.
*/
class ConfigurationDefaults
{
public const TIMEOUT = 0;
public const ENABLE_RETRIES = false;
public const NUMBER_OF_RETRIES = 0;
public const RETRY_INTERVAL = 1;
public const BACK_OFF_FACTOR = 2;
public const MAXIMUM_RETRY_WAIT_TIME = 0;
public const RETRY_ON_TIMEOUT = true;
public const HTTP_STATUS_CODES_TO_RETRY = [408, 413, 429, 500, 502, 503, 504, 521, 522, 524];
public const HTTP_METHODS_TO_RETRY = ['GET', 'PUT'];
public const ENVIRONMENT = Environment::SANDBOX;
public const O_AUTH_CLIENT_ID = '';
public const O_AUTH_CLIENT_SECRET = '';
public const O_AUTH_TOKEN = null;
public const OAUTH_2_CLOCK_SKEW = 0;
public const LOGGER_ALLOWED_LEVELS = [
LogLevel::EMERGENCY,
LogLevel::ALERT,
LogLevel::CRITICAL,
LogLevel::ERROR,
LogLevel::WARNING,
LogLevel::NOTICE,
LogLevel::INFO,
LogLevel::DEBUG
];
public const LOGGER_LEVEL = LogLevel::INFO;
public const LOGGER_MASK_SENSITIVE_HEADERS = true;
public const LOGGER_INCLUDE_QUERY_IN_PATH = false;
public const LOGGER_LOG_BODY = false;
public const LOGGER_LOG_HEADERS = false;
public const LOGGER_EXCLUDE_HEADERS = [];
public const LOGGER_INCLUDE_HEADERS = [];
public const LOGGER_UNMASK_HEADERS = [];
/**
* @var array Associative list of all default configurations
*/
public const _ALL = [
'timeout' => self::TIMEOUT,
'enableRetries' => self::ENABLE_RETRIES,
'numberOfRetries' => self::NUMBER_OF_RETRIES,
'retryInterval' => self::RETRY_INTERVAL,
'backOffFactor' => self::BACK_OFF_FACTOR,
'maximumRetryWaitTime' => self::MAXIMUM_RETRY_WAIT_TIME,
'retryOnTimeout' => self::RETRY_ON_TIMEOUT,
'httpStatusCodesToRetry' => self::HTTP_STATUS_CODES_TO_RETRY,
'httpMethodsToRetry' => self::HTTP_METHODS_TO_RETRY,
'environment' => self::ENVIRONMENT,
'oAuthClientId' => self::O_AUTH_CLIENT_ID,
'oAuthClientSecret' => self::O_AUTH_CLIENT_SECRET,
'oAuthToken' => self::O_AUTH_TOKEN,
'Oauth2-ClockSkew' => self::OAUTH_2_CLOCK_SKEW,
'Oauth2-TokenProvider' => null,
'Oauth2-OnTokenUpdate' => null,
'loggingConfiguration' => null
];
}

View File

@@ -0,0 +1,50 @@
<?php
declare(strict_types=1);
/*
* PaypalServerSDKLib
*
* This file was automatically generated by APIMATIC v3.0 ( https://www.apimatic.io ).
*/
namespace PaypalServerSDKLib;
use CoreInterfaces\Http\HttpConfigurations;
use PaypalServerSDKLib\Authentication\ClientCredentialsAuthCredentialsBuilder;
use PaypalServerSDKLib\Logging\LoggingConfigurationBuilder;
/**
* An interface for all configuration parameters required by the SDK.
*/
interface ConfigurationInterface extends HttpConfigurations
{
/**
* Get current API environment
*/
public function getEnvironment(): string;
/**
* Get the credentials to use with ClientCredentialsAuth
*/
public function getClientCredentialsAuth(): ClientCredentialsAuth;
/**
* Get the credentials builder instance to update credentials for ClientCredentialsAuth
*/
public function getClientCredentialsAuthCredentialsBuilder(): ?ClientCredentialsAuthCredentialsBuilder;
/**
* Represents the logging configurations for API calls.
*/
public function getLoggingConfigurationBuilder(): ?LoggingConfigurationBuilder;
/**
* Get the base uri for a given server in the current environment.
*
* @param string $server Server name
*
* @return string Base URI
*/
public function getBaseUri(string $server = Server::DEFAULT_): string;
}

View File

@@ -0,0 +1,52 @@
<?php
declare(strict_types=1);
/*
* PaypalServerSDKLib
*
* This file was automatically generated by APIMATIC v3.0 ( https://www.apimatic.io ).
*/
namespace PaypalServerSDKLib\Controllers;
use Core\ApiCall;
use Core\Client;
use Core\Request\RequestBuilder;
use Core\Response\ResponseHandler;
/**
* Base controller
*/
class BaseController
{
/**
* Client instance
*
* @var Client
*/
private $client;
public function __construct(Client $client)
{
$this->client = $client;
}
protected function execute(RequestBuilder $requestBuilder, ?ResponseHandler $responseHandler = null)
{
return (new ApiCall($this->client))
->requestBuilder($requestBuilder)
->responseHandler($responseHandler ?? $this->responseHandler())
->execute();
}
protected function requestBuilder(string $requestMethod, string $path): RequestBuilder
{
return new RequestBuilder($requestMethod, $path);
}
protected function responseHandler(): ResponseHandler
{
return $this->client->getGlobalResponseHandler();
}
}

View File

@@ -0,0 +1,60 @@
<?php
declare(strict_types=1);
/*
* PaypalServerSDKLib
*
* This file was automatically generated by APIMATIC v3.0 ( https://www.apimatic.io ).
*/
namespace PaypalServerSDKLib\Controllers;
use Core\Request\Parameters\AdditionalFormParams;
use Core\Request\Parameters\FormParam;
use Core\Request\Parameters\HeaderParam;
use Core\Response\Types\ErrorType;
use CoreInterfaces\Core\Request\RequestMethod;
use PaypalServerSDKLib\Exceptions\OAuthProviderException;
use PaypalServerSDKLib\Http\ApiResponse;
use PaypalServerSDKLib\Models\OAuthToken;
class OAuthAuthorizationController extends BaseController
{
/**
* Create a new OAuth 2 token.
*
* @param array $options Array with all options for search
* @param array|null $fieldParameters Additional optional form parameters are supported by this
* endpoint
*
* @return ApiResponse Response from the API call
*/
public function requestToken(array $options, array $fieldParameters = null): ApiResponse
{
$_reqBuilder = $this->requestBuilder(RequestMethod::POST, '/v1/oauth2/token')
->parameters(
FormParam::init('grant_type', 'client_credentials'),
HeaderParam::init('Authorization', $options)->extract('authorization'),
FormParam::init('scope', $options)->extract('scope'),
AdditionalFormParams::init($fieldParameters)
);
$_resHandler = $this->responseHandler()
->throwErrorOn(
'400',
ErrorType::init('OAuth 2 provider returned an error.', OAuthProviderException::class)
)
->throwErrorOn(
'401',
ErrorType::init(
'OAuth 2 provider says client authentication failed.',
OAuthProviderException::class
)
)
->type(OAuthToken::class)
->returnApiResponse();
return $this->execute($_reqBuilder, $_resHandler);
}
}

View File

@@ -0,0 +1,488 @@
<?php
declare(strict_types=1);
/*
* PaypalServerSDKLib
*
* This file was automatically generated by APIMATIC v3.0 ( https://www.apimatic.io ).
*/
namespace PaypalServerSDKLib\Controllers;
use Core\Request\Parameters\BodyParam;
use Core\Request\Parameters\HeaderParam;
use Core\Request\Parameters\QueryParam;
use Core\Request\Parameters\TemplateParam;
use Core\Response\Types\ErrorType;
use CoreInterfaces\Core\Request\RequestMethod;
use PaypalServerSDKLib\Exceptions\ErrorException;
use PaypalServerSDKLib\Http\ApiResponse;
use PaypalServerSDKLib\Models\Order;
use PaypalServerSDKLib\Models\OrderAuthorizeResponse;
class OrdersController extends BaseController
{
/**
* Creates an order. Merchants and partners can add Level 2 and 3 data to payments to reduce risk and
* payment processing costs. For more information about processing payments, see <a href="https:
* //developer.paypal.com/docs/checkout/advanced/processing/">checkout</a> or <a href="https:
* //developer.paypal.com/docs/multiparty/checkout/advanced/processing/">multiparty checkout</a>.
* <blockquote><strong>Note:</strong> For error handling and troubleshooting, see <a href="https:
* //developer.paypal.com/api/rest/reference/orders/v2/errors/#create-order">Orders v2 errors</a>.
* </blockquote>
*
* @param array $options Array with all options for search
*
* @return ApiResponse Response from the API call
*/
public function ordersCreate(array $options): ApiResponse
{
$_reqBuilder = $this->requestBuilder(RequestMethod::POST, '/v2/checkout/orders')
->auth('Oauth2')
->parameters(
HeaderParam::init('Content-Type', 'application/json'),
BodyParam::init($options)->extract('body'),
HeaderParam::init('PayPal-Request-Id', $options)->extract('payPalRequestId'),
HeaderParam::init('PayPal-Partner-Attribution-Id', $options)->extract('payPalPartnerAttributionId'),
HeaderParam::init('PayPal-Client-Metadata-Id', $options)->extract('payPalClientMetadataId'),
HeaderParam::init('Prefer', $options)->extract('prefer', 'return=minimal')
);
$_resHandler = $this->responseHandler()
->throwErrorOn(
'400',
ErrorType::init(
'Request is not well-formed, syntactically incorrect, or violates schema.',
ErrorException::class
)
)
->throwErrorOn(
'401',
ErrorType::init(
'Authentication failed due to missing authorization header, or invalid auth' .
'entication credentials.',
ErrorException::class
)
)
->throwErrorOn(
'422',
ErrorType::init(
'The requested action could not be performed, semantically incorrect, or fa' .
'iled business validation.',
ErrorException::class
)
)
->throwErrorOn('0', ErrorType::init('The error response.', ErrorException::class))
->type(Order::class)
->returnApiResponse();
return $this->execute($_reqBuilder, $_resHandler);
}
/**
* Shows details for an order, by ID.<blockquote><strong>Note:</strong> For error handling and
* troubleshooting, see <a href="https://developer.paypal.com/api/rest/reference/orders/v2/errors/#get-
* order">Orders v2 errors</a>.</blockquote>
*
* @param array $options Array with all options for search
*
* @return ApiResponse Response from the API call
*/
public function ordersGet(array $options): ApiResponse
{
$_reqBuilder = $this->requestBuilder(RequestMethod::GET, '/v2/checkout/orders/{id}')
->auth('Oauth2')
->parameters(
TemplateParam::init('id', $options)->extract('id'),
QueryParam::init('fields', $options)->extract('fields')
);
$_resHandler = $this->responseHandler()
->throwErrorOn(
'401',
ErrorType::init(
'Authentication failed due to missing authorization header, or invalid auth' .
'entication credentials.',
ErrorException::class
)
)
->throwErrorOn('404', ErrorType::init('The specified resource does not exist.', ErrorException::class))
->throwErrorOn('0', ErrorType::init('The error response.', ErrorException::class))
->type(Order::class)
->returnApiResponse();
return $this->execute($_reqBuilder, $_resHandler);
}
/**
* Updates an order with a `CREATED` or `APPROVED` status. You cannot update an order with the
* `COMPLETED` status.<br/><br/>To make an update, you must provide a `reference_id`. If you omit this
* value with an order that contains only one purchase unit, PayPal sets the value to `default` which
* enables you to use the path: <code>\"/purchase_units/@reference_id=='default'/{attribute-or-
* object}\"</code>. Merchants and partners can add Level 2 and 3 data to payments to reduce risk and
* payment processing costs. For more information about processing payments, see <a href="https:
* //developer.paypal.com/docs/checkout/advanced/processing/">checkout</a> or <a href="https:
* //developer.paypal.com/docs/multiparty/checkout/advanced/processing/">multiparty checkout</a>.
* <blockquote><strong>Note:</strong> For error handling and troubleshooting, see <a href="https:
* //developer.paypal.com/api/rest/reference/orders/v2/errors/#patch-order">Orders v2 errors</a>.
* </blockquote>Patchable attributes or objects:
* <br/><br/><table><thead><th>Attribute</th><th>Op</th><th>Notes</th></thead><tbody><tr><td><code>inte
* nt</code></td><td>replace</td><td></td></tr><tr><td><code>payer</code></td><td>replace,
* add</td><td>Using replace op for <code>payer</code> will replace the whole <code>payer</code> object
* with the value sent in request.</td></tr><tr><td><code>purchase_units</code></td><td>replace,
* add</td><td></td></tr><tr><td><code>purchase_units[].custom_id</code></td><td>replace, add,
* remove</td><td></td></tr><tr><td><code>purchase_units[].description</code></td><td>replace, add,
* remove</td><td></td></tr><tr><td><code>purchase_units[].payee.
* email</code></td><td>replace</td><td></td></tr><tr><td><code>purchase_units[].shipping.
* name</code></td><td>replace, add</td><td></td></tr><tr><td><code>purchase_units[].shipping.
* email_address</code></td><td>replace, add</td><td></td></tr><tr><td><code>purchase_units[].shipping.
* phone_number</code></td><td>replace, add</td><td></td></tr><tr><td><code>purchase_units[].shipping.
* options</code></td><td>replace, add</td><td></td></tr><tr><td><code>purchase_units[].shipping.
* address</code></td><td>replace, add</td><td></td></tr><tr><td><code>purchase_units[].shipping.
* type</code></td><td>replace, add</td><td></td></tr><tr><td><code>purchase_units[].
* soft_descriptor</code></td><td>replace, remove</td><td></td></tr><tr><td><code>purchase_units[].
* amount</code></td><td>replace</td><td></td></tr><tr><td><code>purchase_units[].
* items</code></td><td>replace, add, remove</td><td></td></tr><tr><td><code>purchase_units[].
* invoice_id</code></td><td>replace, add, remove</td><td></td></tr><tr><td><code>purchase_units[].
* payment_instruction</code></td><td>replace</td><td></td></tr><tr><td><code>purchase_units[].
* payment_instruction.disbursement_mode</code></td><td>replace</td><td>By default,
* <code>disbursement_mode</code> is <code>INSTANT</code>.</td></tr><tr><td><code>purchase_units[].
* payment_instruction.payee_receivable_fx_rate_id</code></td><td>replace, add,
* remove</td><td></td></tr><tr><td><code>purchase_units[].payment_instruction.
* platform_fees</code></td><td>replace, add, remove</td><td></td></tr><tr><td><code>purchase_units[].
* supplementary_data.airline</code></td><td>replace, add,
* remove</td><td></td></tr><tr><td><code>purchase_units[].supplementary_data.
* card</code></td><td>replace, add, remove</td><td></td></tr><tr><td><code>application_context.
* client_configuration</code></td><td>replace, add</td><td></td></tr></tbody></table>
*
* @param array $options Array with all options for search
*
* @return ApiResponse Response from the API call
*/
public function ordersPatch(array $options): ApiResponse
{
$_reqBuilder = $this->requestBuilder(RequestMethod::PATCH, '/v2/checkout/orders/{id}')
->auth('Oauth2')
->parameters(
TemplateParam::init('id', $options)->extract('id'),
HeaderParam::init('Content-Type', 'application/json'),
BodyParam::init($options)->extract('body')
);
$_resHandler = $this->responseHandler()
->throwErrorOn(
'400',
ErrorType::init(
'Request is not well-formed, syntactically incorrect, or violates schema.',
ErrorException::class
)
)
->throwErrorOn(
'401',
ErrorType::init(
'Authentication failed due to missing authorization header, or invalid auth' .
'entication credentials.',
ErrorException::class
)
)
->throwErrorOn('404', ErrorType::init('The specified resource does not exist.', ErrorException::class))
->throwErrorOn(
'422',
ErrorType::init(
'The requested action could not be performed, semantically incorrect, or fa' .
'iled business validation.',
ErrorException::class
)
)
->throwErrorOn('0', ErrorType::init('The error response.', ErrorException::class))
->returnApiResponse();
return $this->execute($_reqBuilder, $_resHandler);
}
/**
* Payer confirms their intent to pay for the the Order with the given payment source.
*
* @param array $options Array with all options for search
*
* @return ApiResponse Response from the API call
*/
public function ordersConfirm(array $options): ApiResponse
{
$_reqBuilder = $this->requestBuilder(
RequestMethod::POST,
'/v2/checkout/orders/{id}/confirm-payment-source'
)
->auth('Oauth2')
->parameters(
TemplateParam::init('id', $options)->extract('id'),
HeaderParam::init('Content-Type', 'application/json'),
HeaderParam::init('PayPal-Client-Metadata-Id', $options)->extract('payPalClientMetadataId'),
HeaderParam::init('Prefer', $options)->extract('prefer', 'return=minimal'),
BodyParam::init($options)->extract('body')
);
$_resHandler = $this->responseHandler()
->throwErrorOn(
'400',
ErrorType::init(
'Request is not well-formed, syntactically incorrect, or violates schema.',
ErrorException::class
)
)
->throwErrorOn(
'403',
ErrorType::init('Authorization failed due to insufficient permissions.', ErrorException::class)
)
->throwErrorOn(
'422',
ErrorType::init(
'The requested action could not be performed, semantically incorrect, or fa' .
'iled business validation.',
ErrorException::class
)
)
->throwErrorOn('500', ErrorType::init('An internal server error has occurred.', ErrorException::class))
->throwErrorOn('0', ErrorType::init('The error response.', ErrorException::class))
->type(Order::class)
->returnApiResponse();
return $this->execute($_reqBuilder, $_resHandler);
}
/**
* Authorizes payment for an order. To successfully authorize payment for an order, the buyer must
* first approve the order or a valid payment_source must be provided in the request. A buyer can
* approve the order upon being redirected to the rel:approve URL that was returned in the HATEOAS
* links in the create order response.<blockquote><strong>Note:</strong> For error handling and
* troubleshooting, see <a href="https://developer.paypal.
* com/api/rest/reference/orders/v2/errors/#authorize-order">Orders v2 errors</a>.</blockquote>
*
* @param array $options Array with all options for search
*
* @return ApiResponse Response from the API call
*/
public function ordersAuthorize(array $options): ApiResponse
{
$_reqBuilder = $this->requestBuilder(RequestMethod::POST, '/v2/checkout/orders/{id}/authorize')
->auth('Oauth2')
->parameters(
TemplateParam::init('id', $options)->extract('id'),
HeaderParam::init('Content-Type', 'application/json'),
HeaderParam::init('PayPal-Request-Id', $options)->extract('payPalRequestId'),
HeaderParam::init('Prefer', $options)->extract('prefer', 'return=minimal'),
HeaderParam::init('PayPal-Client-Metadata-Id', $options)->extract('payPalClientMetadataId'),
HeaderParam::init('PayPal-Auth-Assertion', $options)->extract('payPalAuthAssertion'),
BodyParam::init($options)->extract('body')
);
$_resHandler = $this->responseHandler()
->throwErrorOn(
'400',
ErrorType::init(
'Request is not well-formed, syntactically incorrect, or violates schema.',
ErrorException::class
)
)
->throwErrorOn(
'401',
ErrorType::init(
'Authentication failed due to missing authorization header, or invalid auth' .
'entication credentials.',
ErrorException::class
)
)
->throwErrorOn(
'403',
ErrorType::init(
'The authorized payment failed due to insufficient permissions.',
ErrorException::class
)
)
->throwErrorOn('404', ErrorType::init('The specified resource does not exist.', ErrorException::class))
->throwErrorOn(
'422',
ErrorType::init(
'The requested action could not be performed, semantically incorrect, or fa' .
'iled business validation.',
ErrorException::class
)
)
->throwErrorOn('500', ErrorType::init('An internal server error has occurred.', ErrorException::class))
->throwErrorOn('0', ErrorType::init('The error response.', ErrorException::class))
->type(OrderAuthorizeResponse::class)
->returnApiResponse();
return $this->execute($_reqBuilder, $_resHandler);
}
/**
* Captures payment for an order. To successfully capture payment for an order, the buyer must first
* approve the order or a valid payment_source must be provided in the request. A buyer can approve the
* order upon being redirected to the rel:approve URL that was returned in the HATEOAS links in the
* create order response.<blockquote><strong>Note:</strong> For error handling and troubleshooting, see
* <a href="https://developer.paypal.com/api/rest/reference/orders/v2/errors/#capture-order">Orders v2
* errors</a>.</blockquote>
*
* @param array $options Array with all options for search
*
* @return ApiResponse Response from the API call
*/
public function ordersCapture(array $options): ApiResponse
{
$_reqBuilder = $this->requestBuilder(RequestMethod::POST, '/v2/checkout/orders/{id}/capture')
->auth('Oauth2')
->parameters(
TemplateParam::init('id', $options)->extract('id'),
HeaderParam::init('Content-Type', 'application/json'),
HeaderParam::init('PayPal-Request-Id', $options)->extract('payPalRequestId'),
HeaderParam::init('Prefer', $options)->extract('prefer', 'return=minimal'),
HeaderParam::init('PayPal-Client-Metadata-Id', $options)->extract('payPalClientMetadataId'),
HeaderParam::init('PayPal-Auth-Assertion', $options)->extract('payPalAuthAssertion'),
BodyParam::init($options)->extract('body')
);
$_resHandler = $this->responseHandler()
->throwErrorOn(
'400',
ErrorType::init(
'Request is not well-formed, syntactically incorrect, or violates schema.',
ErrorException::class
)
)
->throwErrorOn(
'401',
ErrorType::init(
'Authentication failed due to missing authorization header, or invalid auth' .
'entication credentials.',
ErrorException::class
)
)
->throwErrorOn(
'403',
ErrorType::init(
'The authorized payment failed due to insufficient permissions.',
ErrorException::class
)
)
->throwErrorOn('404', ErrorType::init('The specified resource does not exist.', ErrorException::class))
->throwErrorOn(
'422',
ErrorType::init(
'The requested action could not be performed, semantically incorrect, or fa' .
'iled business validation.',
ErrorException::class
)
)
->throwErrorOn('500', ErrorType::init('An internal server error has occurred.', ErrorException::class))
->throwErrorOn('0', ErrorType::init('The error response.', ErrorException::class))
->type(Order::class)
->returnApiResponse();
return $this->execute($_reqBuilder, $_resHandler);
}
/**
* Adds tracking information for an Order.
*
* @param array $options Array with all options for search
*
* @return ApiResponse Response from the API call
*/
public function ordersTrackCreate(array $options): ApiResponse
{
$_reqBuilder = $this->requestBuilder(RequestMethod::POST, '/v2/checkout/orders/{id}/track')
->auth('Oauth2')
->parameters(
TemplateParam::init('id', $options)->extract('id'),
HeaderParam::init('Content-Type', 'application/json'),
BodyParam::init($options)->extract('body'),
HeaderParam::init('PayPal-Auth-Assertion', $options)->extract('payPalAuthAssertion')
);
$_resHandler = $this->responseHandler()
->throwErrorOn(
'400',
ErrorType::init(
'Request is not well-formed, syntactically incorrect, or violates schema.',
ErrorException::class
)
)
->throwErrorOn(
'403',
ErrorType::init('Authorization failed due to insufficient permissions.', ErrorException::class)
)
->throwErrorOn('404', ErrorType::init('The specified resource does not exist.', ErrorException::class))
->throwErrorOn(
'422',
ErrorType::init(
'The requested action could not be performed, semantically incorrect, or fa' .
'iled business validation.',
ErrorException::class
)
)
->throwErrorOn('500', ErrorType::init('An internal server error has occurred.', ErrorException::class))
->throwErrorOn('0', ErrorType::init('The error response.', ErrorException::class))
->type(Order::class)
->returnApiResponse();
return $this->execute($_reqBuilder, $_resHandler);
}
/**
* Updates or cancels the tracking information for a PayPal order, by ID. Updatable attributes or
* objects:
* <br/><br/><table><thead><th>Attribute</th><th>Op</th><th>Notes</th></thead><tbody></tr><tr><td><code
* >items</code></td><td>replace</td><td>Using replace op for <code>items</code> will replace the
* entire <code>items</code> object with the value sent in request.
* </td></tr><tr><td><code>notify_payer</code></td><td>replace,
* add</td><td></td></tr><tr><td><code>status</code></td><td>replace</td><td>Only patching status to
* CANCELLED is currently supported.</td></tr></tbody></table>
*
* @param array $options Array with all options for search
*
* @return ApiResponse Response from the API call
*/
public function ordersTrackersPatch(array $options): ApiResponse
{
$_reqBuilder = $this->requestBuilder(
RequestMethod::PATCH,
'/v2/checkout/orders/{id}/trackers/{tracker_id}'
)
->auth('Oauth2')
->parameters(
TemplateParam::init('id', $options)->extract('id'),
TemplateParam::init('tracker_id', $options)->extract('trackerId'),
HeaderParam::init('Content-Type', 'application/json'),
BodyParam::init($options)->extract('body')
);
$_resHandler = $this->responseHandler()
->throwErrorOn(
'400',
ErrorType::init(
'Request is not well-formed, syntactically incorrect, or violates schema.',
ErrorException::class
)
)
->throwErrorOn(
'403',
ErrorType::init('Authorization failed due to insufficient permissions.', ErrorException::class)
)
->throwErrorOn('404', ErrorType::init('The specified resource does not exist.', ErrorException::class))
->throwErrorOn(
'422',
ErrorType::init(
'The requested action could not be performed, semantically incorrect, or fa' .
'iled business validation.',
ErrorException::class
)
)
->throwErrorOn('500', ErrorType::init('An internal server error has occurred.', ErrorException::class))
->throwErrorOn('0', ErrorType::init('The error response.', ErrorException::class))
->returnApiResponse();
return $this->execute($_reqBuilder, $_resHandler);
}
}

View File

@@ -0,0 +1,442 @@
<?php
declare(strict_types=1);
/*
* PaypalServerSDKLib
*
* This file was automatically generated by APIMATIC v3.0 ( https://www.apimatic.io ).
*/
namespace PaypalServerSDKLib\Controllers;
use Core\Request\Parameters\BodyParam;
use Core\Request\Parameters\HeaderParam;
use Core\Request\Parameters\TemplateParam;
use Core\Response\Types\ErrorType;
use CoreInterfaces\Core\Request\RequestMethod;
use PaypalServerSDKLib\Exceptions\ErrorException;
use PaypalServerSDKLib\Http\ApiResponse;
use PaypalServerSDKLib\Models\CapturedPayment;
use PaypalServerSDKLib\Models\PaymentAuthorization;
use PaypalServerSDKLib\Models\Refund;
class PaymentsController extends BaseController
{
/**
* Shows details for an authorized payment, by ID.
*
* @param string $authorizationId The ID of the authorized payment for which to show details.
*
* @return ApiResponse Response from the API call
*/
public function authorizationsGet(string $authorizationId): ApiResponse
{
$_reqBuilder = $this->requestBuilder(RequestMethod::GET, '/v2/payments/authorizations/{authorization_id}')
->auth('Oauth2')
->parameters(TemplateParam::init('authorization_id', $authorizationId));
$_resHandler = $this->responseHandler()
->throwErrorOn(
'401',
ErrorType::init(
'Authentication failed due to missing authorization header, or invalid auth' .
'entication credentials.',
ErrorException::class
)
)
->throwErrorOn(
'403',
ErrorType::init(
'The request failed because the caller has insufficient permissions.',
ErrorException::class
)
)
->throwErrorOn(
'404',
ErrorType::init('The request failed because the resource does not exist.', ErrorException::class)
)
->throwErrorOn('500', ErrorType::init('The request failed because an internal server error occurred.'))
->throwErrorOn('0', ErrorType::init('The error response.', ErrorException::class))
->type(PaymentAuthorization::class)
->returnApiResponse();
return $this->execute($_reqBuilder, $_resHandler);
}
/**
* Captures an authorized payment, by ID.
*
* @param array $options Array with all options for search
*
* @return ApiResponse Response from the API call
*/
public function authorizationsCapture(array $options): ApiResponse
{
$_reqBuilder = $this->requestBuilder(
RequestMethod::POST,
'/v2/payments/authorizations/{authorization_id}/capture'
)
->auth('Oauth2')
->parameters(
TemplateParam::init('authorization_id', $options)->extract('authorizationId'),
HeaderParam::init('Content-Type', 'application/json'),
HeaderParam::init('PayPal-Request-Id', $options)->extract('payPalRequestId'),
HeaderParam::init('Prefer', $options)->extract('prefer', 'return=minimal'),
BodyParam::init($options)->extract('body')
);
$_resHandler = $this->responseHandler()
->throwErrorOn(
'400',
ErrorType::init(
'The request failed because it is not well-formed or is syntactically incor' .
'rect or violates schema.',
ErrorException::class
)
)
->throwErrorOn(
'401',
ErrorType::init(
'Authentication failed due to missing authorization header, or invalid auth' .
'entication credentials.',
ErrorException::class
)
)
->throwErrorOn(
'403',
ErrorType::init(
'The request failed because the caller has insufficient permissions.',
ErrorException::class
)
)
->throwErrorOn(
'404',
ErrorType::init('The request failed because the resource does not exist.', ErrorException::class)
)
->throwErrorOn(
'409',
ErrorType::init(
'The server has detected a conflict while processing this request.',
ErrorException::class
)
)
->throwErrorOn(
'422',
ErrorType::init(
'The request failed because it is semantically incorrect or failed business validation.',
ErrorException::class
)
)
->throwErrorOn('500', ErrorType::init('The request failed because an internal server error occurred.'))
->throwErrorOn('0', ErrorType::init('The error response.', ErrorException::class))
->type(CapturedPayment::class)
->returnApiResponse();
return $this->execute($_reqBuilder, $_resHandler);
}
/**
* Reauthorizes an authorized PayPal account payment, by ID. To ensure that funds are still available,
* reauthorize a payment after its initial three-day honor period expires. Within the 29-day
* authorization period, you can issue multiple re-authorizations after the honor period expires.
* <br/><br/>If 30 days have transpired since the date of the original authorization, you must create
* an authorized payment instead of reauthorizing the original authorized payment.<br/><br/>A
* reauthorized payment itself has a new honor period of three days.<br/><br/>You can reauthorize an
* authorized payment from 4 to 29 days after the 3-day honor period. The allowed amount depends on
* context and geography, for example in US it is up to 115% of the original authorized amount, not to
* exceed an increase of $75 USD.<br/><br/>Supports only the `amount` request parameter.
* <blockquote><strong>Note:</strong> This request is currently not supported for Partner use cases.
* </blockquote>
*
* @param array $options Array with all options for search
*
* @return ApiResponse Response from the API call
*/
public function authorizationsReauthorize(array $options): ApiResponse
{
$_reqBuilder = $this->requestBuilder(
RequestMethod::POST,
'/v2/payments/authorizations/{authorization_id}/reauthorize'
)
->auth('Oauth2')
->parameters(
TemplateParam::init('authorization_id', $options)->extract('authorizationId'),
HeaderParam::init('Content-Type', 'application/json'),
HeaderParam::init('PayPal-Request-Id', $options)->extract('payPalRequestId'),
HeaderParam::init('Prefer', $options)->extract('prefer', 'return=minimal'),
BodyParam::init($options)->extract('body')
);
$_resHandler = $this->responseHandler()
->throwErrorOn(
'400',
ErrorType::init(
'The request failed because it is not well-formed or is syntactically incor' .
'rect or violates schema.',
ErrorException::class
)
)
->throwErrorOn(
'401',
ErrorType::init(
'Authentication failed due to missing authorization header, or invalid auth' .
'entication credentials.',
ErrorException::class
)
)
->throwErrorOn(
'403',
ErrorType::init(
'The request failed because the caller has insufficient permissions.',
ErrorException::class
)
)
->throwErrorOn(
'404',
ErrorType::init('The request failed because the resource does not exist.', ErrorException::class)
)
->throwErrorOn(
'422',
ErrorType::init(
'The request failed because it either is semantically incorrect or failed b' .
'usiness validation.',
ErrorException::class
)
)
->throwErrorOn('500', ErrorType::init('The request failed because an internal server error occurred.'))
->throwErrorOn('0', ErrorType::init('The error response.', ErrorException::class))
->type(PaymentAuthorization::class)
->returnApiResponse();
return $this->execute($_reqBuilder, $_resHandler);
}
/**
* Voids, or cancels, an authorized payment, by ID. You cannot void an authorized payment that has been
* fully captured.
*
* @param array $options Array with all options for search
*
* @return ApiResponse Response from the API call
*/
public function authorizationsVoid(array $options): ApiResponse
{
$_reqBuilder = $this->requestBuilder(
RequestMethod::POST,
'/v2/payments/authorizations/{authorization_id}/void'
)
->auth('Oauth2')
->parameters(
TemplateParam::init('authorization_id', $options)->extract('authorizationId'),
HeaderParam::init('PayPal-Auth-Assertion', $options)->extract('payPalAuthAssertion'),
HeaderParam::init('Prefer', $options)->extract('prefer', 'return=minimal')
);
$_resHandler = $this->responseHandler()
->throwErrorOn(
'400',
ErrorType::init(
'The request failed because it is not well-formed or is syntactically incor' .
'rect or violates schema.',
ErrorException::class
)
)
->throwErrorOn(
'401',
ErrorType::init(
'Authentication failed due to missing authorization header, or invalid auth' .
'entication credentials.',
ErrorException::class
)
)
->throwErrorOn(
'403',
ErrorType::init(
'The request failed because the caller has insufficient permissions.',
ErrorException::class
)
)
->throwErrorOn(
'404',
ErrorType::init('The request failed because the resource does not exist.', ErrorException::class)
)
->throwErrorOn(
'409',
ErrorType::init(
'The request failed because a previous call for the given resource is in progress.',
ErrorException::class
)
)
->throwErrorOn(
'422',
ErrorType::init(
'The request failed because it either is semantically incorrect or failed b' .
'usiness validation.',
ErrorException::class
)
)
->throwErrorOn('500', ErrorType::init('The request failed because an internal server error occurred.'))
->throwErrorOn('0', ErrorType::init('The error response.', ErrorException::class))
->nullableType()
->type(PaymentAuthorization::class)
->returnApiResponse();
return $this->execute($_reqBuilder, $_resHandler);
}
/**
* Shows details for a captured payment, by ID.
*
* @param string $captureId The PayPal-generated ID for the captured payment for which to show
* details.
*
* @return ApiResponse Response from the API call
*/
public function capturesGet(string $captureId): ApiResponse
{
$_reqBuilder = $this->requestBuilder(RequestMethod::GET, '/v2/payments/captures/{capture_id}')
->auth('Oauth2')
->parameters(TemplateParam::init('capture_id', $captureId));
$_resHandler = $this->responseHandler()
->throwErrorOn(
'401',
ErrorType::init(
'Authentication failed due to missing authorization header, or invalid auth' .
'entication credentials.',
ErrorException::class
)
)
->throwErrorOn(
'403',
ErrorType::init(
'The request failed because the caller has insufficient permissions.',
ErrorException::class
)
)
->throwErrorOn(
'404',
ErrorType::init('The request failed because the resource does not exist.', ErrorException::class)
)
->throwErrorOn('500', ErrorType::init('The request failed because an internal server error occurred.'))
->throwErrorOn('0', ErrorType::init('The error response.', ErrorException::class))
->type(CapturedPayment::class)
->returnApiResponse();
return $this->execute($_reqBuilder, $_resHandler);
}
/**
* Refunds a captured payment, by ID. For a full refund, include an empty payload in the JSON request
* body. For a partial refund, include an <code>amount</code> object in the JSON request body.
*
* @param array $options Array with all options for search
*
* @return ApiResponse Response from the API call
*/
public function capturesRefund(array $options): ApiResponse
{
$_reqBuilder = $this->requestBuilder(RequestMethod::POST, '/v2/payments/captures/{capture_id}/refund')
->auth('Oauth2')
->parameters(
TemplateParam::init('capture_id', $options)->extract('captureId'),
HeaderParam::init('Content-Type', 'application/json'),
HeaderParam::init('PayPal-Request-Id', $options)->extract('payPalRequestId'),
HeaderParam::init('Prefer', $options)->extract('prefer', 'return=minimal'),
HeaderParam::init('PayPal-Auth-Assertion', $options)->extract('payPalAuthAssertion'),
BodyParam::init($options)->extract('body')
);
$_resHandler = $this->responseHandler()
->throwErrorOn(
'400',
ErrorType::init(
'The request failed because it is not well-formed or is syntactically incor' .
'rect or violates schema.',
ErrorException::class
)
)
->throwErrorOn(
'401',
ErrorType::init(
'Authentication failed due to missing authorization header, or invalid auth' .
'entication credentials.',
ErrorException::class
)
)
->throwErrorOn(
'403',
ErrorType::init(
'The request failed because the caller has insufficient permissions.',
ErrorException::class
)
)
->throwErrorOn(
'404',
ErrorType::init('The request failed because the resource does not exist.', ErrorException::class)
)
->throwErrorOn(
'409',
ErrorType::init(
'The request failed because a previous call for the given resource is in progress.',
ErrorException::class
)
)
->throwErrorOn(
'422',
ErrorType::init(
'The request failed because it either is semantically incorrect or failed b' .
'usiness validation.',
ErrorException::class
)
)
->throwErrorOn('500', ErrorType::init('The request failed because an internal server error occurred.'))
->throwErrorOn('0', ErrorType::init('The error response.', ErrorException::class))
->type(Refund::class)
->returnApiResponse();
return $this->execute($_reqBuilder, $_resHandler);
}
/**
* Shows details for a refund, by ID.
*
* @param string $refundId The PayPal-generated ID for the refund for which to show details.
*
* @return ApiResponse Response from the API call
*/
public function refundsGet(string $refundId): ApiResponse
{
$_reqBuilder = $this->requestBuilder(RequestMethod::GET, '/v2/payments/refunds/{refund_id}')
->auth('Oauth2')
->parameters(TemplateParam::init('refund_id', $refundId));
$_resHandler = $this->responseHandler()
->throwErrorOn(
'401',
ErrorType::init(
'Authentication failed due to missing authorization header, or invalid auth' .
'entication credentials.',
ErrorException::class
)
)
->throwErrorOn(
'403',
ErrorType::init(
'The request failed because the caller has insufficient permissions.',
ErrorException::class
)
)
->throwErrorOn(
'404',
ErrorType::init('The request failed because the resource does not exist.', ErrorException::class)
)
->throwErrorOn('500', ErrorType::init('The request failed because an internal server error occurred.'))
->throwErrorOn('0', ErrorType::init('The error response.', ErrorException::class))
->type(Refund::class)
->returnApiResponse();
return $this->execute($_reqBuilder, $_resHandler);
}
}

View File

@@ -0,0 +1,260 @@
<?php
declare(strict_types=1);
/*
* PaypalServerSDKLib
*
* This file was automatically generated by APIMATIC v3.0 ( https://www.apimatic.io ).
*/
namespace PaypalServerSDKLib\Controllers;
use Core\Request\Parameters\BodyParam;
use Core\Request\Parameters\HeaderParam;
use Core\Request\Parameters\QueryParam;
use Core\Request\Parameters\TemplateParam;
use Core\Response\Types\ErrorType;
use CoreInterfaces\Core\Request\RequestMethod;
use PaypalServerSDKLib\Exceptions\ErrorException;
use PaypalServerSDKLib\Http\ApiResponse;
use PaypalServerSDKLib\Models\CustomerVaultPaymentTokensResponse;
use PaypalServerSDKLib\Models\PaymentTokenResponse;
use PaypalServerSDKLib\Models\SetupTokenResponse;
class VaultController extends BaseController
{
/**
* Creates a Payment Token from the given payment source and adds it to the Vault of the associated
* customer.
*
* @param array $options Array with all options for search
*
* @return ApiResponse Response from the API call
*/
public function paymentTokensCreate(array $options): ApiResponse
{
$_reqBuilder = $this->requestBuilder(RequestMethod::POST, '/v3/vault/payment-tokens')
->auth('Oauth2')
->parameters(
HeaderParam::init('PayPal-Request-Id', $options)->extract('payPalRequestId'),
HeaderParam::init('Content-Type', 'application/json'),
BodyParam::init($options)->extract('body')
);
$_resHandler = $this->responseHandler()
->throwErrorOn(
'400',
ErrorType::init(
'Request is not well-formed, syntactically incorrect, or violates schema.',
ErrorException::class
)
)
->throwErrorOn(
'403',
ErrorType::init('Authorization failed due to insufficient permissions.', ErrorException::class)
)
->throwErrorOn(
'404',
ErrorType::init(
'Request contains reference to resources that do not exist.',
ErrorException::class
)
)
->throwErrorOn(
'422',
ErrorType::init(
'The requested action could not be performed, semantically incorrect, or fa' .
'iled business validation.',
ErrorException::class
)
)
->throwErrorOn('500', ErrorType::init('An internal server error has occurred.', ErrorException::class))
->type(PaymentTokenResponse::class)
->returnApiResponse();
return $this->execute($_reqBuilder, $_resHandler);
}
/**
* Returns all payment tokens for a customer.
*
* @param array $options Array with all options for search
*
* @return ApiResponse Response from the API call
*/
public function customerPaymentTokensGet(array $options): ApiResponse
{
$_reqBuilder = $this->requestBuilder(RequestMethod::GET, '/v3/vault/payment-tokens')
->auth('Oauth2')
->parameters(
QueryParam::init('customer_id', $options)->extract('customerId'),
QueryParam::init('page_size', $options)->extract('pageSize', 5),
QueryParam::init('page', $options)->extract('page', 1),
QueryParam::init('total_required', $options)->extract('totalRequired', false)
);
$_resHandler = $this->responseHandler()
->throwErrorOn(
'400',
ErrorType::init(
'Request is not well-formed, syntactically incorrect, or violates schema.',
ErrorException::class
)
)
->throwErrorOn(
'403',
ErrorType::init('Authorization failed due to insufficient permissions.', ErrorException::class)
)
->throwErrorOn('500', ErrorType::init('An internal server error has occurred.', ErrorException::class))
->type(CustomerVaultPaymentTokensResponse::class)
->returnApiResponse();
return $this->execute($_reqBuilder, $_resHandler);
}
/**
* Returns a readable representation of vaulted payment source associated with the payment token id.
*
* @param string $id ID of the payment token.
*
* @return ApiResponse Response from the API call
*/
public function paymentTokensGet(string $id): ApiResponse
{
$_reqBuilder = $this->requestBuilder(RequestMethod::GET, '/v3/vault/payment-tokens/{id}')
->auth('Oauth2')
->parameters(TemplateParam::init('id', $id));
$_resHandler = $this->responseHandler()
->throwErrorOn(
'403',
ErrorType::init('Authorization failed due to insufficient permissions.', ErrorException::class)
)
->throwErrorOn('404', ErrorType::init('The specified resource does not exist.', ErrorException::class))
->throwErrorOn(
'422',
ErrorType::init(
'The requested action could not be performed, semantically incorrect, or fa' .
'iled business validation.',
ErrorException::class
)
)
->throwErrorOn('500', ErrorType::init('An internal server error has occurred.', ErrorException::class))
->type(PaymentTokenResponse::class)
->returnApiResponse();
return $this->execute($_reqBuilder, $_resHandler);
}
/**
* Delete the payment token associated with the payment token id.
*
* @param string $id ID of the payment token.
*
* @return ApiResponse Response from the API call
*/
public function paymentTokensDelete(string $id): ApiResponse
{
$_reqBuilder = $this->requestBuilder(RequestMethod::DELETE, '/v3/vault/payment-tokens/{id}')
->auth('Oauth2')
->parameters(TemplateParam::init('id', $id));
$_resHandler = $this->responseHandler()
->throwErrorOn(
'400',
ErrorType::init(
'Request is not well-formed, syntactically incorrect, or violates schema.',
ErrorException::class
)
)
->throwErrorOn(
'403',
ErrorType::init('Authorization failed due to insufficient permissions.', ErrorException::class)
)
->throwErrorOn('500', ErrorType::init('An internal server error has occurred.', ErrorException::class))
->returnApiResponse();
return $this->execute($_reqBuilder, $_resHandler);
}
/**
* Creates a Setup Token from the given payment source and adds it to the Vault of the associated
* customer.
*
* @param array $options Array with all options for search
*
* @return ApiResponse Response from the API call
*/
public function setupTokensCreate(array $options): ApiResponse
{
$_reqBuilder = $this->requestBuilder(RequestMethod::POST, '/v3/vault/setup-tokens')
->auth('Oauth2')
->parameters(
HeaderParam::init('PayPal-Request-Id', $options)->extract('payPalRequestId'),
HeaderParam::init('Content-Type', 'application/json'),
BodyParam::init($options)->extract('body')
);
$_resHandler = $this->responseHandler()
->throwErrorOn(
'400',
ErrorType::init(
'Request is not well-formed, syntactically incorrect, or violates schema.',
ErrorException::class
)
)
->throwErrorOn(
'403',
ErrorType::init('Authorization failed due to insufficient permissions.', ErrorException::class)
)
->throwErrorOn(
'422',
ErrorType::init(
'The requested action could not be performed, semantically incorrect, or fa' .
'iled business validation.',
ErrorException::class
)
)
->throwErrorOn('500', ErrorType::init('An internal server error has occurred.', ErrorException::class))
->type(SetupTokenResponse::class)
->returnApiResponse();
return $this->execute($_reqBuilder, $_resHandler);
}
/**
* Returns a readable representation of temporarily vaulted payment source associated with the setup
* token id.
*
* @param string $id ID of the setup token.
*
* @return ApiResponse Response from the API call
*/
public function setupTokensGet(string $id): ApiResponse
{
$_reqBuilder = $this->requestBuilder(RequestMethod::GET, '/v3/vault/setup-tokens/{id}')
->auth('Oauth2')
->parameters(TemplateParam::init('id', $id));
$_resHandler = $this->responseHandler()
->throwErrorOn(
'403',
ErrorType::init('Authorization failed due to insufficient permissions.', ErrorException::class)
)
->throwErrorOn('404', ErrorType::init('The specified resource does not exist.', ErrorException::class))
->throwErrorOn(
'422',
ErrorType::init(
'The requested action could not be performed, semantically incorrect, or fa' .
'iled business validation.',
ErrorException::class
)
)
->throwErrorOn('500', ErrorType::init('An internal server error has occurred.', ErrorException::class))
->type(SetupTokenResponse::class)
->returnApiResponse();
return $this->execute($_reqBuilder, $_resHandler);
}
}

27
src/Environment.php Normal file
View File

@@ -0,0 +1,27 @@
<?php
declare(strict_types=1);
/*
* PaypalServerSDKLib
*
* This file was automatically generated by APIMATIC v3.0 ( https://www.apimatic.io ).
*/
namespace PaypalServerSDKLib;
/**
* Environments available for API
*/
class Environment
{
/**
* PayPal Live Environment
*/
public const PRODUCTION = 'Production';
/**
* PayPal Sandbox Environment
*/
public const SANDBOX = 'Sandbox';
}

View File

@@ -0,0 +1,71 @@
<?php
declare(strict_types=1);
/*
* PaypalServerSDKLib
*
* This file was automatically generated by APIMATIC v3.0 ( https://www.apimatic.io ).
*/
namespace PaypalServerSDKLib\Exceptions;
use CoreInterfaces\Sdk\ExceptionInterface;
use PaypalServerSDKLib\Http\HttpResponse;
use PaypalServerSDKLib\Http\HttpRequest;
/**
* Thrown when there is a network error or HTTP response status code is not okay.
*/
class ApiException extends \Exception implements ExceptionInterface
{
/**
* HTTP request
*
* @var HttpRequest
*/
private $request;
/**
* HTTP response
*
* @var HttpResponse|null
*/
private $response;
/**
* @param string $reason the reason for raising an exception
* @param HttpRequest $request
* @param HttpResponse|null $response
*/
public function __construct(string $reason, HttpRequest $request, ?HttpResponse $response)
{
parent::__construct($reason, \is_null($response) ? 0 : $response->getStatusCode());
$this->request = $request;
$this->response = $response;
}
/**
* Returns the HTTP request
*/
public function getHttpRequest(): HttpRequest
{
return $this->request;
}
/**
* Returns the HTTP response
*/
public function getHttpResponse(): ?HttpResponse
{
return $this->response;
}
/**
* Is the response available?
*/
public function hasResponse(): bool
{
return !\is_null($this->response);
}
}

View File

@@ -0,0 +1,175 @@
<?php
declare(strict_types=1);
/*
* PaypalServerSDKLib
*
* This file was automatically generated by APIMATIC v3.0 ( https://www.apimatic.io ).
*/
namespace PaypalServerSDKLib\Exceptions;
/**
* The error details.
*/
class ErrorException extends ApiException
{
/**
* @var string
*/
private $name;
/**
* @var string
*/
private $messageProperty;
/**
* @var string
*/
private $debugId;
/**
* @var \PaypalServerSDKLib\Models\ErrorDetails[]|null
*/
private $details;
/**
* @var \PaypalServerSDKLib\Models\LinkDescription[]|null
*/
private $links;
/**
* @param string $reason
* @param \PaypalServerSDKLib\Http\HttpRequest $request
* @param \PaypalServerSDKLib\Http\HttpResponse $response
* @param string $name
* @param string $messageProperty
* @param string $debugId
*/
public function __construct(
string $reason,
\PaypalServerSDKLib\Http\HttpRequest $request,
\PaypalServerSDKLib\Http\HttpResponse $response,
string $name,
string $messageProperty,
string $debugId
) {
parent::__construct($reason, $request, $response);
$this->name = $name;
$this->messageProperty = $messageProperty;
$this->debugId = $debugId;
}
/**
* Returns Name.
* The human-readable, unique name of the error.
*/
public function getName(): string
{
return $this->name;
}
/**
* Sets Name.
* The human-readable, unique name of the error.
*
* @required
* @maps name
*/
public function setName(string $name): void
{
$this->name = $name;
}
/**
* Returns Message Property.
* The message that describes the error.
*/
public function getMessageProperty(): string
{
return $this->messageProperty;
}
/**
* Sets Message Property.
* The message that describes the error.
*
* @required
* @maps message
*/
public function setMessageProperty(string $messageProperty): void
{
$this->messageProperty = $messageProperty;
}
/**
* Returns Debug Id.
* The PayPal internal ID. Used for correlation purposes.
*/
public function getDebugId(): string
{
return $this->debugId;
}
/**
* Sets Debug Id.
* The PayPal internal ID. Used for correlation purposes.
*
* @required
* @maps debug_id
*/
public function setDebugId(string $debugId): void
{
$this->debugId = $debugId;
}
/**
* Returns Details.
* An array of additional details about the error.
*
* @return \PaypalServerSDKLib\Models\ErrorDetails[]|null
*/
public function getDetails(): ?array
{
return $this->details;
}
/**
* Sets Details.
* An array of additional details about the error.
*
* @maps details
*
* @param \PaypalServerSDKLib\Models\ErrorDetails[]|null $details
*/
public function setDetails(?array $details): void
{
$this->details = $details;
}
/**
* Returns Links.
* An array of request-related [HATEOAS links](/api/rest/responses/#hateoas-links).
*
* @return \PaypalServerSDKLib\Models\LinkDescription[]|null
*/
public function getLinks(): ?array
{
return $this->links;
}
/**
* Sets Links.
* An array of request-related [HATEOAS links](/api/rest/responses/#hateoas-links).
*
* @maps links
*
* @param \PaypalServerSDKLib\Models\LinkDescription[]|null $links
*/
public function setLinks(?array $links): void
{
$this->links = $links;
}
}

View File

@@ -0,0 +1,114 @@
<?php
declare(strict_types=1);
/*
* PaypalServerSDKLib
*
* This file was automatically generated by APIMATIC v3.0 ( https://www.apimatic.io ).
*/
namespace PaypalServerSDKLib\Exceptions;
/**
* OAuth 2 Authorization endpoint exception.
*/
class OAuthProviderException extends ApiException
{
/**
* @var string
*/
private $error;
/**
* @var string|null
*/
private $errorDescription;
/**
* @var string|null
*/
private $errorUri;
/**
* @param string $reason
* @param \PaypalServerSDKLib\Http\HttpRequest $request
* @param \PaypalServerSDKLib\Http\HttpResponse $response
* @param string $error
*/
public function __construct(
string $reason,
\PaypalServerSDKLib\Http\HttpRequest $request,
\PaypalServerSDKLib\Http\HttpResponse $response,
string $error
) {
parent::__construct($reason, $request, $response);
$this->error = $error;
}
/**
* Returns Error.
* Gets or sets error code.
*/
public function getError(): string
{
return $this->error;
}
/**
* Sets Error.
* Gets or sets error code.
*
* @required
* @maps error
* @factory \PaypalServerSDKLib\Models\OAuthProviderError::checkValue
*/
public function setError(string $error): void
{
$this->error = $error;
}
/**
* Returns Error Description.
* Gets or sets human-readable text providing additional information on error.
* Used to assist the client developer in understanding the error that occurred.
*/
public function getErrorDescription(): ?string
{
return $this->errorDescription;
}
/**
* Sets Error Description.
* Gets or sets human-readable text providing additional information on error.
* Used to assist the client developer in understanding the error that occurred.
*
* @maps error_description
*/
public function setErrorDescription(?string $errorDescription): void
{
$this->errorDescription = $errorDescription;
}
/**
* Returns Error Uri.
* Gets or sets a URI identifying a human-readable web page with information about the error, used to
* provide the client developer with additional information about the error.
*/
public function getErrorUri(): ?string
{
return $this->errorUri;
}
/**
* Sets Error Uri.
* Gets or sets a URI identifying a human-readable web page with information about the error, used to
* provide the client developer with additional information about the error.
*
* @maps error_uri
*/
public function setErrorUri(?string $errorUri): void
{
$this->errorUri = $errorUri;
}
}

45
src/Http/ApiResponse.php Normal file
View File

@@ -0,0 +1,45 @@
<?php
declare(strict_types=1);
/*
* PaypalServerSDKLib
*
* This file was automatically generated by APIMATIC v3.0 ( https://www.apimatic.io ).
*/
namespace PaypalServerSDKLib\Http;
use Core\Types\Sdk\CoreApiResponse;
/**
* Holds the result of an API call.
*/
class ApiResponse extends CoreApiResponse
{
/**
* Create a new instance of this class with the given context and result.
*
* @param mixed $decodedBody Decoded response body
* @param mixed $result Deserialized result from the response
* @param HttpContext $context Http context
*/
public static function createFromContext($decodedBody, $result, HttpContext $context): self
{
$request = $context->getRequest();
$statusCode = $context->getResponse()->getStatusCode();
$reasonPhrase = null; // TODO
$headers = $context->getResponse()->getHeaders();
$body = $context->getResponse()->getRawBody();
return new self($request, $statusCode, $reasonPhrase, $headers, $result, $body);
}
/**
* Returns the original request that resulted in this response.
*/
public function getRequest(): HttpRequest
{
return $this->request;
}
}

20
src/Http/HttpCallBack.php Normal file
View File

@@ -0,0 +1,20 @@
<?php
declare(strict_types=1);
/*
* PaypalServerSDKLib
*
* This file was automatically generated by APIMATIC v3.0 ( https://www.apimatic.io ).
*/
namespace PaypalServerSDKLib\Http;
use Core\Types\Sdk\CoreCallback;
/**
* HttpCallBack allows defining callables for pre and post API calls.
*/
class HttpCallBack extends CoreCallback
{
}

39
src/Http/HttpContext.php Normal file
View File

@@ -0,0 +1,39 @@
<?php
declare(strict_types=1);
/*
* PaypalServerSDKLib
*
* This file was automatically generated by APIMATIC v3.0 ( https://www.apimatic.io ).
*/
namespace PaypalServerSDKLib\Http;
use Core\Types\Sdk\CoreContext;
/**
* Represents an HTTP call in context
*/
class HttpContext extends CoreContext
{
/**
* Returns the HTTP Request
*
* @return HttpRequest request
*/
public function getRequest(): HttpRequest
{
return $this->request;
}
/**
* Returns the HTTP Response
*
* @return HttpResponse response
*/
public function getResponse(): HttpResponse
{
return $this->response;
}
}

26
src/Http/HttpMethod.php Normal file
View File

@@ -0,0 +1,26 @@
<?php
declare(strict_types=1);
/*
* PaypalServerSDKLib
*
* This file was automatically generated by APIMATIC v3.0 ( https://www.apimatic.io ).
*/
namespace PaypalServerSDKLib\Http;
use CoreInterfaces\Core\Request\RequestMethod;
/**
* HTTP Methods Enumeration
*/
class HttpMethod
{
public const GET = RequestMethod::GET;
public const POST = RequestMethod::POST;
public const PUT = RequestMethod::PUT;
public const PATCH = RequestMethod::PATCH;
public const DELETE = RequestMethod::DELETE;
public const HEAD = RequestMethod::HEAD;
}

20
src/Http/HttpRequest.php Normal file
View File

@@ -0,0 +1,20 @@
<?php
declare(strict_types=1);
/*
* PaypalServerSDKLib
*
* This file was automatically generated by APIMATIC v3.0 ( https://www.apimatic.io ).
*/
namespace PaypalServerSDKLib\Http;
use Core\Types\Sdk\CoreRequest;
/**
* Represents a single Http Request
*/
class HttpRequest extends CoreRequest
{
}

20
src/Http/HttpResponse.php Normal file
View File

@@ -0,0 +1,20 @@
<?php
declare(strict_types=1);
/*
* PaypalServerSDKLib
*
* This file was automatically generated by APIMATIC v3.0 ( https://www.apimatic.io ).
*/
namespace PaypalServerSDKLib\Http;
use Core\Types\Sdk\CoreResponse;
/**
* HTTP response received
*/
class HttpResponse extends CoreResponse
{
}

View File

@@ -0,0 +1,109 @@
<?php
declare(strict_types=1);
/*
* PaypalServerSDKLib
*
* This file was automatically generated by APIMATIC v3.0 ( https://www.apimatic.io ).
*/
namespace PaypalServerSDKLib\Logging;
use PaypalServerSDKLib\ConfigurationDefaults;
use Core\Logger\Configuration\LoggingConfiguration;
use Core\Logger\ConsoleLogger;
use Core\Utils\CoreHelper;
use Psr\Log\InvalidArgumentException;
use Psr\Log\LoggerInterface;
class LoggingConfigurationBuilder
{
/**
* @var LoggerInterface|null
*/
private $logger;
private $level = ConfigurationDefaults::LOGGER_LEVEL;
private $maskSensitiveHeaders = ConfigurationDefaults::LOGGER_MASK_SENSITIVE_HEADERS;
private $requestConfig;
private $responseConfig;
private function __construct()
{
$this->logger = new ConsoleLogger('printf');
$this->requestConfig = RequestLoggingConfigurationBuilder::init();
$this->responseConfig = ResponseLoggingConfigurationBuilder::init();
}
/**
* Initializer for LoggingConfigurationBuilder.
*/
public static function init(): self
{
return new self();
}
public function logger(LoggerInterface $logger): self
{
$this->logger = $logger;
return $this;
}
/**
* Setter for level of logging. See Psr\Log\LogLevel.php for possible values of log levels.
*
* @param string $level
*
* @return $this
*/
public function level(string $level): self
{
if (!in_array($level, ConfigurationDefaults::LOGGER_ALLOWED_LEVELS, true)) {
throw new InvalidArgumentException(
'Invalid LogLevel. See Psr\Log\LogLevel.php for possible values of log levels.'
);
}
$this->level = $level;
return $this;
}
public function maskSensitiveHeaders(bool $maskSensitiveHeaders): self
{
$this->maskSensitiveHeaders = $maskSensitiveHeaders;
return $this;
}
public function requestConfiguration(RequestLoggingConfigurationBuilder $requestConfig): self
{
$this->requestConfig = $requestConfig;
return $this;
}
public function responseConfiguration(ResponseLoggingConfigurationBuilder $responseConfig): self
{
$this->responseConfig = $responseConfig;
return $this;
}
public function getConfiguration(): array
{
return [
'logger' => CoreHelper::clone($this->logger),
'level' => $this->level,
'maskSensitiveHeaders' => $this->maskSensitiveHeaders,
'requestConfiguration' => $this->requestConfig->getConfiguration(),
'responseConfiguration' => $this->responseConfig->getConfiguration()
];
}
public function build(): LoggingConfiguration
{
return new LoggingConfiguration(
$this->logger,
$this->level,
$this->maskSensitiveHeaders,
$this->requestConfig->build(),
$this->responseConfig->build()
);
}
}

View File

@@ -0,0 +1,93 @@
<?php
declare(strict_types=1);
/*
* PaypalServerSDKLib
*
* This file was automatically generated by APIMATIC v3.0 ( https://www.apimatic.io ).
*/
namespace PaypalServerSDKLib\Logging;
use PaypalServerSDKLib\ConfigurationDefaults;
use Core\Logger\Configuration\RequestConfiguration;
use Core\Utils\CoreHelper;
class RequestLoggingConfigurationBuilder
{
private $includeQueryInPath = ConfigurationDefaults::LOGGER_INCLUDE_QUERY_IN_PATH;
private $body = ConfigurationDefaults::LOGGER_LOG_BODY;
private $headers = ConfigurationDefaults::LOGGER_LOG_HEADERS;
private $includeHeaders = ConfigurationDefaults::LOGGER_INCLUDE_HEADERS;
private $excludeHeaders = ConfigurationDefaults::LOGGER_EXCLUDE_HEADERS;
private $unmaskHeaders = ConfigurationDefaults::LOGGER_UNMASK_HEADERS;
/**
* Initializer for RequestLoggingConfigurationBuilder.
*/
public static function init(): self
{
return new self();
}
public function includeQueryInPath(bool $includeQueryInPath): self
{
$this->includeQueryInPath = $includeQueryInPath;
return $this;
}
public function body(bool $body): self
{
$this->body = $body;
return $this;
}
public function headers(bool $headers): self
{
$this->headers = $headers;
return $this;
}
public function includeHeaders(string ...$includeHeaders): self
{
$this->includeHeaders = $includeHeaders;
return $this;
}
public function excludeHeaders(string ...$excludeHeaders): self
{
$this->excludeHeaders = $excludeHeaders;
return $this;
}
public function unmaskHeaders(string ...$unmaskHeaders): self
{
$this->unmaskHeaders = $unmaskHeaders;
return $this;
}
public function getConfiguration(): array
{
return [
'includeQueryInPath' => $this->includeQueryInPath,
'body' => $this->body,
'headers' => $this->headers,
'includeHeaders' => CoreHelper::clone($this->includeHeaders),
'excludeHeaders' => CoreHelper::clone($this->excludeHeaders),
'unmaskHeaders' => CoreHelper::clone($this->unmaskHeaders)
];
}
public function build(): RequestConfiguration
{
return new RequestConfiguration(
$this->includeQueryInPath,
$this->body,
$this->headers,
$this->includeHeaders,
$this->excludeHeaders,
$this->unmaskHeaders
);
}
}

View File

@@ -0,0 +1,84 @@
<?php
declare(strict_types=1);
/*
* PaypalServerSDKLib
*
* This file was automatically generated by APIMATIC v3.0 ( https://www.apimatic.io ).
*/
namespace PaypalServerSDKLib\Logging;
use PaypalServerSDKLib\ConfigurationDefaults;
use Core\Logger\Configuration\ResponseConfiguration;
use Core\Utils\CoreHelper;
class ResponseLoggingConfigurationBuilder
{
private $body = ConfigurationDefaults::LOGGER_LOG_BODY;
private $headers = ConfigurationDefaults::LOGGER_LOG_HEADERS;
private $includeHeaders = ConfigurationDefaults::LOGGER_INCLUDE_HEADERS;
private $excludeHeaders = ConfigurationDefaults::LOGGER_EXCLUDE_HEADERS;
private $unmaskHeaders = ConfigurationDefaults::LOGGER_UNMASK_HEADERS;
/**
* Initializer for ResponseLoggingConfigurationBuilder.
*/
public static function init(): self
{
return new self();
}
public function body(bool $body): self
{
$this->body = $body;
return $this;
}
public function headers(bool $headers): self
{
$this->headers = $headers;
return $this;
}
public function includeHeaders(string ...$includeHeaders): self
{
$this->includeHeaders = $includeHeaders;
return $this;
}
public function excludeHeaders(string ...$excludeHeaders): self
{
$this->excludeHeaders = $excludeHeaders;
return $this;
}
public function unmaskHeaders(string ...$unmaskHeaders): self
{
$this->unmaskHeaders = $unmaskHeaders;
return $this;
}
public function getConfiguration(): array
{
return [
'body' => $this->body,
'headers' => $this->headers,
'includeHeaders' => CoreHelper::clone($this->includeHeaders),
'excludeHeaders' => CoreHelper::clone($this->excludeHeaders),
'unmaskHeaders' => CoreHelper::clone($this->unmaskHeaders)
];
}
public function build(): ResponseConfiguration
{
return new ResponseConfiguration(
$this->body,
$this->headers,
$this->includeHeaders,
$this->excludeHeaders,
$this->unmaskHeaders
);
}
}

114
src/Models/AVSCode.php Normal file
View File

@@ -0,0 +1,114 @@
<?php
declare(strict_types=1);
/*
* PaypalServerSDKLib
*
* This file was automatically generated by APIMATIC v3.0 ( https://www.apimatic.io ).
*/
namespace PaypalServerSDKLib\Models;
use Core\Utils\CoreHelper;
use Exception;
use stdClass;
/**
* The address verification code for Visa, Discover, Mastercard, or American Express transactions.
*/
class AVSCode
{
public const A = 'A';
public const B = 'B';
public const C = 'C';
public const D = 'D';
public const E = 'E';
public const F = 'F';
public const G = 'G';
public const I = 'I';
public const M = 'M';
public const N = 'N';
public const P = 'P';
public const R = 'R';
public const S = 'S';
public const U = 'U';
public const W = 'W';
public const X = 'X';
public const Y = 'Y';
public const Z = 'Z';
public const NULL = 'Null';
public const ENUM_0 = '0';
public const ENUM_1 = '1';
public const ENUM_2 = '2';
public const ENUM_3 = '3';
public const ENUM_4 = '4';
private const _ALL_VALUES = [
self::A,
self::B,
self::C,
self::D,
self::E,
self::F,
self::G,
self::I,
self::M,
self::N,
self::P,
self::R,
self::S,
self::U,
self::W,
self::X,
self::Y,
self::Z,
self::NULL,
self::ENUM_0,
self::ENUM_1,
self::ENUM_2,
self::ENUM_3,
self::ENUM_4
];
/**
* Ensures that all the given values are present in this Enum.
*
* @param array|stdClass|null|string $value Value or a list/map of values to be checked
*
* @return array|null|string Input value(s), if all are a part of this Enum
*
* @throws Exception Throws exception if any given value is not in this Enum
*/
public static function checkValue($value)
{
$value = json_decode(json_encode($value), true); // converts stdClass into array
if (CoreHelper::checkValueOrValuesInList($value, self::_ALL_VALUES)) {
return $value;
}
throw new Exception("$value is invalid for AVSCode.");
}
}

View File

@@ -0,0 +1,100 @@
<?php
declare(strict_types=1);
/*
* PaypalServerSDKLib
*
* This file was automatically generated by APIMATIC v3.0 ( https://www.apimatic.io ).
*/
namespace PaypalServerSDKLib\Models;
use stdClass;
/**
* The date and time stamps that are common to authorized payment, captured payment, and refund
* transactions.
*/
class ActivityTimestamps implements \JsonSerializable
{
/**
* @var string|null
*/
private $createTime;
/**
* @var string|null
*/
private $updateTime;
/**
* Returns Create Time.
* The date and time, in [Internet date and time format](https://tools.ietf.org/html/rfc3339#section-5.
* 6). Seconds are required while fractional seconds are optional.<blockquote><strong>Note:</strong>
* The regular expression provides guidance but does not reject all invalid dates.</blockquote>
*/
public function getCreateTime(): ?string
{
return $this->createTime;
}
/**
* Sets Create Time.
* The date and time, in [Internet date and time format](https://tools.ietf.org/html/rfc3339#section-5.
* 6). Seconds are required while fractional seconds are optional.<blockquote><strong>Note:</strong>
* The regular expression provides guidance but does not reject all invalid dates.</blockquote>
*
* @maps create_time
*/
public function setCreateTime(?string $createTime): void
{
$this->createTime = $createTime;
}
/**
* Returns Update Time.
* The date and time, in [Internet date and time format](https://tools.ietf.org/html/rfc3339#section-5.
* 6). Seconds are required while fractional seconds are optional.<blockquote><strong>Note:</strong>
* The regular expression provides guidance but does not reject all invalid dates.</blockquote>
*/
public function getUpdateTime(): ?string
{
return $this->updateTime;
}
/**
* Sets Update Time.
* The date and time, in [Internet date and time format](https://tools.ietf.org/html/rfc3339#section-5.
* 6). Seconds are required while fractional seconds are optional.<blockquote><strong>Note:</strong>
* The regular expression provides guidance but does not reject all invalid dates.</blockquote>
*
* @maps update_time
*/
public function setUpdateTime(?string $updateTime): void
{
$this->updateTime = $updateTime;
}
/**
* Encode this object to JSON
*
* @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields
* are set. (default: false)
*
* @return array|stdClass
*/
#[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1)
public function jsonSerialize(bool $asArrayWhenEmpty = false)
{
$json = [];
if (isset($this->createTime)) {
$json['create_time'] = $this->createTime;
}
if (isset($this->updateTime)) {
$json['update_time'] = $this->updateTime;
}
return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json;
}
}

231
src/Models/Address.php Normal file
View File

@@ -0,0 +1,231 @@
<?php
declare(strict_types=1);
/*
* PaypalServerSDKLib
*
* This file was automatically generated by APIMATIC v3.0 ( https://www.apimatic.io ).
*/
namespace PaypalServerSDKLib\Models;
use stdClass;
/**
* The portable international postal address. Maps to [AddressValidationMetadata](https://github.
* com/googlei18n/libaddressinput/wiki/AddressValidationMetadata) and HTML 5.1 [Autofilling form
* controls: the autocomplete attribute](https://www.w3.org/TR/html51/sec-forms.html#autofilling-form-
* controls-the-autocomplete-attribute).
*/
class Address implements \JsonSerializable
{
/**
* @var string|null
*/
private $addressLine1;
/**
* @var string|null
*/
private $addressLine2;
/**
* @var string|null
*/
private $adminArea2;
/**
* @var string|null
*/
private $adminArea1;
/**
* @var string|null
*/
private $postalCode;
/**
* @var string
*/
private $countryCode;
/**
* @param string $countryCode
*/
public function __construct(string $countryCode)
{
$this->countryCode = $countryCode;
}
/**
* Returns Address Line 1.
* The first line of the address, such as number and street, for example, `173 Drury Lane`. Needed for
* data entry, and Compliance and Risk checks. This field needs to pass the full address.
*/
public function getAddressLine1(): ?string
{
return $this->addressLine1;
}
/**
* Sets Address Line 1.
* The first line of the address, such as number and street, for example, `173 Drury Lane`. Needed for
* data entry, and Compliance and Risk checks. This field needs to pass the full address.
*
* @maps address_line_1
*/
public function setAddressLine1(?string $addressLine1): void
{
$this->addressLine1 = $addressLine1;
}
/**
* Returns Address Line 2.
* The second line of the address, for example, a suite or apartment number.
*/
public function getAddressLine2(): ?string
{
return $this->addressLine2;
}
/**
* Sets Address Line 2.
* The second line of the address, for example, a suite or apartment number.
*
* @maps address_line_2
*/
public function setAddressLine2(?string $addressLine2): void
{
$this->addressLine2 = $addressLine2;
}
/**
* Returns Admin Area 2.
* A city, town, or village. Smaller than `admin_area_level_1`.
*/
public function getAdminArea2(): ?string
{
return $this->adminArea2;
}
/**
* Sets Admin Area 2.
* A city, town, or village. Smaller than `admin_area_level_1`.
*
* @maps admin_area_2
*/
public function setAdminArea2(?string $adminArea2): void
{
$this->adminArea2 = $adminArea2;
}
/**
* Returns Admin Area 1.
* The highest-level sub-division in a country, which is usually a province, state, or ISO-3166-2
* subdivision. This data is formatted for postal delivery, for example, `CA` and not `California`.
* Value, by country, is:<ul><li>UK. A county.</li><li>US. A state.</li><li>Canada. A province.
* </li><li>Japan. A prefecture.</li><li>Switzerland. A *kanton*.</li></ul>
*/
public function getAdminArea1(): ?string
{
return $this->adminArea1;
}
/**
* Sets Admin Area 1.
* The highest-level sub-division in a country, which is usually a province, state, or ISO-3166-2
* subdivision. This data is formatted for postal delivery, for example, `CA` and not `California`.
* Value, by country, is:<ul><li>UK. A county.</li><li>US. A state.</li><li>Canada. A province.
* </li><li>Japan. A prefecture.</li><li>Switzerland. A *kanton*.</li></ul>
*
* @maps admin_area_1
*/
public function setAdminArea1(?string $adminArea1): void
{
$this->adminArea1 = $adminArea1;
}
/**
* Returns Postal Code.
* The postal code, which is the ZIP code or equivalent. Typically required for countries with a postal
* code or an equivalent. See [postal code](https://en.wikipedia.org/wiki/Postal_code).
*/
public function getPostalCode(): ?string
{
return $this->postalCode;
}
/**
* Sets Postal Code.
* The postal code, which is the ZIP code or equivalent. Typically required for countries with a postal
* code or an equivalent. See [postal code](https://en.wikipedia.org/wiki/Postal_code).
*
* @maps postal_code
*/
public function setPostalCode(?string $postalCode): void
{
$this->postalCode = $postalCode;
}
/**
* Returns Country Code.
* The [2-character ISO 3166-1 code](/api/rest/reference/country-codes/) that identifies the country or
* region.<blockquote><strong>Note:</strong> The country code for Great Britain is <code>GB</code> and
* not <code>UK</code> as used in the top-level domain names for that country. Use the `C2` country
* code for China worldwide for comparable uncontrolled price (CUP) method, bank card, and cross-border
* transactions.</blockquote>
*/
public function getCountryCode(): string
{
return $this->countryCode;
}
/**
* Sets Country Code.
* The [2-character ISO 3166-1 code](/api/rest/reference/country-codes/) that identifies the country or
* region.<blockquote><strong>Note:</strong> The country code for Great Britain is <code>GB</code> and
* not <code>UK</code> as used in the top-level domain names for that country. Use the `C2` country
* code for China worldwide for comparable uncontrolled price (CUP) method, bank card, and cross-border
* transactions.</blockquote>
*
* @required
* @maps country_code
*/
public function setCountryCode(string $countryCode): void
{
$this->countryCode = $countryCode;
}
/**
* Encode this object to JSON
*
* @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields
* are set. (default: false)
*
* @return array|stdClass
*/
#[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1)
public function jsonSerialize(bool $asArrayWhenEmpty = false)
{
$json = [];
if (isset($this->addressLine1)) {
$json['address_line_1'] = $this->addressLine1;
}
if (isset($this->addressLine2)) {
$json['address_line_2'] = $this->addressLine2;
}
if (isset($this->adminArea2)) {
$json['admin_area_2'] = $this->adminArea2;
}
if (isset($this->adminArea1)) {
$json['admin_area_1'] = $this->adminArea1;
}
if (isset($this->postalCode)) {
$json['postal_code'] = $this->postalCode;
}
$json['country_code'] = $this->countryCode;
return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json;
}
}

View File

@@ -0,0 +1,372 @@
<?php
declare(strict_types=1);
/*
* PaypalServerSDKLib
*
* This file was automatically generated by APIMATIC v3.0 ( https://www.apimatic.io ).
*/
namespace PaypalServerSDKLib\Models;
use stdClass;
/**
* Address request details.
*/
class AddressDetails implements \JsonSerializable
{
/**
* @var string|null
*/
private $addressLine1;
/**
* @var string|null
*/
private $addressLine2;
/**
* @var string|null
*/
private $adminArea2;
/**
* @var string|null
*/
private $adminArea1;
/**
* @var string|null
*/
private $postalCode;
/**
* @var string
*/
private $countryCode;
/**
* @var Name|null
*/
private $name;
/**
* @var string|null
*/
private $id;
/**
* @var string|null
*/
private $company;
/**
* @var string|null
*/
private $phone;
/**
* @var Phone|null
*/
private $phoneNumber;
/**
* @param string $countryCode
*/
public function __construct(string $countryCode)
{
$this->countryCode = $countryCode;
}
/**
* Returns Address Line 1.
* The first line of the address, such as number and street, for example, `173 Drury Lane`. Needed for
* data entry, and Compliance and Risk checks. This field needs to pass the full address.
*/
public function getAddressLine1(): ?string
{
return $this->addressLine1;
}
/**
* Sets Address Line 1.
* The first line of the address, such as number and street, for example, `173 Drury Lane`. Needed for
* data entry, and Compliance and Risk checks. This field needs to pass the full address.
*
* @maps address_line_1
*/
public function setAddressLine1(?string $addressLine1): void
{
$this->addressLine1 = $addressLine1;
}
/**
* Returns Address Line 2.
* The second line of the address, for example, a suite or apartment number.
*/
public function getAddressLine2(): ?string
{
return $this->addressLine2;
}
/**
* Sets Address Line 2.
* The second line of the address, for example, a suite or apartment number.
*
* @maps address_line_2
*/
public function setAddressLine2(?string $addressLine2): void
{
$this->addressLine2 = $addressLine2;
}
/**
* Returns Admin Area 2.
* A city, town, or village. Smaller than `admin_area_level_1`.
*/
public function getAdminArea2(): ?string
{
return $this->adminArea2;
}
/**
* Sets Admin Area 2.
* A city, town, or village. Smaller than `admin_area_level_1`.
*
* @maps admin_area_2
*/
public function setAdminArea2(?string $adminArea2): void
{
$this->adminArea2 = $adminArea2;
}
/**
* Returns Admin Area 1.
* The highest-level sub-division in a country, which is usually a province, state, or ISO-3166-2
* subdivision. This data is formatted for postal delivery, for example, `CA` and not `California`.
* Value, by country, is:<ul><li>UK. A county.</li><li>US. A state.</li><li>Canada. A province.
* </li><li>Japan. A prefecture.</li><li>Switzerland. A *kanton*.</li></ul>
*/
public function getAdminArea1(): ?string
{
return $this->adminArea1;
}
/**
* Sets Admin Area 1.
* The highest-level sub-division in a country, which is usually a province, state, or ISO-3166-2
* subdivision. This data is formatted for postal delivery, for example, `CA` and not `California`.
* Value, by country, is:<ul><li>UK. A county.</li><li>US. A state.</li><li>Canada. A province.
* </li><li>Japan. A prefecture.</li><li>Switzerland. A *kanton*.</li></ul>
*
* @maps admin_area_1
*/
public function setAdminArea1(?string $adminArea1): void
{
$this->adminArea1 = $adminArea1;
}
/**
* Returns Postal Code.
* The postal code, which is the ZIP code or equivalent. Typically required for countries with a postal
* code or an equivalent. See [postal code](https://en.wikipedia.org/wiki/Postal_code).
*/
public function getPostalCode(): ?string
{
return $this->postalCode;
}
/**
* Sets Postal Code.
* The postal code, which is the ZIP code or equivalent. Typically required for countries with a postal
* code or an equivalent. See [postal code](https://en.wikipedia.org/wiki/Postal_code).
*
* @maps postal_code
*/
public function setPostalCode(?string $postalCode): void
{
$this->postalCode = $postalCode;
}
/**
* Returns Country Code.
* The [2-character ISO 3166-1 code](/api/rest/reference/country-codes/) that identifies the country or
* region.<blockquote><strong>Note:</strong> The country code for Great Britain is <code>GB</code> and
* not <code>UK</code> as used in the top-level domain names for that country. Use the `C2` country
* code for China worldwide for comparable uncontrolled price (CUP) method, bank card, and cross-border
* transactions.</blockquote>
*/
public function getCountryCode(): string
{
return $this->countryCode;
}
/**
* Sets Country Code.
* The [2-character ISO 3166-1 code](/api/rest/reference/country-codes/) that identifies the country or
* region.<blockquote><strong>Note:</strong> The country code for Great Britain is <code>GB</code> and
* not <code>UK</code> as used in the top-level domain names for that country. Use the `C2` country
* code for China worldwide for comparable uncontrolled price (CUP) method, bank card, and cross-border
* transactions.</blockquote>
*
* @required
* @maps country_code
*/
public function setCountryCode(string $countryCode): void
{
$this->countryCode = $countryCode;
}
/**
* Returns Name.
* The name of the party.
*/
public function getName(): ?Name
{
return $this->name;
}
/**
* Sets Name.
* The name of the party.
*
* @maps name
*/
public function setName(?Name $name): void
{
$this->name = $name;
}
/**
* Returns Id.
* The resource ID of the address.
*/
public function getId(): ?string
{
return $this->id;
}
/**
* Sets Id.
* The resource ID of the address.
*
* @maps id
*/
public function setId(?string $id): void
{
$this->id = $id;
}
/**
* Returns Company.
* The name of the company or business associated to the address.
*/
public function getCompany(): ?string
{
return $this->company;
}
/**
* Sets Company.
* The name of the company or business associated to the address.
*
* @maps company
*/
public function setCompany(?string $company): void
{
$this->company = $company;
}
/**
* Returns Phone.
* The phone number that can go on the mailing label with the address to track the shipping. Phone
* number is in E.164 format.
*/
public function getPhone(): ?string
{
return $this->phone;
}
/**
* Sets Phone.
* The phone number that can go on the mailing label with the address to track the shipping. Phone
* number is in E.164 format.
*
* @maps phone
*/
public function setPhone(?string $phone): void
{
$this->phone = $phone;
}
/**
* Returns Phone Number.
* The phone number, in its canonical international [E.164 numbering plan format](https://www.itu.
* int/rec/T-REC-E.164/en).
*/
public function getPhoneNumber(): ?Phone
{
return $this->phoneNumber;
}
/**
* Sets Phone Number.
* The phone number, in its canonical international [E.164 numbering plan format](https://www.itu.
* int/rec/T-REC-E.164/en).
*
* @maps phone_number
*/
public function setPhoneNumber(?Phone $phoneNumber): void
{
$this->phoneNumber = $phoneNumber;
}
/**
* Encode this object to JSON
*
* @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields
* are set. (default: false)
*
* @return array|stdClass
*/
#[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1)
public function jsonSerialize(bool $asArrayWhenEmpty = false)
{
$json = [];
if (isset($this->addressLine1)) {
$json['address_line_1'] = $this->addressLine1;
}
if (isset($this->addressLine2)) {
$json['address_line_2'] = $this->addressLine2;
}
if (isset($this->adminArea2)) {
$json['admin_area_2'] = $this->adminArea2;
}
if (isset($this->adminArea1)) {
$json['admin_area_1'] = $this->adminArea1;
}
if (isset($this->postalCode)) {
$json['postal_code'] = $this->postalCode;
}
$json['country_code'] = $this->countryCode;
if (isset($this->name)) {
$json['name'] = $this->name;
}
if (isset($this->id)) {
$json['id'] = $this->id;
}
if (isset($this->company)) {
$json['company'] = $this->company;
}
if (isset($this->phone)) {
$json['phone'] = $this->phone;
}
if (isset($this->phoneNumber)) {
$json['phone_number'] = $this->phoneNumber;
}
return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json;
}
}

View File

@@ -0,0 +1,232 @@
<?php
declare(strict_types=1);
/*
* PaypalServerSDKLib
*
* This file was automatically generated by APIMATIC v3.0 ( https://www.apimatic.io ).
*/
namespace PaypalServerSDKLib\Models;
use stdClass;
/**
* The breakdown of the amount. Breakdown provides details such as total item amount, total tax amount,
* shipping, handling, insurance, and discounts, if any.
*/
class AmountBreakdown implements \JsonSerializable
{
/**
* @var Money|null
*/
private $itemTotal;
/**
* @var Money|null
*/
private $shipping;
/**
* @var Money|null
*/
private $handling;
/**
* @var Money|null
*/
private $taxTotal;
/**
* @var Money|null
*/
private $insurance;
/**
* @var Money|null
*/
private $shippingDiscount;
/**
* @var Money|null
*/
private $discount;
/**
* Returns Item Total.
* The currency and amount for a financial transaction, such as a balance or payment due.
*/
public function getItemTotal(): ?Money
{
return $this->itemTotal;
}
/**
* Sets Item Total.
* The currency and amount for a financial transaction, such as a balance or payment due.
*
* @maps item_total
*/
public function setItemTotal(?Money $itemTotal): void
{
$this->itemTotal = $itemTotal;
}
/**
* Returns Shipping.
* The currency and amount for a financial transaction, such as a balance or payment due.
*/
public function getShipping(): ?Money
{
return $this->shipping;
}
/**
* Sets Shipping.
* The currency and amount for a financial transaction, such as a balance or payment due.
*
* @maps shipping
*/
public function setShipping(?Money $shipping): void
{
$this->shipping = $shipping;
}
/**
* Returns Handling.
* The currency and amount for a financial transaction, such as a balance or payment due.
*/
public function getHandling(): ?Money
{
return $this->handling;
}
/**
* Sets Handling.
* The currency and amount for a financial transaction, such as a balance or payment due.
*
* @maps handling
*/
public function setHandling(?Money $handling): void
{
$this->handling = $handling;
}
/**
* Returns Tax Total.
* The currency and amount for a financial transaction, such as a balance or payment due.
*/
public function getTaxTotal(): ?Money
{
return $this->taxTotal;
}
/**
* Sets Tax Total.
* The currency and amount for a financial transaction, such as a balance or payment due.
*
* @maps tax_total
*/
public function setTaxTotal(?Money $taxTotal): void
{
$this->taxTotal = $taxTotal;
}
/**
* Returns Insurance.
* The currency and amount for a financial transaction, such as a balance or payment due.
*/
public function getInsurance(): ?Money
{
return $this->insurance;
}
/**
* Sets Insurance.
* The currency and amount for a financial transaction, such as a balance or payment due.
*
* @maps insurance
*/
public function setInsurance(?Money $insurance): void
{
$this->insurance = $insurance;
}
/**
* Returns Shipping Discount.
* The currency and amount for a financial transaction, such as a balance or payment due.
*/
public function getShippingDiscount(): ?Money
{
return $this->shippingDiscount;
}
/**
* Sets Shipping Discount.
* The currency and amount for a financial transaction, such as a balance or payment due.
*
* @maps shipping_discount
*/
public function setShippingDiscount(?Money $shippingDiscount): void
{
$this->shippingDiscount = $shippingDiscount;
}
/**
* Returns Discount.
* The currency and amount for a financial transaction, such as a balance or payment due.
*/
public function getDiscount(): ?Money
{
return $this->discount;
}
/**
* Sets Discount.
* The currency and amount for a financial transaction, such as a balance or payment due.
*
* @maps discount
*/
public function setDiscount(?Money $discount): void
{
$this->discount = $discount;
}
/**
* Encode this object to JSON
*
* @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields
* are set. (default: false)
*
* @return array|stdClass
*/
#[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1)
public function jsonSerialize(bool $asArrayWhenEmpty = false)
{
$json = [];
if (isset($this->itemTotal)) {
$json['item_total'] = $this->itemTotal;
}
if (isset($this->shipping)) {
$json['shipping'] = $this->shipping;
}
if (isset($this->handling)) {
$json['handling'] = $this->handling;
}
if (isset($this->taxTotal)) {
$json['tax_total'] = $this->taxTotal;
}
if (isset($this->insurance)) {
$json['insurance'] = $this->insurance;
}
if (isset($this->shippingDiscount)) {
$json['shipping_discount'] = $this->shippingDiscount;
}
if (isset($this->discount)) {
$json['discount'] = $this->discount;
}
return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json;
}
}

View File

@@ -0,0 +1,142 @@
<?php
declare(strict_types=1);
/*
* PaypalServerSDKLib
*
* This file was automatically generated by APIMATIC v3.0 ( https://www.apimatic.io ).
*/
namespace PaypalServerSDKLib\Models;
use stdClass;
/**
* The total order amount with an optional breakdown that provides details, such as the total item
* amount, total tax amount, shipping, handling, insurance, and discounts, if any.<br/>If you specify
* `amount.breakdown`, the amount equals `item_total` plus `tax_total` plus `shipping` plus `handling`
* plus `insurance` minus `shipping_discount` minus discount.<br/>The amount must be a positive number.
* For listed of supported currencies and decimal precision, see the PayPal REST APIs <a
* href="/docs/integration/direct/rest/currency-codes/">Currency Codes</a>.
*/
class AmountWithBreakdown implements \JsonSerializable
{
/**
* @var string
*/
private $currencyCode;
/**
* @var string
*/
private $value;
/**
* @var AmountBreakdown|null
*/
private $breakdown;
/**
* @param string $currencyCode
* @param string $value
*/
public function __construct(string $currencyCode, string $value)
{
$this->currencyCode = $currencyCode;
$this->value = $value;
}
/**
* Returns Currency Code.
* The [three-character ISO-4217 currency code](/api/rest/reference/currency-codes/) that identifies
* the currency.
*/
public function getCurrencyCode(): string
{
return $this->currencyCode;
}
/**
* Sets Currency Code.
* The [three-character ISO-4217 currency code](/api/rest/reference/currency-codes/) that identifies
* the currency.
*
* @required
* @maps currency_code
*/
public function setCurrencyCode(string $currencyCode): void
{
$this->currencyCode = $currencyCode;
}
/**
* Returns Value.
* The value, which might be:<ul><li>An integer for currencies like `JPY` that are not typically
* fractional.</li><li>A decimal fraction for currencies like `TND` that are subdivided into
* thousandths.</li></ul>For the required number of decimal places for a currency code, see [Currency
* Codes](/api/rest/reference/currency-codes/).
*/
public function getValue(): string
{
return $this->value;
}
/**
* Sets Value.
* The value, which might be:<ul><li>An integer for currencies like `JPY` that are not typically
* fractional.</li><li>A decimal fraction for currencies like `TND` that are subdivided into
* thousandths.</li></ul>For the required number of decimal places for a currency code, see [Currency
* Codes](/api/rest/reference/currency-codes/).
*
* @required
* @maps value
*/
public function setValue(string $value): void
{
$this->value = $value;
}
/**
* Returns Breakdown.
* The breakdown of the amount. Breakdown provides details such as total item amount, total tax amount,
* shipping, handling, insurance, and discounts, if any.
*/
public function getBreakdown(): ?AmountBreakdown
{
return $this->breakdown;
}
/**
* Sets Breakdown.
* The breakdown of the amount. Breakdown provides details such as total item amount, total tax amount,
* shipping, handling, insurance, and discounts, if any.
*
* @maps breakdown
*/
public function setBreakdown(?AmountBreakdown $breakdown): void
{
$this->breakdown = $breakdown;
}
/**
* Encode this object to JSON
*
* @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields
* are set. (default: false)
*
* @return array|stdClass
*/
#[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1)
public function jsonSerialize(bool $asArrayWhenEmpty = false)
{
$json = [];
$json['currency_code'] = $this->currencyCode;
$json['value'] = $this->value;
if (isset($this->breakdown)) {
$json['breakdown'] = $this->breakdown;
}
return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json;
}
}

View File

@@ -0,0 +1,93 @@
<?php
declare(strict_types=1);
/*
* PaypalServerSDKLib
*
* This file was automatically generated by APIMATIC v3.0 ( https://www.apimatic.io ).
*/
namespace PaypalServerSDKLib\Models;
use stdClass;
/**
* Additional attributes associated with apple pay.
*/
class ApplePayAttributes implements \JsonSerializable
{
/**
* @var CustomerInformation|null
*/
private $customer;
/**
* @var VaultInstruction|null
*/
private $vault;
/**
* Returns Customer.
* The details about a customer in PayPal's system of record.
*/
public function getCustomer(): ?CustomerInformation
{
return $this->customer;
}
/**
* Sets Customer.
* The details about a customer in PayPal's system of record.
*
* @maps customer
*/
public function setCustomer(?CustomerInformation $customer): void
{
$this->customer = $customer;
}
/**
* Returns Vault.
* Base vaulting specification. The object can be extended for specific use cases within each
* payment_source that supports vaulting.
*/
public function getVault(): ?VaultInstruction
{
return $this->vault;
}
/**
* Sets Vault.
* Base vaulting specification. The object can be extended for specific use cases within each
* payment_source that supports vaulting.
*
* @maps vault
*/
public function setVault(?VaultInstruction $vault): void
{
$this->vault = $vault;
}
/**
* Encode this object to JSON
*
* @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields
* are set. (default: false)
*
* @return array|stdClass
*/
#[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1)
public function jsonSerialize(bool $asArrayWhenEmpty = false)
{
$json = [];
if (isset($this->customer)) {
$json['customer'] = $this->customer;
}
if (isset($this->vault)) {
$json['vault'] = $this->vault;
}
return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json;
}
}

View File

@@ -0,0 +1,63 @@
<?php
declare(strict_types=1);
/*
* PaypalServerSDKLib
*
* This file was automatically generated by APIMATIC v3.0 ( https://www.apimatic.io ).
*/
namespace PaypalServerSDKLib\Models;
use stdClass;
/**
* Additional attributes associated with the use of Apple Pay.
*/
class ApplePayAttributesResponse implements \JsonSerializable
{
/**
* @var VaultResponse|null
*/
private $vault;
/**
* Returns Vault.
* The details about a saved payment source.
*/
public function getVault(): ?VaultResponse
{
return $this->vault;
}
/**
* Sets Vault.
* The details about a saved payment source.
*
* @maps vault
*/
public function setVault(?VaultResponse $vault): void
{
$this->vault = $vault;
}
/**
* Encode this object to JSON
*
* @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields
* are set. (default: false)
*
* @return array|stdClass
*/
#[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1)
public function jsonSerialize(bool $asArrayWhenEmpty = false)
{
$json = [];
if (isset($this->vault)) {
$json['vault'] = $this->vault;
}
return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json;
}
}

181
src/Models/ApplePayCard.php Normal file
View File

@@ -0,0 +1,181 @@
<?php
declare(strict_types=1);
/*
* PaypalServerSDKLib
*
* This file was automatically generated by APIMATIC v3.0 ( https://www.apimatic.io ).
*/
namespace PaypalServerSDKLib\Models;
use stdClass;
/**
* The payment card to be used to fund a payment. Can be a credit or debit card.
*/
class ApplePayCard implements \JsonSerializable
{
/**
* @var string|null
*/
private $name;
/**
* @var string|null
*/
private $lastDigits;
/**
* @var string|null
*/
private $type;
/**
* @var string|null
*/
private $brand;
/**
* @var Address|null
*/
private $billingAddress;
/**
* Returns Name.
* The card holder's name as it appears on the card.
*/
public function getName(): ?string
{
return $this->name;
}
/**
* Sets Name.
* The card holder's name as it appears on the card.
*
* @maps name
*/
public function setName(?string $name): void
{
$this->name = $name;
}
/**
* Returns Last Digits.
* The last digits of the payment card.
*/
public function getLastDigits(): ?string
{
return $this->lastDigits;
}
/**
* Sets Last Digits.
* The last digits of the payment card.
*
* @maps last_digits
*/
public function setLastDigits(?string $lastDigits): void
{
$this->lastDigits = $lastDigits;
}
/**
* Returns Type.
* Type of card. i.e Credit, Debit and so on.
*/
public function getType(): ?string
{
return $this->type;
}
/**
* Sets Type.
* Type of card. i.e Credit, Debit and so on.
*
* @maps type
*/
public function setType(?string $type): void
{
$this->type = $type;
}
/**
* Returns Brand.
* The card network or brand. Applies to credit, debit, gift, and payment cards.
*/
public function getBrand(): ?string
{
return $this->brand;
}
/**
* Sets Brand.
* The card network or brand. Applies to credit, debit, gift, and payment cards.
*
* @maps brand
*/
public function setBrand(?string $brand): void
{
$this->brand = $brand;
}
/**
* Returns Billing Address.
* The portable international postal address. Maps to [AddressValidationMetadata](https://github.
* com/googlei18n/libaddressinput/wiki/AddressValidationMetadata) and HTML 5.1 [Autofilling form
* controls: the autocomplete attribute](https://www.w3.org/TR/html51/sec-forms.html#autofilling-form-
* controls-the-autocomplete-attribute).
*/
public function getBillingAddress(): ?Address
{
return $this->billingAddress;
}
/**
* Sets Billing Address.
* The portable international postal address. Maps to [AddressValidationMetadata](https://github.
* com/googlei18n/libaddressinput/wiki/AddressValidationMetadata) and HTML 5.1 [Autofilling form
* controls: the autocomplete attribute](https://www.w3.org/TR/html51/sec-forms.html#autofilling-form-
* controls-the-autocomplete-attribute).
*
* @maps billing_address
*/
public function setBillingAddress(?Address $billingAddress): void
{
$this->billingAddress = $billingAddress;
}
/**
* Encode this object to JSON
*
* @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields
* are set. (default: false)
*
* @return array|stdClass
*/
#[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1)
public function jsonSerialize(bool $asArrayWhenEmpty = false)
{
$json = [];
if (isset($this->name)) {
$json['name'] = $this->name;
}
if (isset($this->lastDigits)) {
$json['last_digits'] = $this->lastDigits;
}
if (isset($this->type)) {
$json['type'] = CardType::checkValue($this->type);
}
if (isset($this->brand)) {
$json['brand'] = CardBrand::checkValue($this->brand);
}
if (isset($this->billingAddress)) {
$json['billing_address'] = $this->billingAddress;
}
return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json;
}
}

View File

@@ -0,0 +1,391 @@
<?php
declare(strict_types=1);
/*
* PaypalServerSDKLib
*
* This file was automatically generated by APIMATIC v3.0 ( https://www.apimatic.io ).
*/
namespace PaypalServerSDKLib\Models;
use stdClass;
/**
* The Card from Apple Pay Wallet used to fund the payment.
*/
class ApplePayCardResponse implements \JsonSerializable
{
/**
* @var string|null
*/
private $name;
/**
* @var string|null
*/
private $lastDigits;
/**
* @var string|null
*/
private $brand;
/**
* @var string[]|null
*/
private $availableNetworks;
/**
* @var string|null
*/
private $type;
/**
* @var AuthenticationResponse|null
*/
private $authenticationResult;
/**
* @var CardAttributesResponse|null
*/
private $attributes;
/**
* @var CardFromRequest|null
*/
private $fromRequest;
/**
* @var string|null
*/
private $expiry;
/**
* @var BinDetails|null
*/
private $binDetails;
/**
* @var Address|null
*/
private $billingAddress;
/**
* @var string|null
*/
private $countryCode;
/**
* Returns Name.
* The card holder's name as it appears on the card.
*/
public function getName(): ?string
{
return $this->name;
}
/**
* Sets Name.
* The card holder's name as it appears on the card.
*
* @maps name
*/
public function setName(?string $name): void
{
$this->name = $name;
}
/**
* Returns Last Digits.
* The last digits of the payment card.
*/
public function getLastDigits(): ?string
{
return $this->lastDigits;
}
/**
* Sets Last Digits.
* The last digits of the payment card.
*
* @maps last_digits
*/
public function setLastDigits(?string $lastDigits): void
{
$this->lastDigits = $lastDigits;
}
/**
* Returns Brand.
* The card network or brand. Applies to credit, debit, gift, and payment cards.
*/
public function getBrand(): ?string
{
return $this->brand;
}
/**
* Sets Brand.
* The card network or brand. Applies to credit, debit, gift, and payment cards.
*
* @maps brand
*/
public function setBrand(?string $brand): void
{
$this->brand = $brand;
}
/**
* Returns Available Networks.
* Array of brands or networks associated with the card.
*
* @return string[]|null
*/
public function getAvailableNetworks(): ?array
{
return $this->availableNetworks;
}
/**
* Sets Available Networks.
* Array of brands or networks associated with the card.
*
* @maps available_networks
*
* @param string[]|null $availableNetworks
*/
public function setAvailableNetworks(?array $availableNetworks): void
{
$this->availableNetworks = $availableNetworks;
}
/**
* Returns Type.
* Type of card. i.e Credit, Debit and so on.
*/
public function getType(): ?string
{
return $this->type;
}
/**
* Sets Type.
* Type of card. i.e Credit, Debit and so on.
*
* @maps type
*/
public function setType(?string $type): void
{
$this->type = $type;
}
/**
* Returns Authentication Result.
* Results of Authentication such as 3D Secure.
*/
public function getAuthenticationResult(): ?AuthenticationResponse
{
return $this->authenticationResult;
}
/**
* Sets Authentication Result.
* Results of Authentication such as 3D Secure.
*
* @maps authentication_result
*/
public function setAuthenticationResult(?AuthenticationResponse $authenticationResult): void
{
$this->authenticationResult = $authenticationResult;
}
/**
* Returns Attributes.
* Additional attributes associated with the use of this card.
*/
public function getAttributes(): ?CardAttributesResponse
{
return $this->attributes;
}
/**
* Sets Attributes.
* Additional attributes associated with the use of this card.
*
* @maps attributes
*/
public function setAttributes(?CardAttributesResponse $attributes): void
{
$this->attributes = $attributes;
}
/**
* Returns From Request.
* Representation of card details as received in the request.
*/
public function getFromRequest(): ?CardFromRequest
{
return $this->fromRequest;
}
/**
* Sets From Request.
* Representation of card details as received in the request.
*
* @maps from_request
*/
public function setFromRequest(?CardFromRequest $fromRequest): void
{
$this->fromRequest = $fromRequest;
}
/**
* Returns Expiry.
* The year and month, in ISO-8601 `YYYY-MM` date format. See [Internet date and time format](https:
* //tools.ietf.org/html/rfc3339#section-5.6).
*/
public function getExpiry(): ?string
{
return $this->expiry;
}
/**
* Sets Expiry.
* The year and month, in ISO-8601 `YYYY-MM` date format. See [Internet date and time format](https:
* //tools.ietf.org/html/rfc3339#section-5.6).
*
* @maps expiry
*/
public function setExpiry(?string $expiry): void
{
$this->expiry = $expiry;
}
/**
* Returns Bin Details.
* Bank Identification Number (BIN) details used to fund a payment.
*/
public function getBinDetails(): ?BinDetails
{
return $this->binDetails;
}
/**
* Sets Bin Details.
* Bank Identification Number (BIN) details used to fund a payment.
*
* @maps bin_details
*/
public function setBinDetails(?BinDetails $binDetails): void
{
$this->binDetails = $binDetails;
}
/**
* Returns Billing Address.
* The portable international postal address. Maps to [AddressValidationMetadata](https://github.
* com/googlei18n/libaddressinput/wiki/AddressValidationMetadata) and HTML 5.1 [Autofilling form
* controls: the autocomplete attribute](https://www.w3.org/TR/html51/sec-forms.html#autofilling-form-
* controls-the-autocomplete-attribute).
*/
public function getBillingAddress(): ?Address
{
return $this->billingAddress;
}
/**
* Sets Billing Address.
* The portable international postal address. Maps to [AddressValidationMetadata](https://github.
* com/googlei18n/libaddressinput/wiki/AddressValidationMetadata) and HTML 5.1 [Autofilling form
* controls: the autocomplete attribute](https://www.w3.org/TR/html51/sec-forms.html#autofilling-form-
* controls-the-autocomplete-attribute).
*
* @maps billing_address
*/
public function setBillingAddress(?Address $billingAddress): void
{
$this->billingAddress = $billingAddress;
}
/**
* Returns Country Code.
* The [two-character ISO 3166-1 code](/api/rest/reference/country-codes/) that identifies the country
* or region.<blockquote><strong>Note:</strong> The country code for Great Britain is <code>GB</code>
* and not <code>UK</code> as used in the top-level domain names for that country. Use the `C2` country
* code for China worldwide for comparable uncontrolled price (CUP) method, bank card, and cross-border
* transactions.</blockquote>
*/
public function getCountryCode(): ?string
{
return $this->countryCode;
}
/**
* Sets Country Code.
* The [two-character ISO 3166-1 code](/api/rest/reference/country-codes/) that identifies the country
* or region.<blockquote><strong>Note:</strong> The country code for Great Britain is <code>GB</code>
* and not <code>UK</code> as used in the top-level domain names for that country. Use the `C2` country
* code for China worldwide for comparable uncontrolled price (CUP) method, bank card, and cross-border
* transactions.</blockquote>
*
* @maps country_code
*/
public function setCountryCode(?string $countryCode): void
{
$this->countryCode = $countryCode;
}
/**
* Encode this object to JSON
*
* @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields
* are set. (default: false)
*
* @return array|stdClass
*/
#[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1)
public function jsonSerialize(bool $asArrayWhenEmpty = false)
{
$json = [];
if (isset($this->name)) {
$json['name'] = $this->name;
}
if (isset($this->lastDigits)) {
$json['last_digits'] = $this->lastDigits;
}
if (isset($this->brand)) {
$json['brand'] = CardBrand::checkValue($this->brand);
}
if (isset($this->availableNetworks)) {
$json['available_networks'] = CardBrand::checkValue($this->availableNetworks);
}
if (isset($this->type)) {
$json['type'] = CardType::checkValue($this->type);
}
if (isset($this->authenticationResult)) {
$json['authentication_result'] = $this->authenticationResult;
}
if (isset($this->attributes)) {
$json['attributes'] = $this->attributes;
}
if (isset($this->fromRequest)) {
$json['from_request'] = $this->fromRequest;
}
if (isset($this->expiry)) {
$json['expiry'] = $this->expiry;
}
if (isset($this->binDetails)) {
$json['bin_details'] = $this->binDetails;
}
if (isset($this->billingAddress)) {
$json['billing_address'] = $this->billingAddress;
}
if (isset($this->countryCode)) {
$json['country_code'] = $this->countryCode;
}
return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json;
}
}

View File

@@ -0,0 +1,186 @@
<?php
declare(strict_types=1);
/*
* PaypalServerSDKLib
*
* This file was automatically generated by APIMATIC v3.0 ( https://www.apimatic.io ).
*/
namespace PaypalServerSDKLib\Models;
use stdClass;
/**
* Information about the Payment data obtained by decrypting Apple Pay token.
*/
class ApplePayDecryptedTokenData implements \JsonSerializable
{
/**
* @var Money|null
*/
private $transactionAmount;
/**
* @var ApplePayTokenizedCard
*/
private $tokenizedCard;
/**
* @var string|null
*/
private $deviceManufacturerId;
/**
* @var string|null
*/
private $paymentDataType;
/**
* @var ApplePayPaymentData|null
*/
private $paymentData;
/**
* @param ApplePayTokenizedCard $tokenizedCard
*/
public function __construct(ApplePayTokenizedCard $tokenizedCard)
{
$this->tokenizedCard = $tokenizedCard;
}
/**
* Returns Transaction Amount.
* The currency and amount for a financial transaction, such as a balance or payment due.
*/
public function getTransactionAmount(): ?Money
{
return $this->transactionAmount;
}
/**
* Sets Transaction Amount.
* The currency and amount for a financial transaction, such as a balance or payment due.
*
* @maps transaction_amount
*/
public function setTransactionAmount(?Money $transactionAmount): void
{
$this->transactionAmount = $transactionAmount;
}
/**
* Returns Tokenized Card.
* The payment card to use to fund a payment. Can be a credit or debit card.
*/
public function getTokenizedCard(): ApplePayTokenizedCard
{
return $this->tokenizedCard;
}
/**
* Sets Tokenized Card.
* The payment card to use to fund a payment. Can be a credit or debit card.
*
* @required
* @maps tokenized_card
*/
public function setTokenizedCard(ApplePayTokenizedCard $tokenizedCard): void
{
$this->tokenizedCard = $tokenizedCard;
}
/**
* Returns Device Manufacturer Id.
* Apple Pay Hex-encoded device manufacturer identifier. The pattern is defined by an external party
* and supports Unicode.
*/
public function getDeviceManufacturerId(): ?string
{
return $this->deviceManufacturerId;
}
/**
* Sets Device Manufacturer Id.
* Apple Pay Hex-encoded device manufacturer identifier. The pattern is defined by an external party
* and supports Unicode.
*
* @maps device_manufacturer_id
*/
public function setDeviceManufacturerId(?string $deviceManufacturerId): void
{
$this->deviceManufacturerId = $deviceManufacturerId;
}
/**
* Returns Payment Data Type.
* Indicates the type of payment data passed, in case of Non China the payment data is 3DSECURE and for
* China it is EMV.
*/
public function getPaymentDataType(): ?string
{
return $this->paymentDataType;
}
/**
* Sets Payment Data Type.
* Indicates the type of payment data passed, in case of Non China the payment data is 3DSECURE and for
* China it is EMV.
*
* @maps payment_data_type
*/
public function setPaymentDataType(?string $paymentDataType): void
{
$this->paymentDataType = $paymentDataType;
}
/**
* Returns Payment Data.
* Information about the decrypted apple pay payment data for the token like cryptogram, eci indicator.
*/
public function getPaymentData(): ?ApplePayPaymentData
{
return $this->paymentData;
}
/**
* Sets Payment Data.
* Information about the decrypted apple pay payment data for the token like cryptogram, eci indicator.
*
* @maps payment_data
*/
public function setPaymentData(?ApplePayPaymentData $paymentData): void
{
$this->paymentData = $paymentData;
}
/**
* Encode this object to JSON
*
* @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields
* are set. (default: false)
*
* @return array|stdClass
*/
#[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1)
public function jsonSerialize(bool $asArrayWhenEmpty = false)
{
$json = [];
if (isset($this->transactionAmount)) {
$json['transaction_amount'] = $this->transactionAmount;
}
$json['tokenized_card'] = $this->tokenizedCard;
if (isset($this->deviceManufacturerId)) {
$json['device_manufacturer_id'] = $this->deviceManufacturerId;
}
if (isset($this->paymentDataType)) {
$json['payment_data_type'] = ApplePayPaymentDataType::checkValue($this->paymentDataType);
}
if (isset($this->paymentData)) {
$json['payment_data'] = $this->paymentData;
}
return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json;
}
}

View File

@@ -0,0 +1,153 @@
<?php
declare(strict_types=1);
/*
* PaypalServerSDKLib
*
* This file was automatically generated by APIMATIC v3.0 ( https://www.apimatic.io ).
*/
namespace PaypalServerSDKLib\Models;
use stdClass;
/**
* Information about the decrypted apple pay payment data for the token like cryptogram, eci indicator.
*/
class ApplePayPaymentData implements \JsonSerializable
{
/**
* @var string|null
*/
private $cryptogram;
/**
* @var string|null
*/
private $eciIndicator;
/**
* @var string|null
*/
private $emvData;
/**
* @var string|null
*/
private $pin;
/**
* Returns Cryptogram.
* Online payment cryptogram, as defined by 3D Secure. The pattern is defined by an external party and
* supports Unicode.
*/
public function getCryptogram(): ?string
{
return $this->cryptogram;
}
/**
* Sets Cryptogram.
* Online payment cryptogram, as defined by 3D Secure. The pattern is defined by an external party and
* supports Unicode.
*
* @maps cryptogram
*/
public function setCryptogram(?string $cryptogram): void
{
$this->cryptogram = $cryptogram;
}
/**
* Returns Eci Indicator.
* ECI indicator, as defined by 3- Secure. The pattern is defined by an external party and supports
* Unicode.
*/
public function getEciIndicator(): ?string
{
return $this->eciIndicator;
}
/**
* Sets Eci Indicator.
* ECI indicator, as defined by 3- Secure. The pattern is defined by an external party and supports
* Unicode.
*
* @maps eci_indicator
*/
public function setEciIndicator(?string $eciIndicator): void
{
$this->eciIndicator = $eciIndicator;
}
/**
* Returns Emv Data.
* Encoded Apple Pay EMV Payment Structure used for payments in China. The pattern is defined by an
* external party and supports Unicode.
*/
public function getEmvData(): ?string
{
return $this->emvData;
}
/**
* Sets Emv Data.
* Encoded Apple Pay EMV Payment Structure used for payments in China. The pattern is defined by an
* external party and supports Unicode.
*
* @maps emv_data
*/
public function setEmvData(?string $emvData): void
{
$this->emvData = $emvData;
}
/**
* Returns Pin.
* Bank Key encrypted Apple Pay PIN. The pattern is defined by an external party and supports Unicode.
*/
public function getPin(): ?string
{
return $this->pin;
}
/**
* Sets Pin.
* Bank Key encrypted Apple Pay PIN. The pattern is defined by an external party and supports Unicode.
*
* @maps pin
*/
public function setPin(?string $pin): void
{
$this->pin = $pin;
}
/**
* Encode this object to JSON
*
* @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields
* are set. (default: false)
*
* @return array|stdClass
*/
#[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1)
public function jsonSerialize(bool $asArrayWhenEmpty = false)
{
$json = [];
if (isset($this->cryptogram)) {
$json['cryptogram'] = $this->cryptogram;
}
if (isset($this->eciIndicator)) {
$json['eci_indicator'] = $this->eciIndicator;
}
if (isset($this->emvData)) {
$json['emv_data'] = $this->emvData;
}
if (isset($this->pin)) {
$json['pin'] = $this->pin;
}
return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json;
}
}

View File

@@ -0,0 +1,46 @@
<?php
declare(strict_types=1);
/*
* PaypalServerSDKLib
*
* This file was automatically generated by APIMATIC v3.0 ( https://www.apimatic.io ).
*/
namespace PaypalServerSDKLib\Models;
use Core\Utils\CoreHelper;
use Exception;
use stdClass;
/**
* Indicates the type of payment data passed, in case of Non China the payment data is 3DSECURE and for
* China it is EMV.
*/
class ApplePayPaymentDataType
{
public const ENUM_3DSECURE = '3DSECURE';
public const EMV = 'EMV';
private const _ALL_VALUES = [self::ENUM_3DSECURE, self::EMV];
/**
* Ensures that all the given values are present in this Enum.
*
* @param array|stdClass|null|string $value Value or a list/map of values to be checked
*
* @return array|null|string Input value(s), if all are a part of this Enum
*
* @throws Exception Throws exception if any given value is not in this Enum
*/
public static function checkValue($value)
{
$value = json_decode(json_encode($value), true); // converts stdClass into array
if (CoreHelper::checkValueOrValuesInList($value, self::_ALL_VALUES)) {
return $value;
}
throw new Exception("$value is invalid for ApplePayPaymentDataType.");
}
}

View File

@@ -0,0 +1,243 @@
<?php
declare(strict_types=1);
/*
* PaypalServerSDKLib
*
* This file was automatically generated by APIMATIC v3.0 ( https://www.apimatic.io ).
*/
namespace PaypalServerSDKLib\Models;
use stdClass;
/**
* Information needed to pay using ApplePay.
*/
class ApplePayPaymentObject implements \JsonSerializable
{
/**
* @var string|null
*/
private $id;
/**
* @var string|null
*/
private $token;
/**
* @var string|null
*/
private $name;
/**
* @var string|null
*/
private $emailAddress;
/**
* @var PhoneNumber|null
*/
private $phoneNumber;
/**
* @var ApplePayCardResponse|null
*/
private $card;
/**
* @var ApplePayAttributesResponse|null
*/
private $attributes;
/**
* Returns Id.
* ApplePay transaction identifier, this will be the unique identifier for this transaction provided by
* Apple. The pattern is defined by an external party and supports Unicode.
*/
public function getId(): ?string
{
return $this->id;
}
/**
* Sets Id.
* ApplePay transaction identifier, this will be the unique identifier for this transaction provided by
* Apple. The pattern is defined by an external party and supports Unicode.
*
* @maps id
*/
public function setId(?string $id): void
{
$this->id = $id;
}
/**
* Returns Token.
* Encrypted ApplePay token, containing card information. This token would be base64encoded. The
* pattern is defined by an external party and supports Unicode.
*/
public function getToken(): ?string
{
return $this->token;
}
/**
* Sets Token.
* Encrypted ApplePay token, containing card information. This token would be base64encoded. The
* pattern is defined by an external party and supports Unicode.
*
* @maps token
*/
public function setToken(?string $token): void
{
$this->token = $token;
}
/**
* Returns Name.
* The full name representation like Mr J Smith.
*/
public function getName(): ?string
{
return $this->name;
}
/**
* Sets Name.
* The full name representation like Mr J Smith.
*
* @maps name
*/
public function setName(?string $name): void
{
$this->name = $name;
}
/**
* Returns Email Address.
* The internationalized email address.<blockquote><strong>Note:</strong> Up to 64 characters are
* allowed before and 255 characters are allowed after the <code>@</code> sign. However, the generally
* accepted maximum length for an email address is 254 characters. The pattern verifies that an
* unquoted <code>@</code> sign exists.</blockquote>
*/
public function getEmailAddress(): ?string
{
return $this->emailAddress;
}
/**
* Sets Email Address.
* The internationalized email address.<blockquote><strong>Note:</strong> Up to 64 characters are
* allowed before and 255 characters are allowed after the <code>@</code> sign. However, the generally
* accepted maximum length for an email address is 254 characters. The pattern verifies that an
* unquoted <code>@</code> sign exists.</blockquote>
*
* @maps email_address
*/
public function setEmailAddress(?string $emailAddress): void
{
$this->emailAddress = $emailAddress;
}
/**
* Returns Phone Number.
* The phone number in its canonical international [E.164 numbering plan format](https://www.itu.
* int/rec/T-REC-E.164/en).
*/
public function getPhoneNumber(): ?PhoneNumber
{
return $this->phoneNumber;
}
/**
* Sets Phone Number.
* The phone number in its canonical international [E.164 numbering plan format](https://www.itu.
* int/rec/T-REC-E.164/en).
*
* @maps phone_number
*/
public function setPhoneNumber(?PhoneNumber $phoneNumber): void
{
$this->phoneNumber = $phoneNumber;
}
/**
* Returns Card.
* The Card from Apple Pay Wallet used to fund the payment.
*/
public function getCard(): ?ApplePayCardResponse
{
return $this->card;
}
/**
* Sets Card.
* The Card from Apple Pay Wallet used to fund the payment.
*
* @maps card
*/
public function setCard(?ApplePayCardResponse $card): void
{
$this->card = $card;
}
/**
* Returns Attributes.
* Additional attributes associated with the use of Apple Pay.
*/
public function getAttributes(): ?ApplePayAttributesResponse
{
return $this->attributes;
}
/**
* Sets Attributes.
* Additional attributes associated with the use of Apple Pay.
*
* @maps attributes
*/
public function setAttributes(?ApplePayAttributesResponse $attributes): void
{
$this->attributes = $attributes;
}
/**
* Encode this object to JSON
*
* @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields
* are set. (default: false)
*
* @return array|stdClass
*/
#[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1)
public function jsonSerialize(bool $asArrayWhenEmpty = false)
{
$json = [];
if (isset($this->id)) {
$json['id'] = $this->id;
}
if (isset($this->token)) {
$json['token'] = $this->token;
}
if (isset($this->name)) {
$json['name'] = $this->name;
}
if (isset($this->emailAddress)) {
$json['email_address'] = $this->emailAddress;
}
if (isset($this->phoneNumber)) {
$json['phone_number'] = $this->phoneNumber;
}
if (isset($this->card)) {
$json['card'] = $this->card;
}
if (isset($this->attributes)) {
$json['attributes'] = $this->attributes;
}
return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json;
}
}

View File

@@ -0,0 +1,63 @@
<?php
declare(strict_types=1);
/*
* PaypalServerSDKLib
*
* This file was automatically generated by APIMATIC v3.0 ( https://www.apimatic.io ).
*/
namespace PaypalServerSDKLib\Models;
use stdClass;
/**
* A resource representing a response for Apple Pay.
*/
class ApplePayPaymentToken implements \JsonSerializable
{
/**
* @var ApplePayCard|null
*/
private $card;
/**
* Returns Card.
* The payment card to be used to fund a payment. Can be a credit or debit card.
*/
public function getCard(): ?ApplePayCard
{
return $this->card;
}
/**
* Sets Card.
* The payment card to be used to fund a payment. Can be a credit or debit card.
*
* @maps card
*/
public function setCard(?ApplePayCard $card): void
{
$this->card = $card;
}
/**
* Encode this object to JSON
*
* @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields
* are set. (default: false)
*
* @return array|stdClass
*/
#[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1)
public function jsonSerialize(bool $asArrayWhenEmpty = false)
{
$json = [];
if (isset($this->card)) {
$json['card'] = $this->card;
}
return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json;
}
}

View File

@@ -0,0 +1,285 @@
<?php
declare(strict_types=1);
/*
* PaypalServerSDKLib
*
* This file was automatically generated by APIMATIC v3.0 ( https://www.apimatic.io ).
*/
namespace PaypalServerSDKLib\Models;
use stdClass;
/**
* Information needed to pay using ApplePay.
*/
class ApplePayRequest implements \JsonSerializable
{
/**
* @var string|null
*/
private $id;
/**
* @var string|null
*/
private $name;
/**
* @var string|null
*/
private $emailAddress;
/**
* @var PhoneNumber|null
*/
private $phoneNumber;
/**
* @var ApplePayDecryptedTokenData|null
*/
private $decryptedToken;
/**
* @var CardStoredCredential|null
*/
private $storedCredential;
/**
* @var string|null
*/
private $vaultId;
/**
* @var ApplePayAttributes|null
*/
private $attributes;
/**
* Returns Id.
* ApplePay transaction identifier, this will be the unique identifier for this transaction provided by
* Apple. The pattern is defined by an external party and supports Unicode.
*/
public function getId(): ?string
{
return $this->id;
}
/**
* Sets Id.
* ApplePay transaction identifier, this will be the unique identifier for this transaction provided by
* Apple. The pattern is defined by an external party and supports Unicode.
*
* @maps id
*/
public function setId(?string $id): void
{
$this->id = $id;
}
/**
* Returns Name.
* The full name representation like Mr J Smith.
*/
public function getName(): ?string
{
return $this->name;
}
/**
* Sets Name.
* The full name representation like Mr J Smith.
*
* @maps name
*/
public function setName(?string $name): void
{
$this->name = $name;
}
/**
* Returns Email Address.
* The internationalized email address.<blockquote><strong>Note:</strong> Up to 64 characters are
* allowed before and 255 characters are allowed after the <code>@</code> sign. However, the generally
* accepted maximum length for an email address is 254 characters. The pattern verifies that an
* unquoted <code>@</code> sign exists.</blockquote>
*/
public function getEmailAddress(): ?string
{
return $this->emailAddress;
}
/**
* Sets Email Address.
* The internationalized email address.<blockquote><strong>Note:</strong> Up to 64 characters are
* allowed before and 255 characters are allowed after the <code>@</code> sign. However, the generally
* accepted maximum length for an email address is 254 characters. The pattern verifies that an
* unquoted <code>@</code> sign exists.</blockquote>
*
* @maps email_address
*/
public function setEmailAddress(?string $emailAddress): void
{
$this->emailAddress = $emailAddress;
}
/**
* Returns Phone Number.
* The phone number in its canonical international [E.164 numbering plan format](https://www.itu.
* int/rec/T-REC-E.164/en).
*/
public function getPhoneNumber(): ?PhoneNumber
{
return $this->phoneNumber;
}
/**
* Sets Phone Number.
* The phone number in its canonical international [E.164 numbering plan format](https://www.itu.
* int/rec/T-REC-E.164/en).
*
* @maps phone_number
*/
public function setPhoneNumber(?PhoneNumber $phoneNumber): void
{
$this->phoneNumber = $phoneNumber;
}
/**
* Returns Decrypted Token.
* Information about the Payment data obtained by decrypting Apple Pay token.
*/
public function getDecryptedToken(): ?ApplePayDecryptedTokenData
{
return $this->decryptedToken;
}
/**
* Sets Decrypted Token.
* Information about the Payment data obtained by decrypting Apple Pay token.
*
* @maps decrypted_token
*/
public function setDecryptedToken(?ApplePayDecryptedTokenData $decryptedToken): void
{
$this->decryptedToken = $decryptedToken;
}
/**
* Returns Stored Credential.
* Provides additional details to process a payment using a `card` that has been stored or is intended
* to be stored (also referred to as stored_credential or card-on-file).<br/>Parameter compatibility:
* <br/><ul><li>`payment_type=ONE_TIME` is compatible only with `payment_initiator=CUSTOMER`.
* </li><li>`usage=FIRST` is compatible only with `payment_initiator=CUSTOMER`.
* </li><li>`previous_transaction_reference` or `previous_network_transaction_reference` is compatible
* only with `payment_initiator=MERCHANT`.</li><li>Only one of the parameters -
* `previous_transaction_reference` and `previous_network_transaction_reference` - can be present in
* the request.</li></ul>
*/
public function getStoredCredential(): ?CardStoredCredential
{
return $this->storedCredential;
}
/**
* Sets Stored Credential.
* Provides additional details to process a payment using a `card` that has been stored or is intended
* to be stored (also referred to as stored_credential or card-on-file).<br/>Parameter compatibility:
* <br/><ul><li>`payment_type=ONE_TIME` is compatible only with `payment_initiator=CUSTOMER`.
* </li><li>`usage=FIRST` is compatible only with `payment_initiator=CUSTOMER`.
* </li><li>`previous_transaction_reference` or `previous_network_transaction_reference` is compatible
* only with `payment_initiator=MERCHANT`.</li><li>Only one of the parameters -
* `previous_transaction_reference` and `previous_network_transaction_reference` - can be present in
* the request.</li></ul>
*
* @maps stored_credential
*/
public function setStoredCredential(?CardStoredCredential $storedCredential): void
{
$this->storedCredential = $storedCredential;
}
/**
* Returns Vault Id.
* The PayPal-generated ID for the vaulted payment source. This ID should be stored on the merchant's
* server so the saved payment source can be used for future transactions.
*/
public function getVaultId(): ?string
{
return $this->vaultId;
}
/**
* Sets Vault Id.
* The PayPal-generated ID for the vaulted payment source. This ID should be stored on the merchant's
* server so the saved payment source can be used for future transactions.
*
* @maps vault_id
*/
public function setVaultId(?string $vaultId): void
{
$this->vaultId = $vaultId;
}
/**
* Returns Attributes.
* Additional attributes associated with apple pay.
*/
public function getAttributes(): ?ApplePayAttributes
{
return $this->attributes;
}
/**
* Sets Attributes.
* Additional attributes associated with apple pay.
*
* @maps attributes
*/
public function setAttributes(?ApplePayAttributes $attributes): void
{
$this->attributes = $attributes;
}
/**
* Encode this object to JSON
*
* @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields
* are set. (default: false)
*
* @return array|stdClass
*/
#[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1)
public function jsonSerialize(bool $asArrayWhenEmpty = false)
{
$json = [];
if (isset($this->id)) {
$json['id'] = $this->id;
}
if (isset($this->name)) {
$json['name'] = $this->name;
}
if (isset($this->emailAddress)) {
$json['email_address'] = $this->emailAddress;
}
if (isset($this->phoneNumber)) {
$json['phone_number'] = $this->phoneNumber;
}
if (isset($this->decryptedToken)) {
$json['decrypted_token'] = $this->decryptedToken;
}
if (isset($this->storedCredential)) {
$json['stored_credential'] = $this->storedCredential;
}
if (isset($this->vaultId)) {
$json['vault_id'] = $this->vaultId;
}
if (isset($this->attributes)) {
$json['attributes'] = $this->attributes;
}
return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json;
}
}

View File

@@ -0,0 +1,239 @@
<?php
declare(strict_types=1);
/*
* PaypalServerSDKLib
*
* This file was automatically generated by APIMATIC v3.0 ( https://www.apimatic.io ).
*/
namespace PaypalServerSDKLib\Models;
use stdClass;
/**
* The payment card to use to fund a payment. Can be a credit or debit card.
*/
class ApplePayTokenizedCard implements \JsonSerializable
{
/**
* @var string|null
*/
private $name;
/**
* @var string|null
*/
private $number;
/**
* @var string|null
*/
private $expiry;
/**
* @var string|null
*/
private $cardType;
/**
* @var string|null
*/
private $type;
/**
* @var string|null
*/
private $brand;
/**
* @var Address|null
*/
private $billingAddress;
/**
* Returns Name.
* The card holder's name as it appears on the card.
*/
public function getName(): ?string
{
return $this->name;
}
/**
* Sets Name.
* The card holder's name as it appears on the card.
*
* @maps name
*/
public function setName(?string $name): void
{
$this->name = $name;
}
/**
* Returns Number.
* The primary account number (PAN) for the payment card.
*/
public function getNumber(): ?string
{
return $this->number;
}
/**
* Sets Number.
* The primary account number (PAN) for the payment card.
*
* @maps number
*/
public function setNumber(?string $number): void
{
$this->number = $number;
}
/**
* Returns Expiry.
* The year and month, in ISO-8601 `YYYY-MM` date format. See [Internet date and time format](https:
* //tools.ietf.org/html/rfc3339#section-5.6).
*/
public function getExpiry(): ?string
{
return $this->expiry;
}
/**
* Sets Expiry.
* The year and month, in ISO-8601 `YYYY-MM` date format. See [Internet date and time format](https:
* //tools.ietf.org/html/rfc3339#section-5.6).
*
* @maps expiry
*/
public function setExpiry(?string $expiry): void
{
$this->expiry = $expiry;
}
/**
* Returns Card Type.
* The card network or brand. Applies to credit, debit, gift, and payment cards.
*/
public function getCardType(): ?string
{
return $this->cardType;
}
/**
* Sets Card Type.
* The card network or brand. Applies to credit, debit, gift, and payment cards.
*
* @maps card_type
*/
public function setCardType(?string $cardType): void
{
$this->cardType = $cardType;
}
/**
* Returns Type.
* Type of card. i.e Credit, Debit and so on.
*/
public function getType(): ?string
{
return $this->type;
}
/**
* Sets Type.
* Type of card. i.e Credit, Debit and so on.
*
* @maps type
*/
public function setType(?string $type): void
{
$this->type = $type;
}
/**
* Returns Brand.
* The card network or brand. Applies to credit, debit, gift, and payment cards.
*/
public function getBrand(): ?string
{
return $this->brand;
}
/**
* Sets Brand.
* The card network or brand. Applies to credit, debit, gift, and payment cards.
*
* @maps brand
*/
public function setBrand(?string $brand): void
{
$this->brand = $brand;
}
/**
* Returns Billing Address.
* The portable international postal address. Maps to [AddressValidationMetadata](https://github.
* com/googlei18n/libaddressinput/wiki/AddressValidationMetadata) and HTML 5.1 [Autofilling form
* controls: the autocomplete attribute](https://www.w3.org/TR/html51/sec-forms.html#autofilling-form-
* controls-the-autocomplete-attribute).
*/
public function getBillingAddress(): ?Address
{
return $this->billingAddress;
}
/**
* Sets Billing Address.
* The portable international postal address. Maps to [AddressValidationMetadata](https://github.
* com/googlei18n/libaddressinput/wiki/AddressValidationMetadata) and HTML 5.1 [Autofilling form
* controls: the autocomplete attribute](https://www.w3.org/TR/html51/sec-forms.html#autofilling-form-
* controls-the-autocomplete-attribute).
*
* @maps billing_address
*/
public function setBillingAddress(?Address $billingAddress): void
{
$this->billingAddress = $billingAddress;
}
/**
* Encode this object to JSON
*
* @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields
* are set. (default: false)
*
* @return array|stdClass
*/
#[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1)
public function jsonSerialize(bool $asArrayWhenEmpty = false)
{
$json = [];
if (isset($this->name)) {
$json['name'] = $this->name;
}
if (isset($this->number)) {
$json['number'] = $this->number;
}
if (isset($this->expiry)) {
$json['expiry'] = $this->expiry;
}
if (isset($this->cardType)) {
$json['card_type'] = CardBrand::checkValue($this->cardType);
}
if (isset($this->type)) {
$json['type'] = CardType::checkValue($this->type);
}
if (isset($this->brand)) {
$json['brand'] = CardBrand::checkValue($this->brand);
}
if (isset($this->billingAddress)) {
$json['billing_address'] = $this->billingAddress;
}
return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json;
}
}

View File

@@ -0,0 +1,100 @@
<?php
declare(strict_types=1);
/*
* PaypalServerSDKLib
*
* This file was automatically generated by APIMATIC v3.0 ( https://www.apimatic.io ).
*/
namespace PaypalServerSDKLib\Models;
use stdClass;
/**
* Information about cardholder possession validation and cardholder identification and verifications
* (ID&V).
*/
class AssuranceDetails implements \JsonSerializable
{
/**
* @var bool|null
*/
private $accountVerified = false;
/**
* @var bool|null
*/
private $cardHolderAuthenticated = false;
/**
* Returns Account Verified.
* If true, indicates that Cardholder possession validation has been performed on returned payment
* credential.
*/
public function getAccountVerified(): ?bool
{
return $this->accountVerified;
}
/**
* Sets Account Verified.
* If true, indicates that Cardholder possession validation has been performed on returned payment
* credential.
*
* @maps account_verified
*/
public function setAccountVerified(?bool $accountVerified): void
{
$this->accountVerified = $accountVerified;
}
/**
* Returns Card Holder Authenticated.
* If true, indicates that identification and verifications (ID&V) was performed on the returned
* payment credential.If false, the same risk-based authentication can be performed as you would for
* card transactions. This risk-based authentication can include, but not limited to, step-up with 3D
* Secure protocol if applicable.
*/
public function getCardHolderAuthenticated(): ?bool
{
return $this->cardHolderAuthenticated;
}
/**
* Sets Card Holder Authenticated.
* If true, indicates that identification and verifications (ID&V) was performed on the returned
* payment credential.If false, the same risk-based authentication can be performed as you would for
* card transactions. This risk-based authentication can include, but not limited to, step-up with 3D
* Secure protocol if applicable.
*
* @maps card_holder_authenticated
*/
public function setCardHolderAuthenticated(?bool $cardHolderAuthenticated): void
{
$this->cardHolderAuthenticated = $cardHolderAuthenticated;
}
/**
* Encode this object to JSON
*
* @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields
* are set. (default: false)
*
* @return array|stdClass
*/
#[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1)
public function jsonSerialize(bool $asArrayWhenEmpty = false)
{
$json = [];
if (isset($this->accountVerified)) {
$json['account_verified'] = $this->accountVerified;
}
if (isset($this->cardHolderAuthenticated)) {
$json['card_holder_authenticated'] = $this->cardHolderAuthenticated;
}
return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json;
}
}

View File

@@ -0,0 +1,91 @@
<?php
declare(strict_types=1);
/*
* PaypalServerSDKLib
*
* This file was automatically generated by APIMATIC v3.0 ( https://www.apimatic.io ).
*/
namespace PaypalServerSDKLib\Models;
use stdClass;
/**
* Results of Authentication such as 3D Secure.
*/
class AuthenticationResponse implements \JsonSerializable
{
/**
* @var string|null
*/
private $liabilityShift;
/**
* @var ThreeDSecureAuthenticationResponse|null
*/
private $threeDSecure;
/**
* Returns Liability Shift.
* Liability shift indicator. The outcome of the issuer's authentication.
*/
public function getLiabilityShift(): ?string
{
return $this->liabilityShift;
}
/**
* Sets Liability Shift.
* Liability shift indicator. The outcome of the issuer's authentication.
*
* @maps liability_shift
*/
public function setLiabilityShift(?string $liabilityShift): void
{
$this->liabilityShift = $liabilityShift;
}
/**
* Returns Three D Secure.
* Results of 3D Secure Authentication.
*/
public function getThreeDSecure(): ?ThreeDSecureAuthenticationResponse
{
return $this->threeDSecure;
}
/**
* Sets Three D Secure.
* Results of 3D Secure Authentication.
*
* @maps three_d_secure
*/
public function setThreeDSecure(?ThreeDSecureAuthenticationResponse $threeDSecure): void
{
$this->threeDSecure = $threeDSecure;
}
/**
* Encode this object to JSON
*
* @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields
* are set. (default: false)
*
* @return array|stdClass
*/
#[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1)
public function jsonSerialize(bool $asArrayWhenEmpty = false)
{
$json = [];
if (isset($this->liabilityShift)) {
$json['liability_shift'] = LiabilityShiftIndicator::checkValue($this->liabilityShift);
}
if (isset($this->threeDSecure)) {
$json['three_d_secure'] = $this->threeDSecure;
}
return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json;
}
}

View File

@@ -0,0 +1,393 @@
<?php
declare(strict_types=1);
/*
* PaypalServerSDKLib
*
* This file was automatically generated by APIMATIC v3.0 ( https://www.apimatic.io ).
*/
namespace PaypalServerSDKLib\Models;
use stdClass;
/**
* The authorized payment transaction.
*/
class Authorization implements \JsonSerializable
{
/**
* @var string|null
*/
private $status;
/**
* @var AuthorizationStatusDetails|null
*/
private $statusDetails;
/**
* @var string|null
*/
private $id;
/**
* @var Money|null
*/
private $amount;
/**
* @var string|null
*/
private $invoiceId;
/**
* @var string|null
*/
private $customId;
/**
* @var NetworkTransactionReference|null
*/
private $networkTransactionReference;
/**
* @var SellerProtection|null
*/
private $sellerProtection;
/**
* @var string|null
*/
private $expirationTime;
/**
* @var LinkDescription[]|null
*/
private $links;
/**
* @var string|null
*/
private $createTime;
/**
* @var string|null
*/
private $updateTime;
/**
* Returns Status.
* The status for the authorized payment.
*/
public function getStatus(): ?string
{
return $this->status;
}
/**
* Sets Status.
* The status for the authorized payment.
*
* @maps status
*/
public function setStatus(?string $status): void
{
$this->status = $status;
}
/**
* Returns Status Details.
* The details of the authorized payment status.
*/
public function getStatusDetails(): ?AuthorizationStatusDetails
{
return $this->statusDetails;
}
/**
* Sets Status Details.
* The details of the authorized payment status.
*
* @maps status_details
*/
public function setStatusDetails(?AuthorizationStatusDetails $statusDetails): void
{
$this->statusDetails = $statusDetails;
}
/**
* Returns Id.
* The PayPal-generated ID for the authorized payment.
*/
public function getId(): ?string
{
return $this->id;
}
/**
* Sets Id.
* The PayPal-generated ID for the authorized payment.
*
* @maps id
*/
public function setId(?string $id): void
{
$this->id = $id;
}
/**
* Returns Amount.
* The currency and amount for a financial transaction, such as a balance or payment due.
*/
public function getAmount(): ?Money
{
return $this->amount;
}
/**
* Sets Amount.
* The currency and amount for a financial transaction, such as a balance or payment due.
*
* @maps amount
*/
public function setAmount(?Money $amount): void
{
$this->amount = $amount;
}
/**
* Returns Invoice Id.
* The API caller-provided external invoice number for this order. Appears in both the payer's
* transaction history and the emails that the payer receives.
*/
public function getInvoiceId(): ?string
{
return $this->invoiceId;
}
/**
* Sets Invoice Id.
* The API caller-provided external invoice number for this order. Appears in both the payer's
* transaction history and the emails that the payer receives.
*
* @maps invoice_id
*/
public function setInvoiceId(?string $invoiceId): void
{
$this->invoiceId = $invoiceId;
}
/**
* Returns Custom Id.
* The API caller-provided external ID. Used to reconcile API caller-initiated transactions with PayPal
* transactions. Appears in transaction and settlement reports.
*/
public function getCustomId(): ?string
{
return $this->customId;
}
/**
* Sets Custom Id.
* The API caller-provided external ID. Used to reconcile API caller-initiated transactions with PayPal
* transactions. Appears in transaction and settlement reports.
*
* @maps custom_id
*/
public function setCustomId(?string $customId): void
{
$this->customId = $customId;
}
/**
* Returns Network Transaction Reference.
* Reference values used by the card network to identify a transaction.
*/
public function getNetworkTransactionReference(): ?NetworkTransactionReference
{
return $this->networkTransactionReference;
}
/**
* Sets Network Transaction Reference.
* Reference values used by the card network to identify a transaction.
*
* @maps network_transaction_reference
*/
public function setNetworkTransactionReference(?NetworkTransactionReference $networkTransactionReference): void
{
$this->networkTransactionReference = $networkTransactionReference;
}
/**
* Returns Seller Protection.
* The level of protection offered as defined by [PayPal Seller Protection for Merchants](https://www.
* paypal.com/us/webapps/mpp/security/seller-protection).
*/
public function getSellerProtection(): ?SellerProtection
{
return $this->sellerProtection;
}
/**
* Sets Seller Protection.
* The level of protection offered as defined by [PayPal Seller Protection for Merchants](https://www.
* paypal.com/us/webapps/mpp/security/seller-protection).
*
* @maps seller_protection
*/
public function setSellerProtection(?SellerProtection $sellerProtection): void
{
$this->sellerProtection = $sellerProtection;
}
/**
* Returns Expiration Time.
* The date and time, in [Internet date and time format](https://tools.ietf.org/html/rfc3339#section-5.
* 6). Seconds are required while fractional seconds are optional.<blockquote><strong>Note:</strong>
* The regular expression provides guidance but does not reject all invalid dates.</blockquote>
*/
public function getExpirationTime(): ?string
{
return $this->expirationTime;
}
/**
* Sets Expiration Time.
* The date and time, in [Internet date and time format](https://tools.ietf.org/html/rfc3339#section-5.
* 6). Seconds are required while fractional seconds are optional.<blockquote><strong>Note:</strong>
* The regular expression provides guidance but does not reject all invalid dates.</blockquote>
*
* @maps expiration_time
*/
public function setExpirationTime(?string $expirationTime): void
{
$this->expirationTime = $expirationTime;
}
/**
* Returns Links.
* An array of related [HATEOAS links](/docs/api/reference/api-responses/#hateoas-links).
*
* @return LinkDescription[]|null
*/
public function getLinks(): ?array
{
return $this->links;
}
/**
* Sets Links.
* An array of related [HATEOAS links](/docs/api/reference/api-responses/#hateoas-links).
*
* @maps links
*
* @param LinkDescription[]|null $links
*/
public function setLinks(?array $links): void
{
$this->links = $links;
}
/**
* Returns Create Time.
* The date and time, in [Internet date and time format](https://tools.ietf.org/html/rfc3339#section-5.
* 6). Seconds are required while fractional seconds are optional.<blockquote><strong>Note:</strong>
* The regular expression provides guidance but does not reject all invalid dates.</blockquote>
*/
public function getCreateTime(): ?string
{
return $this->createTime;
}
/**
* Sets Create Time.
* The date and time, in [Internet date and time format](https://tools.ietf.org/html/rfc3339#section-5.
* 6). Seconds are required while fractional seconds are optional.<blockquote><strong>Note:</strong>
* The regular expression provides guidance but does not reject all invalid dates.</blockquote>
*
* @maps create_time
*/
public function setCreateTime(?string $createTime): void
{
$this->createTime = $createTime;
}
/**
* Returns Update Time.
* The date and time, in [Internet date and time format](https://tools.ietf.org/html/rfc3339#section-5.
* 6). Seconds are required while fractional seconds are optional.<blockquote><strong>Note:</strong>
* The regular expression provides guidance but does not reject all invalid dates.</blockquote>
*/
public function getUpdateTime(): ?string
{
return $this->updateTime;
}
/**
* Sets Update Time.
* The date and time, in [Internet date and time format](https://tools.ietf.org/html/rfc3339#section-5.
* 6). Seconds are required while fractional seconds are optional.<blockquote><strong>Note:</strong>
* The regular expression provides guidance but does not reject all invalid dates.</blockquote>
*
* @maps update_time
*/
public function setUpdateTime(?string $updateTime): void
{
$this->updateTime = $updateTime;
}
/**
* Encode this object to JSON
*
* @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields
* are set. (default: false)
*
* @return array|stdClass
*/
#[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1)
public function jsonSerialize(bool $asArrayWhenEmpty = false)
{
$json = [];
if (isset($this->status)) {
$json['status'] = AuthorizationStatus::checkValue($this->status);
}
if (isset($this->statusDetails)) {
$json['status_details'] = $this->statusDetails;
}
if (isset($this->id)) {
$json['id'] = $this->id;
}
if (isset($this->amount)) {
$json['amount'] = $this->amount;
}
if (isset($this->invoiceId)) {
$json['invoice_id'] = $this->invoiceId;
}
if (isset($this->customId)) {
$json['custom_id'] = $this->customId;
}
if (isset($this->networkTransactionReference)) {
$json['network_transaction_reference'] = $this->networkTransactionReference;
}
if (isset($this->sellerProtection)) {
$json['seller_protection'] = $this->sellerProtection;
}
if (isset($this->expirationTime)) {
$json['expiration_time'] = $this->expirationTime;
}
if (isset($this->links)) {
$json['links'] = $this->links;
}
if (isset($this->createTime)) {
$json['create_time'] = $this->createTime;
}
if (isset($this->updateTime)) {
$json['update_time'] = $this->updateTime;
}
return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json;
}
}

View File

@@ -0,0 +1,45 @@
<?php
declare(strict_types=1);
/*
* PaypalServerSDKLib
*
* This file was automatically generated by APIMATIC v3.0 ( https://www.apimatic.io ).
*/
namespace PaypalServerSDKLib\Models;
use Core\Utils\CoreHelper;
use Exception;
use stdClass;
/**
* The reason why the authorized status is `PENDING`.
*/
class AuthorizationIncompleteReason
{
public const PENDING_REVIEW = 'PENDING_REVIEW';
public const DECLINED_BY_RISK_FRAUD_FILTERS = 'DECLINED_BY_RISK_FRAUD_FILTERS';
private const _ALL_VALUES = [self::PENDING_REVIEW, self::DECLINED_BY_RISK_FRAUD_FILTERS];
/**
* Ensures that all the given values are present in this Enum.
*
* @param array|stdClass|null|string $value Value or a list/map of values to be checked
*
* @return array|null|string Input value(s), if all are a part of this Enum
*
* @throws Exception Throws exception if any given value is not in this Enum
*/
public static function checkValue($value)
{
$value = json_decode(json_encode($value), true); // converts stdClass into array
if (CoreHelper::checkValueOrValuesInList($value, self::_ALL_VALUES)) {
return $value;
}
throw new Exception("$value is invalid for AuthorizationIncompleteReason.");
}
}

View File

@@ -0,0 +1,54 @@
<?php
declare(strict_types=1);
/*
* PaypalServerSDKLib
*
* This file was automatically generated by APIMATIC v3.0 ( https://www.apimatic.io ).
*/
namespace PaypalServerSDKLib\Models;
use Core\Utils\CoreHelper;
use Exception;
use stdClass;
/**
* The status for the authorized payment.
*/
class AuthorizationStatus
{
public const CREATED = 'CREATED';
public const CAPTURED = 'CAPTURED';
public const DENIED = 'DENIED';
public const PARTIALLY_CAPTURED = 'PARTIALLY_CAPTURED';
public const VOIDED = 'VOIDED';
public const PENDING = 'PENDING';
private const _ALL_VALUES =
[self::CREATED, self::CAPTURED, self::DENIED, self::PARTIALLY_CAPTURED, self::VOIDED, self::PENDING];
/**
* Ensures that all the given values are present in this Enum.
*
* @param array|stdClass|null|string $value Value or a list/map of values to be checked
*
* @return array|null|string Input value(s), if all are a part of this Enum
*
* @throws Exception Throws exception if any given value is not in this Enum
*/
public static function checkValue($value)
{
$value = json_decode(json_encode($value), true); // converts stdClass into array
if (CoreHelper::checkValueOrValuesInList($value, self::_ALL_VALUES)) {
return $value;
}
throw new Exception("$value is invalid for AuthorizationStatus.");
}
}

View File

@@ -0,0 +1,63 @@
<?php
declare(strict_types=1);
/*
* PaypalServerSDKLib
*
* This file was automatically generated by APIMATIC v3.0 ( https://www.apimatic.io ).
*/
namespace PaypalServerSDKLib\Models;
use stdClass;
/**
* The details of the authorized payment status.
*/
class AuthorizationStatusDetails implements \JsonSerializable
{
/**
* @var string|null
*/
private $reason;
/**
* Returns Reason.
* The reason why the authorized status is `PENDING`.
*/
public function getReason(): ?string
{
return $this->reason;
}
/**
* Sets Reason.
* The reason why the authorized status is `PENDING`.
*
* @maps reason
*/
public function setReason(?string $reason): void
{
$this->reason = $reason;
}
/**
* Encode this object to JSON
*
* @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields
* are set. (default: false)
*
* @return array|stdClass
*/
#[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1)
public function jsonSerialize(bool $asArrayWhenEmpty = false)
{
$json = [];
if (isset($this->reason)) {
$json['reason'] = AuthorizationIncompleteReason::checkValue($this->reason);
}
return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json;
}
}

View File

@@ -0,0 +1,91 @@
<?php
declare(strict_types=1);
/*
* PaypalServerSDKLib
*
* This file was automatically generated by APIMATIC v3.0 ( https://www.apimatic.io ).
*/
namespace PaypalServerSDKLib\Models;
use stdClass;
/**
* The status fields and status details for an authorized payment.
*/
class AuthorizationStatusWithDetails implements \JsonSerializable
{
/**
* @var string|null
*/
private $status;
/**
* @var AuthorizationStatusDetails|null
*/
private $statusDetails;
/**
* Returns Status.
* The status for the authorized payment.
*/
public function getStatus(): ?string
{
return $this->status;
}
/**
* Sets Status.
* The status for the authorized payment.
*
* @maps status
*/
public function setStatus(?string $status): void
{
$this->status = $status;
}
/**
* Returns Status Details.
* The details of the authorized payment status.
*/
public function getStatusDetails(): ?AuthorizationStatusDetails
{
return $this->statusDetails;
}
/**
* Sets Status Details.
* The details of the authorized payment status.
*
* @maps status_details
*/
public function setStatusDetails(?AuthorizationStatusDetails $statusDetails): void
{
$this->statusDetails = $statusDetails;
}
/**
* Encode this object to JSON
*
* @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields
* are set. (default: false)
*
* @return array|stdClass
*/
#[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1)
public function jsonSerialize(bool $asArrayWhenEmpty = false)
{
$json = [];
if (isset($this->status)) {
$json['status'] = AuthorizationStatus::checkValue($this->status);
}
if (isset($this->statusDetails)) {
$json['status_details'] = $this->statusDetails;
}
return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json;
}
}

View File

@@ -0,0 +1,422 @@
<?php
declare(strict_types=1);
/*
* PaypalServerSDKLib
*
* This file was automatically generated by APIMATIC v3.0 ( https://www.apimatic.io ).
*/
namespace PaypalServerSDKLib\Models;
use stdClass;
/**
* The authorization with additional payment details, such as risk assessment and processor response.
* These details are populated only for certain payment methods.
*/
class AuthorizationWithAdditionalData implements \JsonSerializable
{
/**
* @var string|null
*/
private $status;
/**
* @var AuthorizationStatusDetails|null
*/
private $statusDetails;
/**
* @var string|null
*/
private $id;
/**
* @var Money|null
*/
private $amount;
/**
* @var string|null
*/
private $invoiceId;
/**
* @var string|null
*/
private $customId;
/**
* @var NetworkTransactionReference|null
*/
private $networkTransactionReference;
/**
* @var SellerProtection|null
*/
private $sellerProtection;
/**
* @var string|null
*/
private $expirationTime;
/**
* @var LinkDescription[]|null
*/
private $links;
/**
* @var string|null
*/
private $createTime;
/**
* @var string|null
*/
private $updateTime;
/**
* @var ProcessorResponse|null
*/
private $processorResponse;
/**
* Returns Status.
* The status for the authorized payment.
*/
public function getStatus(): ?string
{
return $this->status;
}
/**
* Sets Status.
* The status for the authorized payment.
*
* @maps status
*/
public function setStatus(?string $status): void
{
$this->status = $status;
}
/**
* Returns Status Details.
* The details of the authorized payment status.
*/
public function getStatusDetails(): ?AuthorizationStatusDetails
{
return $this->statusDetails;
}
/**
* Sets Status Details.
* The details of the authorized payment status.
*
* @maps status_details
*/
public function setStatusDetails(?AuthorizationStatusDetails $statusDetails): void
{
$this->statusDetails = $statusDetails;
}
/**
* Returns Id.
* The PayPal-generated ID for the authorized payment.
*/
public function getId(): ?string
{
return $this->id;
}
/**
* Sets Id.
* The PayPal-generated ID for the authorized payment.
*
* @maps id
*/
public function setId(?string $id): void
{
$this->id = $id;
}
/**
* Returns Amount.
* The currency and amount for a financial transaction, such as a balance or payment due.
*/
public function getAmount(): ?Money
{
return $this->amount;
}
/**
* Sets Amount.
* The currency and amount for a financial transaction, such as a balance or payment due.
*
* @maps amount
*/
public function setAmount(?Money $amount): void
{
$this->amount = $amount;
}
/**
* Returns Invoice Id.
* The API caller-provided external invoice number for this order. Appears in both the payer's
* transaction history and the emails that the payer receives.
*/
public function getInvoiceId(): ?string
{
return $this->invoiceId;
}
/**
* Sets Invoice Id.
* The API caller-provided external invoice number for this order. Appears in both the payer's
* transaction history and the emails that the payer receives.
*
* @maps invoice_id
*/
public function setInvoiceId(?string $invoiceId): void
{
$this->invoiceId = $invoiceId;
}
/**
* Returns Custom Id.
* The API caller-provided external ID. Used to reconcile API caller-initiated transactions with PayPal
* transactions. Appears in transaction and settlement reports.
*/
public function getCustomId(): ?string
{
return $this->customId;
}
/**
* Sets Custom Id.
* The API caller-provided external ID. Used to reconcile API caller-initiated transactions with PayPal
* transactions. Appears in transaction and settlement reports.
*
* @maps custom_id
*/
public function setCustomId(?string $customId): void
{
$this->customId = $customId;
}
/**
* Returns Network Transaction Reference.
* Reference values used by the card network to identify a transaction.
*/
public function getNetworkTransactionReference(): ?NetworkTransactionReference
{
return $this->networkTransactionReference;
}
/**
* Sets Network Transaction Reference.
* Reference values used by the card network to identify a transaction.
*
* @maps network_transaction_reference
*/
public function setNetworkTransactionReference(?NetworkTransactionReference $networkTransactionReference): void
{
$this->networkTransactionReference = $networkTransactionReference;
}
/**
* Returns Seller Protection.
* The level of protection offered as defined by [PayPal Seller Protection for Merchants](https://www.
* paypal.com/us/webapps/mpp/security/seller-protection).
*/
public function getSellerProtection(): ?SellerProtection
{
return $this->sellerProtection;
}
/**
* Sets Seller Protection.
* The level of protection offered as defined by [PayPal Seller Protection for Merchants](https://www.
* paypal.com/us/webapps/mpp/security/seller-protection).
*
* @maps seller_protection
*/
public function setSellerProtection(?SellerProtection $sellerProtection): void
{
$this->sellerProtection = $sellerProtection;
}
/**
* Returns Expiration Time.
* The date and time, in [Internet date and time format](https://tools.ietf.org/html/rfc3339#section-5.
* 6). Seconds are required while fractional seconds are optional.<blockquote><strong>Note:</strong>
* The regular expression provides guidance but does not reject all invalid dates.</blockquote>
*/
public function getExpirationTime(): ?string
{
return $this->expirationTime;
}
/**
* Sets Expiration Time.
* The date and time, in [Internet date and time format](https://tools.ietf.org/html/rfc3339#section-5.
* 6). Seconds are required while fractional seconds are optional.<blockquote><strong>Note:</strong>
* The regular expression provides guidance but does not reject all invalid dates.</blockquote>
*
* @maps expiration_time
*/
public function setExpirationTime(?string $expirationTime): void
{
$this->expirationTime = $expirationTime;
}
/**
* Returns Links.
* An array of related [HATEOAS links](/docs/api/reference/api-responses/#hateoas-links).
*
* @return LinkDescription[]|null
*/
public function getLinks(): ?array
{
return $this->links;
}
/**
* Sets Links.
* An array of related [HATEOAS links](/docs/api/reference/api-responses/#hateoas-links).
*
* @maps links
*
* @param LinkDescription[]|null $links
*/
public function setLinks(?array $links): void
{
$this->links = $links;
}
/**
* Returns Create Time.
* The date and time, in [Internet date and time format](https://tools.ietf.org/html/rfc3339#section-5.
* 6). Seconds are required while fractional seconds are optional.<blockquote><strong>Note:</strong>
* The regular expression provides guidance but does not reject all invalid dates.</blockquote>
*/
public function getCreateTime(): ?string
{
return $this->createTime;
}
/**
* Sets Create Time.
* The date and time, in [Internet date and time format](https://tools.ietf.org/html/rfc3339#section-5.
* 6). Seconds are required while fractional seconds are optional.<blockquote><strong>Note:</strong>
* The regular expression provides guidance but does not reject all invalid dates.</blockquote>
*
* @maps create_time
*/
public function setCreateTime(?string $createTime): void
{
$this->createTime = $createTime;
}
/**
* Returns Update Time.
* The date and time, in [Internet date and time format](https://tools.ietf.org/html/rfc3339#section-5.
* 6). Seconds are required while fractional seconds are optional.<blockquote><strong>Note:</strong>
* The regular expression provides guidance but does not reject all invalid dates.</blockquote>
*/
public function getUpdateTime(): ?string
{
return $this->updateTime;
}
/**
* Sets Update Time.
* The date and time, in [Internet date and time format](https://tools.ietf.org/html/rfc3339#section-5.
* 6). Seconds are required while fractional seconds are optional.<blockquote><strong>Note:</strong>
* The regular expression provides guidance but does not reject all invalid dates.</blockquote>
*
* @maps update_time
*/
public function setUpdateTime(?string $updateTime): void
{
$this->updateTime = $updateTime;
}
/**
* Returns Processor Response.
* The processor response information for payment requests, such as direct credit card transactions.
*/
public function getProcessorResponse(): ?ProcessorResponse
{
return $this->processorResponse;
}
/**
* Sets Processor Response.
* The processor response information for payment requests, such as direct credit card transactions.
*
* @maps processor_response
*/
public function setProcessorResponse(?ProcessorResponse $processorResponse): void
{
$this->processorResponse = $processorResponse;
}
/**
* Encode this object to JSON
*
* @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields
* are set. (default: false)
*
* @return array|stdClass
*/
#[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1)
public function jsonSerialize(bool $asArrayWhenEmpty = false)
{
$json = [];
if (isset($this->status)) {
$json['status'] = AuthorizationStatus::checkValue($this->status);
}
if (isset($this->statusDetails)) {
$json['status_details'] = $this->statusDetails;
}
if (isset($this->id)) {
$json['id'] = $this->id;
}
if (isset($this->amount)) {
$json['amount'] = $this->amount;
}
if (isset($this->invoiceId)) {
$json['invoice_id'] = $this->invoiceId;
}
if (isset($this->customId)) {
$json['custom_id'] = $this->customId;
}
if (isset($this->networkTransactionReference)) {
$json['network_transaction_reference'] = $this->networkTransactionReference;
}
if (isset($this->sellerProtection)) {
$json['seller_protection'] = $this->sellerProtection;
}
if (isset($this->expirationTime)) {
$json['expiration_time'] = $this->expirationTime;
}
if (isset($this->links)) {
$json['links'] = $this->links;
}
if (isset($this->createTime)) {
$json['create_time'] = $this->createTime;
}
if (isset($this->updateTime)) {
$json['update_time'] = $this->updateTime;
}
if (isset($this->processorResponse)) {
$json['processor_response'] = $this->processorResponse;
}
return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json;
}
}

View File

@@ -0,0 +1,247 @@
<?php
declare(strict_types=1);
/*
* PaypalServerSDKLib
*
* This file was automatically generated by APIMATIC v3.0 ( https://www.apimatic.io ).
*/
namespace PaypalServerSDKLib\Models;
use stdClass;
/**
* Customizes the payer experience during the approval process for the BLIK payment.
*/
class BLIKExperienceContext implements \JsonSerializable
{
/**
* @var string|null
*/
private $brandName;
/**
* @var string|null
*/
private $locale;
/**
* @var string|null
*/
private $shippingPreference = ShippingPreference::GET_FROM_FILE;
/**
* @var string|null
*/
private $returnUrl;
/**
* @var string|null
*/
private $cancelUrl;
/**
* @var string|null
*/
private $consumerIp;
/**
* @var string|null
*/
private $consumerUserAgent;
/**
* Returns Brand Name.
* The label that overrides the business name in the PayPal account on the PayPal site. The pattern is
* defined by an external party and supports Unicode.
*/
public function getBrandName(): ?string
{
return $this->brandName;
}
/**
* Sets Brand Name.
* The label that overrides the business name in the PayPal account on the PayPal site. The pattern is
* defined by an external party and supports Unicode.
*
* @maps brand_name
*/
public function setBrandName(?string $brandName): void
{
$this->brandName = $brandName;
}
/**
* Returns Locale.
* The [language tag](https://tools.ietf.org/html/bcp47#section-2) for the language in which to
* localize the error-related strings, such as messages, issues, and suggested actions. The tag is made
* up of the [ISO 639-2 language code](https://www.loc.gov/standards/iso639-2/php/code_list.php), the
* optional [ISO-15924 script tag](https://www.unicode.org/iso15924/codelists.html), and the [ISO-3166
* alpha-2 country code](/api/rest/reference/country-codes/) or [M49 region code](https://unstats.un.
* org/unsd/methodology/m49/).
*/
public function getLocale(): ?string
{
return $this->locale;
}
/**
* Sets Locale.
* The [language tag](https://tools.ietf.org/html/bcp47#section-2) for the language in which to
* localize the error-related strings, such as messages, issues, and suggested actions. The tag is made
* up of the [ISO 639-2 language code](https://www.loc.gov/standards/iso639-2/php/code_list.php), the
* optional [ISO-15924 script tag](https://www.unicode.org/iso15924/codelists.html), and the [ISO-3166
* alpha-2 country code](/api/rest/reference/country-codes/) or [M49 region code](https://unstats.un.
* org/unsd/methodology/m49/).
*
* @maps locale
*/
public function setLocale(?string $locale): void
{
$this->locale = $locale;
}
/**
* Returns Shipping Preference.
* The location from which the shipping address is derived.
*/
public function getShippingPreference(): ?string
{
return $this->shippingPreference;
}
/**
* Sets Shipping Preference.
* The location from which the shipping address is derived.
*
* @maps shipping_preference
*/
public function setShippingPreference(?string $shippingPreference): void
{
$this->shippingPreference = $shippingPreference;
}
/**
* Returns Return Url.
* Describes the URL.
*/
public function getReturnUrl(): ?string
{
return $this->returnUrl;
}
/**
* Sets Return Url.
* Describes the URL.
*
* @maps return_url
*/
public function setReturnUrl(?string $returnUrl): void
{
$this->returnUrl = $returnUrl;
}
/**
* Returns Cancel Url.
* Describes the URL.
*/
public function getCancelUrl(): ?string
{
return $this->cancelUrl;
}
/**
* Sets Cancel Url.
* Describes the URL.
*
* @maps cancel_url
*/
public function setCancelUrl(?string $cancelUrl): void
{
$this->cancelUrl = $cancelUrl;
}
/**
* Returns Consumer Ip.
* An Internet Protocol address (IP address). This address assigns a numerical label to each device
* that is connected to a computer network through the Internet Protocol. Supports IPv4 and IPv6
* addresses.
*/
public function getConsumerIp(): ?string
{
return $this->consumerIp;
}
/**
* Sets Consumer Ip.
* An Internet Protocol address (IP address). This address assigns a numerical label to each device
* that is connected to a computer network through the Internet Protocol. Supports IPv4 and IPv6
* addresses.
*
* @maps consumer_ip
*/
public function setConsumerIp(?string $consumerIp): void
{
$this->consumerIp = $consumerIp;
}
/**
* Returns Consumer User Agent.
* The payer's User Agent. For example, Mozilla/5.0 (Macintosh; Intel Mac OS X x.y; rv:42.0).
*/
public function getConsumerUserAgent(): ?string
{
return $this->consumerUserAgent;
}
/**
* Sets Consumer User Agent.
* The payer's User Agent. For example, Mozilla/5.0 (Macintosh; Intel Mac OS X x.y; rv:42.0).
*
* @maps consumer_user_agent
*/
public function setConsumerUserAgent(?string $consumerUserAgent): void
{
$this->consumerUserAgent = $consumerUserAgent;
}
/**
* Encode this object to JSON
*
* @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields
* are set. (default: false)
*
* @return array|stdClass
*/
#[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1)
public function jsonSerialize(bool $asArrayWhenEmpty = false)
{
$json = [];
if (isset($this->brandName)) {
$json['brand_name'] = $this->brandName;
}
if (isset($this->locale)) {
$json['locale'] = $this->locale;
}
if (isset($this->shippingPreference)) {
$json['shipping_preference'] = ShippingPreference::checkValue($this->shippingPreference);
}
if (isset($this->returnUrl)) {
$json['return_url'] = $this->returnUrl;
}
if (isset($this->cancelUrl)) {
$json['cancel_url'] = $this->cancelUrl;
}
if (isset($this->consumerIp)) {
$json['consumer_ip'] = $this->consumerIp;
}
if (isset($this->consumerUserAgent)) {
$json['consumer_user_agent'] = $this->consumerUserAgent;
}
return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json;
}
}

View File

@@ -0,0 +1,70 @@
<?php
declare(strict_types=1);
/*
* PaypalServerSDKLib
*
* This file was automatically generated by APIMATIC v3.0 ( https://www.apimatic.io ).
*/
namespace PaypalServerSDKLib\Models;
use stdClass;
/**
* Information used to pay using BLIK level_0 flow.
*/
class BLIKLevel0PaymentObject implements \JsonSerializable
{
/**
* @var string
*/
private $authCode;
/**
* @param string $authCode
*/
public function __construct(string $authCode)
{
$this->authCode = $authCode;
}
/**
* Returns Auth Code.
* The 6-digit code used to authenticate a consumer within BLIK.
*/
public function getAuthCode(): string
{
return $this->authCode;
}
/**
* Sets Auth Code.
* The 6-digit code used to authenticate a consumer within BLIK.
*
* @required
* @maps auth_code
*/
public function setAuthCode(string $authCode): void
{
$this->authCode = $authCode;
}
/**
* Encode this object to JSON
*
* @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields
* are set. (default: false)
*
* @return array|stdClass
*/
#[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1)
public function jsonSerialize(bool $asArrayWhenEmpty = false)
{
$json = [];
$json['auth_code'] = $this->authCode;
return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json;
}
}

View File

@@ -0,0 +1,65 @@
<?php
declare(strict_types=1);
/*
* PaypalServerSDKLib
*
* This file was automatically generated by APIMATIC v3.0 ( https://www.apimatic.io ).
*/
namespace PaypalServerSDKLib\Models;
use stdClass;
/**
* Information used to pay using BLIK one-click flow.
*/
class BLIKOneClickPaymentObject implements \JsonSerializable
{
/**
* @var string|null
*/
private $consumerReference;
/**
* Returns Consumer Reference.
* The merchant generated, unique reference serving as a primary identifier for accounts connected
* between Blik and a merchant.
*/
public function getConsumerReference(): ?string
{
return $this->consumerReference;
}
/**
* Sets Consumer Reference.
* The merchant generated, unique reference serving as a primary identifier for accounts connected
* between Blik and a merchant.
*
* @maps consumer_reference
*/
public function setConsumerReference(?string $consumerReference): void
{
$this->consumerReference = $consumerReference;
}
/**
* Encode this object to JSON
*
* @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields
* are set. (default: false)
*
* @return array|stdClass
*/
#[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1)
public function jsonSerialize(bool $asArrayWhenEmpty = false)
{
$json = [];
if (isset($this->consumerReference)) {
$json['consumer_reference'] = $this->consumerReference;
}
return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json;
}
}

View File

@@ -0,0 +1,160 @@
<?php
declare(strict_types=1);
/*
* PaypalServerSDKLib
*
* This file was automatically generated by APIMATIC v3.0 ( https://www.apimatic.io ).
*/
namespace PaypalServerSDKLib\Models;
use stdClass;
/**
* Information used to pay using BLIK one-click flow.
*/
class BLIKOneClickPaymentRequest implements \JsonSerializable
{
/**
* @var string|null
*/
private $authCode;
/**
* @var string
*/
private $consumerReference;
/**
* @var string|null
*/
private $aliasLabel;
/**
* @var string|null
*/
private $aliasKey;
/**
* @param string $consumerReference
*/
public function __construct(string $consumerReference)
{
$this->consumerReference = $consumerReference;
}
/**
* Returns Auth Code.
* The 6-digit code used to authenticate a consumer within BLIK.
*/
public function getAuthCode(): ?string
{
return $this->authCode;
}
/**
* Sets Auth Code.
* The 6-digit code used to authenticate a consumer within BLIK.
*
* @maps auth_code
*/
public function setAuthCode(?string $authCode): void
{
$this->authCode = $authCode;
}
/**
* Returns Consumer Reference.
* The merchant generated, unique reference serving as a primary identifier for accounts connected
* between Blik and a merchant.
*/
public function getConsumerReference(): string
{
return $this->consumerReference;
}
/**
* Sets Consumer Reference.
* The merchant generated, unique reference serving as a primary identifier for accounts connected
* between Blik and a merchant.
*
* @required
* @maps consumer_reference
*/
public function setConsumerReference(string $consumerReference): void
{
$this->consumerReference = $consumerReference;
}
/**
* Returns Alias Label.
* A bank defined identifier used as a display name to allow the payer to differentiate between
* multiple registered bank accounts.
*/
public function getAliasLabel(): ?string
{
return $this->aliasLabel;
}
/**
* Sets Alias Label.
* A bank defined identifier used as a display name to allow the payer to differentiate between
* multiple registered bank accounts.
*
* @maps alias_label
*/
public function setAliasLabel(?string $aliasLabel): void
{
$this->aliasLabel = $aliasLabel;
}
/**
* Returns Alias Key.
* A Blik-defined identifier for a specific Blik-enabled bank account that is associated with a given
* merchant. Used only in conjunction with a Consumer Reference.
*/
public function getAliasKey(): ?string
{
return $this->aliasKey;
}
/**
* Sets Alias Key.
* A Blik-defined identifier for a specific Blik-enabled bank account that is associated with a given
* merchant. Used only in conjunction with a Consumer Reference.
*
* @maps alias_key
*/
public function setAliasKey(?string $aliasKey): void
{
$this->aliasKey = $aliasKey;
}
/**
* Encode this object to JSON
*
* @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields
* are set. (default: false)
*
* @return array|stdClass
*/
#[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1)
public function jsonSerialize(bool $asArrayWhenEmpty = false)
{
$json = [];
if (isset($this->authCode)) {
$json['auth_code'] = $this->authCode;
}
$json['consumer_reference'] = $this->consumerReference;
if (isset($this->aliasLabel)) {
$json['alias_label'] = $this->aliasLabel;
}
if (isset($this->aliasKey)) {
$json['alias_key'] = $this->aliasKey;
}
return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json;
}
}

View File

@@ -0,0 +1,161 @@
<?php
declare(strict_types=1);
/*
* PaypalServerSDKLib
*
* This file was automatically generated by APIMATIC v3.0 ( https://www.apimatic.io ).
*/
namespace PaypalServerSDKLib\Models;
use stdClass;
/**
* Information used to pay using BLIK.
*/
class BLIKPaymentObject implements \JsonSerializable
{
/**
* @var string|null
*/
private $name;
/**
* @var string|null
*/
private $countryCode;
/**
* @var string|null
*/
private $email;
/**
* @var BLIKOneClickPaymentObject|null
*/
private $oneClick;
/**
* Returns Name.
* The full name representation like Mr J Smith.
*/
public function getName(): ?string
{
return $this->name;
}
/**
* Sets Name.
* The full name representation like Mr J Smith.
*
* @maps name
*/
public function setName(?string $name): void
{
$this->name = $name;
}
/**
* Returns Country Code.
* The [two-character ISO 3166-1 code](/api/rest/reference/country-codes/) that identifies the country
* or region.<blockquote><strong>Note:</strong> The country code for Great Britain is <code>GB</code>
* and not <code>UK</code> as used in the top-level domain names for that country. Use the `C2` country
* code for China worldwide for comparable uncontrolled price (CUP) method, bank card, and cross-border
* transactions.</blockquote>
*/
public function getCountryCode(): ?string
{
return $this->countryCode;
}
/**
* Sets Country Code.
* The [two-character ISO 3166-1 code](/api/rest/reference/country-codes/) that identifies the country
* or region.<blockquote><strong>Note:</strong> The country code for Great Britain is <code>GB</code>
* and not <code>UK</code> as used in the top-level domain names for that country. Use the `C2` country
* code for China worldwide for comparable uncontrolled price (CUP) method, bank card, and cross-border
* transactions.</blockquote>
*
* @maps country_code
*/
public function setCountryCode(?string $countryCode): void
{
$this->countryCode = $countryCode;
}
/**
* Returns Email.
* The internationalized email address.<blockquote><strong>Note:</strong> Up to 64 characters are
* allowed before and 255 characters are allowed after the <code>@</code> sign. However, the generally
* accepted maximum length for an email address is 254 characters. The pattern verifies that an
* unquoted <code>@</code> sign exists.</blockquote>
*/
public function getEmail(): ?string
{
return $this->email;
}
/**
* Sets Email.
* The internationalized email address.<blockquote><strong>Note:</strong> Up to 64 characters are
* allowed before and 255 characters are allowed after the <code>@</code> sign. However, the generally
* accepted maximum length for an email address is 254 characters. The pattern verifies that an
* unquoted <code>@</code> sign exists.</blockquote>
*
* @maps email
*/
public function setEmail(?string $email): void
{
$this->email = $email;
}
/**
* Returns One Click.
* Information used to pay using BLIK one-click flow.
*/
public function getOneClick(): ?BLIKOneClickPaymentObject
{
return $this->oneClick;
}
/**
* Sets One Click.
* Information used to pay using BLIK one-click flow.
*
* @maps one_click
*/
public function setOneClick(?BLIKOneClickPaymentObject $oneClick): void
{
$this->oneClick = $oneClick;
}
/**
* Encode this object to JSON
*
* @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields
* are set. (default: false)
*
* @return array|stdClass
*/
#[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1)
public function jsonSerialize(bool $asArrayWhenEmpty = false)
{
$json = [];
if (isset($this->name)) {
$json['name'] = $this->name;
}
if (isset($this->countryCode)) {
$json['country_code'] = $this->countryCode;
}
if (isset($this->email)) {
$json['email'] = $this->email;
}
if (isset($this->oneClick)) {
$json['one_click'] = $this->oneClick;
}
return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json;
}
}

View File

@@ -0,0 +1,225 @@
<?php
declare(strict_types=1);
/*
* PaypalServerSDKLib
*
* This file was automatically generated by APIMATIC v3.0 ( https://www.apimatic.io ).
*/
namespace PaypalServerSDKLib\Models;
use stdClass;
/**
* Information needed to pay using BLIK.
*/
class BLIKPaymentRequest implements \JsonSerializable
{
/**
* @var string
*/
private $name;
/**
* @var string
*/
private $countryCode;
/**
* @var string|null
*/
private $email;
/**
* @var BLIKExperienceContext|null
*/
private $experienceContext;
/**
* @var BLIKLevel0PaymentObject|null
*/
private $level0;
/**
* @var BLIKOneClickPaymentRequest|null
*/
private $oneClick;
/**
* @param string $name
* @param string $countryCode
*/
public function __construct(string $name, string $countryCode)
{
$this->name = $name;
$this->countryCode = $countryCode;
}
/**
* Returns Name.
* The full name representation like Mr J Smith.
*/
public function getName(): string
{
return $this->name;
}
/**
* Sets Name.
* The full name representation like Mr J Smith.
*
* @required
* @maps name
*/
public function setName(string $name): void
{
$this->name = $name;
}
/**
* Returns Country Code.
* The [two-character ISO 3166-1 code](/api/rest/reference/country-codes/) that identifies the country
* or region.<blockquote><strong>Note:</strong> The country code for Great Britain is <code>GB</code>
* and not <code>UK</code> as used in the top-level domain names for that country. Use the `C2` country
* code for China worldwide for comparable uncontrolled price (CUP) method, bank card, and cross-border
* transactions.</blockquote>
*/
public function getCountryCode(): string
{
return $this->countryCode;
}
/**
* Sets Country Code.
* The [two-character ISO 3166-1 code](/api/rest/reference/country-codes/) that identifies the country
* or region.<blockquote><strong>Note:</strong> The country code for Great Britain is <code>GB</code>
* and not <code>UK</code> as used in the top-level domain names for that country. Use the `C2` country
* code for China worldwide for comparable uncontrolled price (CUP) method, bank card, and cross-border
* transactions.</blockquote>
*
* @required
* @maps country_code
*/
public function setCountryCode(string $countryCode): void
{
$this->countryCode = $countryCode;
}
/**
* Returns Email.
* The internationalized email address.<blockquote><strong>Note:</strong> Up to 64 characters are
* allowed before and 255 characters are allowed after the <code>@</code> sign. However, the generally
* accepted maximum length for an email address is 254 characters. The pattern verifies that an
* unquoted <code>@</code> sign exists.</blockquote>
*/
public function getEmail(): ?string
{
return $this->email;
}
/**
* Sets Email.
* The internationalized email address.<blockquote><strong>Note:</strong> Up to 64 characters are
* allowed before and 255 characters are allowed after the <code>@</code> sign. However, the generally
* accepted maximum length for an email address is 254 characters. The pattern verifies that an
* unquoted <code>@</code> sign exists.</blockquote>
*
* @maps email
*/
public function setEmail(?string $email): void
{
$this->email = $email;
}
/**
* Returns Experience Context.
* Customizes the payer experience during the approval process for the BLIK payment.
*/
public function getExperienceContext(): ?BLIKExperienceContext
{
return $this->experienceContext;
}
/**
* Sets Experience Context.
* Customizes the payer experience during the approval process for the BLIK payment.
*
* @maps experience_context
*/
public function setExperienceContext(?BLIKExperienceContext $experienceContext): void
{
$this->experienceContext = $experienceContext;
}
/**
* Returns Level 0.
* Information used to pay using BLIK level_0 flow.
*/
public function getLevel0(): ?BLIKLevel0PaymentObject
{
return $this->level0;
}
/**
* Sets Level 0.
* Information used to pay using BLIK level_0 flow.
*
* @maps level_0
*/
public function setLevel0(?BLIKLevel0PaymentObject $level0): void
{
$this->level0 = $level0;
}
/**
* Returns One Click.
* Information used to pay using BLIK one-click flow.
*/
public function getOneClick(): ?BLIKOneClickPaymentRequest
{
return $this->oneClick;
}
/**
* Sets One Click.
* Information used to pay using BLIK one-click flow.
*
* @maps one_click
*/
public function setOneClick(?BLIKOneClickPaymentRequest $oneClick): void
{
$this->oneClick = $oneClick;
}
/**
* Encode this object to JSON
*
* @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields
* are set. (default: false)
*
* @return array|stdClass
*/
#[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1)
public function jsonSerialize(bool $asArrayWhenEmpty = false)
{
$json = [];
$json['name'] = $this->name;
$json['country_code'] = $this->countryCode;
if (isset($this->email)) {
$json['email'] = $this->email;
}
if (isset($this->experienceContext)) {
$json['experience_context'] = $this->experienceContext;
}
if (isset($this->level0)) {
$json['level_0'] = $this->level0;
}
if (isset($this->oneClick)) {
$json['one_click'] = $this->oneClick;
}
return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json;
}
}

View File

@@ -0,0 +1,185 @@
<?php
declare(strict_types=1);
/*
* PaypalServerSDKLib
*
* This file was automatically generated by APIMATIC v3.0 ( https://www.apimatic.io ).
*/
namespace PaypalServerSDKLib\Models;
use stdClass;
/**
* Information used to pay Bancontact.
*/
class BancontactPaymentObject implements \JsonSerializable
{
/**
* @var string|null
*/
private $name;
/**
* @var string|null
*/
private $countryCode;
/**
* @var string|null
*/
private $bic;
/**
* @var string|null
*/
private $ibanLastChars;
/**
* @var string|null
*/
private $cardLastDigits;
/**
* Returns Name.
* The full name representation like Mr J Smith.
*/
public function getName(): ?string
{
return $this->name;
}
/**
* Sets Name.
* The full name representation like Mr J Smith.
*
* @maps name
*/
public function setName(?string $name): void
{
$this->name = $name;
}
/**
* Returns Country Code.
* The [two-character ISO 3166-1 code](/api/rest/reference/country-codes/) that identifies the country
* or region.<blockquote><strong>Note:</strong> The country code for Great Britain is <code>GB</code>
* and not <code>UK</code> as used in the top-level domain names for that country. Use the `C2` country
* code for China worldwide for comparable uncontrolled price (CUP) method, bank card, and cross-border
* transactions.</blockquote>
*/
public function getCountryCode(): ?string
{
return $this->countryCode;
}
/**
* Sets Country Code.
* The [two-character ISO 3166-1 code](/api/rest/reference/country-codes/) that identifies the country
* or region.<blockquote><strong>Note:</strong> The country code for Great Britain is <code>GB</code>
* and not <code>UK</code> as used in the top-level domain names for that country. Use the `C2` country
* code for China worldwide for comparable uncontrolled price (CUP) method, bank card, and cross-border
* transactions.</blockquote>
*
* @maps country_code
*/
public function setCountryCode(?string $countryCode): void
{
$this->countryCode = $countryCode;
}
/**
* Returns Bic.
* The business identification code (BIC). In payments systems, a BIC is used to identify a specific
* business, most commonly a bank.
*/
public function getBic(): ?string
{
return $this->bic;
}
/**
* Sets Bic.
* The business identification code (BIC). In payments systems, a BIC is used to identify a specific
* business, most commonly a bank.
*
* @maps bic
*/
public function setBic(?string $bic): void
{
$this->bic = $bic;
}
/**
* Returns Iban Last Chars.
* The last characters of the IBAN used to pay.
*/
public function getIbanLastChars(): ?string
{
return $this->ibanLastChars;
}
/**
* Sets Iban Last Chars.
* The last characters of the IBAN used to pay.
*
* @maps iban_last_chars
*/
public function setIbanLastChars(?string $ibanLastChars): void
{
$this->ibanLastChars = $ibanLastChars;
}
/**
* Returns Card Last Digits.
* The last digits of the card used to fund the Bancontact payment.
*/
public function getCardLastDigits(): ?string
{
return $this->cardLastDigits;
}
/**
* Sets Card Last Digits.
* The last digits of the card used to fund the Bancontact payment.
*
* @maps card_last_digits
*/
public function setCardLastDigits(?string $cardLastDigits): void
{
$this->cardLastDigits = $cardLastDigits;
}
/**
* Encode this object to JSON
*
* @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields
* are set. (default: false)
*
* @return array|stdClass
*/
#[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1)
public function jsonSerialize(bool $asArrayWhenEmpty = false)
{
$json = [];
if (isset($this->name)) {
$json['name'] = $this->name;
}
if (isset($this->countryCode)) {
$json['country_code'] = $this->countryCode;
}
if (isset($this->bic)) {
$json['bic'] = $this->bic;
}
if (isset($this->ibanLastChars)) {
$json['iban_last_chars'] = $this->ibanLastChars;
}
if (isset($this->cardLastDigits)) {
$json['card_last_digits'] = $this->cardLastDigits;
}
return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json;
}
}

View File

@@ -0,0 +1,135 @@
<?php
declare(strict_types=1);
/*
* PaypalServerSDKLib
*
* This file was automatically generated by APIMATIC v3.0 ( https://www.apimatic.io ).
*/
namespace PaypalServerSDKLib\Models;
use stdClass;
/**
* Information needed to pay using Bancontact.
*/
class BancontactPaymentRequest implements \JsonSerializable
{
/**
* @var string
*/
private $name;
/**
* @var string
*/
private $countryCode;
/**
* @var ExperienceContext|null
*/
private $experienceContext;
/**
* @param string $name
* @param string $countryCode
*/
public function __construct(string $name, string $countryCode)
{
$this->name = $name;
$this->countryCode = $countryCode;
}
/**
* Returns Name.
* The full name representation like Mr J Smith.
*/
public function getName(): string
{
return $this->name;
}
/**
* Sets Name.
* The full name representation like Mr J Smith.
*
* @required
* @maps name
*/
public function setName(string $name): void
{
$this->name = $name;
}
/**
* Returns Country Code.
* The [two-character ISO 3166-1 code](/api/rest/reference/country-codes/) that identifies the country
* or region.<blockquote><strong>Note:</strong> The country code for Great Britain is <code>GB</code>
* and not <code>UK</code> as used in the top-level domain names for that country. Use the `C2` country
* code for China worldwide for comparable uncontrolled price (CUP) method, bank card, and cross-border
* transactions.</blockquote>
*/
public function getCountryCode(): string
{
return $this->countryCode;
}
/**
* Sets Country Code.
* The [two-character ISO 3166-1 code](/api/rest/reference/country-codes/) that identifies the country
* or region.<blockquote><strong>Note:</strong> The country code for Great Britain is <code>GB</code>
* and not <code>UK</code> as used in the top-level domain names for that country. Use the `C2` country
* code for China worldwide for comparable uncontrolled price (CUP) method, bank card, and cross-border
* transactions.</blockquote>
*
* @required
* @maps country_code
*/
public function setCountryCode(string $countryCode): void
{
$this->countryCode = $countryCode;
}
/**
* Returns Experience Context.
* Customizes the payer experience during the approval process for the payment.
*/
public function getExperienceContext(): ?ExperienceContext
{
return $this->experienceContext;
}
/**
* Sets Experience Context.
* Customizes the payer experience during the approval process for the payment.
*
* @maps experience_context
*/
public function setExperienceContext(?ExperienceContext $experienceContext): void
{
$this->experienceContext = $experienceContext;
}
/**
* Encode this object to JSON
*
* @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields
* are set. (default: false)
*
* @return array|stdClass
*/
#[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1)
public function jsonSerialize(bool $asArrayWhenEmpty = false)
{
$json = [];
$json['name'] = $this->name;
$json['country_code'] = $this->countryCode;
if (isset($this->experienceContext)) {
$json['experience_context'] = $this->experienceContext;
}
return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json;
}
}

163
src/Models/BinDetails.php Normal file
View File

@@ -0,0 +1,163 @@
<?php
declare(strict_types=1);
/*
* PaypalServerSDKLib
*
* This file was automatically generated by APIMATIC v3.0 ( https://www.apimatic.io ).
*/
namespace PaypalServerSDKLib\Models;
use stdClass;
/**
* Bank Identification Number (BIN) details used to fund a payment.
*/
class BinDetails implements \JsonSerializable
{
/**
* @var string|null
*/
private $bin;
/**
* @var string|null
*/
private $issuingBank;
/**
* @var string|null
*/
private $binCountryCode;
/**
* @var string[]|null
*/
private $products;
/**
* Returns Bin.
* The Bank Identification Number (BIN) signifies the number that is being used to identify the
* granular level details (except the PII information) of the card.
*/
public function getBin(): ?string
{
return $this->bin;
}
/**
* Sets Bin.
* The Bank Identification Number (BIN) signifies the number that is being used to identify the
* granular level details (except the PII information) of the card.
*
* @maps bin
*/
public function setBin(?string $bin): void
{
$this->bin = $bin;
}
/**
* Returns Issuing Bank.
* The issuer of the card instrument.
*/
public function getIssuingBank(): ?string
{
return $this->issuingBank;
}
/**
* Sets Issuing Bank.
* The issuer of the card instrument.
*
* @maps issuing_bank
*/
public function setIssuingBank(?string $issuingBank): void
{
$this->issuingBank = $issuingBank;
}
/**
* Returns Bin Country Code.
* The [two-character ISO 3166-1 code](/api/rest/reference/country-codes/) that identifies the country
* or region.<blockquote><strong>Note:</strong> The country code for Great Britain is <code>GB</code>
* and not <code>UK</code> as used in the top-level domain names for that country. Use the `C2` country
* code for China worldwide for comparable uncontrolled price (CUP) method, bank card, and cross-border
* transactions.</blockquote>
*/
public function getBinCountryCode(): ?string
{
return $this->binCountryCode;
}
/**
* Sets Bin Country Code.
* The [two-character ISO 3166-1 code](/api/rest/reference/country-codes/) that identifies the country
* or region.<blockquote><strong>Note:</strong> The country code for Great Britain is <code>GB</code>
* and not <code>UK</code> as used in the top-level domain names for that country. Use the `C2` country
* code for China worldwide for comparable uncontrolled price (CUP) method, bank card, and cross-border
* transactions.</blockquote>
*
* @maps bin_country_code
*/
public function setBinCountryCode(?string $binCountryCode): void
{
$this->binCountryCode = $binCountryCode;
}
/**
* Returns Products.
* The type of card product assigned to the BIN by the issuer. These values are defined by the issuer
* and may change over time. Some examples include: PREPAID_GIFT, CONSUMER, CORPORATE.
*
* @return string[]|null
*/
public function getProducts(): ?array
{
return $this->products;
}
/**
* Sets Products.
* The type of card product assigned to the BIN by the issuer. These values are defined by the issuer
* and may change over time. Some examples include: PREPAID_GIFT, CONSUMER, CORPORATE.
*
* @maps products
*
* @param string[]|null $products
*/
public function setProducts(?array $products): void
{
$this->products = $products;
}
/**
* Encode this object to JSON
*
* @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields
* are set. (default: false)
*
* @return array|stdClass
*/
#[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1)
public function jsonSerialize(bool $asArrayWhenEmpty = false)
{
$json = [];
if (isset($this->bin)) {
$json['bin'] = $this->bin;
}
if (isset($this->issuingBank)) {
$json['issuing_bank'] = $this->issuingBank;
}
if (isset($this->binCountryCode)) {
$json['bin_country_code'] = $this->binCountryCode;
}
if (isset($this->products)) {
$json['products'] = $this->products;
}
return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json;
}
}

View File

@@ -0,0 +1,66 @@
<?php
declare(strict_types=1);
/*
* PaypalServerSDKLib
*
* This file was automatically generated by APIMATIC v3.0 ( https://www.apimatic.io ).
*/
namespace PaypalServerSDKLib\Models\Builders;
use Core\Utils\CoreHelper;
use PaypalServerSDKLib\Models\ActivityTimestamps;
/**
* Builder for model ActivityTimestamps
*
* @see ActivityTimestamps
*/
class ActivityTimestampsBuilder
{
/**
* @var ActivityTimestamps
*/
private $instance;
private function __construct(ActivityTimestamps $instance)
{
$this->instance = $instance;
}
/**
* Initializes a new activity timestamps Builder object.
*/
public static function init(): self
{
return new self(new ActivityTimestamps());
}
/**
* Sets create time field.
*/
public function createTime(?string $value): self
{
$this->instance->setCreateTime($value);
return $this;
}
/**
* Sets update time field.
*/
public function updateTime(?string $value): self
{
$this->instance->setUpdateTime($value);
return $this;
}
/**
* Initializes a new activity timestamps object.
*/
public function build(): ActivityTimestamps
{
return CoreHelper::clone($this->instance);
}
}

View File

@@ -0,0 +1,93 @@
<?php
declare(strict_types=1);
/*
* PaypalServerSDKLib
*
* This file was automatically generated by APIMATIC v3.0 ( https://www.apimatic.io ).
*/
namespace PaypalServerSDKLib\Models\Builders;
use Core\Utils\CoreHelper;
use PaypalServerSDKLib\Models\Address;
/**
* Builder for model Address
*
* @see Address
*/
class AddressBuilder
{
/**
* @var Address
*/
private $instance;
private function __construct(Address $instance)
{
$this->instance = $instance;
}
/**
* Initializes a new address Builder object.
*/
public static function init(string $countryCode): self
{
return new self(new Address($countryCode));
}
/**
* Sets address line 1 field.
*/
public function addressLine1(?string $value): self
{
$this->instance->setAddressLine1($value);
return $this;
}
/**
* Sets address line 2 field.
*/
public function addressLine2(?string $value): self
{
$this->instance->setAddressLine2($value);
return $this;
}
/**
* Sets admin area 2 field.
*/
public function adminArea2(?string $value): self
{
$this->instance->setAdminArea2($value);
return $this;
}
/**
* Sets admin area 1 field.
*/
public function adminArea1(?string $value): self
{
$this->instance->setAdminArea1($value);
return $this;
}
/**
* Sets postal code field.
*/
public function postalCode(?string $value): self
{
$this->instance->setPostalCode($value);
return $this;
}
/**
* Initializes a new address object.
*/
public function build(): Address
{
return CoreHelper::clone($this->instance);
}
}

View File

@@ -0,0 +1,140 @@
<?php
declare(strict_types=1);
/*
* PaypalServerSDKLib
*
* This file was automatically generated by APIMATIC v3.0 ( https://www.apimatic.io ).
*/
namespace PaypalServerSDKLib\Models\Builders;
use Core\Utils\CoreHelper;
use PaypalServerSDKLib\Models\AddressDetails;
use PaypalServerSDKLib\Models\Name;
use PaypalServerSDKLib\Models\Phone;
/**
* Builder for model AddressDetails
*
* @see AddressDetails
*/
class AddressDetailsBuilder
{
/**
* @var AddressDetails
*/
private $instance;
private function __construct(AddressDetails $instance)
{
$this->instance = $instance;
}
/**
* Initializes a new address details Builder object.
*/
public static function init(string $countryCode): self
{
return new self(new AddressDetails($countryCode));
}
/**
* Sets address line 1 field.
*/
public function addressLine1(?string $value): self
{
$this->instance->setAddressLine1($value);
return $this;
}
/**
* Sets address line 2 field.
*/
public function addressLine2(?string $value): self
{
$this->instance->setAddressLine2($value);
return $this;
}
/**
* Sets admin area 2 field.
*/
public function adminArea2(?string $value): self
{
$this->instance->setAdminArea2($value);
return $this;
}
/**
* Sets admin area 1 field.
*/
public function adminArea1(?string $value): self
{
$this->instance->setAdminArea1($value);
return $this;
}
/**
* Sets postal code field.
*/
public function postalCode(?string $value): self
{
$this->instance->setPostalCode($value);
return $this;
}
/**
* Sets name field.
*/
public function name(?Name $value): self
{
$this->instance->setName($value);
return $this;
}
/**
* Sets id field.
*/
public function id(?string $value): self
{
$this->instance->setId($value);
return $this;
}
/**
* Sets company field.
*/
public function company(?string $value): self
{
$this->instance->setCompany($value);
return $this;
}
/**
* Sets phone field.
*/
public function phone(?string $value): self
{
$this->instance->setPhone($value);
return $this;
}
/**
* Sets phone number field.
*/
public function phoneNumber(?Phone $value): self
{
$this->instance->setPhoneNumber($value);
return $this;
}
/**
* Initializes a new address details object.
*/
public function build(): AddressDetails
{
return CoreHelper::clone($this->instance);
}
}

View File

@@ -0,0 +1,112 @@
<?php
declare(strict_types=1);
/*
* PaypalServerSDKLib
*
* This file was automatically generated by APIMATIC v3.0 ( https://www.apimatic.io ).
*/
namespace PaypalServerSDKLib\Models\Builders;
use Core\Utils\CoreHelper;
use PaypalServerSDKLib\Models\AmountBreakdown;
use PaypalServerSDKLib\Models\Money;
/**
* Builder for model AmountBreakdown
*
* @see AmountBreakdown
*/
class AmountBreakdownBuilder
{
/**
* @var AmountBreakdown
*/
private $instance;
private function __construct(AmountBreakdown $instance)
{
$this->instance = $instance;
}
/**
* Initializes a new amount breakdown Builder object.
*/
public static function init(): self
{
return new self(new AmountBreakdown());
}
/**
* Sets item total field.
*/
public function itemTotal(?Money $value): self
{
$this->instance->setItemTotal($value);
return $this;
}
/**
* Sets shipping field.
*/
public function shipping(?Money $value): self
{
$this->instance->setShipping($value);
return $this;
}
/**
* Sets handling field.
*/
public function handling(?Money $value): self
{
$this->instance->setHandling($value);
return $this;
}
/**
* Sets tax total field.
*/
public function taxTotal(?Money $value): self
{
$this->instance->setTaxTotal($value);
return $this;
}
/**
* Sets insurance field.
*/
public function insurance(?Money $value): self
{
$this->instance->setInsurance($value);
return $this;
}
/**
* Sets shipping discount field.
*/
public function shippingDiscount(?Money $value): self
{
$this->instance->setShippingDiscount($value);
return $this;
}
/**
* Sets discount field.
*/
public function discount(?Money $value): self
{
$this->instance->setDiscount($value);
return $this;
}
/**
* Initializes a new amount breakdown object.
*/
public function build(): AmountBreakdown
{
return CoreHelper::clone($this->instance);
}
}

View File

@@ -0,0 +1,58 @@
<?php
declare(strict_types=1);
/*
* PaypalServerSDKLib
*
* This file was automatically generated by APIMATIC v3.0 ( https://www.apimatic.io ).
*/
namespace PaypalServerSDKLib\Models\Builders;
use Core\Utils\CoreHelper;
use PaypalServerSDKLib\Models\AmountBreakdown;
use PaypalServerSDKLib\Models\AmountWithBreakdown;
/**
* Builder for model AmountWithBreakdown
*
* @see AmountWithBreakdown
*/
class AmountWithBreakdownBuilder
{
/**
* @var AmountWithBreakdown
*/
private $instance;
private function __construct(AmountWithBreakdown $instance)
{
$this->instance = $instance;
}
/**
* Initializes a new amount with breakdown Builder object.
*/
public static function init(string $currencyCode, string $value): self
{
return new self(new AmountWithBreakdown($currencyCode, $value));
}
/**
* Sets breakdown field.
*/
public function breakdown(?AmountBreakdown $value): self
{
$this->instance->setBreakdown($value);
return $this;
}
/**
* Initializes a new amount with breakdown object.
*/
public function build(): AmountWithBreakdown
{
return CoreHelper::clone($this->instance);
}
}

View File

@@ -0,0 +1,68 @@
<?php
declare(strict_types=1);
/*
* PaypalServerSDKLib
*
* This file was automatically generated by APIMATIC v3.0 ( https://www.apimatic.io ).
*/
namespace PaypalServerSDKLib\Models\Builders;
use Core\Utils\CoreHelper;
use PaypalServerSDKLib\Models\ApplePayAttributes;
use PaypalServerSDKLib\Models\CustomerInformation;
use PaypalServerSDKLib\Models\VaultInstruction;
/**
* Builder for model ApplePayAttributes
*
* @see ApplePayAttributes
*/
class ApplePayAttributesBuilder
{
/**
* @var ApplePayAttributes
*/
private $instance;
private function __construct(ApplePayAttributes $instance)
{
$this->instance = $instance;
}
/**
* Initializes a new apple pay attributes Builder object.
*/
public static function init(): self
{
return new self(new ApplePayAttributes());
}
/**
* Sets customer field.
*/
public function customer(?CustomerInformation $value): self
{
$this->instance->setCustomer($value);
return $this;
}
/**
* Sets vault field.
*/
public function vault(?VaultInstruction $value): self
{
$this->instance->setVault($value);
return $this;
}
/**
* Initializes a new apple pay attributes object.
*/
public function build(): ApplePayAttributes
{
return CoreHelper::clone($this->instance);
}
}

View File

@@ -0,0 +1,58 @@
<?php
declare(strict_types=1);
/*
* PaypalServerSDKLib
*
* This file was automatically generated by APIMATIC v3.0 ( https://www.apimatic.io ).
*/
namespace PaypalServerSDKLib\Models\Builders;
use Core\Utils\CoreHelper;
use PaypalServerSDKLib\Models\ApplePayAttributesResponse;
use PaypalServerSDKLib\Models\VaultResponse;
/**
* Builder for model ApplePayAttributesResponse
*
* @see ApplePayAttributesResponse
*/
class ApplePayAttributesResponseBuilder
{
/**
* @var ApplePayAttributesResponse
*/
private $instance;
private function __construct(ApplePayAttributesResponse $instance)
{
$this->instance = $instance;
}
/**
* Initializes a new apple pay attributes response Builder object.
*/
public static function init(): self
{
return new self(new ApplePayAttributesResponse());
}
/**
* Sets vault field.
*/
public function vault(?VaultResponse $value): self
{
$this->instance->setVault($value);
return $this;
}
/**
* Initializes a new apple pay attributes response object.
*/
public function build(): ApplePayAttributesResponse
{
return CoreHelper::clone($this->instance);
}
}

View File

@@ -0,0 +1,94 @@
<?php
declare(strict_types=1);
/*
* PaypalServerSDKLib
*
* This file was automatically generated by APIMATIC v3.0 ( https://www.apimatic.io ).
*/
namespace PaypalServerSDKLib\Models\Builders;
use Core\Utils\CoreHelper;
use PaypalServerSDKLib\Models\Address;
use PaypalServerSDKLib\Models\ApplePayCard;
/**
* Builder for model ApplePayCard
*
* @see ApplePayCard
*/
class ApplePayCardBuilder
{
/**
* @var ApplePayCard
*/
private $instance;
private function __construct(ApplePayCard $instance)
{
$this->instance = $instance;
}
/**
* Initializes a new apple pay card Builder object.
*/
public static function init(): self
{
return new self(new ApplePayCard());
}
/**
* Sets name field.
*/
public function name(?string $value): self
{
$this->instance->setName($value);
return $this;
}
/**
* Sets last digits field.
*/
public function lastDigits(?string $value): self
{
$this->instance->setLastDigits($value);
return $this;
}
/**
* Sets type field.
*/
public function type(?string $value): self
{
$this->instance->setType($value);
return $this;
}
/**
* Sets brand field.
*/
public function brand(?string $value): self
{
$this->instance->setBrand($value);
return $this;
}
/**
* Sets billing address field.
*/
public function billingAddress(?Address $value): self
{
$this->instance->setBillingAddress($value);
return $this;
}
/**
* Initializes a new apple pay card object.
*/
public function build(): ApplePayCard
{
return CoreHelper::clone($this->instance);
}
}

View File

@@ -0,0 +1,161 @@
<?php
declare(strict_types=1);
/*
* PaypalServerSDKLib
*
* This file was automatically generated by APIMATIC v3.0 ( https://www.apimatic.io ).
*/
namespace PaypalServerSDKLib\Models\Builders;
use Core\Utils\CoreHelper;
use PaypalServerSDKLib\Models\Address;
use PaypalServerSDKLib\Models\ApplePayCardResponse;
use PaypalServerSDKLib\Models\AuthenticationResponse;
use PaypalServerSDKLib\Models\BinDetails;
use PaypalServerSDKLib\Models\CardAttributesResponse;
use PaypalServerSDKLib\Models\CardFromRequest;
/**
* Builder for model ApplePayCardResponse
*
* @see ApplePayCardResponse
*/
class ApplePayCardResponseBuilder
{
/**
* @var ApplePayCardResponse
*/
private $instance;
private function __construct(ApplePayCardResponse $instance)
{
$this->instance = $instance;
}
/**
* Initializes a new apple pay card response Builder object.
*/
public static function init(): self
{
return new self(new ApplePayCardResponse());
}
/**
* Sets name field.
*/
public function name(?string $value): self
{
$this->instance->setName($value);
return $this;
}
/**
* Sets last digits field.
*/
public function lastDigits(?string $value): self
{
$this->instance->setLastDigits($value);
return $this;
}
/**
* Sets brand field.
*/
public function brand(?string $value): self
{
$this->instance->setBrand($value);
return $this;
}
/**
* Sets available networks field.
*/
public function availableNetworks(?array $value): self
{
$this->instance->setAvailableNetworks($value);
return $this;
}
/**
* Sets type field.
*/
public function type(?string $value): self
{
$this->instance->setType($value);
return $this;
}
/**
* Sets authentication result field.
*/
public function authenticationResult(?AuthenticationResponse $value): self
{
$this->instance->setAuthenticationResult($value);
return $this;
}
/**
* Sets attributes field.
*/
public function attributes(?CardAttributesResponse $value): self
{
$this->instance->setAttributes($value);
return $this;
}
/**
* Sets from request field.
*/
public function fromRequest(?CardFromRequest $value): self
{
$this->instance->setFromRequest($value);
return $this;
}
/**
* Sets expiry field.
*/
public function expiry(?string $value): self
{
$this->instance->setExpiry($value);
return $this;
}
/**
* Sets bin details field.
*/
public function binDetails(?BinDetails $value): self
{
$this->instance->setBinDetails($value);
return $this;
}
/**
* Sets billing address field.
*/
public function billingAddress(?Address $value): self
{
$this->instance->setBillingAddress($value);
return $this;
}
/**
* Sets country code field.
*/
public function countryCode(?string $value): self
{
$this->instance->setCountryCode($value);
return $this;
}
/**
* Initializes a new apple pay card response object.
*/
public function build(): ApplePayCardResponse
{
return CoreHelper::clone($this->instance);
}
}

View File

@@ -0,0 +1,87 @@
<?php
declare(strict_types=1);
/*
* PaypalServerSDKLib
*
* This file was automatically generated by APIMATIC v3.0 ( https://www.apimatic.io ).
*/
namespace PaypalServerSDKLib\Models\Builders;
use Core\Utils\CoreHelper;
use PaypalServerSDKLib\Models\ApplePayDecryptedTokenData;
use PaypalServerSDKLib\Models\ApplePayPaymentData;
use PaypalServerSDKLib\Models\ApplePayTokenizedCard;
use PaypalServerSDKLib\Models\Money;
/**
* Builder for model ApplePayDecryptedTokenData
*
* @see ApplePayDecryptedTokenData
*/
class ApplePayDecryptedTokenDataBuilder
{
/**
* @var ApplePayDecryptedTokenData
*/
private $instance;
private function __construct(ApplePayDecryptedTokenData $instance)
{
$this->instance = $instance;
}
/**
* Initializes a new apple pay decrypted token data Builder object.
*/
public static function init(ApplePayTokenizedCard $tokenizedCard): self
{
return new self(new ApplePayDecryptedTokenData($tokenizedCard));
}
/**
* Sets transaction amount field.
*/
public function transactionAmount(?Money $value): self
{
$this->instance->setTransactionAmount($value);
return $this;
}
/**
* Sets device manufacturer id field.
*/
public function deviceManufacturerId(?string $value): self
{
$this->instance->setDeviceManufacturerId($value);
return $this;
}
/**
* Sets payment data type field.
*/
public function paymentDataType(?string $value): self
{
$this->instance->setPaymentDataType($value);
return $this;
}
/**
* Sets payment data field.
*/
public function paymentData(?ApplePayPaymentData $value): self
{
$this->instance->setPaymentData($value);
return $this;
}
/**
* Initializes a new apple pay decrypted token data object.
*/
public function build(): ApplePayDecryptedTokenData
{
return CoreHelper::clone($this->instance);
}
}

View File

@@ -0,0 +1,84 @@
<?php
declare(strict_types=1);
/*
* PaypalServerSDKLib
*
* This file was automatically generated by APIMATIC v3.0 ( https://www.apimatic.io ).
*/
namespace PaypalServerSDKLib\Models\Builders;
use Core\Utils\CoreHelper;
use PaypalServerSDKLib\Models\ApplePayPaymentData;
/**
* Builder for model ApplePayPaymentData
*
* @see ApplePayPaymentData
*/
class ApplePayPaymentDataBuilder
{
/**
* @var ApplePayPaymentData
*/
private $instance;
private function __construct(ApplePayPaymentData $instance)
{
$this->instance = $instance;
}
/**
* Initializes a new apple pay payment data Builder object.
*/
public static function init(): self
{
return new self(new ApplePayPaymentData());
}
/**
* Sets cryptogram field.
*/
public function cryptogram(?string $value): self
{
$this->instance->setCryptogram($value);
return $this;
}
/**
* Sets eci indicator field.
*/
public function eciIndicator(?string $value): self
{
$this->instance->setEciIndicator($value);
return $this;
}
/**
* Sets emv data field.
*/
public function emvData(?string $value): self
{
$this->instance->setEmvData($value);
return $this;
}
/**
* Sets pin field.
*/
public function pin(?string $value): self
{
$this->instance->setPin($value);
return $this;
}
/**
* Initializes a new apple pay payment data object.
*/
public function build(): ApplePayPaymentData
{
return CoreHelper::clone($this->instance);
}
}

View File

@@ -0,0 +1,114 @@
<?php
declare(strict_types=1);
/*
* PaypalServerSDKLib
*
* This file was automatically generated by APIMATIC v3.0 ( https://www.apimatic.io ).
*/
namespace PaypalServerSDKLib\Models\Builders;
use Core\Utils\CoreHelper;
use PaypalServerSDKLib\Models\ApplePayAttributesResponse;
use PaypalServerSDKLib\Models\ApplePayCardResponse;
use PaypalServerSDKLib\Models\ApplePayPaymentObject;
use PaypalServerSDKLib\Models\PhoneNumber;
/**
* Builder for model ApplePayPaymentObject
*
* @see ApplePayPaymentObject
*/
class ApplePayPaymentObjectBuilder
{
/**
* @var ApplePayPaymentObject
*/
private $instance;
private function __construct(ApplePayPaymentObject $instance)
{
$this->instance = $instance;
}
/**
* Initializes a new apple pay payment object Builder object.
*/
public static function init(): self
{
return new self(new ApplePayPaymentObject());
}
/**
* Sets id field.
*/
public function id(?string $value): self
{
$this->instance->setId($value);
return $this;
}
/**
* Sets token field.
*/
public function token(?string $value): self
{
$this->instance->setToken($value);
return $this;
}
/**
* Sets name field.
*/
public function name(?string $value): self
{
$this->instance->setName($value);
return $this;
}
/**
* Sets email address field.
*/
public function emailAddress(?string $value): self
{
$this->instance->setEmailAddress($value);
return $this;
}
/**
* Sets phone number field.
*/
public function phoneNumber(?PhoneNumber $value): self
{
$this->instance->setPhoneNumber($value);
return $this;
}
/**
* Sets card field.
*/
public function card(?ApplePayCardResponse $value): self
{
$this->instance->setCard($value);
return $this;
}
/**
* Sets attributes field.
*/
public function attributes(?ApplePayAttributesResponse $value): self
{
$this->instance->setAttributes($value);
return $this;
}
/**
* Initializes a new apple pay payment object object.
*/
public function build(): ApplePayPaymentObject
{
return CoreHelper::clone($this->instance);
}
}

View File

@@ -0,0 +1,58 @@
<?php
declare(strict_types=1);
/*
* PaypalServerSDKLib
*
* This file was automatically generated by APIMATIC v3.0 ( https://www.apimatic.io ).
*/
namespace PaypalServerSDKLib\Models\Builders;
use Core\Utils\CoreHelper;
use PaypalServerSDKLib\Models\ApplePayCard;
use PaypalServerSDKLib\Models\ApplePayPaymentToken;
/**
* Builder for model ApplePayPaymentToken
*
* @see ApplePayPaymentToken
*/
class ApplePayPaymentTokenBuilder
{
/**
* @var ApplePayPaymentToken
*/
private $instance;
private function __construct(ApplePayPaymentToken $instance)
{
$this->instance = $instance;
}
/**
* Initializes a new apple pay payment token Builder object.
*/
public static function init(): self
{
return new self(new ApplePayPaymentToken());
}
/**
* Sets card field.
*/
public function card(?ApplePayCard $value): self
{
$this->instance->setCard($value);
return $this;
}
/**
* Initializes a new apple pay payment token object.
*/
public function build(): ApplePayPaymentToken
{
return CoreHelper::clone($this->instance);
}
}

View File

@@ -0,0 +1,124 @@
<?php
declare(strict_types=1);
/*
* PaypalServerSDKLib
*
* This file was automatically generated by APIMATIC v3.0 ( https://www.apimatic.io ).
*/
namespace PaypalServerSDKLib\Models\Builders;
use Core\Utils\CoreHelper;
use PaypalServerSDKLib\Models\ApplePayAttributes;
use PaypalServerSDKLib\Models\ApplePayDecryptedTokenData;
use PaypalServerSDKLib\Models\ApplePayRequest;
use PaypalServerSDKLib\Models\CardStoredCredential;
use PaypalServerSDKLib\Models\PhoneNumber;
/**
* Builder for model ApplePayRequest
*
* @see ApplePayRequest
*/
class ApplePayRequestBuilder
{
/**
* @var ApplePayRequest
*/
private $instance;
private function __construct(ApplePayRequest $instance)
{
$this->instance = $instance;
}
/**
* Initializes a new apple pay request Builder object.
*/
public static function init(): self
{
return new self(new ApplePayRequest());
}
/**
* Sets id field.
*/
public function id(?string $value): self
{
$this->instance->setId($value);
return $this;
}
/**
* Sets name field.
*/
public function name(?string $value): self
{
$this->instance->setName($value);
return $this;
}
/**
* Sets email address field.
*/
public function emailAddress(?string $value): self
{
$this->instance->setEmailAddress($value);
return $this;
}
/**
* Sets phone number field.
*/
public function phoneNumber(?PhoneNumber $value): self
{
$this->instance->setPhoneNumber($value);
return $this;
}
/**
* Sets decrypted token field.
*/
public function decryptedToken(?ApplePayDecryptedTokenData $value): self
{
$this->instance->setDecryptedToken($value);
return $this;
}
/**
* Sets stored credential field.
*/
public function storedCredential(?CardStoredCredential $value): self
{
$this->instance->setStoredCredential($value);
return $this;
}
/**
* Sets vault id field.
*/
public function vaultId(?string $value): self
{
$this->instance->setVaultId($value);
return $this;
}
/**
* Sets attributes field.
*/
public function attributes(?ApplePayAttributes $value): self
{
$this->instance->setAttributes($value);
return $this;
}
/**
* Initializes a new apple pay request object.
*/
public function build(): ApplePayRequest
{
return CoreHelper::clone($this->instance);
}
}

View File

@@ -0,0 +1,112 @@
<?php
declare(strict_types=1);
/*
* PaypalServerSDKLib
*
* This file was automatically generated by APIMATIC v3.0 ( https://www.apimatic.io ).
*/
namespace PaypalServerSDKLib\Models\Builders;
use Core\Utils\CoreHelper;
use PaypalServerSDKLib\Models\Address;
use PaypalServerSDKLib\Models\ApplePayTokenizedCard;
/**
* Builder for model ApplePayTokenizedCard
*
* @see ApplePayTokenizedCard
*/
class ApplePayTokenizedCardBuilder
{
/**
* @var ApplePayTokenizedCard
*/
private $instance;
private function __construct(ApplePayTokenizedCard $instance)
{
$this->instance = $instance;
}
/**
* Initializes a new apple pay tokenized card Builder object.
*/
public static function init(): self
{
return new self(new ApplePayTokenizedCard());
}
/**
* Sets name field.
*/
public function name(?string $value): self
{
$this->instance->setName($value);
return $this;
}
/**
* Sets number field.
*/
public function number(?string $value): self
{
$this->instance->setNumber($value);
return $this;
}
/**
* Sets expiry field.
*/
public function expiry(?string $value): self
{
$this->instance->setExpiry($value);
return $this;
}
/**
* Sets card type field.
*/
public function cardType(?string $value): self
{
$this->instance->setCardType($value);
return $this;
}
/**
* Sets type field.
*/
public function type(?string $value): self
{
$this->instance->setType($value);
return $this;
}
/**
* Sets brand field.
*/
public function brand(?string $value): self
{
$this->instance->setBrand($value);
return $this;
}
/**
* Sets billing address field.
*/
public function billingAddress(?Address $value): self
{
$this->instance->setBillingAddress($value);
return $this;
}
/**
* Initializes a new apple pay tokenized card object.
*/
public function build(): ApplePayTokenizedCard
{
return CoreHelper::clone($this->instance);
}
}

View File

@@ -0,0 +1,66 @@
<?php
declare(strict_types=1);
/*
* PaypalServerSDKLib
*
* This file was automatically generated by APIMATIC v3.0 ( https://www.apimatic.io ).
*/
namespace PaypalServerSDKLib\Models\Builders;
use Core\Utils\CoreHelper;
use PaypalServerSDKLib\Models\AssuranceDetails;
/**
* Builder for model AssuranceDetails
*
* @see AssuranceDetails
*/
class AssuranceDetailsBuilder
{
/**
* @var AssuranceDetails
*/
private $instance;
private function __construct(AssuranceDetails $instance)
{
$this->instance = $instance;
}
/**
* Initializes a new assurance details Builder object.
*/
public static function init(): self
{
return new self(new AssuranceDetails());
}
/**
* Sets account verified field.
*/
public function accountVerified(?bool $value): self
{
$this->instance->setAccountVerified($value);
return $this;
}
/**
* Sets card holder authenticated field.
*/
public function cardHolderAuthenticated(?bool $value): self
{
$this->instance->setCardHolderAuthenticated($value);
return $this;
}
/**
* Initializes a new assurance details object.
*/
public function build(): AssuranceDetails
{
return CoreHelper::clone($this->instance);
}
}

View File

@@ -0,0 +1,67 @@
<?php
declare(strict_types=1);
/*
* PaypalServerSDKLib
*
* This file was automatically generated by APIMATIC v3.0 ( https://www.apimatic.io ).
*/
namespace PaypalServerSDKLib\Models\Builders;
use Core\Utils\CoreHelper;
use PaypalServerSDKLib\Models\AuthenticationResponse;
use PaypalServerSDKLib\Models\ThreeDSecureAuthenticationResponse;
/**
* Builder for model AuthenticationResponse
*
* @see AuthenticationResponse
*/
class AuthenticationResponseBuilder
{
/**
* @var AuthenticationResponse
*/
private $instance;
private function __construct(AuthenticationResponse $instance)
{
$this->instance = $instance;
}
/**
* Initializes a new authentication response Builder object.
*/
public static function init(): self
{
return new self(new AuthenticationResponse());
}
/**
* Sets liability shift field.
*/
public function liabilityShift(?string $value): self
{
$this->instance->setLiabilityShift($value);
return $this;
}
/**
* Sets three d secure field.
*/
public function threeDSecure(?ThreeDSecureAuthenticationResponse $value): self
{
$this->instance->setThreeDSecure($value);
return $this;
}
/**
* Initializes a new authentication response object.
*/
public function build(): AuthenticationResponse
{
return CoreHelper::clone($this->instance);
}
}

View File

@@ -0,0 +1,160 @@
<?php
declare(strict_types=1);
/*
* PaypalServerSDKLib
*
* This file was automatically generated by APIMATIC v3.0 ( https://www.apimatic.io ).
*/
namespace PaypalServerSDKLib\Models\Builders;
use Core\Utils\CoreHelper;
use PaypalServerSDKLib\Models\Authorization;
use PaypalServerSDKLib\Models\AuthorizationStatusDetails;
use PaypalServerSDKLib\Models\Money;
use PaypalServerSDKLib\Models\NetworkTransactionReference;
use PaypalServerSDKLib\Models\SellerProtection;
/**
* Builder for model Authorization
*
* @see Authorization
*/
class AuthorizationBuilder
{
/**
* @var Authorization
*/
private $instance;
private function __construct(Authorization $instance)
{
$this->instance = $instance;
}
/**
* Initializes a new authorization Builder object.
*/
public static function init(): self
{
return new self(new Authorization());
}
/**
* Sets status field.
*/
public function status(?string $value): self
{
$this->instance->setStatus($value);
return $this;
}
/**
* Sets status details field.
*/
public function statusDetails(?AuthorizationStatusDetails $value): self
{
$this->instance->setStatusDetails($value);
return $this;
}
/**
* Sets id field.
*/
public function id(?string $value): self
{
$this->instance->setId($value);
return $this;
}
/**
* Sets amount field.
*/
public function amount(?Money $value): self
{
$this->instance->setAmount($value);
return $this;
}
/**
* Sets invoice id field.
*/
public function invoiceId(?string $value): self
{
$this->instance->setInvoiceId($value);
return $this;
}
/**
* Sets custom id field.
*/
public function customId(?string $value): self
{
$this->instance->setCustomId($value);
return $this;
}
/**
* Sets network transaction reference field.
*/
public function networkTransactionReference(?NetworkTransactionReference $value): self
{
$this->instance->setNetworkTransactionReference($value);
return $this;
}
/**
* Sets seller protection field.
*/
public function sellerProtection(?SellerProtection $value): self
{
$this->instance->setSellerProtection($value);
return $this;
}
/**
* Sets expiration time field.
*/
public function expirationTime(?string $value): self
{
$this->instance->setExpirationTime($value);
return $this;
}
/**
* Sets links field.
*/
public function links(?array $value): self
{
$this->instance->setLinks($value);
return $this;
}
/**
* Sets create time field.
*/
public function createTime(?string $value): self
{
$this->instance->setCreateTime($value);
return $this;
}
/**
* Sets update time field.
*/
public function updateTime(?string $value): self
{
$this->instance->setUpdateTime($value);
return $this;
}
/**
* Initializes a new authorization object.
*/
public function build(): Authorization
{
return CoreHelper::clone($this->instance);
}
}

View File

@@ -0,0 +1,57 @@
<?php
declare(strict_types=1);
/*
* PaypalServerSDKLib
*
* This file was automatically generated by APIMATIC v3.0 ( https://www.apimatic.io ).
*/
namespace PaypalServerSDKLib\Models\Builders;
use Core\Utils\CoreHelper;
use PaypalServerSDKLib\Models\AuthorizationStatusDetails;
/**
* Builder for model AuthorizationStatusDetails
*
* @see AuthorizationStatusDetails
*/
class AuthorizationStatusDetailsBuilder
{
/**
* @var AuthorizationStatusDetails
*/
private $instance;
private function __construct(AuthorizationStatusDetails $instance)
{
$this->instance = $instance;
}
/**
* Initializes a new authorization status details Builder object.
*/
public static function init(): self
{
return new self(new AuthorizationStatusDetails());
}
/**
* Sets reason field.
*/
public function reason(?string $value): self
{
$this->instance->setReason($value);
return $this;
}
/**
* Initializes a new authorization status details object.
*/
public function build(): AuthorizationStatusDetails
{
return CoreHelper::clone($this->instance);
}
}

View File

@@ -0,0 +1,67 @@
<?php
declare(strict_types=1);
/*
* PaypalServerSDKLib
*
* This file was automatically generated by APIMATIC v3.0 ( https://www.apimatic.io ).
*/
namespace PaypalServerSDKLib\Models\Builders;
use Core\Utils\CoreHelper;
use PaypalServerSDKLib\Models\AuthorizationStatusDetails;
use PaypalServerSDKLib\Models\AuthorizationStatusWithDetails;
/**
* Builder for model AuthorizationStatusWithDetails
*
* @see AuthorizationStatusWithDetails
*/
class AuthorizationStatusWithDetailsBuilder
{
/**
* @var AuthorizationStatusWithDetails
*/
private $instance;
private function __construct(AuthorizationStatusWithDetails $instance)
{
$this->instance = $instance;
}
/**
* Initializes a new authorization status with details Builder object.
*/
public static function init(): self
{
return new self(new AuthorizationStatusWithDetails());
}
/**
* Sets status field.
*/
public function status(?string $value): self
{
$this->instance->setStatus($value);
return $this;
}
/**
* Sets status details field.
*/
public function statusDetails(?AuthorizationStatusDetails $value): self
{
$this->instance->setStatusDetails($value);
return $this;
}
/**
* Initializes a new authorization status with details object.
*/
public function build(): AuthorizationStatusWithDetails
{
return CoreHelper::clone($this->instance);
}
}

View File

@@ -0,0 +1,170 @@
<?php
declare(strict_types=1);
/*
* PaypalServerSDKLib
*
* This file was automatically generated by APIMATIC v3.0 ( https://www.apimatic.io ).
*/
namespace PaypalServerSDKLib\Models\Builders;
use Core\Utils\CoreHelper;
use PaypalServerSDKLib\Models\AuthorizationStatusDetails;
use PaypalServerSDKLib\Models\AuthorizationWithAdditionalData;
use PaypalServerSDKLib\Models\Money;
use PaypalServerSDKLib\Models\NetworkTransactionReference;
use PaypalServerSDKLib\Models\ProcessorResponse;
use PaypalServerSDKLib\Models\SellerProtection;
/**
* Builder for model AuthorizationWithAdditionalData
*
* @see AuthorizationWithAdditionalData
*/
class AuthorizationWithAdditionalDataBuilder
{
/**
* @var AuthorizationWithAdditionalData
*/
private $instance;
private function __construct(AuthorizationWithAdditionalData $instance)
{
$this->instance = $instance;
}
/**
* Initializes a new authorization with additional data Builder object.
*/
public static function init(): self
{
return new self(new AuthorizationWithAdditionalData());
}
/**
* Sets status field.
*/
public function status(?string $value): self
{
$this->instance->setStatus($value);
return $this;
}
/**
* Sets status details field.
*/
public function statusDetails(?AuthorizationStatusDetails $value): self
{
$this->instance->setStatusDetails($value);
return $this;
}
/**
* Sets id field.
*/
public function id(?string $value): self
{
$this->instance->setId($value);
return $this;
}
/**
* Sets amount field.
*/
public function amount(?Money $value): self
{
$this->instance->setAmount($value);
return $this;
}
/**
* Sets invoice id field.
*/
public function invoiceId(?string $value): self
{
$this->instance->setInvoiceId($value);
return $this;
}
/**
* Sets custom id field.
*/
public function customId(?string $value): self
{
$this->instance->setCustomId($value);
return $this;
}
/**
* Sets network transaction reference field.
*/
public function networkTransactionReference(?NetworkTransactionReference $value): self
{
$this->instance->setNetworkTransactionReference($value);
return $this;
}
/**
* Sets seller protection field.
*/
public function sellerProtection(?SellerProtection $value): self
{
$this->instance->setSellerProtection($value);
return $this;
}
/**
* Sets expiration time field.
*/
public function expirationTime(?string $value): self
{
$this->instance->setExpirationTime($value);
return $this;
}
/**
* Sets links field.
*/
public function links(?array $value): self
{
$this->instance->setLinks($value);
return $this;
}
/**
* Sets create time field.
*/
public function createTime(?string $value): self
{
$this->instance->setCreateTime($value);
return $this;
}
/**
* Sets update time field.
*/
public function updateTime(?string $value): self
{
$this->instance->setUpdateTime($value);
return $this;
}
/**
* Sets processor response field.
*/
public function processorResponse(?ProcessorResponse $value): self
{
$this->instance->setProcessorResponse($value);
return $this;
}
/**
* Initializes a new authorization with additional data object.
*/
public function build(): AuthorizationWithAdditionalData
{
return CoreHelper::clone($this->instance);
}
}

View File

@@ -0,0 +1,111 @@
<?php
declare(strict_types=1);
/*
* PaypalServerSDKLib
*
* This file was automatically generated by APIMATIC v3.0 ( https://www.apimatic.io ).
*/
namespace PaypalServerSDKLib\Models\Builders;
use Core\Utils\CoreHelper;
use PaypalServerSDKLib\Models\BLIKExperienceContext;
/**
* Builder for model BLIKExperienceContext
*
* @see BLIKExperienceContext
*/
class BLIKExperienceContextBuilder
{
/**
* @var BLIKExperienceContext
*/
private $instance;
private function __construct(BLIKExperienceContext $instance)
{
$this->instance = $instance;
}
/**
* Initializes a new blikexperience context Builder object.
*/
public static function init(): self
{
return new self(new BLIKExperienceContext());
}
/**
* Sets brand name field.
*/
public function brandName(?string $value): self
{
$this->instance->setBrandName($value);
return $this;
}
/**
* Sets locale field.
*/
public function locale(?string $value): self
{
$this->instance->setLocale($value);
return $this;
}
/**
* Sets shipping preference field.
*/
public function shippingPreference(?string $value): self
{
$this->instance->setShippingPreference($value);
return $this;
}
/**
* Sets return url field.
*/
public function returnUrl(?string $value): self
{
$this->instance->setReturnUrl($value);
return $this;
}
/**
* Sets cancel url field.
*/
public function cancelUrl(?string $value): self
{
$this->instance->setCancelUrl($value);
return $this;
}
/**
* Sets consumer ip field.
*/
public function consumerIp(?string $value): self
{
$this->instance->setConsumerIp($value);
return $this;
}
/**
* Sets consumer user agent field.
*/
public function consumerUserAgent(?string $value): self
{
$this->instance->setConsumerUserAgent($value);
return $this;
}
/**
* Initializes a new blikexperience context object.
*/
public function build(): BLIKExperienceContext
{
return CoreHelper::clone($this->instance);
}
}

View File

@@ -0,0 +1,48 @@
<?php
declare(strict_types=1);
/*
* PaypalServerSDKLib
*
* This file was automatically generated by APIMATIC v3.0 ( https://www.apimatic.io ).
*/
namespace PaypalServerSDKLib\Models\Builders;
use Core\Utils\CoreHelper;
use PaypalServerSDKLib\Models\BLIKLevel0PaymentObject;
/**
* Builder for model BLIKLevel0PaymentObject
*
* @see BLIKLevel0PaymentObject
*/
class BLIKLevel0PaymentObjectBuilder
{
/**
* @var BLIKLevel0PaymentObject
*/
private $instance;
private function __construct(BLIKLevel0PaymentObject $instance)
{
$this->instance = $instance;
}
/**
* Initializes a new bliklevel 0 payment object Builder object.
*/
public static function init(string $authCode): self
{
return new self(new BLIKLevel0PaymentObject($authCode));
}
/**
* Initializes a new bliklevel 0 payment object object.
*/
public function build(): BLIKLevel0PaymentObject
{
return CoreHelper::clone($this->instance);
}
}

View File

@@ -0,0 +1,57 @@
<?php
declare(strict_types=1);
/*
* PaypalServerSDKLib
*
* This file was automatically generated by APIMATIC v3.0 ( https://www.apimatic.io ).
*/
namespace PaypalServerSDKLib\Models\Builders;
use Core\Utils\CoreHelper;
use PaypalServerSDKLib\Models\BLIKOneClickPaymentObject;
/**
* Builder for model BLIKOneClickPaymentObject
*
* @see BLIKOneClickPaymentObject
*/
class BLIKOneClickPaymentObjectBuilder
{
/**
* @var BLIKOneClickPaymentObject
*/
private $instance;
private function __construct(BLIKOneClickPaymentObject $instance)
{
$this->instance = $instance;
}
/**
* Initializes a new blikone click payment object Builder object.
*/
public static function init(): self
{
return new self(new BLIKOneClickPaymentObject());
}
/**
* Sets consumer reference field.
*/
public function consumerReference(?string $value): self
{
$this->instance->setConsumerReference($value);
return $this;
}
/**
* Initializes a new blikone click payment object object.
*/
public function build(): BLIKOneClickPaymentObject
{
return CoreHelper::clone($this->instance);
}
}

View File

@@ -0,0 +1,75 @@
<?php
declare(strict_types=1);
/*
* PaypalServerSDKLib
*
* This file was automatically generated by APIMATIC v3.0 ( https://www.apimatic.io ).
*/
namespace PaypalServerSDKLib\Models\Builders;
use Core\Utils\CoreHelper;
use PaypalServerSDKLib\Models\BLIKOneClickPaymentRequest;
/**
* Builder for model BLIKOneClickPaymentRequest
*
* @see BLIKOneClickPaymentRequest
*/
class BLIKOneClickPaymentRequestBuilder
{
/**
* @var BLIKOneClickPaymentRequest
*/
private $instance;
private function __construct(BLIKOneClickPaymentRequest $instance)
{
$this->instance = $instance;
}
/**
* Initializes a new blikone click payment request Builder object.
*/
public static function init(string $consumerReference): self
{
return new self(new BLIKOneClickPaymentRequest($consumerReference));
}
/**
* Sets auth code field.
*/
public function authCode(?string $value): self
{
$this->instance->setAuthCode($value);
return $this;
}
/**
* Sets alias label field.
*/
public function aliasLabel(?string $value): self
{
$this->instance->setAliasLabel($value);
return $this;
}
/**
* Sets alias key field.
*/
public function aliasKey(?string $value): self
{
$this->instance->setAliasKey($value);
return $this;
}
/**
* Initializes a new blikone click payment request object.
*/
public function build(): BLIKOneClickPaymentRequest
{
return CoreHelper::clone($this->instance);
}
}

View File

@@ -0,0 +1,85 @@
<?php
declare(strict_types=1);
/*
* PaypalServerSDKLib
*
* This file was automatically generated by APIMATIC v3.0 ( https://www.apimatic.io ).
*/
namespace PaypalServerSDKLib\Models\Builders;
use Core\Utils\CoreHelper;
use PaypalServerSDKLib\Models\BLIKOneClickPaymentObject;
use PaypalServerSDKLib\Models\BLIKPaymentObject;
/**
* Builder for model BLIKPaymentObject
*
* @see BLIKPaymentObject
*/
class BLIKPaymentObjectBuilder
{
/**
* @var BLIKPaymentObject
*/
private $instance;
private function __construct(BLIKPaymentObject $instance)
{
$this->instance = $instance;
}
/**
* Initializes a new blikpayment object Builder object.
*/
public static function init(): self
{
return new self(new BLIKPaymentObject());
}
/**
* Sets name field.
*/
public function name(?string $value): self
{
$this->instance->setName($value);
return $this;
}
/**
* Sets country code field.
*/
public function countryCode(?string $value): self
{
$this->instance->setCountryCode($value);
return $this;
}
/**
* Sets email field.
*/
public function email(?string $value): self
{
$this->instance->setEmail($value);
return $this;
}
/**
* Sets one click field.
*/
public function oneClick(?BLIKOneClickPaymentObject $value): self
{
$this->instance->setOneClick($value);
return $this;
}
/**
* Initializes a new blikpayment object object.
*/
public function build(): BLIKPaymentObject
{
return CoreHelper::clone($this->instance);
}
}

View File

@@ -0,0 +1,87 @@
<?php
declare(strict_types=1);
/*
* PaypalServerSDKLib
*
* This file was automatically generated by APIMATIC v3.0 ( https://www.apimatic.io ).
*/
namespace PaypalServerSDKLib\Models\Builders;
use Core\Utils\CoreHelper;
use PaypalServerSDKLib\Models\BLIKExperienceContext;
use PaypalServerSDKLib\Models\BLIKLevel0PaymentObject;
use PaypalServerSDKLib\Models\BLIKOneClickPaymentRequest;
use PaypalServerSDKLib\Models\BLIKPaymentRequest;
/**
* Builder for model BLIKPaymentRequest
*
* @see BLIKPaymentRequest
*/
class BLIKPaymentRequestBuilder
{
/**
* @var BLIKPaymentRequest
*/
private $instance;
private function __construct(BLIKPaymentRequest $instance)
{
$this->instance = $instance;
}
/**
* Initializes a new blikpayment request Builder object.
*/
public static function init(string $name, string $countryCode): self
{
return new self(new BLIKPaymentRequest($name, $countryCode));
}
/**
* Sets email field.
*/
public function email(?string $value): self
{
$this->instance->setEmail($value);
return $this;
}
/**
* Sets experience context field.
*/
public function experienceContext(?BLIKExperienceContext $value): self
{
$this->instance->setExperienceContext($value);
return $this;
}
/**
* Sets level 0 field.
*/
public function level0(?BLIKLevel0PaymentObject $value): self
{
$this->instance->setLevel0($value);
return $this;
}
/**
* Sets one click field.
*/
public function oneClick(?BLIKOneClickPaymentRequest $value): self
{
$this->instance->setOneClick($value);
return $this;
}
/**
* Initializes a new blikpayment request object.
*/
public function build(): BLIKPaymentRequest
{
return CoreHelper::clone($this->instance);
}
}

View File

@@ -0,0 +1,93 @@
<?php
declare(strict_types=1);
/*
* PaypalServerSDKLib
*
* This file was automatically generated by APIMATIC v3.0 ( https://www.apimatic.io ).
*/
namespace PaypalServerSDKLib\Models\Builders;
use Core\Utils\CoreHelper;
use PaypalServerSDKLib\Models\BancontactPaymentObject;
/**
* Builder for model BancontactPaymentObject
*
* @see BancontactPaymentObject
*/
class BancontactPaymentObjectBuilder
{
/**
* @var BancontactPaymentObject
*/
private $instance;
private function __construct(BancontactPaymentObject $instance)
{
$this->instance = $instance;
}
/**
* Initializes a new bancontact payment object Builder object.
*/
public static function init(): self
{
return new self(new BancontactPaymentObject());
}
/**
* Sets name field.
*/
public function name(?string $value): self
{
$this->instance->setName($value);
return $this;
}
/**
* Sets country code field.
*/
public function countryCode(?string $value): self
{
$this->instance->setCountryCode($value);
return $this;
}
/**
* Sets bic field.
*/
public function bic(?string $value): self
{
$this->instance->setBic($value);
return $this;
}
/**
* Sets iban last chars field.
*/
public function ibanLastChars(?string $value): self
{
$this->instance->setIbanLastChars($value);
return $this;
}
/**
* Sets card last digits field.
*/
public function cardLastDigits(?string $value): self
{
$this->instance->setCardLastDigits($value);
return $this;
}
/**
* Initializes a new bancontact payment object object.
*/
public function build(): BancontactPaymentObject
{
return CoreHelper::clone($this->instance);
}
}

View File

@@ -0,0 +1,58 @@
<?php
declare(strict_types=1);
/*
* PaypalServerSDKLib
*
* This file was automatically generated by APIMATIC v3.0 ( https://www.apimatic.io ).
*/
namespace PaypalServerSDKLib\Models\Builders;
use Core\Utils\CoreHelper;
use PaypalServerSDKLib\Models\BancontactPaymentRequest;
use PaypalServerSDKLib\Models\ExperienceContext;
/**
* Builder for model BancontactPaymentRequest
*
* @see BancontactPaymentRequest
*/
class BancontactPaymentRequestBuilder
{
/**
* @var BancontactPaymentRequest
*/
private $instance;
private function __construct(BancontactPaymentRequest $instance)
{
$this->instance = $instance;
}
/**
* Initializes a new bancontact payment request Builder object.
*/
public static function init(string $name, string $countryCode): self
{
return new self(new BancontactPaymentRequest($name, $countryCode));
}
/**
* Sets experience context field.
*/
public function experienceContext(?ExperienceContext $value): self
{
$this->instance->setExperienceContext($value);
return $this;
}
/**
* Initializes a new bancontact payment request object.
*/
public function build(): BancontactPaymentRequest
{
return CoreHelper::clone($this->instance);
}
}

View File

@@ -0,0 +1,84 @@
<?php
declare(strict_types=1);
/*
* PaypalServerSDKLib
*
* This file was automatically generated by APIMATIC v3.0 ( https://www.apimatic.io ).
*/
namespace PaypalServerSDKLib\Models\Builders;
use Core\Utils\CoreHelper;
use PaypalServerSDKLib\Models\BinDetails;
/**
* Builder for model BinDetails
*
* @see BinDetails
*/
class BinDetailsBuilder
{
/**
* @var BinDetails
*/
private $instance;
private function __construct(BinDetails $instance)
{
$this->instance = $instance;
}
/**
* Initializes a new bin details Builder object.
*/
public static function init(): self
{
return new self(new BinDetails());
}
/**
* Sets bin field.
*/
public function bin(?string $value): self
{
$this->instance->setBin($value);
return $this;
}
/**
* Sets issuing bank field.
*/
public function issuingBank(?string $value): self
{
$this->instance->setIssuingBank($value);
return $this;
}
/**
* Sets bin country code field.
*/
public function binCountryCode(?string $value): self
{
$this->instance->setBinCountryCode($value);
return $this;
}
/**
* Sets products field.
*/
public function products(?array $value): self
{
$this->instance->setProducts($value);
return $this;
}
/**
* Initializes a new bin details object.
*/
public function build(): BinDetails
{
return CoreHelper::clone($this->instance);
}
}

View File

@@ -0,0 +1,189 @@
<?php
declare(strict_types=1);
/*
* PaypalServerSDKLib
*
* This file was automatically generated by APIMATIC v3.0 ( https://www.apimatic.io ).
*/
namespace PaypalServerSDKLib\Models\Builders;
use Core\Utils\CoreHelper;
use PaypalServerSDKLib\Models\Capture;
use PaypalServerSDKLib\Models\CaptureStatusDetails;
use PaypalServerSDKLib\Models\Money;
use PaypalServerSDKLib\Models\NetworkTransactionReference;
use PaypalServerSDKLib\Models\ProcessorResponse;
use PaypalServerSDKLib\Models\SellerProtection;
use PaypalServerSDKLib\Models\SellerReceivableBreakdown;
/**
* Builder for model Capture
*
* @see Capture
*/
class CaptureBuilder
{
/**
* @var Capture
*/
private $instance;
private function __construct(Capture $instance)
{
$this->instance = $instance;
}
/**
* Initializes a new capture Builder object.
*/
public static function init(): self
{
return new self(new Capture());
}
/**
* Sets status field.
*/
public function status(?string $value): self
{
$this->instance->setStatus($value);
return $this;
}
/**
* Sets status details field.
*/
public function statusDetails(?CaptureStatusDetails $value): self
{
$this->instance->setStatusDetails($value);
return $this;
}
/**
* Sets id field.
*/
public function id(?string $value): self
{
$this->instance->setId($value);
return $this;
}
/**
* Sets amount field.
*/
public function amount(?Money $value): self
{
$this->instance->setAmount($value);
return $this;
}
/**
* Sets invoice id field.
*/
public function invoiceId(?string $value): self
{
$this->instance->setInvoiceId($value);
return $this;
}
/**
* Sets custom id field.
*/
public function customId(?string $value): self
{
$this->instance->setCustomId($value);
return $this;
}
/**
* Sets network transaction reference field.
*/
public function networkTransactionReference(?NetworkTransactionReference $value): self
{
$this->instance->setNetworkTransactionReference($value);
return $this;
}
/**
* Sets seller protection field.
*/
public function sellerProtection(?SellerProtection $value): self
{
$this->instance->setSellerProtection($value);
return $this;
}
/**
* Sets final capture field.
*/
public function finalCapture(?bool $value): self
{
$this->instance->setFinalCapture($value);
return $this;
}
/**
* Sets seller receivable breakdown field.
*/
public function sellerReceivableBreakdown(?SellerReceivableBreakdown $value): self
{
$this->instance->setSellerReceivableBreakdown($value);
return $this;
}
/**
* Sets disbursement mode field.
*/
public function disbursementMode(?string $value): self
{
$this->instance->setDisbursementMode($value);
return $this;
}
/**
* Sets links field.
*/
public function links(?array $value): self
{
$this->instance->setLinks($value);
return $this;
}
/**
* Sets processor response field.
*/
public function processorResponse(?ProcessorResponse $value): self
{
$this->instance->setProcessorResponse($value);
return $this;
}
/**
* Sets create time field.
*/
public function createTime(?string $value): self
{
$this->instance->setCreateTime($value);
return $this;
}
/**
* Sets update time field.
*/
public function updateTime(?string $value): self
{
$this->instance->setUpdateTime($value);
return $this;
}
/**
* Initializes a new capture object.
*/
public function build(): Capture
{
return CoreHelper::clone($this->instance);
}
}

View File

@@ -0,0 +1,75 @@
<?php
declare(strict_types=1);
/*
* PaypalServerSDKLib
*
* This file was automatically generated by APIMATIC v3.0 ( https://www.apimatic.io ).
*/
namespace PaypalServerSDKLib\Models\Builders;
use Core\Utils\CoreHelper;
use PaypalServerSDKLib\Models\CapturePaymentInstruction;
/**
* Builder for model CapturePaymentInstruction
*
* @see CapturePaymentInstruction
*/
class CapturePaymentInstructionBuilder
{
/**
* @var CapturePaymentInstruction
*/
private $instance;
private function __construct(CapturePaymentInstruction $instance)
{
$this->instance = $instance;
}
/**
* Initializes a new capture payment instruction Builder object.
*/
public static function init(): self
{
return new self(new CapturePaymentInstruction());
}
/**
* Sets platform fees field.
*/
public function platformFees(?array $value): self
{
$this->instance->setPlatformFees($value);
return $this;
}
/**
* Sets disbursement mode field.
*/
public function disbursementMode(?string $value): self
{
$this->instance->setDisbursementMode($value);
return $this;
}
/**
* Sets payee receivable fx rate id field.
*/
public function payeeReceivableFxRateId(?string $value): self
{
$this->instance->setPayeeReceivableFxRateId($value);
return $this;
}
/**
* Initializes a new capture payment instruction object.
*/
public function build(): CapturePaymentInstruction
{
return CoreHelper::clone($this->instance);
}
}

View File

@@ -0,0 +1,104 @@
<?php
declare(strict_types=1);
/*
* PaypalServerSDKLib
*
* This file was automatically generated by APIMATIC v3.0 ( https://www.apimatic.io ).
*/
namespace PaypalServerSDKLib\Models\Builders;
use Core\Utils\CoreHelper;
use PaypalServerSDKLib\Models\CapturePaymentInstruction;
use PaypalServerSDKLib\Models\CaptureRequest;
use PaypalServerSDKLib\Models\Money;
/**
* Builder for model CaptureRequest
*
* @see CaptureRequest
*/
class CaptureRequestBuilder
{
/**
* @var CaptureRequest
*/
private $instance;
private function __construct(CaptureRequest $instance)
{
$this->instance = $instance;
}
/**
* Initializes a new capture request Builder object.
*/
public static function init(): self
{
return new self(new CaptureRequest());
}
/**
* Sets invoice id field.
*/
public function invoiceId(?string $value): self
{
$this->instance->setInvoiceId($value);
return $this;
}
/**
* Sets note to payer field.
*/
public function noteToPayer(?string $value): self
{
$this->instance->setNoteToPayer($value);
return $this;
}
/**
* Sets amount field.
*/
public function amount(?Money $value): self
{
$this->instance->setAmount($value);
return $this;
}
/**
* Sets final capture field.
*/
public function finalCapture(?bool $value): self
{
$this->instance->setFinalCapture($value);
return $this;
}
/**
* Sets payment instruction field.
*/
public function paymentInstruction(?CapturePaymentInstruction $value): self
{
$this->instance->setPaymentInstruction($value);
return $this;
}
/**
* Sets soft descriptor field.
*/
public function softDescriptor(?string $value): self
{
$this->instance->setSoftDescriptor($value);
return $this;
}
/**
* Initializes a new capture request object.
*/
public function build(): CaptureRequest
{
return CoreHelper::clone($this->instance);
}
}

View File

@@ -0,0 +1,57 @@
<?php
declare(strict_types=1);
/*
* PaypalServerSDKLib
*
* This file was automatically generated by APIMATIC v3.0 ( https://www.apimatic.io ).
*/
namespace PaypalServerSDKLib\Models\Builders;
use Core\Utils\CoreHelper;
use PaypalServerSDKLib\Models\CaptureStatusDetails;
/**
* Builder for model CaptureStatusDetails
*
* @see CaptureStatusDetails
*/
class CaptureStatusDetailsBuilder
{
/**
* @var CaptureStatusDetails
*/
private $instance;
private function __construct(CaptureStatusDetails $instance)
{
$this->instance = $instance;
}
/**
* Initializes a new capture status details Builder object.
*/
public static function init(): self
{
return new self(new CaptureStatusDetails());
}
/**
* Sets reason field.
*/
public function reason(?string $value): self
{
$this->instance->setReason($value);
return $this;
}
/**
* Initializes a new capture status details object.
*/
public function build(): CaptureStatusDetails
{
return CoreHelper::clone($this->instance);
}
}

View File

@@ -0,0 +1,67 @@
<?php
declare(strict_types=1);
/*
* PaypalServerSDKLib
*
* This file was automatically generated by APIMATIC v3.0 ( https://www.apimatic.io ).
*/
namespace PaypalServerSDKLib\Models\Builders;
use Core\Utils\CoreHelper;
use PaypalServerSDKLib\Models\CaptureStatusDetails;
use PaypalServerSDKLib\Models\CaptureStatusWithDetails;
/**
* Builder for model CaptureStatusWithDetails
*
* @see CaptureStatusWithDetails
*/
class CaptureStatusWithDetailsBuilder
{
/**
* @var CaptureStatusWithDetails
*/
private $instance;
private function __construct(CaptureStatusWithDetails $instance)
{
$this->instance = $instance;
}
/**
* Initializes a new capture status with details Builder object.
*/
public static function init(): self
{
return new self(new CaptureStatusWithDetails());
}
/**
* Sets status field.
*/
public function status(?string $value): self
{
$this->instance->setStatus($value);
return $this;
}
/**
* Sets status details field.
*/
public function statusDetails(?CaptureStatusDetails $value): self
{
$this->instance->setStatusDetails($value);
return $this;
}
/**
* Initializes a new capture status with details object.
*/
public function build(): CaptureStatusWithDetails
{
return CoreHelper::clone($this->instance);
}
}

View File

@@ -0,0 +1,209 @@
<?php
declare(strict_types=1);
/*
* PaypalServerSDKLib
*
* This file was automatically generated by APIMATIC v3.0 ( https://www.apimatic.io ).
*/
namespace PaypalServerSDKLib\Models\Builders;
use Core\Utils\CoreHelper;
use PaypalServerSDKLib\Models\CapturedPayment;
use PaypalServerSDKLib\Models\CaptureStatusDetails;
use PaypalServerSDKLib\Models\Money;
use PaypalServerSDKLib\Models\NetworkTransactionReference;
use PaypalServerSDKLib\Models\Payee;
use PaypalServerSDKLib\Models\PaymentSupplementaryData;
use PaypalServerSDKLib\Models\ProcessorResponse;
use PaypalServerSDKLib\Models\SellerProtection;
use PaypalServerSDKLib\Models\SellerReceivableBreakdown;
/**
* Builder for model CapturedPayment
*
* @see CapturedPayment
*/
class CapturedPaymentBuilder
{
/**
* @var CapturedPayment
*/
private $instance;
private function __construct(CapturedPayment $instance)
{
$this->instance = $instance;
}
/**
* Initializes a new captured payment Builder object.
*/
public static function init(): self
{
return new self(new CapturedPayment());
}
/**
* Sets status field.
*/
public function status(?string $value): self
{
$this->instance->setStatus($value);
return $this;
}
/**
* Sets status details field.
*/
public function statusDetails(?CaptureStatusDetails $value): self
{
$this->instance->setStatusDetails($value);
return $this;
}
/**
* Sets id field.
*/
public function id(?string $value): self
{
$this->instance->setId($value);
return $this;
}
/**
* Sets amount field.
*/
public function amount(?Money $value): self
{
$this->instance->setAmount($value);
return $this;
}
/**
* Sets invoice id field.
*/
public function invoiceId(?string $value): self
{
$this->instance->setInvoiceId($value);
return $this;
}
/**
* Sets custom id field.
*/
public function customId(?string $value): self
{
$this->instance->setCustomId($value);
return $this;
}
/**
* Sets network transaction reference field.
*/
public function networkTransactionReference(?NetworkTransactionReference $value): self
{
$this->instance->setNetworkTransactionReference($value);
return $this;
}
/**
* Sets seller protection field.
*/
public function sellerProtection(?SellerProtection $value): self
{
$this->instance->setSellerProtection($value);
return $this;
}
/**
* Sets final capture field.
*/
public function finalCapture(?bool $value): self
{
$this->instance->setFinalCapture($value);
return $this;
}
/**
* Sets seller receivable breakdown field.
*/
public function sellerReceivableBreakdown(?SellerReceivableBreakdown $value): self
{
$this->instance->setSellerReceivableBreakdown($value);
return $this;
}
/**
* Sets disbursement mode field.
*/
public function disbursementMode(?string $value): self
{
$this->instance->setDisbursementMode($value);
return $this;
}
/**
* Sets links field.
*/
public function links(?array $value): self
{
$this->instance->setLinks($value);
return $this;
}
/**
* Sets processor response field.
*/
public function processorResponse(?ProcessorResponse $value): self
{
$this->instance->setProcessorResponse($value);
return $this;
}
/**
* Sets create time field.
*/
public function createTime(?string $value): self
{
$this->instance->setCreateTime($value);
return $this;
}
/**
* Sets update time field.
*/
public function updateTime(?string $value): self
{
$this->instance->setUpdateTime($value);
return $this;
}
/**
* Sets supplementary data field.
*/
public function supplementaryData(?PaymentSupplementaryData $value): self
{
$this->instance->setSupplementaryData($value);
return $this;
}
/**
* Sets payee field.
*/
public function payee(?Payee $value): self
{
$this->instance->setPayee($value);
return $this;
}
/**
* Initializes a new captured payment object.
*/
public function build(): CapturedPayment
{
return CoreHelper::clone($this->instance);
}
}

View File

@@ -0,0 +1,78 @@
<?php
declare(strict_types=1);
/*
* PaypalServerSDKLib
*
* This file was automatically generated by APIMATIC v3.0 ( https://www.apimatic.io ).
*/
namespace PaypalServerSDKLib\Models\Builders;
use Core\Utils\CoreHelper;
use PaypalServerSDKLib\Models\CardAttributes;
use PaypalServerSDKLib\Models\CardCustomerInformation;
use PaypalServerSDKLib\Models\CardVerification;
use PaypalServerSDKLib\Models\VaultInstructionBase;
/**
* Builder for model CardAttributes
*
* @see CardAttributes
*/
class CardAttributesBuilder
{
/**
* @var CardAttributes
*/
private $instance;
private function __construct(CardAttributes $instance)
{
$this->instance = $instance;
}
/**
* Initializes a new card attributes Builder object.
*/
public static function init(): self
{
return new self(new CardAttributes());
}
/**
* Sets customer field.
*/
public function customer(?CardCustomerInformation $value): self
{
$this->instance->setCustomer($value);
return $this;
}
/**
* Sets vault field.
*/
public function vault(?VaultInstructionBase $value): self
{
$this->instance->setVault($value);
return $this;
}
/**
* Sets verification field.
*/
public function verification(?CardVerification $value): self
{
$this->instance->setVerification($value);
return $this;
}
/**
* Initializes a new card attributes object.
*/
public function build(): CardAttributes
{
return CoreHelper::clone($this->instance);
}
}

View File

@@ -0,0 +1,58 @@
<?php
declare(strict_types=1);
/*
* PaypalServerSDKLib
*
* This file was automatically generated by APIMATIC v3.0 ( https://www.apimatic.io ).
*/
namespace PaypalServerSDKLib\Models\Builders;
use Core\Utils\CoreHelper;
use PaypalServerSDKLib\Models\CardAttributesResponse;
use PaypalServerSDKLib\Models\CardVaultResponse;
/**
* Builder for model CardAttributesResponse
*
* @see CardAttributesResponse
*/
class CardAttributesResponseBuilder
{
/**
* @var CardAttributesResponse
*/
private $instance;
private function __construct(CardAttributesResponse $instance)
{
$this->instance = $instance;
}
/**
* Initializes a new card attributes response Builder object.
*/
public static function init(): self
{
return new self(new CardAttributesResponse());
}
/**
* Sets vault field.
*/
public function vault(?CardVaultResponse $value): self
{
$this->instance->setVault($value);
return $this;
}
/**
* Initializes a new card attributes response object.
*/
public function build(): CardAttributesResponse
{
return CoreHelper::clone($this->instance);
}
}

View File

@@ -0,0 +1,58 @@
<?php
declare(strict_types=1);
/*
* PaypalServerSDKLib
*
* This file was automatically generated by APIMATIC v3.0 ( https://www.apimatic.io ).
*/
namespace PaypalServerSDKLib\Models\Builders;
use Core\Utils\CoreHelper;
use PaypalServerSDKLib\Models\CardAuthenticationResponse;
use PaypalServerSDKLib\Models\ThreeDSecureAuthenticationResponse;
/**
* Builder for model CardAuthenticationResponse
*
* @see CardAuthenticationResponse
*/
class CardAuthenticationResponseBuilder
{
/**
* @var CardAuthenticationResponse
*/
private $instance;
private function __construct(CardAuthenticationResponse $instance)
{
$this->instance = $instance;
}
/**
* Initializes a new card authentication response Builder object.
*/
public static function init(): self
{
return new self(new CardAuthenticationResponse());
}
/**
* Sets three d secure field.
*/
public function threeDSecure(?ThreeDSecureAuthenticationResponse $value): self
{
$this->instance->setThreeDSecure($value);
return $this;
}
/**
* Initializes a new card authentication response object.
*/
public function build(): CardAuthenticationResponse
{
return CoreHelper::clone($this->instance);
}
}

View File

@@ -0,0 +1,85 @@
<?php
declare(strict_types=1);
/*
* PaypalServerSDKLib
*
* This file was automatically generated by APIMATIC v3.0 ( https://www.apimatic.io ).
*/
namespace PaypalServerSDKLib\Models\Builders;
use Core\Utils\CoreHelper;
use PaypalServerSDKLib\Models\CardCustomerInformation;
use PaypalServerSDKLib\Models\PhoneWithType;
/**
* Builder for model CardCustomerInformation
*
* @see CardCustomerInformation
*/
class CardCustomerInformationBuilder
{
/**
* @var CardCustomerInformation
*/
private $instance;
private function __construct(CardCustomerInformation $instance)
{
$this->instance = $instance;
}
/**
* Initializes a new card customer information Builder object.
*/
public static function init(): self
{
return new self(new CardCustomerInformation());
}
/**
* Sets id field.
*/
public function id(?string $value): self
{
$this->instance->setId($value);
return $this;
}
/**
* Sets email address field.
*/
public function emailAddress(?string $value): self
{
$this->instance->setEmailAddress($value);
return $this;
}
/**
* Sets phone field.
*/
public function phone(?PhoneWithType $value): self
{
$this->instance->setPhone($value);
return $this;
}
/**
* Sets merchant customer id field.
*/
public function merchantCustomerId(?string $value): self
{
$this->instance->setMerchantCustomerId($value);
return $this;
}
/**
* Initializes a new card customer information object.
*/
public function build(): CardCustomerInformation
{
return CoreHelper::clone($this->instance);
}
}

View File

@@ -0,0 +1,66 @@
<?php
declare(strict_types=1);
/*
* PaypalServerSDKLib
*
* This file was automatically generated by APIMATIC v3.0 ( https://www.apimatic.io ).
*/
namespace PaypalServerSDKLib\Models\Builders;
use Core\Utils\CoreHelper;
use PaypalServerSDKLib\Models\CardExperienceContext;
/**
* Builder for model CardExperienceContext
*
* @see CardExperienceContext
*/
class CardExperienceContextBuilder
{
/**
* @var CardExperienceContext
*/
private $instance;
private function __construct(CardExperienceContext $instance)
{
$this->instance = $instance;
}
/**
* Initializes a new card experience context Builder object.
*/
public static function init(): self
{
return new self(new CardExperienceContext());
}
/**
* Sets return url field.
*/
public function returnUrl(?string $value): self
{
$this->instance->setReturnUrl($value);
return $this;
}
/**
* Sets cancel url field.
*/
public function cancelUrl(?string $value): self
{
$this->instance->setCancelUrl($value);
return $this;
}
/**
* Initializes a new card experience context object.
*/
public function build(): CardExperienceContext
{
return CoreHelper::clone($this->instance);
}
}

View File

@@ -0,0 +1,66 @@
<?php
declare(strict_types=1);
/*
* PaypalServerSDKLib
*
* This file was automatically generated by APIMATIC v3.0 ( https://www.apimatic.io ).
*/
namespace PaypalServerSDKLib\Models\Builders;
use Core\Utils\CoreHelper;
use PaypalServerSDKLib\Models\CardFromRequest;
/**
* Builder for model CardFromRequest
*
* @see CardFromRequest
*/
class CardFromRequestBuilder
{
/**
* @var CardFromRequest
*/
private $instance;
private function __construct(CardFromRequest $instance)
{
$this->instance = $instance;
}
/**
* Initializes a new card from request Builder object.
*/
public static function init(): self
{
return new self(new CardFromRequest());
}
/**
* Sets expiry field.
*/
public function expiry(?string $value): self
{
$this->instance->setExpiry($value);
return $this;
}
/**
* Sets last digits field.
*/
public function lastDigits(?string $value): self
{
$this->instance->setLastDigits($value);
return $this;
}
/**
* Initializes a new card from request object.
*/
public function build(): CardFromRequest
{
return CoreHelper::clone($this->instance);
}
}

Some files were not shown because too many files have changed in this diff Show More