diff --git a/.changeset/shaggy-knives-obey.md b/.changeset/shaggy-knives-obey.md new file mode 100644 index 000000000..e3f663661 --- /dev/null +++ b/.changeset/shaggy-knives-obey.md @@ -0,0 +1,5 @@ +--- +"@rebilly/client-php": patch +--- + +Add three3dsIO to Airwallex Rebilly/api-definitions#1647 diff --git a/.changeset/sweet-news-beam.md b/.changeset/sweet-news-beam.md new file mode 100644 index 000000000..b86f7f56d --- /dev/null +++ b/.changeset/sweet-news-beam.md @@ -0,0 +1,5 @@ +--- +"@rebilly/client-php": patch +--- + +Add dispute type Rebilly/api-definitions#1646 diff --git a/src/Model/Airwallex.php b/src/Model/Airwallex.php index d90d8a905..1710bb844 100644 --- a/src/Model/Airwallex.php +++ b/src/Model/Airwallex.php @@ -26,6 +26,9 @@ public function __construct(array $data = []) if (array_key_exists('credentials', $data)) { $this->setCredentials($data['credentials']); } + if (array_key_exists('threeDSecureServer', $data)) { + $this->setThreeDSecureServer($data['threeDSecureServer']); + } } public static function from(array $data = []): self @@ -49,12 +52,31 @@ public function setCredentials(AirwallexCredentials|array $credentials): static return $this; } + public function getThreeDSecureServer(): ?ThreeDSecureIO3dsServer + { + return $this->fields['threeDSecureServer'] ?? null; + } + + public function setThreeDSecureServer(null|ThreeDSecureIO3dsServer|array $threeDSecureServer): static + { + if ($threeDSecureServer !== null && !($threeDSecureServer instanceof ThreeDSecureIO3dsServer)) { + $threeDSecureServer = ThreeDSecureIO3dsServer::from($threeDSecureServer); + } + + $this->fields['threeDSecureServer'] = $threeDSecureServer; + + return $this; + } + public function jsonSerialize(): array { $data = []; if (array_key_exists('credentials', $this->fields)) { $data['credentials'] = $this->fields['credentials']?->jsonSerialize(); } + if (array_key_exists('threeDSecureServer', $this->fields)) { + $data['threeDSecureServer'] = $this->fields['threeDSecureServer']?->jsonSerialize(); + } return parent::jsonSerialize() + $data; } diff --git a/src/Model/CouponRestrictionDiscountPerRedemption.php b/src/Model/CouponRestrictionDiscountPerRedemption.php index 25cf88248..7da1ddd73 100644 --- a/src/Model/CouponRestrictionDiscountPerRedemption.php +++ b/src/Model/CouponRestrictionDiscountPerRedemption.php @@ -19,6 +19,10 @@ class CouponRestrictionDiscountPerRedemption implements CouponRestriction, RedemptionRestriction, JsonSerializable { + public const REQUIRE_ALL_TAGS_TRUE = 'true'; + + public const REQUIRE_ALL_TAGS_FALSE = 'false'; + private array $fields = []; public function __construct(array $data = []) @@ -38,6 +42,9 @@ public function __construct(array $data = []) if (array_key_exists('countries', $data)) { $this->setCountries($data['countries']); } + if (array_key_exists('tags', $data)) { + $this->setTags($data['tags']); + } if (array_key_exists('productIds', $data)) { $this->setProductIds($data['productIds']); } @@ -56,6 +63,9 @@ public function __construct(array $data = []) if (array_key_exists('time', $data)) { $this->setTime($data['time']); } + if (array_key_exists('requireAllTags', $data)) { + $this->setRequireAllTags($data['requireAllTags']); + } if (array_key_exists('minimumQuantity', $data)) { $this->setMinimumQuantity($data['minimumQuantity']); } @@ -167,6 +177,29 @@ public function setCountries(array $countries): static return $this; } + /** + * @return string[] + */ + public function getTags(): array + { + return $this->fields['tags']; + } + + /** + * @param string[] $tags + */ + public function setTags(array $tags): static + { + $tags = array_map( + fn ($value) => $value, + $tags, + ); + + $this->fields['tags'] = $tags; + + return $this; + } + /** * @return string[] */ @@ -287,6 +320,18 @@ public function setTime(DateTimeImmutable|string $time): static return $this; } + public function getRequireAllTags(): string + { + return $this->fields['requireAllTags']; + } + + public function setRequireAllTags(string $requireAllTags): static + { + $this->fields['requireAllTags'] = $requireAllTags; + + return $this; + } + public function getMinimumQuantity(): ?int { return $this->fields['minimumQuantity'] ?? null; @@ -342,6 +387,9 @@ public function jsonSerialize(): array if (array_key_exists('countries', $this->fields)) { $data['countries'] = $this->fields['countries']; } + if (array_key_exists('tags', $this->fields)) { + $data['tags'] = $this->fields['tags']; + } if (array_key_exists('productIds', $this->fields)) { $data['productIds'] = $this->fields['productIds']; } @@ -360,6 +408,9 @@ public function jsonSerialize(): array if (array_key_exists('time', $this->fields)) { $data['time'] = $this->fields['time']?->format(DateTimeInterface::RFC3339); } + if (array_key_exists('requireAllTags', $this->fields)) { + $data['requireAllTags'] = $this->fields['requireAllTags']; + } if (array_key_exists('minimumQuantity', $this->fields)) { $data['minimumQuantity'] = $this->fields['minimumQuantity']; } diff --git a/src/Model/CouponRestrictionExclusiveApplication.php b/src/Model/CouponRestrictionExclusiveApplication.php index b0c40e2a6..2846ddc19 100644 --- a/src/Model/CouponRestrictionExclusiveApplication.php +++ b/src/Model/CouponRestrictionExclusiveApplication.php @@ -19,6 +19,10 @@ class CouponRestrictionExclusiveApplication implements CouponRestriction, JsonSerializable { + public const REQUIRE_ALL_TAGS_TRUE = 'true'; + + public const REQUIRE_ALL_TAGS_FALSE = 'false'; + private array $fields = []; public function __construct(array $data = []) @@ -38,6 +42,9 @@ public function __construct(array $data = []) if (array_key_exists('countries', $data)) { $this->setCountries($data['countries']); } + if (array_key_exists('tags', $data)) { + $this->setTags($data['tags']); + } if (array_key_exists('productIds', $data)) { $this->setProductIds($data['productIds']); } @@ -56,6 +63,9 @@ public function __construct(array $data = []) if (array_key_exists('time', $data)) { $this->setTime($data['time']); } + if (array_key_exists('requireAllTags', $data)) { + $this->setRequireAllTags($data['requireAllTags']); + } if (array_key_exists('minimumQuantity', $data)) { $this->setMinimumQuantity($data['minimumQuantity']); } @@ -167,6 +177,29 @@ public function setCountries(array $countries): static return $this; } + /** + * @return string[] + */ + public function getTags(): array + { + return $this->fields['tags']; + } + + /** + * @param string[] $tags + */ + public function setTags(array $tags): static + { + $tags = array_map( + fn ($value) => $value, + $tags, + ); + + $this->fields['tags'] = $tags; + + return $this; + } + /** * @return string[] */ @@ -287,6 +320,18 @@ public function setTime(DateTimeImmutable|string $time): static return $this; } + public function getRequireAllTags(): string + { + return $this->fields['requireAllTags']; + } + + public function setRequireAllTags(string $requireAllTags): static + { + $this->fields['requireAllTags'] = $requireAllTags; + + return $this; + } + public function getMinimumQuantity(): ?int { return $this->fields['minimumQuantity'] ?? null; @@ -342,6 +387,9 @@ public function jsonSerialize(): array if (array_key_exists('countries', $this->fields)) { $data['countries'] = $this->fields['countries']; } + if (array_key_exists('tags', $this->fields)) { + $data['tags'] = $this->fields['tags']; + } if (array_key_exists('productIds', $this->fields)) { $data['productIds'] = $this->fields['productIds']; } @@ -360,6 +408,9 @@ public function jsonSerialize(): array if (array_key_exists('time', $this->fields)) { $data['time'] = $this->fields['time']?->format(DateTimeInterface::RFC3339); } + if (array_key_exists('requireAllTags', $this->fields)) { + $data['requireAllTags'] = $this->fields['requireAllTags']; + } if (array_key_exists('minimumQuantity', $this->fields)) { $data['minimumQuantity'] = $this->fields['minimumQuantity']; } diff --git a/src/Model/CouponRestrictionFactory.php b/src/Model/CouponRestrictionFactory.php index ef062cd15..f7f260062 100644 --- a/src/Model/CouponRestrictionFactory.php +++ b/src/Model/CouponRestrictionFactory.php @@ -26,6 +26,7 @@ public static function from(array $data = []): CouponRestriction 'redemptions-per-customer' => CouponRestrictionRedemptionsPerCustomer::from($data), 'restrict-to-bxgy' => CouponRestrictionRestrictToBxgy::from($data), 'restrict-to-countries' => CouponRestrictionRestrictToCountries::from($data), + 'restrict-to-customer-tags' => CouponRestrictionRestrictToCustomerTags::from($data), 'restrict-to-customers' => CouponRestrictionRestrictToCustomers::from($data), 'restrict-to-exclusive-application' => CouponRestrictionExclusiveApplication::from($data), 'restrict-to-invoices' => CouponRestrictionRestrictToInvoices::from($data), diff --git a/src/Model/CouponRestrictionMinimumOrderAmount.php b/src/Model/CouponRestrictionMinimumOrderAmount.php index 79f3bdd65..1dae915bc 100644 --- a/src/Model/CouponRestrictionMinimumOrderAmount.php +++ b/src/Model/CouponRestrictionMinimumOrderAmount.php @@ -19,6 +19,10 @@ class CouponRestrictionMinimumOrderAmount implements CouponRestriction, RedemptionRestriction, JsonSerializable { + public const REQUIRE_ALL_TAGS_TRUE = 'true'; + + public const REQUIRE_ALL_TAGS_FALSE = 'false'; + private array $fields = []; public function __construct(array $data = []) @@ -41,6 +45,9 @@ public function __construct(array $data = []) if (array_key_exists('countries', $data)) { $this->setCountries($data['countries']); } + if (array_key_exists('tags', $data)) { + $this->setTags($data['tags']); + } if (array_key_exists('productIds', $data)) { $this->setProductIds($data['productIds']); } @@ -56,6 +63,9 @@ public function __construct(array $data = []) if (array_key_exists('time', $data)) { $this->setTime($data['time']); } + if (array_key_exists('requireAllTags', $data)) { + $this->setRequireAllTags($data['requireAllTags']); + } if (array_key_exists('minimumQuantity', $data)) { $this->setMinimumQuantity($data['minimumQuantity']); } @@ -179,6 +189,29 @@ public function setCountries(array $countries): static return $this; } + /** + * @return string[] + */ + public function getTags(): array + { + return $this->fields['tags']; + } + + /** + * @param string[] $tags + */ + public function setTags(array $tags): static + { + $tags = array_map( + fn ($value) => $value, + $tags, + ); + + $this->fields['tags'] = $tags; + + return $this; + } + /** * @return string[] */ @@ -287,6 +320,18 @@ public function setTime(DateTimeImmutable|string $time): static return $this; } + public function getRequireAllTags(): string + { + return $this->fields['requireAllTags']; + } + + public function setRequireAllTags(string $requireAllTags): static + { + $this->fields['requireAllTags'] = $requireAllTags; + + return $this; + } + public function getMinimumQuantity(): ?int { return $this->fields['minimumQuantity'] ?? null; @@ -345,6 +390,9 @@ public function jsonSerialize(): array if (array_key_exists('countries', $this->fields)) { $data['countries'] = $this->fields['countries']; } + if (array_key_exists('tags', $this->fields)) { + $data['tags'] = $this->fields['tags']; + } if (array_key_exists('productIds', $this->fields)) { $data['productIds'] = $this->fields['productIds']; } @@ -360,6 +408,9 @@ public function jsonSerialize(): array if (array_key_exists('time', $this->fields)) { $data['time'] = $this->fields['time']?->format(DateTimeInterface::RFC3339); } + if (array_key_exists('requireAllTags', $this->fields)) { + $data['requireAllTags'] = $this->fields['requireAllTags']; + } if (array_key_exists('minimumQuantity', $this->fields)) { $data['minimumQuantity'] = $this->fields['minimumQuantity']; } diff --git a/src/Model/CouponRestrictionPaidByTime.php b/src/Model/CouponRestrictionPaidByTime.php index 55e072a60..dfb2e0888 100644 --- a/src/Model/CouponRestrictionPaidByTime.php +++ b/src/Model/CouponRestrictionPaidByTime.php @@ -19,6 +19,10 @@ class CouponRestrictionPaidByTime implements CouponRestriction, RedemptionRestriction, JsonSerializable { + public const REQUIRE_ALL_TAGS_TRUE = 'true'; + + public const REQUIRE_ALL_TAGS_FALSE = 'false'; + private array $fields = []; public function __construct(array $data = []) @@ -41,6 +45,9 @@ public function __construct(array $data = []) if (array_key_exists('countries', $data)) { $this->setCountries($data['countries']); } + if (array_key_exists('tags', $data)) { + $this->setTags($data['tags']); + } if (array_key_exists('productIds', $data)) { $this->setProductIds($data['productIds']); } @@ -56,6 +63,9 @@ public function __construct(array $data = []) if (array_key_exists('customerIds', $data)) { $this->setCustomerIds($data['customerIds']); } + if (array_key_exists('requireAllTags', $data)) { + $this->setRequireAllTags($data['requireAllTags']); + } if (array_key_exists('minimumQuantity', $data)) { $this->setMinimumQuantity($data['minimumQuantity']); } @@ -183,6 +193,29 @@ public function setCountries(array $countries): static return $this; } + /** + * @return string[] + */ + public function getTags(): array + { + return $this->fields['tags']; + } + + /** + * @param string[] $tags + */ + public function setTags(array $tags): static + { + $tags = array_map( + fn ($value) => $value, + $tags, + ); + + $this->fields['tags'] = $tags; + + return $this; + } + /** * @return string[] */ @@ -287,6 +320,18 @@ public function setCustomerIds(array $customerIds): static return $this; } + public function getRequireAllTags(): string + { + return $this->fields['requireAllTags']; + } + + public function setRequireAllTags(string $requireAllTags): static + { + $this->fields['requireAllTags'] = $requireAllTags; + + return $this; + } + public function getMinimumQuantity(): ?int { return $this->fields['minimumQuantity'] ?? null; @@ -345,6 +390,9 @@ public function jsonSerialize(): array if (array_key_exists('countries', $this->fields)) { $data['countries'] = $this->fields['countries']; } + if (array_key_exists('tags', $this->fields)) { + $data['tags'] = $this->fields['tags']; + } if (array_key_exists('productIds', $this->fields)) { $data['productIds'] = $this->fields['productIds']; } @@ -360,6 +408,9 @@ public function jsonSerialize(): array if (array_key_exists('customerIds', $this->fields)) { $data['customerIds'] = $this->fields['customerIds']; } + if (array_key_exists('requireAllTags', $this->fields)) { + $data['requireAllTags'] = $this->fields['requireAllTags']; + } if (array_key_exists('minimumQuantity', $this->fields)) { $data['minimumQuantity'] = $this->fields['minimumQuantity']; } diff --git a/src/Model/CouponRestrictionRedemptionsPerCustomer.php b/src/Model/CouponRestrictionRedemptionsPerCustomer.php index 116d87178..501defe63 100644 --- a/src/Model/CouponRestrictionRedemptionsPerCustomer.php +++ b/src/Model/CouponRestrictionRedemptionsPerCustomer.php @@ -19,6 +19,10 @@ class CouponRestrictionRedemptionsPerCustomer implements CouponRestriction, JsonSerializable { + public const REQUIRE_ALL_TAGS_TRUE = 'true'; + + public const REQUIRE_ALL_TAGS_FALSE = 'false'; + private array $fields = []; public function __construct(array $data = []) @@ -38,6 +42,9 @@ public function __construct(array $data = []) if (array_key_exists('countries', $data)) { $this->setCountries($data['countries']); } + if (array_key_exists('tags', $data)) { + $this->setTags($data['tags']); + } if (array_key_exists('productIds', $data)) { $this->setProductIds($data['productIds']); } @@ -56,6 +63,9 @@ public function __construct(array $data = []) if (array_key_exists('time', $data)) { $this->setTime($data['time']); } + if (array_key_exists('requireAllTags', $data)) { + $this->setRequireAllTags($data['requireAllTags']); + } if (array_key_exists('minimumQuantity', $data)) { $this->setMinimumQuantity($data['minimumQuantity']); } @@ -167,6 +177,29 @@ public function setCountries(array $countries): static return $this; } + /** + * @return string[] + */ + public function getTags(): array + { + return $this->fields['tags']; + } + + /** + * @param string[] $tags + */ + public function setTags(array $tags): static + { + $tags = array_map( + fn ($value) => $value, + $tags, + ); + + $this->fields['tags'] = $tags; + + return $this; + } + /** * @return string[] */ @@ -287,6 +320,18 @@ public function setTime(DateTimeImmutable|string $time): static return $this; } + public function getRequireAllTags(): string + { + return $this->fields['requireAllTags']; + } + + public function setRequireAllTags(string $requireAllTags): static + { + $this->fields['requireAllTags'] = $requireAllTags; + + return $this; + } + public function getMinimumQuantity(): ?int { return $this->fields['minimumQuantity'] ?? null; @@ -342,6 +387,9 @@ public function jsonSerialize(): array if (array_key_exists('countries', $this->fields)) { $data['countries'] = $this->fields['countries']; } + if (array_key_exists('tags', $this->fields)) { + $data['tags'] = $this->fields['tags']; + } if (array_key_exists('productIds', $this->fields)) { $data['productIds'] = $this->fields['productIds']; } @@ -360,6 +408,9 @@ public function jsonSerialize(): array if (array_key_exists('time', $this->fields)) { $data['time'] = $this->fields['time']?->format(DateTimeInterface::RFC3339); } + if (array_key_exists('requireAllTags', $this->fields)) { + $data['requireAllTags'] = $this->fields['requireAllTags']; + } if (array_key_exists('minimumQuantity', $this->fields)) { $data['minimumQuantity'] = $this->fields['minimumQuantity']; } diff --git a/src/Model/CouponRestrictionRestrictToBxgy.php b/src/Model/CouponRestrictionRestrictToBxgy.php index 10a12ff5e..e65a1b7e9 100644 --- a/src/Model/CouponRestrictionRestrictToBxgy.php +++ b/src/Model/CouponRestrictionRestrictToBxgy.php @@ -19,6 +19,10 @@ class CouponRestrictionRestrictToBxgy implements CouponRestriction, JsonSerializable { + public const REQUIRE_ALL_TAGS_TRUE = 'true'; + + public const REQUIRE_ALL_TAGS_FALSE = 'false'; + private array $fields = []; public function __construct(array $data = []) @@ -41,6 +45,9 @@ public function __construct(array $data = []) if (array_key_exists('countries', $data)) { $this->setCountries($data['countries']); } + if (array_key_exists('tags', $data)) { + $this->setTags($data['tags']); + } if (array_key_exists('productIds', $data)) { $this->setProductIds($data['productIds']); } @@ -56,6 +63,9 @@ public function __construct(array $data = []) if (array_key_exists('time', $data)) { $this->setTime($data['time']); } + if (array_key_exists('requireAllTags', $data)) { + $this->setRequireAllTags($data['requireAllTags']); + } if (array_key_exists('minimumQuantity', $data)) { $this->setMinimumQuantity($data['minimumQuantity']); } @@ -190,6 +200,29 @@ public function setCountries(array $countries): static return $this; } + /** + * @return string[] + */ + public function getTags(): array + { + return $this->fields['tags']; + } + + /** + * @param string[] $tags + */ + public function setTags(array $tags): static + { + $tags = array_map( + fn ($value) => $value, + $tags, + ); + + $this->fields['tags'] = $tags; + + return $this; + } + /** * @return string[] */ @@ -287,6 +320,18 @@ public function setTime(DateTimeImmutable|string $time): static return $this; } + public function getRequireAllTags(): string + { + return $this->fields['requireAllTags']; + } + + public function setRequireAllTags(string $requireAllTags): static + { + $this->fields['requireAllTags'] = $requireAllTags; + + return $this; + } + public function getMinimumQuantity(): ?int { return $this->fields['minimumQuantity'] ?? null; @@ -345,6 +390,9 @@ public function jsonSerialize(): array if (array_key_exists('countries', $this->fields)) { $data['countries'] = $this->fields['countries']; } + if (array_key_exists('tags', $this->fields)) { + $data['tags'] = $this->fields['tags']; + } if (array_key_exists('productIds', $this->fields)) { $data['productIds'] = $this->fields['productIds']; } @@ -360,6 +408,9 @@ public function jsonSerialize(): array if (array_key_exists('time', $this->fields)) { $data['time'] = $this->fields['time']?->format(DateTimeInterface::RFC3339); } + if (array_key_exists('requireAllTags', $this->fields)) { + $data['requireAllTags'] = $this->fields['requireAllTags']; + } if (array_key_exists('minimumQuantity', $this->fields)) { $data['minimumQuantity'] = $this->fields['minimumQuantity']; } diff --git a/src/Model/CouponRestrictionRestrictToCountries.php b/src/Model/CouponRestrictionRestrictToCountries.php index 0f5010f6e..72d7f04bc 100644 --- a/src/Model/CouponRestrictionRestrictToCountries.php +++ b/src/Model/CouponRestrictionRestrictToCountries.php @@ -19,6 +19,10 @@ class CouponRestrictionRestrictToCountries implements CouponRestriction, JsonSerializable { + public const REQUIRE_ALL_TAGS_TRUE = 'true'; + + public const REQUIRE_ALL_TAGS_FALSE = 'false'; + private array $fields = []; public function __construct(array $data = []) @@ -38,6 +42,9 @@ public function __construct(array $data = []) if (array_key_exists('buy', $data)) { $this->setBuy($data['buy']); } + if (array_key_exists('tags', $data)) { + $this->setTags($data['tags']); + } if (array_key_exists('productIds', $data)) { $this->setProductIds($data['productIds']); } @@ -56,6 +63,9 @@ public function __construct(array $data = []) if (array_key_exists('time', $data)) { $this->setTime($data['time']); } + if (array_key_exists('requireAllTags', $data)) { + $this->setRequireAllTags($data['requireAllTags']); + } if (array_key_exists('minimumQuantity', $data)) { $this->setMinimumQuantity($data['minimumQuantity']); } @@ -167,6 +177,29 @@ public function setBuy(array $buy): static return $this; } + /** + * @return string[] + */ + public function getTags(): array + { + return $this->fields['tags']; + } + + /** + * @param string[] $tags + */ + public function setTags(array $tags): static + { + $tags = array_map( + fn ($value) => $value, + $tags, + ); + + $this->fields['tags'] = $tags; + + return $this; + } + /** * @return string[] */ @@ -287,6 +320,18 @@ public function setTime(DateTimeImmutable|string $time): static return $this; } + public function getRequireAllTags(): string + { + return $this->fields['requireAllTags']; + } + + public function setRequireAllTags(string $requireAllTags): static + { + $this->fields['requireAllTags'] = $requireAllTags; + + return $this; + } + public function getMinimumQuantity(): ?int { return $this->fields['minimumQuantity'] ?? null; @@ -342,6 +387,9 @@ public function jsonSerialize(): array if (array_key_exists('buy', $this->fields)) { $data['buy'] = $this->fields['buy']; } + if (array_key_exists('tags', $this->fields)) { + $data['tags'] = $this->fields['tags']; + } if (array_key_exists('productIds', $this->fields)) { $data['productIds'] = $this->fields['productIds']; } @@ -360,6 +408,9 @@ public function jsonSerialize(): array if (array_key_exists('time', $this->fields)) { $data['time'] = $this->fields['time']?->format(DateTimeInterface::RFC3339); } + if (array_key_exists('requireAllTags', $this->fields)) { + $data['requireAllTags'] = $this->fields['requireAllTags']; + } if (array_key_exists('minimumQuantity', $this->fields)) { $data['minimumQuantity'] = $this->fields['minimumQuantity']; } diff --git a/src/Model/CouponRestrictionRestrictToCustomerTags.php b/src/Model/CouponRestrictionRestrictToCustomerTags.php new file mode 100644 index 000000000..cdcb41cba --- /dev/null +++ b/src/Model/CouponRestrictionRestrictToCustomerTags.php @@ -0,0 +1,423 @@ +setTags($data['tags']); + } + if (array_key_exists('requireAllTags', $data)) { + $this->setRequireAllTags($data['requireAllTags']); + } + if (array_key_exists('planIds', $data)) { + $this->setPlanIds($data['planIds']); + } + if (array_key_exists('amount', $data)) { + $this->setAmount($data['amount']); + } + if (array_key_exists('quantity', $data)) { + $this->setQuantity($data['quantity']); + } + if (array_key_exists('buy', $data)) { + $this->setBuy($data['buy']); + } + if (array_key_exists('countries', $data)) { + $this->setCountries($data['countries']); + } + if (array_key_exists('productIds', $data)) { + $this->setProductIds($data['productIds']); + } + if (array_key_exists('subscriptionIds', $data)) { + $this->setSubscriptionIds($data['subscriptionIds']); + } + if (array_key_exists('get', $data)) { + $this->setGet($data['get']); + } + if (array_key_exists('currency', $data)) { + $this->setCurrency($data['currency']); + } + if (array_key_exists('customerIds', $data)) { + $this->setCustomerIds($data['customerIds']); + } + if (array_key_exists('time', $data)) { + $this->setTime($data['time']); + } + if (array_key_exists('minimumQuantity', $data)) { + $this->setMinimumQuantity($data['minimumQuantity']); + } + if (array_key_exists('invoiceIds', $data)) { + $this->setInvoiceIds($data['invoiceIds']); + } + } + + public static function from(array $data = []): self + { + return new self($data); + } + + public function getType(): string + { + return 'restrict-to-customer-tags'; + } + + /** + * @return string[] + */ + public function getTags(): array + { + return $this->fields['tags']; + } + + /** + * @param string[] $tags + */ + public function setTags(array $tags): static + { + $tags = array_map( + fn ($value) => $value, + $tags, + ); + + $this->fields['tags'] = $tags; + + return $this; + } + + public function getRequireAllTags(): string + { + return $this->fields['requireAllTags']; + } + + public function setRequireAllTags(string $requireAllTags): static + { + $this->fields['requireAllTags'] = $requireAllTags; + + return $this; + } + + /** + * @return string[] + */ + public function getPlanIds(): array + { + return $this->fields['planIds']; + } + + /** + * @param string[] $planIds + */ + public function setPlanIds(array $planIds): static + { + $planIds = array_map( + fn ($value) => $value, + $planIds, + ); + + $this->fields['planIds'] = $planIds; + + return $this; + } + + public function getAmount(): int + { + return $this->fields['amount']; + } + + public function setAmount(int $amount): static + { + $this->fields['amount'] = $amount; + + return $this; + } + + public function getQuantity(): int + { + return $this->fields['quantity']; + } + + public function setQuantity(int $quantity): static + { + $this->fields['quantity'] = $quantity; + + return $this; + } + + /** + * @return CouponRestrictionRestrictToBxgyBuy[] + */ + public function getBuy(): array + { + return $this->fields['buy']; + } + + /** + * @param array[]|CouponRestrictionRestrictToBxgyBuy[] $buy + */ + public function setBuy(array $buy): static + { + $buy = array_map( + fn ($value) => $value !== null ? ($value instanceof CouponRestrictionRestrictToBxgyBuy ? $value : CouponRestrictionRestrictToBxgyBuy::from($value)) : null, + $buy, + ); + + $this->fields['buy'] = $buy; + + return $this; + } + + /** + * @return string[] + */ + public function getCountries(): array + { + return $this->fields['countries']; + } + + /** + * @param string[] $countries + */ + public function setCountries(array $countries): static + { + $countries = array_map( + fn ($value) => $value, + $countries, + ); + + $this->fields['countries'] = $countries; + + return $this; + } + + /** + * @return string[] + */ + public function getProductIds(): array + { + return $this->fields['productIds']; + } + + /** + * @param string[] $productIds + */ + public function setProductIds(array $productIds): static + { + $productIds = array_map( + fn ($value) => $value, + $productIds, + ); + + $this->fields['productIds'] = $productIds; + + return $this; + } + + /** + * @return string[] + */ + public function getSubscriptionIds(): array + { + return $this->fields['subscriptionIds']; + } + + /** + * @param string[] $subscriptionIds + */ + public function setSubscriptionIds(array $subscriptionIds): static + { + $subscriptionIds = array_map( + fn ($value) => $value, + $subscriptionIds, + ); + + $this->fields['subscriptionIds'] = $subscriptionIds; + + return $this; + } + + /** + * @return CouponRestrictionRestrictToBxgyGet[] + */ + public function getGet(): array + { + return $this->fields['get']; + } + + /** + * @param array[]|CouponRestrictionRestrictToBxgyGet[] $get + */ + public function setGet(array $get): static + { + $get = array_map( + fn ($value) => $value !== null ? ($value instanceof CouponRestrictionRestrictToBxgyGet ? $value : CouponRestrictionRestrictToBxgyGet::from($value)) : null, + $get, + ); + + $this->fields['get'] = $get; + + return $this; + } + + public function getCurrency(): string + { + return $this->fields['currency']; + } + + public function setCurrency(string $currency): static + { + $this->fields['currency'] = $currency; + + return $this; + } + + /** + * @return string[] + */ + public function getCustomerIds(): array + { + return $this->fields['customerIds']; + } + + /** + * @param string[] $customerIds + */ + public function setCustomerIds(array $customerIds): static + { + $customerIds = array_map( + fn ($value) => $value, + $customerIds, + ); + + $this->fields['customerIds'] = $customerIds; + + return $this; + } + + public function getTime(): DateTimeImmutable + { + return $this->fields['time']; + } + + public function setTime(DateTimeImmutable|string $time): static + { + if (!($time instanceof DateTimeImmutable)) { + $time = new DateTimeImmutable($time); + } + + $this->fields['time'] = $time; + + return $this; + } + + public function getMinimumQuantity(): ?int + { + return $this->fields['minimumQuantity'] ?? null; + } + + public function setMinimumQuantity(null|int $minimumQuantity): static + { + $this->fields['minimumQuantity'] = $minimumQuantity; + + return $this; + } + + /** + * @return string[] + */ + public function getInvoiceIds(): array + { + return $this->fields['invoiceIds']; + } + + /** + * @param string[] $invoiceIds + */ + public function setInvoiceIds(array $invoiceIds): static + { + $invoiceIds = array_map( + fn ($value) => $value, + $invoiceIds, + ); + + $this->fields['invoiceIds'] = $invoiceIds; + + return $this; + } + + public function jsonSerialize(): array + { + $data = [ + 'type' => 'restrict-to-customer-tags', + ]; + if (array_key_exists('tags', $this->fields)) { + $data['tags'] = $this->fields['tags']; + } + if (array_key_exists('requireAllTags', $this->fields)) { + $data['requireAllTags'] = $this->fields['requireAllTags']; + } + if (array_key_exists('planIds', $this->fields)) { + $data['planIds'] = $this->fields['planIds']; + } + if (array_key_exists('amount', $this->fields)) { + $data['amount'] = $this->fields['amount']; + } + if (array_key_exists('quantity', $this->fields)) { + $data['quantity'] = $this->fields['quantity']; + } + if (array_key_exists('buy', $this->fields)) { + $data['buy'] = $this->fields['buy']; + } + if (array_key_exists('countries', $this->fields)) { + $data['countries'] = $this->fields['countries']; + } + if (array_key_exists('productIds', $this->fields)) { + $data['productIds'] = $this->fields['productIds']; + } + if (array_key_exists('subscriptionIds', $this->fields)) { + $data['subscriptionIds'] = $this->fields['subscriptionIds']; + } + if (array_key_exists('get', $this->fields)) { + $data['get'] = $this->fields['get']; + } + if (array_key_exists('currency', $this->fields)) { + $data['currency'] = $this->fields['currency']; + } + if (array_key_exists('customerIds', $this->fields)) { + $data['customerIds'] = $this->fields['customerIds']; + } + if (array_key_exists('time', $this->fields)) { + $data['time'] = $this->fields['time']?->format(DateTimeInterface::RFC3339); + } + if (array_key_exists('minimumQuantity', $this->fields)) { + $data['minimumQuantity'] = $this->fields['minimumQuantity']; + } + if (array_key_exists('invoiceIds', $this->fields)) { + $data['invoiceIds'] = $this->fields['invoiceIds']; + } + + return $data; + } +} diff --git a/src/Model/CouponRestrictionRestrictToCustomers.php b/src/Model/CouponRestrictionRestrictToCustomers.php index b07ccfb63..55929dea7 100644 --- a/src/Model/CouponRestrictionRestrictToCustomers.php +++ b/src/Model/CouponRestrictionRestrictToCustomers.php @@ -19,6 +19,10 @@ class CouponRestrictionRestrictToCustomers implements CouponRestriction, JsonSerializable { + public const REQUIRE_ALL_TAGS_TRUE = 'true'; + + public const REQUIRE_ALL_TAGS_FALSE = 'false'; + private array $fields = []; public function __construct(array $data = []) @@ -41,6 +45,9 @@ public function __construct(array $data = []) if (array_key_exists('countries', $data)) { $this->setCountries($data['countries']); } + if (array_key_exists('tags', $data)) { + $this->setTags($data['tags']); + } if (array_key_exists('productIds', $data)) { $this->setProductIds($data['productIds']); } @@ -56,6 +63,9 @@ public function __construct(array $data = []) if (array_key_exists('time', $data)) { $this->setTime($data['time']); } + if (array_key_exists('requireAllTags', $data)) { + $this->setRequireAllTags($data['requireAllTags']); + } if (array_key_exists('minimumQuantity', $data)) { $this->setMinimumQuantity($data['minimumQuantity']); } @@ -190,6 +200,29 @@ public function setCountries(array $countries): static return $this; } + /** + * @return string[] + */ + public function getTags(): array + { + return $this->fields['tags']; + } + + /** + * @param string[] $tags + */ + public function setTags(array $tags): static + { + $tags = array_map( + fn ($value) => $value, + $tags, + ); + + $this->fields['tags'] = $tags; + + return $this; + } + /** * @return string[] */ @@ -287,6 +320,18 @@ public function setTime(DateTimeImmutable|string $time): static return $this; } + public function getRequireAllTags(): string + { + return $this->fields['requireAllTags']; + } + + public function setRequireAllTags(string $requireAllTags): static + { + $this->fields['requireAllTags'] = $requireAllTags; + + return $this; + } + public function getMinimumQuantity(): ?int { return $this->fields['minimumQuantity'] ?? null; @@ -345,6 +390,9 @@ public function jsonSerialize(): array if (array_key_exists('countries', $this->fields)) { $data['countries'] = $this->fields['countries']; } + if (array_key_exists('tags', $this->fields)) { + $data['tags'] = $this->fields['tags']; + } if (array_key_exists('productIds', $this->fields)) { $data['productIds'] = $this->fields['productIds']; } @@ -360,6 +408,9 @@ public function jsonSerialize(): array if (array_key_exists('time', $this->fields)) { $data['time'] = $this->fields['time']?->format(DateTimeInterface::RFC3339); } + if (array_key_exists('requireAllTags', $this->fields)) { + $data['requireAllTags'] = $this->fields['requireAllTags']; + } if (array_key_exists('minimumQuantity', $this->fields)) { $data['minimumQuantity'] = $this->fields['minimumQuantity']; } diff --git a/src/Model/CouponRestrictionRestrictToInvoices.php b/src/Model/CouponRestrictionRestrictToInvoices.php index bb4314d36..70bb59b21 100644 --- a/src/Model/CouponRestrictionRestrictToInvoices.php +++ b/src/Model/CouponRestrictionRestrictToInvoices.php @@ -19,6 +19,10 @@ class CouponRestrictionRestrictToInvoices implements CouponRestriction, RedemptionRestriction, JsonSerializable { + public const REQUIRE_ALL_TAGS_TRUE = 'true'; + + public const REQUIRE_ALL_TAGS_FALSE = 'false'; + private array $fields = []; public function __construct(array $data = []) @@ -41,6 +45,9 @@ public function __construct(array $data = []) if (array_key_exists('countries', $data)) { $this->setCountries($data['countries']); } + if (array_key_exists('tags', $data)) { + $this->setTags($data['tags']); + } if (array_key_exists('productIds', $data)) { $this->setProductIds($data['productIds']); } @@ -59,6 +66,9 @@ public function __construct(array $data = []) if (array_key_exists('time', $data)) { $this->setTime($data['time']); } + if (array_key_exists('requireAllTags', $data)) { + $this->setRequireAllTags($data['requireAllTags']); + } if (array_key_exists('minimumQuantity', $data)) { $this->setMinimumQuantity($data['minimumQuantity']); } @@ -190,6 +200,29 @@ public function setCountries(array $countries): static return $this; } + /** + * @return string[] + */ + public function getTags(): array + { + return $this->fields['tags']; + } + + /** + * @param string[] $tags + */ + public function setTags(array $tags): static + { + $tags = array_map( + fn ($value) => $value, + $tags, + ); + + $this->fields['tags'] = $tags; + + return $this; + } + /** * @return string[] */ @@ -310,6 +343,18 @@ public function setTime(DateTimeImmutable|string $time): static return $this; } + public function getRequireAllTags(): string + { + return $this->fields['requireAllTags']; + } + + public function setRequireAllTags(string $requireAllTags): static + { + $this->fields['requireAllTags'] = $requireAllTags; + + return $this; + } + public function getMinimumQuantity(): ?int { return $this->fields['minimumQuantity'] ?? null; @@ -345,6 +390,9 @@ public function jsonSerialize(): array if (array_key_exists('countries', $this->fields)) { $data['countries'] = $this->fields['countries']; } + if (array_key_exists('tags', $this->fields)) { + $data['tags'] = $this->fields['tags']; + } if (array_key_exists('productIds', $this->fields)) { $data['productIds'] = $this->fields['productIds']; } @@ -363,6 +411,9 @@ public function jsonSerialize(): array if (array_key_exists('time', $this->fields)) { $data['time'] = $this->fields['time']?->format(DateTimeInterface::RFC3339); } + if (array_key_exists('requireAllTags', $this->fields)) { + $data['requireAllTags'] = $this->fields['requireAllTags']; + } if (array_key_exists('minimumQuantity', $this->fields)) { $data['minimumQuantity'] = $this->fields['minimumQuantity']; } diff --git a/src/Model/CouponRestrictionRestrictToPlans.php b/src/Model/CouponRestrictionRestrictToPlans.php index ee9893850..e48b9884f 100644 --- a/src/Model/CouponRestrictionRestrictToPlans.php +++ b/src/Model/CouponRestrictionRestrictToPlans.php @@ -19,6 +19,10 @@ class CouponRestrictionRestrictToPlans implements CouponRestriction, RedemptionRestriction, JsonSerializable { + public const REQUIRE_ALL_TAGS_TRUE = 'true'; + + public const REQUIRE_ALL_TAGS_FALSE = 'false'; + private array $fields = []; public function __construct(array $data = []) @@ -41,6 +45,9 @@ public function __construct(array $data = []) if (array_key_exists('countries', $data)) { $this->setCountries($data['countries']); } + if (array_key_exists('tags', $data)) { + $this->setTags($data['tags']); + } if (array_key_exists('productIds', $data)) { $this->setProductIds($data['productIds']); } @@ -59,6 +66,9 @@ public function __construct(array $data = []) if (array_key_exists('time', $data)) { $this->setTime($data['time']); } + if (array_key_exists('requireAllTags', $data)) { + $this->setRequireAllTags($data['requireAllTags']); + } if (array_key_exists('invoiceIds', $data)) { $this->setInvoiceIds($data['invoiceIds']); } @@ -179,6 +189,29 @@ public function setCountries(array $countries): static return $this; } + /** + * @return string[] + */ + public function getTags(): array + { + return $this->fields['tags']; + } + + /** + * @param string[] $tags + */ + public function setTags(array $tags): static + { + $tags = array_map( + fn ($value) => $value, + $tags, + ); + + $this->fields['tags'] = $tags; + + return $this; + } + /** * @return string[] */ @@ -299,6 +332,18 @@ public function setTime(DateTimeImmutable|string $time): static return $this; } + public function getRequireAllTags(): string + { + return $this->fields['requireAllTags']; + } + + public function setRequireAllTags(string $requireAllTags): static + { + $this->fields['requireAllTags'] = $requireAllTags; + + return $this; + } + /** * @return string[] */ @@ -345,6 +390,9 @@ public function jsonSerialize(): array if (array_key_exists('countries', $this->fields)) { $data['countries'] = $this->fields['countries']; } + if (array_key_exists('tags', $this->fields)) { + $data['tags'] = $this->fields['tags']; + } if (array_key_exists('productIds', $this->fields)) { $data['productIds'] = $this->fields['productIds']; } @@ -363,6 +411,9 @@ public function jsonSerialize(): array if (array_key_exists('time', $this->fields)) { $data['time'] = $this->fields['time']?->format(DateTimeInterface::RFC3339); } + if (array_key_exists('requireAllTags', $this->fields)) { + $data['requireAllTags'] = $this->fields['requireAllTags']; + } if (array_key_exists('invoiceIds', $this->fields)) { $data['invoiceIds'] = $this->fields['invoiceIds']; } diff --git a/src/Model/CouponRestrictionRestrictToProducts.php b/src/Model/CouponRestrictionRestrictToProducts.php index 93e2c124f..abdb1ae7c 100644 --- a/src/Model/CouponRestrictionRestrictToProducts.php +++ b/src/Model/CouponRestrictionRestrictToProducts.php @@ -19,6 +19,10 @@ class CouponRestrictionRestrictToProducts implements CouponRestriction, RedemptionRestriction, JsonSerializable { + public const REQUIRE_ALL_TAGS_TRUE = 'true'; + + public const REQUIRE_ALL_TAGS_FALSE = 'false'; + private array $fields = []; public function __construct(array $data = []) @@ -44,6 +48,9 @@ public function __construct(array $data = []) if (array_key_exists('countries', $data)) { $this->setCountries($data['countries']); } + if (array_key_exists('tags', $data)) { + $this->setTags($data['tags']); + } if (array_key_exists('subscriptionIds', $data)) { $this->setSubscriptionIds($data['subscriptionIds']); } @@ -59,6 +66,9 @@ public function __construct(array $data = []) if (array_key_exists('time', $data)) { $this->setTime($data['time']); } + if (array_key_exists('requireAllTags', $data)) { + $this->setRequireAllTags($data['requireAllTags']); + } if (array_key_exists('invoiceIds', $data)) { $this->setInvoiceIds($data['invoiceIds']); } @@ -202,6 +212,29 @@ public function setCountries(array $countries): static return $this; } + /** + * @return string[] + */ + public function getTags(): array + { + return $this->fields['tags']; + } + + /** + * @param string[] $tags + */ + public function setTags(array $tags): static + { + $tags = array_map( + fn ($value) => $value, + $tags, + ); + + $this->fields['tags'] = $tags; + + return $this; + } + /** * @return string[] */ @@ -299,6 +332,18 @@ public function setTime(DateTimeImmutable|string $time): static return $this; } + public function getRequireAllTags(): string + { + return $this->fields['requireAllTags']; + } + + public function setRequireAllTags(string $requireAllTags): static + { + $this->fields['requireAllTags'] = $requireAllTags; + + return $this; + } + /** * @return string[] */ @@ -348,6 +393,9 @@ public function jsonSerialize(): array if (array_key_exists('countries', $this->fields)) { $data['countries'] = $this->fields['countries']; } + if (array_key_exists('tags', $this->fields)) { + $data['tags'] = $this->fields['tags']; + } if (array_key_exists('subscriptionIds', $this->fields)) { $data['subscriptionIds'] = $this->fields['subscriptionIds']; } @@ -363,6 +411,9 @@ public function jsonSerialize(): array if (array_key_exists('time', $this->fields)) { $data['time'] = $this->fields['time']?->format(DateTimeInterface::RFC3339); } + if (array_key_exists('requireAllTags', $this->fields)) { + $data['requireAllTags'] = $this->fields['requireAllTags']; + } if (array_key_exists('invoiceIds', $this->fields)) { $data['invoiceIds'] = $this->fields['invoiceIds']; } diff --git a/src/Model/CouponRestrictionRestrictToSubscriptions.php b/src/Model/CouponRestrictionRestrictToSubscriptions.php index 7d00a8fe1..cbe41e113 100644 --- a/src/Model/CouponRestrictionRestrictToSubscriptions.php +++ b/src/Model/CouponRestrictionRestrictToSubscriptions.php @@ -19,6 +19,10 @@ class CouponRestrictionRestrictToSubscriptions implements CouponRestriction, RedemptionRestriction, JsonSerializable { + public const REQUIRE_ALL_TAGS_TRUE = 'true'; + + public const REQUIRE_ALL_TAGS_FALSE = 'false'; + private array $fields = []; public function __construct(array $data = []) @@ -41,6 +45,9 @@ public function __construct(array $data = []) if (array_key_exists('countries', $data)) { $this->setCountries($data['countries']); } + if (array_key_exists('tags', $data)) { + $this->setTags($data['tags']); + } if (array_key_exists('productIds', $data)) { $this->setProductIds($data['productIds']); } @@ -56,6 +63,9 @@ public function __construct(array $data = []) if (array_key_exists('time', $data)) { $this->setTime($data['time']); } + if (array_key_exists('requireAllTags', $data)) { + $this->setRequireAllTags($data['requireAllTags']); + } if (array_key_exists('minimumQuantity', $data)) { $this->setMinimumQuantity($data['minimumQuantity']); } @@ -190,6 +200,29 @@ public function setCountries(array $countries): static return $this; } + /** + * @return string[] + */ + public function getTags(): array + { + return $this->fields['tags']; + } + + /** + * @param string[] $tags + */ + public function setTags(array $tags): static + { + $tags = array_map( + fn ($value) => $value, + $tags, + ); + + $this->fields['tags'] = $tags; + + return $this; + } + /** * @return string[] */ @@ -287,6 +320,18 @@ public function setTime(DateTimeImmutable|string $time): static return $this; } + public function getRequireAllTags(): string + { + return $this->fields['requireAllTags']; + } + + public function setRequireAllTags(string $requireAllTags): static + { + $this->fields['requireAllTags'] = $requireAllTags; + + return $this; + } + public function getMinimumQuantity(): ?int { return $this->fields['minimumQuantity'] ?? null; @@ -345,6 +390,9 @@ public function jsonSerialize(): array if (array_key_exists('countries', $this->fields)) { $data['countries'] = $this->fields['countries']; } + if (array_key_exists('tags', $this->fields)) { + $data['tags'] = $this->fields['tags']; + } if (array_key_exists('productIds', $this->fields)) { $data['productIds'] = $this->fields['productIds']; } @@ -360,6 +408,9 @@ public function jsonSerialize(): array if (array_key_exists('time', $this->fields)) { $data['time'] = $this->fields['time']?->format(DateTimeInterface::RFC3339); } + if (array_key_exists('requireAllTags', $this->fields)) { + $data['requireAllTags'] = $this->fields['requireAllTags']; + } if (array_key_exists('minimumQuantity', $this->fields)) { $data['minimumQuantity'] = $this->fields['minimumQuantity']; } diff --git a/src/Model/CouponRestrictionTotalRedemptions.php b/src/Model/CouponRestrictionTotalRedemptions.php index 7c396ad71..a24a36211 100644 --- a/src/Model/CouponRestrictionTotalRedemptions.php +++ b/src/Model/CouponRestrictionTotalRedemptions.php @@ -19,6 +19,10 @@ class CouponRestrictionTotalRedemptions implements CouponRestriction, JsonSerializable { + public const REQUIRE_ALL_TAGS_TRUE = 'true'; + + public const REQUIRE_ALL_TAGS_FALSE = 'false'; + private array $fields = []; public function __construct(array $data = []) @@ -38,6 +42,9 @@ public function __construct(array $data = []) if (array_key_exists('countries', $data)) { $this->setCountries($data['countries']); } + if (array_key_exists('tags', $data)) { + $this->setTags($data['tags']); + } if (array_key_exists('productIds', $data)) { $this->setProductIds($data['productIds']); } @@ -56,6 +63,9 @@ public function __construct(array $data = []) if (array_key_exists('time', $data)) { $this->setTime($data['time']); } + if (array_key_exists('requireAllTags', $data)) { + $this->setRequireAllTags($data['requireAllTags']); + } if (array_key_exists('minimumQuantity', $data)) { $this->setMinimumQuantity($data['minimumQuantity']); } @@ -167,6 +177,29 @@ public function setCountries(array $countries): static return $this; } + /** + * @return string[] + */ + public function getTags(): array + { + return $this->fields['tags']; + } + + /** + * @param string[] $tags + */ + public function setTags(array $tags): static + { + $tags = array_map( + fn ($value) => $value, + $tags, + ); + + $this->fields['tags'] = $tags; + + return $this; + } + /** * @return string[] */ @@ -287,6 +320,18 @@ public function setTime(DateTimeImmutable|string $time): static return $this; } + public function getRequireAllTags(): string + { + return $this->fields['requireAllTags']; + } + + public function setRequireAllTags(string $requireAllTags): static + { + $this->fields['requireAllTags'] = $requireAllTags; + + return $this; + } + public function getMinimumQuantity(): ?int { return $this->fields['minimumQuantity'] ?? null; @@ -342,6 +387,9 @@ public function jsonSerialize(): array if (array_key_exists('countries', $this->fields)) { $data['countries'] = $this->fields['countries']; } + if (array_key_exists('tags', $this->fields)) { + $data['tags'] = $this->fields['tags']; + } if (array_key_exists('productIds', $this->fields)) { $data['productIds'] = $this->fields['productIds']; } @@ -360,6 +408,9 @@ public function jsonSerialize(): array if (array_key_exists('time', $this->fields)) { $data['time'] = $this->fields['time']?->format(DateTimeInterface::RFC3339); } + if (array_key_exists('requireAllTags', $this->fields)) { + $data['requireAllTags'] = $this->fields['requireAllTags']; + } if (array_key_exists('minimumQuantity', $this->fields)) { $data['minimumQuantity'] = $this->fields['minimumQuantity']; } diff --git a/src/Model/Dispute.php b/src/Model/Dispute.php index 5809fc069..fe89740d3 100644 --- a/src/Model/Dispute.php +++ b/src/Model/Dispute.php @@ -357,6 +357,8 @@ class Dispute implements JsonSerializable public const CATEGORY_UNCATEGORIZED = 'uncategorized'; + public const CATEGORY_BANK_RETURN = 'bank-return'; + public const TYPE_INFORMATION_REQUEST = 'information-request'; public const TYPE_FIRST_CHARGEBACK = 'first-chargeback'; @@ -371,6 +373,8 @@ class Dispute implements JsonSerializable public const TYPE_VERIFI_ALERT = 'verifi-alert'; + public const TYPE_BANK_RETURN = 'bank-return'; + public const STATUS_RESPONSE_NEEDED = 'response-needed'; public const STATUS_UNDER_REVIEW = 'under-review';