%PDF- %GIF98; %PNG;
Server : ApacheSystem : Linux host.digitalbabaji.in 4.18.0-513.11.1.el8_9.x86_64 #1 SMP Wed Jan 17 02:00:40 EST 2024 x86_64 User : addictionfreeind ( 1003) PHP Version : 7.2.34 Disable Function : exec,passthru,shell_exec,system Directory : /home/addictionfreeind/www/admin1/vendor/square/square/src/Models/ |
Upload File : |
<?php
declare(strict_types=1);
namespace Square\Models;
use stdClass;
/**
* Describes a request to complete (capture) a payment using
* [CompletePayment]($e/Payments/CompletePayment).
*
* By default, payments are set to `autocomplete` immediately after they are created.
* To complete payments manually, set `autocomplete` to `false`.
*/
class CompletePaymentRequest implements \JsonSerializable
{
/**
* @var string|null
*/
private $versionToken;
/**
* Returns Version Token.
*
* Used for optimistic concurrency. This opaque token identifies the current `Payment`
* version that the caller expects. If the server has a different version of the Payment,
* the update fails and a response with a VERSION_MISMATCH error is returned.
*/
public function getVersionToken(): ?string
{
return $this->versionToken;
}
/**
* Sets Version Token.
*
* Used for optimistic concurrency. This opaque token identifies the current `Payment`
* version that the caller expects. If the server has a different version of the Payment,
* the update fails and a response with a VERSION_MISMATCH error is returned.
*
* @maps version_token
*/
public function setVersionToken(?string $versionToken): void
{
$this->versionToken = $versionToken;
}
/**
* Encode this object to JSON
*
* @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields
* are set. (default: false)
*
* @return mixed
*/
public function jsonSerialize(bool $asArrayWhenEmpty = false)
{
$json = [];
if (isset($this->versionToken)) {
$json['version_token'] = $this->versionToken;
}
$json = array_filter($json, function ($val) {
return $val !== null;
});
return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json;
}
}