From 4de2e3cfa14cc1db3829625c81162d1d4b8b0040 Mon Sep 17 00:00:00 2001 From: rebilly-machine-user Date: Mon, 19 Jan 2026 16:39:49 +0000 Subject: [PATCH] update SDK from api-definitions --- .changeset/fluffy-insects-warn.md | 5 + .changeset/gentle-numbers-compete.md | 5 + .changeset/selfish-dolls-punch.md | 5 + .changeset/strong-penguins-draw.md | 5 + .changeset/violet-years-cross.md | 5 + src/Model/CreationQuoteOrder.php | 24 ++++ src/Model/OrderPreview.php | 44 ++++++ src/Model/OrderPreviewInitialAmounts.php | 148 +++++++++++++++++++++ src/Model/OrderPreviewRecurringAmounts.php | 148 +++++++++++++++++++++ src/Model/PostDisputeRequest.php | 30 +++++ 10 files changed, 419 insertions(+) create mode 100644 .changeset/fluffy-insects-warn.md create mode 100644 .changeset/gentle-numbers-compete.md create mode 100644 .changeset/selfish-dolls-punch.md create mode 100644 .changeset/strong-penguins-draw.md create mode 100644 .changeset/violet-years-cross.md create mode 100644 src/Model/OrderPreviewInitialAmounts.php create mode 100644 src/Model/OrderPreviewRecurringAmounts.php diff --git a/.changeset/fluffy-insects-warn.md b/.changeset/fluffy-insects-warn.md new file mode 100644 index 00000000..c3c1f490 --- /dev/null +++ b/.changeset/fluffy-insects-warn.md @@ -0,0 +1,5 @@ +--- +"@rebilly/client-php": patch +--- + +fix(be,api-definitions,recomm): Add missing Discover dispute reason codes Rebilly/rebilly#18032 diff --git a/.changeset/gentle-numbers-compete.md b/.changeset/gentle-numbers-compete.md new file mode 100644 index 00000000..677b7691 --- /dev/null +++ b/.changeset/gentle-numbers-compete.md @@ -0,0 +1,5 @@ +--- +"@rebilly/client-php": patch +--- + +feat(be, api-definitions): preview orders enhancements Rebilly/rebilly#17844 diff --git a/.changeset/selfish-dolls-punch.md b/.changeset/selfish-dolls-punch.md new file mode 100644 index 00000000..8bb569d4 --- /dev/null +++ b/.changeset/selfish-dolls-punch.md @@ -0,0 +1,5 @@ +--- +"@rebilly/client-php": patch +--- + +feat(be, api-definitions): Add startTime to creation quotes Rebilly/rebilly#18022 diff --git a/.changeset/strong-penguins-draw.md b/.changeset/strong-penguins-draw.md new file mode 100644 index 00000000..7bbc357d --- /dev/null +++ b/.changeset/strong-penguins-draw.md @@ -0,0 +1,5 @@ +--- +"@rebilly/client-php": patch +--- + +revert(backend): Permanently block above and Temporary block above use the independent pool of attributes - remove backward compatibility Rebilly/rebilly#17885 diff --git a/.changeset/violet-years-cross.md b/.changeset/violet-years-cross.md new file mode 100644 index 00000000..53722b54 --- /dev/null +++ b/.changeset/violet-years-cross.md @@ -0,0 +1,5 @@ +--- +"@rebilly/client-php": patch +--- + +fix(backend): Permanently block above and Temporary block above use the independent pool of attributes - remove backward compatibility Rebilly/rebilly#17885 diff --git a/src/Model/CreationQuoteOrder.php b/src/Model/CreationQuoteOrder.php index ac071c24..caf3f561 100644 --- a/src/Model/CreationQuoteOrder.php +++ b/src/Model/CreationQuoteOrder.php @@ -14,6 +14,8 @@ namespace Rebilly\Sdk\Model; +use DateTimeImmutable; +use DateTimeInterface; use JsonSerializable; class CreationQuoteOrder implements JsonSerializable @@ -40,6 +42,9 @@ public function __construct(array $data = []) if (array_key_exists('billingAddress', $data)) { $this->setBillingAddress($data['billingAddress']); } + if (array_key_exists('startTime', $data)) { + $this->setStartTime($data['startTime']); + } } public static function from(array $data = []): self @@ -135,6 +140,22 @@ public function setBillingAddress(null|ContactObject|array $billingAddress): sta return $this; } + public function getStartTime(): ?DateTimeImmutable + { + return $this->fields['startTime'] ?? null; + } + + public function setStartTime(null|DateTimeImmutable|string $startTime): static + { + if ($startTime !== null && !($startTime instanceof DateTimeImmutable)) { + $startTime = new DateTimeImmutable($startTime); + } + + $this->fields['startTime'] = $startTime; + + return $this; + } + public function jsonSerialize(): array { $data = []; @@ -159,6 +180,9 @@ public function jsonSerialize(): array if (array_key_exists('billingAddress', $this->fields)) { $data['billingAddress'] = $this->fields['billingAddress']?->jsonSerialize(); } + if (array_key_exists('startTime', $this->fields)) { + $data['startTime'] = $this->fields['startTime']?->format(DateTimeInterface::RFC3339); + } return $data; } diff --git a/src/Model/OrderPreview.php b/src/Model/OrderPreview.php index 0f279aec..db32129e 100644 --- a/src/Model/OrderPreview.php +++ b/src/Model/OrderPreview.php @@ -67,6 +67,12 @@ public function __construct(array $data = []) if (array_key_exists('total', $data)) { $this->setTotal($data['total']); } + if (array_key_exists('initialAmounts', $data)) { + $this->setInitialAmounts($data['initialAmounts']); + } + if (array_key_exists('recurringAmounts', $data)) { + $this->setRecurringAmounts($data['recurringAmounts']); + } if (array_key_exists('shipping', $data)) { $this->setShipping($data['shipping']); } @@ -224,6 +230,38 @@ public function getTotal(): ?float return $this->fields['total'] ?? null; } + public function getInitialAmounts(): ?OrderPreviewInitialAmounts + { + return $this->fields['initialAmounts'] ?? null; + } + + public function setInitialAmounts(null|OrderPreviewInitialAmounts|array $initialAmounts): static + { + if ($initialAmounts !== null && !($initialAmounts instanceof OrderPreviewInitialAmounts)) { + $initialAmounts = OrderPreviewInitialAmounts::from($initialAmounts); + } + + $this->fields['initialAmounts'] = $initialAmounts; + + return $this; + } + + public function getRecurringAmounts(): ?OrderPreviewRecurringAmounts + { + return $this->fields['recurringAmounts'] ?? null; + } + + public function setRecurringAmounts(null|OrderPreviewRecurringAmounts|array $recurringAmounts): static + { + if ($recurringAmounts !== null && !($recurringAmounts instanceof OrderPreviewRecurringAmounts)) { + $recurringAmounts = OrderPreviewRecurringAmounts::from($recurringAmounts); + } + + $this->fields['recurringAmounts'] = $recurringAmounts; + + return $this; + } + public function getShipping(): ?Shipping { return $this->fields['shipping'] ?? null; @@ -311,6 +349,12 @@ public function jsonSerialize(): array if (array_key_exists('total', $this->fields)) { $data['total'] = $this->fields['total']; } + if (array_key_exists('initialAmounts', $this->fields)) { + $data['initialAmounts'] = $this->fields['initialAmounts']?->jsonSerialize(); + } + if (array_key_exists('recurringAmounts', $this->fields)) { + $data['recurringAmounts'] = $this->fields['recurringAmounts']?->jsonSerialize(); + } if (array_key_exists('shipping', $this->fields)) { $data['shipping'] = $this->fields['shipping']?->jsonSerialize(); } diff --git a/src/Model/OrderPreviewInitialAmounts.php b/src/Model/OrderPreviewInitialAmounts.php new file mode 100644 index 00000000..67d83256 --- /dev/null +++ b/src/Model/OrderPreviewInitialAmounts.php @@ -0,0 +1,148 @@ +setAmount($data['amount']); + } + if (array_key_exists('subtotalAmount', $data)) { + $this->setSubtotalAmount($data['subtotalAmount']); + } + if (array_key_exists('discountAmount', $data)) { + $this->setDiscountAmount($data['discountAmount']); + } + if (array_key_exists('shippingAmount', $data)) { + $this->setShippingAmount($data['shippingAmount']); + } + if (array_key_exists('taxAmount', $data)) { + $this->setTaxAmount($data['taxAmount']); + } + } + + public static function from(array $data = []): self + { + return new self($data); + } + + public function getAmount(): ?float + { + return $this->fields['amount'] ?? null; + } + + public function setAmount(null|float|string $amount): static + { + if (is_string($amount)) { + $amount = (float) $amount; + } + + $this->fields['amount'] = $amount; + + return $this; + } + + public function getSubtotalAmount(): ?float + { + return $this->fields['subtotalAmount'] ?? null; + } + + public function setSubtotalAmount(null|float|string $subtotalAmount): static + { + if (is_string($subtotalAmount)) { + $subtotalAmount = (float) $subtotalAmount; + } + + $this->fields['subtotalAmount'] = $subtotalAmount; + + return $this; + } + + public function getDiscountAmount(): ?float + { + return $this->fields['discountAmount'] ?? null; + } + + public function setDiscountAmount(null|float|string $discountAmount): static + { + if (is_string($discountAmount)) { + $discountAmount = (float) $discountAmount; + } + + $this->fields['discountAmount'] = $discountAmount; + + return $this; + } + + public function getShippingAmount(): ?float + { + return $this->fields['shippingAmount'] ?? null; + } + + public function setShippingAmount(null|float|string $shippingAmount): static + { + if (is_string($shippingAmount)) { + $shippingAmount = (float) $shippingAmount; + } + + $this->fields['shippingAmount'] = $shippingAmount; + + return $this; + } + + public function getTaxAmount(): ?float + { + return $this->fields['taxAmount'] ?? null; + } + + public function setTaxAmount(null|float|string $taxAmount): static + { + if (is_string($taxAmount)) { + $taxAmount = (float) $taxAmount; + } + + $this->fields['taxAmount'] = $taxAmount; + + return $this; + } + + public function jsonSerialize(): array + { + $data = []; + if (array_key_exists('amount', $this->fields)) { + $data['amount'] = $this->fields['amount']; + } + if (array_key_exists('subtotalAmount', $this->fields)) { + $data['subtotalAmount'] = $this->fields['subtotalAmount']; + } + if (array_key_exists('discountAmount', $this->fields)) { + $data['discountAmount'] = $this->fields['discountAmount']; + } + if (array_key_exists('shippingAmount', $this->fields)) { + $data['shippingAmount'] = $this->fields['shippingAmount']; + } + if (array_key_exists('taxAmount', $this->fields)) { + $data['taxAmount'] = $this->fields['taxAmount']; + } + + return $data; + } +} diff --git a/src/Model/OrderPreviewRecurringAmounts.php b/src/Model/OrderPreviewRecurringAmounts.php new file mode 100644 index 00000000..3db468b0 --- /dev/null +++ b/src/Model/OrderPreviewRecurringAmounts.php @@ -0,0 +1,148 @@ +setAmount($data['amount']); + } + if (array_key_exists('subtotalAmount', $data)) { + $this->setSubtotalAmount($data['subtotalAmount']); + } + if (array_key_exists('discountAmount', $data)) { + $this->setDiscountAmount($data['discountAmount']); + } + if (array_key_exists('shippingAmount', $data)) { + $this->setShippingAmount($data['shippingAmount']); + } + if (array_key_exists('taxAmount', $data)) { + $this->setTaxAmount($data['taxAmount']); + } + } + + public static function from(array $data = []): self + { + return new self($data); + } + + public function getAmount(): ?float + { + return $this->fields['amount'] ?? null; + } + + public function setAmount(null|float|string $amount): static + { + if (is_string($amount)) { + $amount = (float) $amount; + } + + $this->fields['amount'] = $amount; + + return $this; + } + + public function getSubtotalAmount(): ?float + { + return $this->fields['subtotalAmount'] ?? null; + } + + public function setSubtotalAmount(null|float|string $subtotalAmount): static + { + if (is_string($subtotalAmount)) { + $subtotalAmount = (float) $subtotalAmount; + } + + $this->fields['subtotalAmount'] = $subtotalAmount; + + return $this; + } + + public function getDiscountAmount(): ?float + { + return $this->fields['discountAmount'] ?? null; + } + + public function setDiscountAmount(null|float|string $discountAmount): static + { + if (is_string($discountAmount)) { + $discountAmount = (float) $discountAmount; + } + + $this->fields['discountAmount'] = $discountAmount; + + return $this; + } + + public function getShippingAmount(): ?float + { + return $this->fields['shippingAmount'] ?? null; + } + + public function setShippingAmount(null|float|string $shippingAmount): static + { + if (is_string($shippingAmount)) { + $shippingAmount = (float) $shippingAmount; + } + + $this->fields['shippingAmount'] = $shippingAmount; + + return $this; + } + + public function getTaxAmount(): ?float + { + return $this->fields['taxAmount'] ?? null; + } + + public function setTaxAmount(null|float|string $taxAmount): static + { + if (is_string($taxAmount)) { + $taxAmount = (float) $taxAmount; + } + + $this->fields['taxAmount'] = $taxAmount; + + return $this; + } + + public function jsonSerialize(): array + { + $data = []; + if (array_key_exists('amount', $this->fields)) { + $data['amount'] = $this->fields['amount']; + } + if (array_key_exists('subtotalAmount', $this->fields)) { + $data['subtotalAmount'] = $this->fields['subtotalAmount']; + } + if (array_key_exists('discountAmount', $this->fields)) { + $data['discountAmount'] = $this->fields['discountAmount']; + } + if (array_key_exists('shippingAmount', $this->fields)) { + $data['shippingAmount'] = $this->fields['shippingAmount']; + } + if (array_key_exists('taxAmount', $this->fields)) { + $data['taxAmount'] = $this->fields['taxAmount']; + } + + return $data; + } +} diff --git a/src/Model/PostDisputeRequest.php b/src/Model/PostDisputeRequest.php index 7c3f66f0..2fa00039 100644 --- a/src/Model/PostDisputeRequest.php +++ b/src/Model/PostDisputeRequest.php @@ -310,6 +310,36 @@ class PostDisputeRequest implements JsonSerializable public const REASON_CODE_4999 = '4999'; + public const REASON_CODE_4534 = '4534'; + + public const REASON_CODE_4541 = '4541'; + + public const REASON_CODE_4542 = '4542'; + + public const REASON_CODE_4550 = '4550'; + + public const REASON_CODE_4553 = '4553'; + + public const REASON_CODE_4586 = '4586'; + + public const REASON_CODE_4752 = '4752'; + + public const REASON_CODE_4753 = '4753'; + + public const REASON_CODE_4755 = '4755'; + + public const REASON_CODE_4865 = '4865'; + + public const REASON_CODE_4866 = '4866'; + + public const REASON_CODE_4867 = '4867'; + + public const REASON_CODE_7010 = '7010'; + + public const REASON_CODE_7030 = '7030'; + + public const REASON_CODE_8002 = '8002'; + public const REASON_CODE_A = 'A'; public const REASON_CODE_A01 = 'A01';