diff --git a/.konfig/generate-id.txt b/.konfig/generate-id.txt index cb69078..6eb0983 100644 --- a/.konfig/generate-id.txt +++ b/.konfig/generate-id.txt @@ -1 +1 @@ -0b810a23-4746-49e7-9e36-f34ff9929554 \ No newline at end of file +3e0235b9-32f0-4b4a-881c-87e0fdc46df1 \ No newline at end of file diff --git a/lib/Model/PaymentInfo.php b/lib/Model/PaymentInfo.php new file mode 100644 index 0000000..84297f3 --- /dev/null +++ b/lib/Model/PaymentInfo.php @@ -0,0 +1,439 @@ + + */ +class PaymentInfo implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'PaymentInfo'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'card_bin' => 'string', + 'card_type' => '\Splitit\Model\CardType' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'card_bin' => null, + 'card_type' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'card_bin' => false, + 'card_type' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'card_bin' => 'CardBin', + 'card_type' => 'CardType' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'card_bin' => 'setCardBin', + 'card_type' => 'setCardType' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'card_bin' => 'getCardBin', + 'card_type' => 'getCardType' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('card_bin', $data ?? [], null); + $this->setIfExists('card_type', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets card_bin + * + * @return string|null + */ + public function getCardBin() + { + return $this->container['card_bin']; + } + + /** + * Sets card_bin + * + * @param string|null $card_bin card_bin + * + * @return self + */ + public function setCardBin($card_bin) + { + + if (is_null($card_bin)) { + throw new \InvalidArgumentException('non-nullable card_bin cannot be null'); + } + + $this->container['card_bin'] = $card_bin; + + return $this; + } + + /** + * Gets card_type + * + * @return \Splitit\Model\CardType|null + */ + public function getCardType() + { + return $this->container['card_type']; + } + + /** + * Sets card_type + * + * @param \Splitit\Model\CardType|null $card_type card_type + * + * @return self + */ + public function setCardType($card_type) + { + + if (is_null($card_type)) { + throw new \InvalidArgumentException('non-nullable card_type cannot be null'); + } + + $this->container['card_type'] = $card_type; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/Model/PlanErrorResponse.php b/lib/Model/PlanErrorResponse.php index 5087cce..ade6dc3 100644 --- a/lib/Model/PlanErrorResponse.php +++ b/lib/Model/PlanErrorResponse.php @@ -51,7 +51,8 @@ class PlanErrorResponse implements ModelInterface, ArrayAccess, \JsonSerializabl protected static $openAPITypes = [ 'trace_id' => 'string', 'error' => '\Splitit\Model\ErrorExtended', - 'installment_plan_number' => 'string' + 'installment_plan_number' => 'string', + 'payment_info' => '\Splitit\Model\PaymentInfo' ]; /** @@ -64,7 +65,8 @@ class PlanErrorResponse implements ModelInterface, ArrayAccess, \JsonSerializabl protected static $openAPIFormats = [ 'trace_id' => null, 'error' => null, - 'installment_plan_number' => null + 'installment_plan_number' => null, + 'payment_info' => null ]; /** @@ -75,7 +77,8 @@ class PlanErrorResponse implements ModelInterface, ArrayAccess, \JsonSerializabl protected static $openAPINullables = [ 'trace_id' => false, 'error' => false, - 'installment_plan_number' => false + 'installment_plan_number' => false, + 'payment_info' => false ]; /** @@ -166,7 +169,8 @@ public function isNullableSetToNull(string $property): bool protected static $attributeMap = [ 'trace_id' => 'TraceId', 'error' => 'Error', - 'installment_plan_number' => 'InstallmentPlanNumber' + 'installment_plan_number' => 'InstallmentPlanNumber', + 'payment_info' => 'PaymentInfo' ]; /** @@ -177,7 +181,8 @@ public function isNullableSetToNull(string $property): bool protected static $setters = [ 'trace_id' => 'setTraceId', 'error' => 'setError', - 'installment_plan_number' => 'setInstallmentPlanNumber' + 'installment_plan_number' => 'setInstallmentPlanNumber', + 'payment_info' => 'setPaymentInfo' ]; /** @@ -188,7 +193,8 @@ public function isNullableSetToNull(string $property): bool protected static $getters = [ 'trace_id' => 'getTraceId', 'error' => 'getError', - 'installment_plan_number' => 'getInstallmentPlanNumber' + 'installment_plan_number' => 'getInstallmentPlanNumber', + 'payment_info' => 'getPaymentInfo' ]; /** @@ -251,6 +257,7 @@ public function __construct(array $data = null) $this->setIfExists('trace_id', $data ?? [], null); $this->setIfExists('error', $data ?? [], null); $this->setIfExists('installment_plan_number', $data ?? [], null); + $this->setIfExists('payment_info', $data ?? [], null); } /** @@ -381,6 +388,35 @@ public function setInstallmentPlanNumber($installment_plan_number) return $this; } + + /** + * Gets payment_info + * + * @return \Splitit\Model\PaymentInfo|null + */ + public function getPaymentInfo() + { + return $this->container['payment_info']; + } + + /** + * Sets payment_info + * + * @param \Splitit\Model\PaymentInfo|null $payment_info payment_info + * + * @return self + */ + public function setPaymentInfo($payment_info) + { + + if (is_null($payment_info)) { + throw new \InvalidArgumentException('non-nullable payment_info cannot be null'); + } + + $this->container['payment_info'] = $payment_info; + + return $this; + } /** * Returns true if offset exists. False otherwise. * diff --git a/lib/Model/PlanErrorResponseAllOf.php b/lib/Model/PlanErrorResponseAllOf.php index 4e55fc5..d256b40 100644 --- a/lib/Model/PlanErrorResponseAllOf.php +++ b/lib/Model/PlanErrorResponseAllOf.php @@ -49,7 +49,8 @@ class PlanErrorResponseAllOf implements ModelInterface, ArrayAccess, \JsonSerial * @var string[] */ protected static $openAPITypes = [ - 'installment_plan_number' => 'string' + 'installment_plan_number' => 'string', + 'payment_info' => '\Splitit\Model\PaymentInfo' ]; /** @@ -60,7 +61,8 @@ class PlanErrorResponseAllOf implements ModelInterface, ArrayAccess, \JsonSerial * @psalm-var array */ protected static $openAPIFormats = [ - 'installment_plan_number' => null + 'installment_plan_number' => null, + 'payment_info' => null ]; /** @@ -69,7 +71,8 @@ class PlanErrorResponseAllOf implements ModelInterface, ArrayAccess, \JsonSerial * @var boolean[] */ protected static $openAPINullables = [ - 'installment_plan_number' => false + 'installment_plan_number' => false, + 'payment_info' => false ]; /** @@ -158,7 +161,8 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $attributeMap = [ - 'installment_plan_number' => 'InstallmentPlanNumber' + 'installment_plan_number' => 'InstallmentPlanNumber', + 'payment_info' => 'PaymentInfo' ]; /** @@ -167,7 +171,8 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $setters = [ - 'installment_plan_number' => 'setInstallmentPlanNumber' + 'installment_plan_number' => 'setInstallmentPlanNumber', + 'payment_info' => 'setPaymentInfo' ]; /** @@ -176,7 +181,8 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $getters = [ - 'installment_plan_number' => 'getInstallmentPlanNumber' + 'installment_plan_number' => 'getInstallmentPlanNumber', + 'payment_info' => 'getPaymentInfo' ]; /** @@ -237,6 +243,7 @@ public function getModelName() public function __construct(array $data = null) { $this->setIfExists('installment_plan_number', $data ?? [], null); + $this->setIfExists('payment_info', $data ?? [], null); } /** @@ -309,6 +316,35 @@ public function setInstallmentPlanNumber($installment_plan_number) return $this; } + + /** + * Gets payment_info + * + * @return \Splitit\Model\PaymentInfo|null + */ + public function getPaymentInfo() + { + return $this->container['payment_info']; + } + + /** + * Sets payment_info + * + * @param \Splitit\Model\PaymentInfo|null $payment_info payment_info + * + * @return self + */ + public function setPaymentInfo($payment_info) + { + + if (is_null($payment_info)) { + throw new \InvalidArgumentException('non-nullable payment_info cannot be null'); + } + + $this->container['payment_info'] = $payment_info; + + return $this; + } /** * Returns true if offset exists. False otherwise. * diff --git a/test/Model/PaymentInfoTest.php b/test/Model/PaymentInfoTest.php new file mode 100644 index 0000000..d1ab67b --- /dev/null +++ b/test/Model/PaymentInfoTest.php @@ -0,0 +1,91 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "card_bin" + */ + public function testPropertyCardBin() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "card_type" + */ + public function testPropertyCardType() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/PlanErrorResponseAllOfTest.php b/test/Model/PlanErrorResponseAllOfTest.php index 8b7438e..d4bdfbe 100644 --- a/test/Model/PlanErrorResponseAllOfTest.php +++ b/test/Model/PlanErrorResponseAllOfTest.php @@ -79,4 +79,13 @@ public function testPropertyInstallmentPlanNumber() // TODO: implement $this->markTestIncomplete('Not implemented'); } + + /** + * Test attribute "payment_info" + */ + public function testPropertyPaymentInfo() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } } diff --git a/test/Model/PlanErrorResponseTest.php b/test/Model/PlanErrorResponseTest.php index 41f36b4..d3b6930 100644 --- a/test/Model/PlanErrorResponseTest.php +++ b/test/Model/PlanErrorResponseTest.php @@ -97,4 +97,13 @@ public function testPropertyInstallmentPlanNumber() // TODO: implement $this->markTestIncomplete('Not implemented'); } + + /** + * Test attribute "payment_info" + */ + public function testPropertyPaymentInfo() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } }