forked from LiveCarta/PayPal-PHP-Server-SDK
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:
151
src/Models/VaultResponse.php
Normal file
151
src/Models/VaultResponse.php
Normal file
@@ -0,0 +1,151 @@
|
||||
<?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 about a saved payment source.
|
||||
*/
|
||||
class VaultResponse implements \JsonSerializable
|
||||
{
|
||||
/**
|
||||
* @var string|null
|
||||
*/
|
||||
private $id;
|
||||
|
||||
/**
|
||||
* @var string|null
|
||||
*/
|
||||
private $status;
|
||||
|
||||
/**
|
||||
* @var VaultCustomer|null
|
||||
*/
|
||||
private $customer;
|
||||
|
||||
/**
|
||||
* @var LinkDescription[]|null
|
||||
*/
|
||||
private $links;
|
||||
|
||||
/**
|
||||
* Returns Id.
|
||||
* The PayPal-generated ID for the saved payment source.
|
||||
*/
|
||||
public function getId(): ?string
|
||||
{
|
||||
return $this->id;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets Id.
|
||||
* The PayPal-generated ID for the saved payment source.
|
||||
*
|
||||
* @maps id
|
||||
*/
|
||||
public function setId(?string $id): void
|
||||
{
|
||||
$this->id = $id;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns Status.
|
||||
* The vault status.
|
||||
*/
|
||||
public function getStatus(): ?string
|
||||
{
|
||||
return $this->status;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets Status.
|
||||
* The vault status.
|
||||
*
|
||||
* @maps status
|
||||
*/
|
||||
public function setStatus(?string $status): void
|
||||
{
|
||||
$this->status = $status;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns Customer.
|
||||
* The details about a customer in PayPal's system of record.
|
||||
*/
|
||||
public function getCustomer(): ?VaultCustomer
|
||||
{
|
||||
return $this->customer;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets Customer.
|
||||
* The details about a customer in PayPal's system of record.
|
||||
*
|
||||
* @maps customer
|
||||
*/
|
||||
public function setCustomer(?VaultCustomer $customer): void
|
||||
{
|
||||
$this->customer = $customer;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns Links.
|
||||
* An array of request-related HATEOAS links.
|
||||
*
|
||||
* @return LinkDescription[]|null
|
||||
*/
|
||||
public function getLinks(): ?array
|
||||
{
|
||||
return $this->links;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets Links.
|
||||
* An array of request-related HATEOAS links.
|
||||
*
|
||||
* @maps links
|
||||
*
|
||||
* @param LinkDescription[]|null $links
|
||||
*/
|
||||
public function setLinks(?array $links): void
|
||||
{
|
||||
$this->links = $links;
|
||||
}
|
||||
|
||||
/**
|
||||
* 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->status)) {
|
||||
$json['status'] = VaultStatus::checkValue($this->status);
|
||||
}
|
||||
if (isset($this->customer)) {
|
||||
$json['customer'] = $this->customer;
|
||||
}
|
||||
if (isset($this->links)) {
|
||||
$json['links'] = $this->links;
|
||||
}
|
||||
|
||||
return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user