%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/public_html/admin1/vendor/square/square/src/Models/ |
Upload File : |
<?php
declare(strict_types=1);
namespace Square\Models;
use stdClass;
/**
* Defines the fields that are included in requests to the
* [UpdateOrder]($e/Orders/UpdateOrder) endpoint.
*/
class UpdateOrderRequest implements \JsonSerializable
{
/**
* @var Order|null
*/
private $order;
/**
* @var string[]|null
*/
private $fieldsToClear;
/**
* @var string|null
*/
private $idempotencyKey;
/**
* Returns Order.
*
* Contains all information related to a single order to process with Square,
* including line items that specify the products to purchase. `Order` objects also
* include information about any associated tenders, refunds, and returns.
*
* All Connect V2 Transactions have all been converted to Orders including all associated
* itemization data.
*/
public function getOrder(): ?Order
{
return $this->order;
}
/**
* Sets Order.
*
* Contains all information related to a single order to process with Square,
* including line items that specify the products to purchase. `Order` objects also
* include information about any associated tenders, refunds, and returns.
*
* All Connect V2 Transactions have all been converted to Orders including all associated
* itemization data.
*
* @maps order
*/
public function setOrder(?Order $order): void
{
$this->order = $order;
}
/**
* Returns Fields to Clear.
*
* The [dot notation paths](https://developer.squareup.com/docs/orders-api/manage-orders#on-dot-
* notation)
* fields to clear. For example, `line_items[uid].note`.
* For more information, see [Deleting fields](https://developer.squareup.com/docs/orders-api/manage-
* orders#delete-fields).
*
* @return string[]|null
*/
public function getFieldsToClear(): ?array
{
return $this->fieldsToClear;
}
/**
* Sets Fields to Clear.
*
* The [dot notation paths](https://developer.squareup.com/docs/orders-api/manage-orders#on-dot-
* notation)
* fields to clear. For example, `line_items[uid].note`.
* For more information, see [Deleting fields](https://developer.squareup.com/docs/orders-api/manage-
* orders#delete-fields).
*
* @maps fields_to_clear
*
* @param string[]|null $fieldsToClear
*/
public function setFieldsToClear(?array $fieldsToClear): void
{
$this->fieldsToClear = $fieldsToClear;
}
/**
* Returns Idempotency Key.
*
* A value you specify that uniquely identifies this update request.
*
* If you are unsure whether a particular update was applied to an order successfully,
* you can reattempt it with the same idempotency key without
* worrying about creating duplicate updates to the order.
* The latest order version is returned.
*
* For more information, see [Idempotency](https://developer.squareup.
* com/docs/basics/api101/idempotency).
*/
public function getIdempotencyKey(): ?string
{
return $this->idempotencyKey;
}
/**
* Sets Idempotency Key.
*
* A value you specify that uniquely identifies this update request.
*
* If you are unsure whether a particular update was applied to an order successfully,
* you can reattempt it with the same idempotency key without
* worrying about creating duplicate updates to the order.
* The latest order version is returned.
*
* For more information, see [Idempotency](https://developer.squareup.
* com/docs/basics/api101/idempotency).
*
* @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 mixed
*/
public function jsonSerialize(bool $asArrayWhenEmpty = false)
{
$json = [];
if (isset($this->order)) {
$json['order'] = $this->order;
}
if (isset($this->fieldsToClear)) {
$json['fields_to_clear'] = $this->fieldsToClear;
}
if (isset($this->idempotencyKey)) {
$json['idempotency_key'] = $this->idempotencyKey;
}
$json = array_filter($json, function ($val) {
return $val !== null;
});
return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json;
}
}