forked from LiveCarta/PayPal-PHP-Server-SDK
Automated commit message
This commit is contained in:
181
src/Models/ApplePayCard.php
Normal file
181
src/Models/ApplePayCard.php
Normal file
@@ -0,0 +1,181 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
/*
|
||||
* PayPalRESTAPIsLib
|
||||
*
|
||||
* This file was automatically generated by APIMATIC v3.0 ( https://www.apimatic.io ).
|
||||
*/
|
||||
|
||||
namespace PayPalRESTAPIsLib\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;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user