Current path: home/webdevt/www/demo2/wp-content/plugins/wpforms-lite/vendor_prefixed/square/square/src/Models/
?? Go up: /home/webdevt/www/demo2/wp-content/plugins/wpforms-lite/vendor_prefixed/square/square/src
<?php
declare (strict_types=1);
namespace WPForms\Vendor\Square\Models;
use stdClass;
/**
* Describes a request to cancel a payment using
* [CancelPaymentByIdempotencyKey]($e/Payments/CancelPaymentByIdempotencyKey).
*/
class CancelPaymentByIdempotencyKeyRequest implements \JsonSerializable
{
/**
* @var string
*/
private $idempotencyKey;
/**
* @param string $idempotencyKey
*/
public function __construct(string $idempotencyKey)
{
$this->idempotencyKey = $idempotencyKey;
}
/**
* Returns Idempotency Key.
* The `idempotency_key` identifying the payment to be canceled.
*/
public function getIdempotencyKey() : string
{
return $this->idempotencyKey;
}
/**
* Sets Idempotency Key.
* The `idempotency_key` identifying the payment to be canceled.
*
* @required
* @maps idempotency_key
*/
public function setIdempotencyKey(string $idempotencyKey) : void
{
$this->idempotencyKey = $idempotencyKey;
}
/**
* 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]
public function jsonSerialize(bool $asArrayWhenEmpty = \false)
{
$json = [];
$json['idempotency_key'] = $this->idempotencyKey;
$json = \array_filter($json, function ($val) {
return $val !== null;
});
return !$asArrayWhenEmpty && empty($json) ? new stdClass() : $json;
}
}