<?php
 declare(strict_types=1); namespace Square\Models; use stdClass; class Card implements \JsonSerializable { private $id; private $cardBrand; private $last4; private $expMonth; private $expYear; private $cardholderName; private $billingAddress; private $fingerprint; private $customerId; private $merchantId; private $referenceId; private $enabled; private $cardType; private $prepaidType; private $bin; private $version; private $cardCoBrand; public function getId(): ?string { return $this->id; } public function setId(?string $id): void { $this->id = $id; } public function getCardBrand(): ?string { return $this->cardBrand; } public function setCardBrand(?string $cardBrand): void { $this->cardBrand = $cardBrand; } public function getLast4(): ?string { return $this->last4; } public function setLast4(?string $last4): void { $this->last4 = $last4; } public function getExpMonth(): ?int { return $this->expMonth; } public function setExpMonth(?int $expMonth): void { $this->expMonth = $expMonth; } public function getExpYear(): ?int { return $this->expYear; } public function setExpYear(?int $expYear): void { $this->expYear = $expYear; } public function getCardholderName(): ?string { return $this->cardholderName; } public function setCardholderName(?string $cardholderName): void { $this->cardholderName = $cardholderName; } public function getBillingAddress(): ?Address { return $this->billingAddress; } public function setBillingAddress(?Address $billingAddress): void { $this->billingAddress = $billingAddress; } public function getFingerprint(): ?string { return $this->fingerprint; } public function setFingerprint(?string $fingerprint): void { $this->fingerprint = $fingerprint; } public function getCustomerId(): ?string { return $this->customerId; } public function setCustomerId(?string $customerId): void { $this->customerId = $customerId; } public function getMerchantId(): ?string { return $this->merchantId; } public function setMerchantId(?string $merchantId): void { $this->merchantId = $merchantId; } public function getReferenceId(): ?string { return $this->referenceId; } public function setReferenceId(?string $referenceId): void { $this->referenceId = $referenceId; } public function getEnabled(): ?bool { return $this->enabled; } public function setEnabled(?bool $enabled): void { $this->enabled = $enabled; } public function getCardType(): ?string { return $this->cardType; } public function setCardType(?string $cardType): void { $this->cardType = $cardType; } public function getPrepaidType(): ?string { return $this->prepaidType; } public function setPrepaidType(?string $prepaidType): void { $this->prepaidType = $prepaidType; } public function getBin(): ?string { return $this->bin; } public function setBin(?string $bin): void { $this->bin = $bin; } public function getVersion(): ?int { return $this->version; } public function setVersion(?int $version): void { $this->version = $version; } public function getCardCoBrand(): ?string { return $this->cardCoBrand; } public function setCardCoBrand(?string $cardCoBrand): void { $this->cardCoBrand = $cardCoBrand; } #[\ReturnTypeWillChange] public function jsonSerialize(bool $asArrayWhenEmpty = false) { $json = []; if (isset($this->id)) { $json['id'] = $this->id; } if (isset($this->cardBrand)) { $json['card_brand'] = $this->cardBrand; } if (isset($this->last4)) { $json['last_4'] = $this->last4; } if (isset($this->expMonth)) { $json['exp_month'] = $this->expMonth; } if (isset($this->expYear)) { $json['exp_year'] = $this->expYear; } if (isset($this->cardholderName)) { $json['cardholder_name'] = $this->cardholderName; } if (isset($this->billingAddress)) { $json['billing_address'] = $this->billingAddress; } if (isset($this->fingerprint)) { $json['fingerprint'] = $this->fingerprint; } if (isset($this->customerId)) { $json['customer_id'] = $this->customerId; } if (isset($this->merchantId)) { $json['merchant_id'] = $this->merchantId; } if (isset($this->referenceId)) { $json['reference_id'] = $this->referenceId; } if (isset($this->enabled)) { $json['enabled'] = $this->enabled; } if (isset($this->cardType)) { $json['card_type'] = $this->cardType; } if (isset($this->prepaidType)) { $json['prepaid_type'] = $this->prepaidType; } if (isset($this->bin)) { $json['bin'] = $this->bin; } if (isset($this->version)) { $json['version'] = $this->version; } if (isset($this->cardCoBrand)) { $json['card_co_brand'] = $this->cardCoBrand; } $json = array_filter($json, function ($val) { return $val !== null; }); return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; } } 