diff --git a/.changeset/lazy-dolphins-burn.md b/.changeset/lazy-dolphins-burn.md new file mode 100644 index 000000000..161d6360e --- /dev/null +++ b/.changeset/lazy-dolphins-burn.md @@ -0,0 +1,10 @@ +--- +"@rebilly/client-php": patch +--- + +Add dispute credentials for PSiGate +Add quote events to customer timeline +Add PayRedeem gateway config +Add Restrict to customer coupon restriction type +Add customerDocumentCustomField setting to dLocal +Add pricing min quantity diff --git a/src/Model/CouponRestrictionDiscountPerRedemption.php b/src/Model/CouponRestrictionDiscountPerRedemption.php index 11317df23..25cf88248 100644 --- a/src/Model/CouponRestrictionDiscountPerRedemption.php +++ b/src/Model/CouponRestrictionDiscountPerRedemption.php @@ -50,6 +50,9 @@ public function __construct(array $data = []) 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']); } @@ -119,7 +122,7 @@ public function setAmount(int $amount): static } /** - * @return CouponRestrictionRetrictToBxgyBuy[] + * @return CouponRestrictionRestrictToBxgyBuy[] */ public function getBuy(): array { @@ -127,12 +130,12 @@ public function getBuy(): array } /** - * @param array[]|CouponRestrictionRetrictToBxgyBuy[] $buy + * @param array[]|CouponRestrictionRestrictToBxgyBuy[] $buy */ public function setBuy(array $buy): static { $buy = array_map( - fn ($value) => $value !== null ? ($value instanceof CouponRestrictionRetrictToBxgyBuy ? $value : CouponRestrictionRetrictToBxgyBuy::from($value)) : null, + fn ($value) => $value !== null ? ($value instanceof CouponRestrictionRestrictToBxgyBuy ? $value : CouponRestrictionRestrictToBxgyBuy::from($value)) : null, $buy, ); @@ -211,7 +214,7 @@ public function setSubscriptionIds(array $subscriptionIds): static } /** - * @return CouponRestrictionRetrictToBxgyGet[] + * @return CouponRestrictionRestrictToBxgyGet[] */ public function getGet(): array { @@ -219,12 +222,12 @@ public function getGet(): array } /** - * @param array[]|CouponRestrictionRetrictToBxgyGet[] $get + * @param array[]|CouponRestrictionRestrictToBxgyGet[] $get */ public function setGet(array $get): static { $get = array_map( - fn ($value) => $value !== null ? ($value instanceof CouponRestrictionRetrictToBxgyGet ? $value : CouponRestrictionRetrictToBxgyGet::from($value)) : null, + fn ($value) => $value !== null ? ($value instanceof CouponRestrictionRestrictToBxgyGet ? $value : CouponRestrictionRestrictToBxgyGet::from($value)) : null, $get, ); @@ -245,6 +248,29 @@ public function setCurrency(string $currency): static 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']; @@ -328,6 +354,9 @@ public function jsonSerialize(): array 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); } diff --git a/src/Model/CouponRestrictionFactory.php b/src/Model/CouponRestrictionFactory.php index 3a3447d40..28343c670 100644 --- a/src/Model/CouponRestrictionFactory.php +++ b/src/Model/CouponRestrictionFactory.php @@ -24,8 +24,9 @@ public static function from(array $data = []): CouponRestriction 'minimum-order-amount' => CouponRestrictionMinimumOrderAmount::from($data), 'paid-by-time' => CouponRestrictionPaidByTime::from($data), 'redemptions-per-customer' => CouponRestrictionRedemptionsPerCustomer::from($data), - 'restrict-to-bxgy' => CouponRestrictionRetrictToBxgy::from($data), + 'restrict-to-bxgy' => CouponRestrictionRestrictToBxgy::from($data), 'restrict-to-countries' => CouponRestrictionRestrictToCountries::from($data), + 'restrict-to-customers' => CouponRestrictionRestrictToCustomers::from($data), 'restrict-to-invoices' => CouponRestrictionRestrictToInvoices::from($data), 'restrict-to-plans' => CouponRestrictionRestrictToPlans::from($data), 'restrict-to-products' => CouponRestrictionRestrictToProducts::from($data), diff --git a/src/Model/CouponRestrictionMinimumOrderAmount.php b/src/Model/CouponRestrictionMinimumOrderAmount.php index 5f3c637eb..79f3bdd65 100644 --- a/src/Model/CouponRestrictionMinimumOrderAmount.php +++ b/src/Model/CouponRestrictionMinimumOrderAmount.php @@ -50,6 +50,9 @@ public function __construct(array $data = []) if (array_key_exists('get', $data)) { $this->setGet($data['get']); } + if (array_key_exists('customerIds', $data)) { + $this->setCustomerIds($data['customerIds']); + } if (array_key_exists('time', $data)) { $this->setTime($data['time']); } @@ -131,7 +134,7 @@ public function setQuantity(int $quantity): static } /** - * @return CouponRestrictionRetrictToBxgyBuy[] + * @return CouponRestrictionRestrictToBxgyBuy[] */ public function getBuy(): array { @@ -139,12 +142,12 @@ public function getBuy(): array } /** - * @param array[]|CouponRestrictionRetrictToBxgyBuy[] $buy + * @param array[]|CouponRestrictionRestrictToBxgyBuy[] $buy */ public function setBuy(array $buy): static { $buy = array_map( - fn ($value) => $value !== null ? ($value instanceof CouponRestrictionRetrictToBxgyBuy ? $value : CouponRestrictionRetrictToBxgyBuy::from($value)) : null, + fn ($value) => $value !== null ? ($value instanceof CouponRestrictionRestrictToBxgyBuy ? $value : CouponRestrictionRestrictToBxgyBuy::from($value)) : null, $buy, ); @@ -223,7 +226,7 @@ public function setSubscriptionIds(array $subscriptionIds): static } /** - * @return CouponRestrictionRetrictToBxgyGet[] + * @return CouponRestrictionRestrictToBxgyGet[] */ public function getGet(): array { @@ -231,12 +234,12 @@ public function getGet(): array } /** - * @param array[]|CouponRestrictionRetrictToBxgyGet[] $get + * @param array[]|CouponRestrictionRestrictToBxgyGet[] $get */ public function setGet(array $get): static { $get = array_map( - fn ($value) => $value !== null ? ($value instanceof CouponRestrictionRetrictToBxgyGet ? $value : CouponRestrictionRetrictToBxgyGet::from($value)) : null, + fn ($value) => $value !== null ? ($value instanceof CouponRestrictionRestrictToBxgyGet ? $value : CouponRestrictionRestrictToBxgyGet::from($value)) : null, $get, ); @@ -245,6 +248,29 @@ public function setGet(array $get): static 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']; @@ -328,6 +354,9 @@ public function jsonSerialize(): array if (array_key_exists('get', $this->fields)) { $data['get'] = $this->fields['get']; } + 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); } diff --git a/src/Model/CouponRestrictionPaidByTime.php b/src/Model/CouponRestrictionPaidByTime.php index f7d1cdb28..55e072a60 100644 --- a/src/Model/CouponRestrictionPaidByTime.php +++ b/src/Model/CouponRestrictionPaidByTime.php @@ -53,6 +53,9 @@ public function __construct(array $data = []) if (array_key_exists('currency', $data)) { $this->setCurrency($data['currency']); } + if (array_key_exists('customerIds', $data)) { + $this->setCustomerIds($data['customerIds']); + } if (array_key_exists('minimumQuantity', $data)) { $this->setMinimumQuantity($data['minimumQuantity']); } @@ -135,7 +138,7 @@ public function setQuantity(int $quantity): static } /** - * @return CouponRestrictionRetrictToBxgyBuy[] + * @return CouponRestrictionRestrictToBxgyBuy[] */ public function getBuy(): array { @@ -143,12 +146,12 @@ public function getBuy(): array } /** - * @param array[]|CouponRestrictionRetrictToBxgyBuy[] $buy + * @param array[]|CouponRestrictionRestrictToBxgyBuy[] $buy */ public function setBuy(array $buy): static { $buy = array_map( - fn ($value) => $value !== null ? ($value instanceof CouponRestrictionRetrictToBxgyBuy ? $value : CouponRestrictionRetrictToBxgyBuy::from($value)) : null, + fn ($value) => $value !== null ? ($value instanceof CouponRestrictionRestrictToBxgyBuy ? $value : CouponRestrictionRestrictToBxgyBuy::from($value)) : null, $buy, ); @@ -227,7 +230,7 @@ public function setSubscriptionIds(array $subscriptionIds): static } /** - * @return CouponRestrictionRetrictToBxgyGet[] + * @return CouponRestrictionRestrictToBxgyGet[] */ public function getGet(): array { @@ -235,12 +238,12 @@ public function getGet(): array } /** - * @param array[]|CouponRestrictionRetrictToBxgyGet[] $get + * @param array[]|CouponRestrictionRestrictToBxgyGet[] $get */ public function setGet(array $get): static { $get = array_map( - fn ($value) => $value !== null ? ($value instanceof CouponRestrictionRetrictToBxgyGet ? $value : CouponRestrictionRetrictToBxgyGet::from($value)) : null, + fn ($value) => $value !== null ? ($value instanceof CouponRestrictionRestrictToBxgyGet ? $value : CouponRestrictionRestrictToBxgyGet::from($value)) : null, $get, ); @@ -261,6 +264,29 @@ public function setCurrency(string $currency): static 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 getMinimumQuantity(): ?int { return $this->fields['minimumQuantity'] ?? null; @@ -331,6 +357,9 @@ public function jsonSerialize(): array 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('minimumQuantity', $this->fields)) { $data['minimumQuantity'] = $this->fields['minimumQuantity']; } diff --git a/src/Model/CouponRestrictionRedemptionsPerCustomer.php b/src/Model/CouponRestrictionRedemptionsPerCustomer.php index 7f85efcea..116d87178 100644 --- a/src/Model/CouponRestrictionRedemptionsPerCustomer.php +++ b/src/Model/CouponRestrictionRedemptionsPerCustomer.php @@ -50,6 +50,9 @@ public function __construct(array $data = []) 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']); } @@ -119,7 +122,7 @@ public function setAmount(int $amount): static } /** - * @return CouponRestrictionRetrictToBxgyBuy[] + * @return CouponRestrictionRestrictToBxgyBuy[] */ public function getBuy(): array { @@ -127,12 +130,12 @@ public function getBuy(): array } /** - * @param array[]|CouponRestrictionRetrictToBxgyBuy[] $buy + * @param array[]|CouponRestrictionRestrictToBxgyBuy[] $buy */ public function setBuy(array $buy): static { $buy = array_map( - fn ($value) => $value !== null ? ($value instanceof CouponRestrictionRetrictToBxgyBuy ? $value : CouponRestrictionRetrictToBxgyBuy::from($value)) : null, + fn ($value) => $value !== null ? ($value instanceof CouponRestrictionRestrictToBxgyBuy ? $value : CouponRestrictionRestrictToBxgyBuy::from($value)) : null, $buy, ); @@ -211,7 +214,7 @@ public function setSubscriptionIds(array $subscriptionIds): static } /** - * @return CouponRestrictionRetrictToBxgyGet[] + * @return CouponRestrictionRestrictToBxgyGet[] */ public function getGet(): array { @@ -219,12 +222,12 @@ public function getGet(): array } /** - * @param array[]|CouponRestrictionRetrictToBxgyGet[] $get + * @param array[]|CouponRestrictionRestrictToBxgyGet[] $get */ public function setGet(array $get): static { $get = array_map( - fn ($value) => $value !== null ? ($value instanceof CouponRestrictionRetrictToBxgyGet ? $value : CouponRestrictionRetrictToBxgyGet::from($value)) : null, + fn ($value) => $value !== null ? ($value instanceof CouponRestrictionRestrictToBxgyGet ? $value : CouponRestrictionRestrictToBxgyGet::from($value)) : null, $get, ); @@ -245,6 +248,29 @@ public function setCurrency(string $currency): static 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']; @@ -328,6 +354,9 @@ public function jsonSerialize(): array 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); } diff --git a/src/Model/CouponRestrictionRetrictToBxgy.php b/src/Model/CouponRestrictionRestrictToBxgy.php similarity index 86% rename from src/Model/CouponRestrictionRetrictToBxgy.php rename to src/Model/CouponRestrictionRestrictToBxgy.php index 7feabfc0a..10a12ff5e 100644 --- a/src/Model/CouponRestrictionRetrictToBxgy.php +++ b/src/Model/CouponRestrictionRestrictToBxgy.php @@ -17,7 +17,7 @@ use DateTimeInterface; use JsonSerializable; -class CouponRestrictionRetrictToBxgy implements CouponRestriction, JsonSerializable +class CouponRestrictionRestrictToBxgy implements CouponRestriction, JsonSerializable { private array $fields = []; @@ -50,6 +50,9 @@ public function __construct(array $data = []) 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']); } @@ -72,7 +75,7 @@ public function getType(): string } /** - * @return CouponRestrictionRetrictToBxgyBuy[] + * @return CouponRestrictionRestrictToBxgyBuy[] */ public function getBuy(): array { @@ -80,12 +83,12 @@ public function getBuy(): array } /** - * @param array[]|CouponRestrictionRetrictToBxgyBuy[] $buy + * @param array[]|CouponRestrictionRestrictToBxgyBuy[] $buy */ public function setBuy(array $buy): static { $buy = array_map( - fn ($value) => $value !== null ? ($value instanceof CouponRestrictionRetrictToBxgyBuy ? $value : CouponRestrictionRetrictToBxgyBuy::from($value)) : null, + fn ($value) => $value !== null ? ($value instanceof CouponRestrictionRestrictToBxgyBuy ? $value : CouponRestrictionRestrictToBxgyBuy::from($value)) : null, $buy, ); @@ -95,7 +98,7 @@ public function setBuy(array $buy): static } /** - * @return CouponRestrictionRetrictToBxgyGet[] + * @return CouponRestrictionRestrictToBxgyGet[] */ public function getGet(): array { @@ -103,12 +106,12 @@ public function getGet(): array } /** - * @param array[]|CouponRestrictionRetrictToBxgyGet[] $get + * @param array[]|CouponRestrictionRestrictToBxgyGet[] $get */ public function setGet(array $get): static { $get = array_map( - fn ($value) => $value !== null ? ($value instanceof CouponRestrictionRetrictToBxgyGet ? $value : CouponRestrictionRetrictToBxgyGet::from($value)) : null, + fn ($value) => $value !== null ? ($value instanceof CouponRestrictionRestrictToBxgyGet ? $value : CouponRestrictionRestrictToBxgyGet::from($value)) : null, $get, ); @@ -245,6 +248,29 @@ public function setCurrency(string $currency): static 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']; @@ -328,6 +354,9 @@ public function jsonSerialize(): array 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); } diff --git a/src/Model/CouponRestrictionRetrictToBxgyBuy.php b/src/Model/CouponRestrictionRestrictToBxgyBuy.php similarity index 95% rename from src/Model/CouponRestrictionRetrictToBxgyBuy.php rename to src/Model/CouponRestrictionRestrictToBxgyBuy.php index 9455d4045..f75ac0bd3 100644 --- a/src/Model/CouponRestrictionRetrictToBxgyBuy.php +++ b/src/Model/CouponRestrictionRestrictToBxgyBuy.php @@ -15,7 +15,7 @@ use JsonSerializable; -class CouponRestrictionRetrictToBxgyBuy implements JsonSerializable +class CouponRestrictionRestrictToBxgyBuy implements JsonSerializable { private array $fields = []; diff --git a/src/Model/CouponRestrictionRetrictToBxgyGet.php b/src/Model/CouponRestrictionRestrictToBxgyGet.php similarity index 95% rename from src/Model/CouponRestrictionRetrictToBxgyGet.php rename to src/Model/CouponRestrictionRestrictToBxgyGet.php index 063d9a8df..3fea262d0 100644 --- a/src/Model/CouponRestrictionRetrictToBxgyGet.php +++ b/src/Model/CouponRestrictionRestrictToBxgyGet.php @@ -15,7 +15,7 @@ use JsonSerializable; -class CouponRestrictionRetrictToBxgyGet implements JsonSerializable +class CouponRestrictionRestrictToBxgyGet implements JsonSerializable { private array $fields = []; diff --git a/src/Model/CouponRestrictionRestrictToCountries.php b/src/Model/CouponRestrictionRestrictToCountries.php index 814ac727a..0f5010f6e 100644 --- a/src/Model/CouponRestrictionRestrictToCountries.php +++ b/src/Model/CouponRestrictionRestrictToCountries.php @@ -50,6 +50,9 @@ public function __construct(array $data = []) 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']); } @@ -142,7 +145,7 @@ public function setQuantity(int $quantity): static } /** - * @return CouponRestrictionRetrictToBxgyBuy[] + * @return CouponRestrictionRestrictToBxgyBuy[] */ public function getBuy(): array { @@ -150,12 +153,12 @@ public function getBuy(): array } /** - * @param array[]|CouponRestrictionRetrictToBxgyBuy[] $buy + * @param array[]|CouponRestrictionRestrictToBxgyBuy[] $buy */ public function setBuy(array $buy): static { $buy = array_map( - fn ($value) => $value !== null ? ($value instanceof CouponRestrictionRetrictToBxgyBuy ? $value : CouponRestrictionRetrictToBxgyBuy::from($value)) : null, + fn ($value) => $value !== null ? ($value instanceof CouponRestrictionRestrictToBxgyBuy ? $value : CouponRestrictionRestrictToBxgyBuy::from($value)) : null, $buy, ); @@ -211,7 +214,7 @@ public function setSubscriptionIds(array $subscriptionIds): static } /** - * @return CouponRestrictionRetrictToBxgyGet[] + * @return CouponRestrictionRestrictToBxgyGet[] */ public function getGet(): array { @@ -219,12 +222,12 @@ public function getGet(): array } /** - * @param array[]|CouponRestrictionRetrictToBxgyGet[] $get + * @param array[]|CouponRestrictionRestrictToBxgyGet[] $get */ public function setGet(array $get): static { $get = array_map( - fn ($value) => $value !== null ? ($value instanceof CouponRestrictionRetrictToBxgyGet ? $value : CouponRestrictionRetrictToBxgyGet::from($value)) : null, + fn ($value) => $value !== null ? ($value instanceof CouponRestrictionRestrictToBxgyGet ? $value : CouponRestrictionRestrictToBxgyGet::from($value)) : null, $get, ); @@ -245,6 +248,29 @@ public function setCurrency(string $currency): static 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']; @@ -328,6 +354,9 @@ public function jsonSerialize(): array 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); } diff --git a/src/Model/CouponRestrictionRestrictToCustomers.php b/src/Model/CouponRestrictionRestrictToCustomers.php new file mode 100644 index 000000000..b07ccfb63 --- /dev/null +++ b/src/Model/CouponRestrictionRestrictToCustomers.php @@ -0,0 +1,372 @@ +setCustomerIds($data['customerIds']); + } + 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('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-customers'; + } + + /** + * @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; + } + + /** + * @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; + } + + 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-customers', + ]; + if (array_key_exists('customerIds', $this->fields)) { + $data['customerIds'] = $this->fields['customerIds']; + } + 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('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/CouponRestrictionRestrictToInvoices.php b/src/Model/CouponRestrictionRestrictToInvoices.php index a44ffadff..bb4314d36 100644 --- a/src/Model/CouponRestrictionRestrictToInvoices.php +++ b/src/Model/CouponRestrictionRestrictToInvoices.php @@ -53,6 +53,9 @@ public function __construct(array $data = []) 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']); } @@ -142,7 +145,7 @@ public function setQuantity(int $quantity): static } /** - * @return CouponRestrictionRetrictToBxgyBuy[] + * @return CouponRestrictionRestrictToBxgyBuy[] */ public function getBuy(): array { @@ -150,12 +153,12 @@ public function getBuy(): array } /** - * @param array[]|CouponRestrictionRetrictToBxgyBuy[] $buy + * @param array[]|CouponRestrictionRestrictToBxgyBuy[] $buy */ public function setBuy(array $buy): static { $buy = array_map( - fn ($value) => $value !== null ? ($value instanceof CouponRestrictionRetrictToBxgyBuy ? $value : CouponRestrictionRetrictToBxgyBuy::from($value)) : null, + fn ($value) => $value !== null ? ($value instanceof CouponRestrictionRestrictToBxgyBuy ? $value : CouponRestrictionRestrictToBxgyBuy::from($value)) : null, $buy, ); @@ -234,7 +237,7 @@ public function setSubscriptionIds(array $subscriptionIds): static } /** - * @return CouponRestrictionRetrictToBxgyGet[] + * @return CouponRestrictionRestrictToBxgyGet[] */ public function getGet(): array { @@ -242,12 +245,12 @@ public function getGet(): array } /** - * @param array[]|CouponRestrictionRetrictToBxgyGet[] $get + * @param array[]|CouponRestrictionRestrictToBxgyGet[] $get */ public function setGet(array $get): static { $get = array_map( - fn ($value) => $value !== null ? ($value instanceof CouponRestrictionRetrictToBxgyGet ? $value : CouponRestrictionRetrictToBxgyGet::from($value)) : null, + fn ($value) => $value !== null ? ($value instanceof CouponRestrictionRestrictToBxgyGet ? $value : CouponRestrictionRestrictToBxgyGet::from($value)) : null, $get, ); @@ -268,6 +271,29 @@ public function setCurrency(string $currency): static 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']; @@ -331,6 +357,9 @@ public function jsonSerialize(): array 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); } diff --git a/src/Model/CouponRestrictionRestrictToPlans.php b/src/Model/CouponRestrictionRestrictToPlans.php index 00671f44c..ee9893850 100644 --- a/src/Model/CouponRestrictionRestrictToPlans.php +++ b/src/Model/CouponRestrictionRestrictToPlans.php @@ -53,6 +53,9 @@ public function __construct(array $data = []) 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']); } @@ -131,7 +134,7 @@ public function setQuantity(int $quantity): static } /** - * @return CouponRestrictionRetrictToBxgyBuy[] + * @return CouponRestrictionRestrictToBxgyBuy[] */ public function getBuy(): array { @@ -139,12 +142,12 @@ public function getBuy(): array } /** - * @param array[]|CouponRestrictionRetrictToBxgyBuy[] $buy + * @param array[]|CouponRestrictionRestrictToBxgyBuy[] $buy */ public function setBuy(array $buy): static { $buy = array_map( - fn ($value) => $value !== null ? ($value instanceof CouponRestrictionRetrictToBxgyBuy ? $value : CouponRestrictionRetrictToBxgyBuy::from($value)) : null, + fn ($value) => $value !== null ? ($value instanceof CouponRestrictionRestrictToBxgyBuy ? $value : CouponRestrictionRestrictToBxgyBuy::from($value)) : null, $buy, ); @@ -223,7 +226,7 @@ public function setSubscriptionIds(array $subscriptionIds): static } /** - * @return CouponRestrictionRetrictToBxgyGet[] + * @return CouponRestrictionRestrictToBxgyGet[] */ public function getGet(): array { @@ -231,12 +234,12 @@ public function getGet(): array } /** - * @param array[]|CouponRestrictionRetrictToBxgyGet[] $get + * @param array[]|CouponRestrictionRestrictToBxgyGet[] $get */ public function setGet(array $get): static { $get = array_map( - fn ($value) => $value !== null ? ($value instanceof CouponRestrictionRetrictToBxgyGet ? $value : CouponRestrictionRetrictToBxgyGet::from($value)) : null, + fn ($value) => $value !== null ? ($value instanceof CouponRestrictionRestrictToBxgyGet ? $value : CouponRestrictionRestrictToBxgyGet::from($value)) : null, $get, ); @@ -257,6 +260,29 @@ public function setCurrency(string $currency): static 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']; @@ -331,6 +357,9 @@ public function jsonSerialize(): array 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); } diff --git a/src/Model/CouponRestrictionRestrictToProducts.php b/src/Model/CouponRestrictionRestrictToProducts.php index ab21fa1d0..93e2c124f 100644 --- a/src/Model/CouponRestrictionRestrictToProducts.php +++ b/src/Model/CouponRestrictionRestrictToProducts.php @@ -53,6 +53,9 @@ public function __construct(array $data = []) 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']); } @@ -154,7 +157,7 @@ public function setQuantity(int $quantity): static } /** - * @return CouponRestrictionRetrictToBxgyBuy[] + * @return CouponRestrictionRestrictToBxgyBuy[] */ public function getBuy(): array { @@ -162,12 +165,12 @@ public function getBuy(): array } /** - * @param array[]|CouponRestrictionRetrictToBxgyBuy[] $buy + * @param array[]|CouponRestrictionRestrictToBxgyBuy[] $buy */ public function setBuy(array $buy): static { $buy = array_map( - fn ($value) => $value !== null ? ($value instanceof CouponRestrictionRetrictToBxgyBuy ? $value : CouponRestrictionRetrictToBxgyBuy::from($value)) : null, + fn ($value) => $value !== null ? ($value instanceof CouponRestrictionRestrictToBxgyBuy ? $value : CouponRestrictionRestrictToBxgyBuy::from($value)) : null, $buy, ); @@ -223,7 +226,7 @@ public function setSubscriptionIds(array $subscriptionIds): static } /** - * @return CouponRestrictionRetrictToBxgyGet[] + * @return CouponRestrictionRestrictToBxgyGet[] */ public function getGet(): array { @@ -231,12 +234,12 @@ public function getGet(): array } /** - * @param array[]|CouponRestrictionRetrictToBxgyGet[] $get + * @param array[]|CouponRestrictionRestrictToBxgyGet[] $get */ public function setGet(array $get): static { $get = array_map( - fn ($value) => $value !== null ? ($value instanceof CouponRestrictionRetrictToBxgyGet ? $value : CouponRestrictionRetrictToBxgyGet::from($value)) : null, + fn ($value) => $value !== null ? ($value instanceof CouponRestrictionRestrictToBxgyGet ? $value : CouponRestrictionRestrictToBxgyGet::from($value)) : null, $get, ); @@ -257,6 +260,29 @@ public function setCurrency(string $currency): static 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']; @@ -331,6 +357,9 @@ public function jsonSerialize(): array 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); } diff --git a/src/Model/CouponRestrictionRestrictToSubscriptions.php b/src/Model/CouponRestrictionRestrictToSubscriptions.php index 52c91b2ff..7d00a8fe1 100644 --- a/src/Model/CouponRestrictionRestrictToSubscriptions.php +++ b/src/Model/CouponRestrictionRestrictToSubscriptions.php @@ -50,6 +50,9 @@ public function __construct(array $data = []) 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']); } @@ -142,7 +145,7 @@ public function setQuantity(int $quantity): static } /** - * @return CouponRestrictionRetrictToBxgyBuy[] + * @return CouponRestrictionRestrictToBxgyBuy[] */ public function getBuy(): array { @@ -150,12 +153,12 @@ public function getBuy(): array } /** - * @param array[]|CouponRestrictionRetrictToBxgyBuy[] $buy + * @param array[]|CouponRestrictionRestrictToBxgyBuy[] $buy */ public function setBuy(array $buy): static { $buy = array_map( - fn ($value) => $value !== null ? ($value instanceof CouponRestrictionRetrictToBxgyBuy ? $value : CouponRestrictionRetrictToBxgyBuy::from($value)) : null, + fn ($value) => $value !== null ? ($value instanceof CouponRestrictionRestrictToBxgyBuy ? $value : CouponRestrictionRestrictToBxgyBuy::from($value)) : null, $buy, ); @@ -211,7 +214,7 @@ public function setProductIds(array $productIds): static } /** - * @return CouponRestrictionRetrictToBxgyGet[] + * @return CouponRestrictionRestrictToBxgyGet[] */ public function getGet(): array { @@ -219,12 +222,12 @@ public function getGet(): array } /** - * @param array[]|CouponRestrictionRetrictToBxgyGet[] $get + * @param array[]|CouponRestrictionRestrictToBxgyGet[] $get */ public function setGet(array $get): static { $get = array_map( - fn ($value) => $value !== null ? ($value instanceof CouponRestrictionRetrictToBxgyGet ? $value : CouponRestrictionRetrictToBxgyGet::from($value)) : null, + fn ($value) => $value !== null ? ($value instanceof CouponRestrictionRestrictToBxgyGet ? $value : CouponRestrictionRestrictToBxgyGet::from($value)) : null, $get, ); @@ -245,6 +248,29 @@ public function setCurrency(string $currency): static 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']; @@ -328,6 +354,9 @@ public function jsonSerialize(): array 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); } diff --git a/src/Model/CouponRestrictionTotalRedemptions.php b/src/Model/CouponRestrictionTotalRedemptions.php index e0b1c247b..7c396ad71 100644 --- a/src/Model/CouponRestrictionTotalRedemptions.php +++ b/src/Model/CouponRestrictionTotalRedemptions.php @@ -50,6 +50,9 @@ public function __construct(array $data = []) 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']); } @@ -119,7 +122,7 @@ public function setAmount(int $amount): static } /** - * @return CouponRestrictionRetrictToBxgyBuy[] + * @return CouponRestrictionRestrictToBxgyBuy[] */ public function getBuy(): array { @@ -127,12 +130,12 @@ public function getBuy(): array } /** - * @param array[]|CouponRestrictionRetrictToBxgyBuy[] $buy + * @param array[]|CouponRestrictionRestrictToBxgyBuy[] $buy */ public function setBuy(array $buy): static { $buy = array_map( - fn ($value) => $value !== null ? ($value instanceof CouponRestrictionRetrictToBxgyBuy ? $value : CouponRestrictionRetrictToBxgyBuy::from($value)) : null, + fn ($value) => $value !== null ? ($value instanceof CouponRestrictionRestrictToBxgyBuy ? $value : CouponRestrictionRestrictToBxgyBuy::from($value)) : null, $buy, ); @@ -211,7 +214,7 @@ public function setSubscriptionIds(array $subscriptionIds): static } /** - * @return CouponRestrictionRetrictToBxgyGet[] + * @return CouponRestrictionRestrictToBxgyGet[] */ public function getGet(): array { @@ -219,12 +222,12 @@ public function getGet(): array } /** - * @param array[]|CouponRestrictionRetrictToBxgyGet[] $get + * @param array[]|CouponRestrictionRestrictToBxgyGet[] $get */ public function setGet(array $get): static { $get = array_map( - fn ($value) => $value !== null ? ($value instanceof CouponRestrictionRetrictToBxgyGet ? $value : CouponRestrictionRetrictToBxgyGet::from($value)) : null, + fn ($value) => $value !== null ? ($value instanceof CouponRestrictionRestrictToBxgyGet ? $value : CouponRestrictionRestrictToBxgyGet::from($value)) : null, $get, ); @@ -245,6 +248,29 @@ public function setCurrency(string $currency): static 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']; @@ -328,6 +354,9 @@ public function jsonSerialize(): array 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); } diff --git a/src/Model/CustomerTimeline.php b/src/Model/CustomerTimeline.php index c085087e3..84152e0d9 100644 --- a/src/Model/CustomerTimeline.php +++ b/src/Model/CustomerTimeline.php @@ -141,10 +141,22 @@ class CustomerTimeline implements JsonSerializable public const TYPE_QUICKBOOKS_CUSTOMER_TASK_FAILED = 'quickbooks-customer-task-failed'; + public const TYPE_QUOTE_CANCELED = 'quote-canceled'; + + public const TYPE_QUOTE_CREATED = 'quote-created'; + + public const TYPE_QUOTE_EXPIRED = 'quote-expired'; + + public const TYPE_QUOTE_ISSUED = 'quote-issued'; + public const TYPE_QUOTE_ORDER_ATTACHED = 'quote-order-attached'; + public const TYPE_QUOTE_RECALLED = 'quote-recalled'; + public const TYPE_QUOTE_REJECTED = 'quote-rejected'; + public const TYPE_QUOTE_UPDATED = 'quote-updated'; + public const TYPE_REFUND_WAS_REFLECTED_IN_INVOICES = 'refund-was-reflected-in-invoices'; public const TYPE_SUBSCRIPTION_PAUSED = 'subscription-paused'; diff --git a/src/Model/DLocalSettings.php b/src/Model/DLocalSettings.php index cd7373979..288854839 100644 --- a/src/Model/DLocalSettings.php +++ b/src/Model/DLocalSettings.php @@ -24,6 +24,9 @@ public function __construct(array $data = []) if (array_key_exists('createInstallmentPlan', $data)) { $this->setCreateInstallmentPlan($data['createInstallmentPlan']); } + if (array_key_exists('customerDocumentCustomField', $data)) { + $this->setCustomerDocumentCustomField($data['customerDocumentCustomField']); + } } public static function from(array $data = []): self @@ -43,12 +46,27 @@ public function setCreateInstallmentPlan(null|bool $createInstallmentPlan): stat return $this; } + public function getCustomerDocumentCustomField(): ?string + { + return $this->fields['customerDocumentCustomField'] ?? null; + } + + public function setCustomerDocumentCustomField(null|string $customerDocumentCustomField): static + { + $this->fields['customerDocumentCustomField'] = $customerDocumentCustomField; + + return $this; + } + public function jsonSerialize(): array { $data = []; if (array_key_exists('createInstallmentPlan', $this->fields)) { $data['createInstallmentPlan'] = $this->fields['createInstallmentPlan']; } + if (array_key_exists('customerDocumentCustomField', $this->fields)) { + $data['customerDocumentCustomField'] = $this->fields['customerDocumentCustomField']; + } return $data; } diff --git a/src/Model/GatewayAccount.php b/src/Model/GatewayAccount.php index 1ce6da864..b73445f28 100644 --- a/src/Model/GatewayAccount.php +++ b/src/Model/GatewayAccount.php @@ -380,6 +380,8 @@ public static function from(array $data = []): self return new PayEcards($data); case 'PayPal': return new PayPal($data); + case 'PayRedeem': + return new PayRedeem($data); case 'PayRetailers': return new PayRetailers($data); case 'PayTabs': diff --git a/src/Model/PSiGateCredentials.php b/src/Model/PSiGateCredentials.php index e0575a679..8bd26daf2 100644 --- a/src/Model/PSiGateCredentials.php +++ b/src/Model/PSiGateCredentials.php @@ -33,6 +33,12 @@ public function __construct(array $data = []) if (array_key_exists('clientApiKey', $data)) { $this->setClientApiKey($data['clientApiKey']); } + if (array_key_exists('disputeUsername', $data)) { + $this->setDisputeUsername($data['disputeUsername']); + } + if (array_key_exists('disputePassword', $data)) { + $this->setDisputePassword($data['disputePassword']); + } } public static function from(array $data = []): self @@ -88,6 +94,30 @@ public function setClientApiKey(string $clientApiKey): static return $this; } + public function getDisputeUsername(): ?string + { + return $this->fields['disputeUsername'] ?? null; + } + + public function setDisputeUsername(null|string $disputeUsername): static + { + $this->fields['disputeUsername'] = $disputeUsername; + + return $this; + } + + public function getDisputePassword(): ?string + { + return $this->fields['disputePassword'] ?? null; + } + + public function setDisputePassword(null|string $disputePassword): static + { + $this->fields['disputePassword'] = $disputePassword; + + return $this; + } + public function jsonSerialize(): array { $data = []; @@ -103,6 +133,12 @@ public function jsonSerialize(): array if (array_key_exists('clientApiKey', $this->fields)) { $data['clientApiKey'] = $this->fields['clientApiKey']; } + if (array_key_exists('disputeUsername', $this->fields)) { + $data['disputeUsername'] = $this->fields['disputeUsername']; + } + if (array_key_exists('disputePassword', $this->fields)) { + $data['disputePassword'] = $this->fields['disputePassword']; + } return $data; } diff --git a/src/Model/PayRedeem.php b/src/Model/PayRedeem.php new file mode 100644 index 000000000..93e21aa08 --- /dev/null +++ b/src/Model/PayRedeem.php @@ -0,0 +1,83 @@ + 'PayRedeem', + ] + $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 + { + return new self($data); + } + + public function getCredentials(): PayRedeemCredentials + { + return $this->fields['credentials']; + } + + public function setCredentials(PayRedeemCredentials|array $credentials): static + { + if (!($credentials instanceof PayRedeemCredentials)) { + $credentials = PayRedeemCredentials::from($credentials); + } + + $this->fields['credentials'] = $credentials; + + 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/PayRedeemCredentials.php b/src/Model/PayRedeemCredentials.php new file mode 100644 index 000000000..4dd4f5333 --- /dev/null +++ b/src/Model/PayRedeemCredentials.php @@ -0,0 +1,91 @@ +setApiUser($data['apiUser']); + } + if (array_key_exists('apiPassword', $data)) { + $this->setApiPassword($data['apiPassword']); + } + if (array_key_exists('apiKey', $data)) { + $this->setApiKey($data['apiKey']); + } + } + + public static function from(array $data = []): self + { + return new self($data); + } + + public function getApiUser(): string + { + return $this->fields['apiUser']; + } + + public function setApiUser(string $apiUser): static + { + $this->fields['apiUser'] = $apiUser; + + return $this; + } + + public function getApiPassword(): string + { + return $this->fields['apiPassword']; + } + + public function setApiPassword(string $apiPassword): static + { + $this->fields['apiPassword'] = $apiPassword; + + return $this; + } + + public function getApiKey(): string + { + return $this->fields['apiKey']; + } + + public function setApiKey(string $apiKey): static + { + $this->fields['apiKey'] = $apiKey; + + return $this; + } + + public function jsonSerialize(): array + { + $data = []; + if (array_key_exists('apiUser', $this->fields)) { + $data['apiUser'] = $this->fields['apiUser']; + } + if (array_key_exists('apiPassword', $this->fields)) { + $data['apiPassword'] = $this->fields['apiPassword']; + } + if (array_key_exists('apiKey', $this->fields)) { + $data['apiKey'] = $this->fields['apiKey']; + } + + return $data; + } +} diff --git a/src/Model/PlanFormulaFixedFee.php b/src/Model/PlanFormulaFixedFee.php index 09aeedf07..d455892f6 100644 --- a/src/Model/PlanFormulaFixedFee.php +++ b/src/Model/PlanFormulaFixedFee.php @@ -24,6 +24,9 @@ public function __construct(array $data = []) if (array_key_exists('price', $data)) { $this->setPrice($data['price']); } + if (array_key_exists('minQuantity', $data)) { + $this->setMinQuantity($data['minQuantity']); + } if (array_key_exists('maxQuantity', $data)) { $this->setMaxQuantity($data['maxQuantity']); } @@ -58,6 +61,18 @@ public function setPrice(float|string $price): static return $this; } + public function getMinQuantity(): ?int + { + return $this->fields['minQuantity'] ?? null; + } + + public function setMinQuantity(null|int $minQuantity): static + { + $this->fields['minQuantity'] = $minQuantity; + + return $this; + } + public function getMaxQuantity(): ?int { return $this->fields['maxQuantity'] ?? null; @@ -101,6 +116,9 @@ public function jsonSerialize(): array if (array_key_exists('price', $this->fields)) { $data['price'] = $this->fields['price']; } + if (array_key_exists('minQuantity', $this->fields)) { + $data['minQuantity'] = $this->fields['minQuantity']; + } if (array_key_exists('maxQuantity', $this->fields)) { $data['maxQuantity'] = $this->fields['maxQuantity']; } diff --git a/src/Model/PlanFormulaFlatRate.php b/src/Model/PlanFormulaFlatRate.php index e33f9b012..3e1731526 100644 --- a/src/Model/PlanFormulaFlatRate.php +++ b/src/Model/PlanFormulaFlatRate.php @@ -24,6 +24,9 @@ public function __construct(array $data = []) if (array_key_exists('price', $data)) { $this->setPrice($data['price']); } + if (array_key_exists('minQuantity', $data)) { + $this->setMinQuantity($data['minQuantity']); + } if (array_key_exists('maxQuantity', $data)) { $this->setMaxQuantity($data['maxQuantity']); } @@ -58,6 +61,18 @@ public function setPrice(float|string $price): static return $this; } + public function getMinQuantity(): ?int + { + return $this->fields['minQuantity'] ?? null; + } + + public function setMinQuantity(null|int $minQuantity): static + { + $this->fields['minQuantity'] = $minQuantity; + + return $this; + } + public function getMaxQuantity(): ?int { return $this->fields['maxQuantity'] ?? null; @@ -101,6 +116,9 @@ public function jsonSerialize(): array if (array_key_exists('price', $this->fields)) { $data['price'] = $this->fields['price']; } + if (array_key_exists('minQuantity', $this->fields)) { + $data['minQuantity'] = $this->fields['minQuantity']; + } if (array_key_exists('maxQuantity', $this->fields)) { $data['maxQuantity'] = $this->fields['maxQuantity']; } diff --git a/src/Model/PlanFormulaStairstep.php b/src/Model/PlanFormulaStairstep.php index bf08a3b1d..fb535348c 100644 --- a/src/Model/PlanFormulaStairstep.php +++ b/src/Model/PlanFormulaStairstep.php @@ -24,6 +24,9 @@ public function __construct(array $data = []) if (array_key_exists('brackets', $data)) { $this->setBrackets($data['brackets']); } + if (array_key_exists('minQuantity', $data)) { + $this->setMinQuantity($data['minQuantity']); + } if (array_key_exists('maxQuantity', $data)) { $this->setMaxQuantity($data['maxQuantity']); } @@ -65,6 +68,18 @@ public function setBrackets(array $brackets): static return $this; } + public function getMinQuantity(): ?int + { + return $this->fields['minQuantity'] ?? null; + } + + public function setMinQuantity(null|int $minQuantity): static + { + $this->fields['minQuantity'] = $minQuantity; + + return $this; + } + public function getMaxQuantity(): ?int { return $this->fields['maxQuantity'] ?? null; @@ -101,6 +116,9 @@ public function jsonSerialize(): array if (array_key_exists('brackets', $this->fields)) { $data['brackets'] = $this->fields['brackets']; } + if (array_key_exists('minQuantity', $this->fields)) { + $data['minQuantity'] = $this->fields['minQuantity']; + } if (array_key_exists('maxQuantity', $this->fields)) { $data['maxQuantity'] = $this->fields['maxQuantity']; } diff --git a/src/Model/PlanFormulaTiered.php b/src/Model/PlanFormulaTiered.php index 17380fc18..6a242e88c 100644 --- a/src/Model/PlanFormulaTiered.php +++ b/src/Model/PlanFormulaTiered.php @@ -24,6 +24,9 @@ public function __construct(array $data = []) if (array_key_exists('brackets', $data)) { $this->setBrackets($data['brackets']); } + if (array_key_exists('minQuantity', $data)) { + $this->setMinQuantity($data['minQuantity']); + } if (array_key_exists('maxQuantity', $data)) { $this->setMaxQuantity($data['maxQuantity']); } @@ -65,6 +68,18 @@ public function setBrackets(array $brackets): static return $this; } + public function getMinQuantity(): ?int + { + return $this->fields['minQuantity'] ?? null; + } + + public function setMinQuantity(null|int $minQuantity): static + { + $this->fields['minQuantity'] = $minQuantity; + + return $this; + } + public function getMaxQuantity(): ?int { return $this->fields['maxQuantity'] ?? null; @@ -101,6 +116,9 @@ public function jsonSerialize(): array if (array_key_exists('brackets', $this->fields)) { $data['brackets'] = $this->fields['brackets']; } + if (array_key_exists('minQuantity', $this->fields)) { + $data['minQuantity'] = $this->fields['minQuantity']; + } if (array_key_exists('maxQuantity', $this->fields)) { $data['maxQuantity'] = $this->fields['maxQuantity']; } diff --git a/src/Model/PlanFormulaVolume.php b/src/Model/PlanFormulaVolume.php index 5b4a060b4..75d2b7690 100644 --- a/src/Model/PlanFormulaVolume.php +++ b/src/Model/PlanFormulaVolume.php @@ -24,6 +24,9 @@ public function __construct(array $data = []) if (array_key_exists('brackets', $data)) { $this->setBrackets($data['brackets']); } + if (array_key_exists('minQuantity', $data)) { + $this->setMinQuantity($data['minQuantity']); + } if (array_key_exists('maxQuantity', $data)) { $this->setMaxQuantity($data['maxQuantity']); } @@ -65,6 +68,18 @@ public function setBrackets(array $brackets): static return $this; } + public function getMinQuantity(): ?int + { + return $this->fields['minQuantity'] ?? null; + } + + public function setMinQuantity(null|int $minQuantity): static + { + $this->fields['minQuantity'] = $minQuantity; + + return $this; + } + public function getMaxQuantity(): ?int { return $this->fields['maxQuantity'] ?? null; @@ -101,6 +116,9 @@ public function jsonSerialize(): array if (array_key_exists('brackets', $this->fields)) { $data['brackets'] = $this->fields['brackets']; } + if (array_key_exists('minQuantity', $this->fields)) { + $data['minQuantity'] = $this->fields['minQuantity']; + } if (array_key_exists('maxQuantity', $this->fields)) { $data['maxQuantity'] = $this->fields['maxQuantity']; }