diff --git a/composer.json b/composer.json index 5c5d532..aec3f8b 100644 --- a/composer.json +++ b/composer.json @@ -1,6 +1,6 @@ { "name": "postfinancecheckout/sdk", - "version": "3.0.3", + "version": "3.1.1", "description": "PostFinance Checkout SDK for PHP", "keywords": [ "postfinancecheckout", diff --git a/lib/ApiClient.php b/lib/ApiClient.php index 81c665f..792bd4d 100644 --- a/lib/ApiClient.php +++ b/lib/ApiClient.php @@ -54,7 +54,7 @@ final class ApiClient { * * @var string */ - private $userAgent = 'PHP-Client/3.0.3/php'; + private $userAgent = 'PHP-Client/3.1.1/php'; /** * The path to the certificate authority file. diff --git a/lib/Configuration.php b/lib/Configuration.php index ad58cf9..20e2bd6 100644 --- a/lib/Configuration.php +++ b/lib/Configuration.php @@ -80,7 +80,7 @@ class Configuration * * @var string */ - protected $userAgent = 'PostFinanceCheckout\Sdk/3.0.3/php'; + protected $userAgent = 'PostFinanceCheckout\Sdk/3.1.1/php'; /** * Debug switch (default set to false) @@ -388,8 +388,8 @@ public static function toDebugReport() $report = 'PHP SDK (PostFinanceCheckout\Sdk) Debug Report:' . PHP_EOL; $report .= ' OS: ' . php_uname() . PHP_EOL; $report .= ' PHP Version: ' . PHP_VERSION . PHP_EOL; - $report .= ' OpenAPI Spec Version: 3.0.3' . PHP_EOL; - $report .= ' SDK Package Version: 3.0.3' . PHP_EOL; + $report .= ' OpenAPI Spec Version: 3.1.1' . PHP_EOL; + $report .= ' SDK Package Version: 3.1.1' . PHP_EOL; $report .= ' Temp Folder Path: ' . self::getDefaultConfiguration()->getTempFolderPath() . PHP_EOL; return $report; diff --git a/lib/Model/AbstractTransactionPending.php b/lib/Model/AbstractTransactionPending.php index 9c37b82..e85cc3a 100644 --- a/lib/Model/AbstractTransactionPending.php +++ b/lib/Model/AbstractTransactionPending.php @@ -48,7 +48,7 @@ class AbstractTransactionPending implements ModelInterface, ArrayAccess * @var string[] */ protected static $swaggerTypes = [ - 'allowed_payment_method_brands' => '\PostFinanceCheckout\Sdk\Model\PaymentMethodBrand[]', + 'allowed_payment_method_brands' => 'int[]', 'allowed_payment_method_configurations' => 'int[]', 'billing_address' => '\PostFinanceCheckout\Sdk\Model\AddressCreate', 'completion_behavior' => '\PostFinanceCheckout\Sdk\Model\TransactionCompletionBehavior', @@ -75,7 +75,7 @@ class AbstractTransactionPending implements ModelInterface, ArrayAccess * @var string[] */ protected static $swaggerFormats = [ - 'allowed_payment_method_brands' => null, + 'allowed_payment_method_brands' => 'int64', 'allowed_payment_method_configurations' => 'int64', 'billing_address' => null, 'completion_behavior' => null, @@ -360,7 +360,7 @@ public function valid() /** * Gets allowed_payment_method_brands * - * @return \PostFinanceCheckout\Sdk\Model\PaymentMethodBrand[] + * @return int[] */ public function getAllowedPaymentMethodBrands() { @@ -370,7 +370,7 @@ public function getAllowedPaymentMethodBrands() /** * Sets allowed_payment_method_brands * - * @param \PostFinanceCheckout\Sdk\Model\PaymentMethodBrand[] $allowed_payment_method_brands + * @param int[] $allowed_payment_method_brands * * @return $this */ diff --git a/lib/Model/InvoiceReimbursementWithRefundReference.php b/lib/Model/InvoiceReimbursementWithRefundReference.php new file mode 100644 index 0000000..95ab72d --- /dev/null +++ b/lib/Model/InvoiceReimbursementWithRefundReference.php @@ -0,0 +1,296 @@ + 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'refund_merchant_reference' => null + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'refund_merchant_reference' => 'refundMerchantReference' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'refund_merchant_reference' => 'setRefundMerchantReference' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'refund_merchant_reference' => 'getRefundMerchantReference' + ]; + + + + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + parent::__construct($data); + + + $this->container['refund_merchant_reference'] = isset($data['refund_merchant_reference']) ? $data['refund_merchant_reference'] : null; + + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = parent::listInvalidProperties(); + + return $invalidProperties; + } + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerTypes() + { + return self::$swaggerTypes + parent::swaggerTypes(); + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerFormats() + { + return self::$swaggerFormats + parent::swaggerFormats(); + } + + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return parent::attributeMap() + self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return parent::setters() + self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return parent::getters() + self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$swaggerModelName; + } + + + + /** + * 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 refund_merchant_reference + * + * @return string + */ + public function getRefundMerchantReference() + { + return $this->container['refund_merchant_reference']; + } + + /** + * Sets refund_merchant_reference + * + * @param string $refund_merchant_reference + * + * @return $this + */ + public function setRefundMerchantReference($refund_merchant_reference) + { + $this->container['refund_merchant_reference'] = $refund_merchant_reference; + + return $this; + } + + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + #[\ReturnTypeWillChange] + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * + * @param integer $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + #[\ReturnTypeWillChange] + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + #[\ReturnTypeWillChange] + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/Model/Transaction.php b/lib/Model/Transaction.php index 17895b1..a2b2237 100644 --- a/lib/Model/Transaction.php +++ b/lib/Model/Transaction.php @@ -51,7 +51,7 @@ class Transaction implements ModelInterface, ArrayAccess protected static $swaggerTypes = [ 'accept_header' => 'string', 'accept_language_header' => 'string', - 'allowed_payment_method_brands' => '\PostFinanceCheckout\Sdk\Model\PaymentMethodBrand[]', + 'allowed_payment_method_brands' => 'int[]', 'allowed_payment_method_configurations' => 'int[]', 'authorization_amount' => 'float', 'authorization_environment' => '\PostFinanceCheckout\Sdk\Model\ChargeAttemptEnvironment', @@ -129,7 +129,7 @@ class Transaction implements ModelInterface, ArrayAccess protected static $swaggerFormats = [ 'accept_header' => null, 'accept_language_header' => null, - 'allowed_payment_method_brands' => null, + 'allowed_payment_method_brands' => 'int64', 'allowed_payment_method_configurations' => 'int64', 'authorization_amount' => null, 'authorization_environment' => null, @@ -776,7 +776,7 @@ public function setAcceptLanguageHeader($accept_language_header) /** * Gets allowed_payment_method_brands * - * @return \PostFinanceCheckout\Sdk\Model\PaymentMethodBrand[] + * @return int[] */ public function getAllowedPaymentMethodBrands() { @@ -786,7 +786,7 @@ public function getAllowedPaymentMethodBrands() /** * Sets allowed_payment_method_brands * - * @param \PostFinanceCheckout\Sdk\Model\PaymentMethodBrand[] $allowed_payment_method_brands + * @param int[] $allowed_payment_method_brands * * @return $this */ diff --git a/lib/Service/InvoiceReimbursementService.php b/lib/Service/InvoiceReimbursementService.php index f2a5ae9..5a42215 100644 --- a/lib/Service/InvoiceReimbursementService.php +++ b/lib/Service/InvoiceReimbursementService.php @@ -300,7 +300,7 @@ public function readWithHttpInfo($space_id, $id) { * @throws \PostFinanceCheckout\Sdk\ApiException * @throws \PostFinanceCheckout\Sdk\VersioningException * @throws \PostFinanceCheckout\Sdk\Http\ConnectionException - * @return \PostFinanceCheckout\Sdk\Model\InvoiceReimbursement[] + * @return \PostFinanceCheckout\Sdk\Model\InvoiceReimbursementWithRefundReference[] */ public function search($space_id, $query) { return $this->searchWithHttpInfo($space_id, $query)->getData(); @@ -370,16 +370,16 @@ public function searchWithHttpInfo($space_id, $query) { $queryParams, $httpBody, $headerParams, - '\PostFinanceCheckout\Sdk\Model\InvoiceReimbursement[]', + '\PostFinanceCheckout\Sdk\Model\InvoiceReimbursementWithRefundReference[]', '/invoice-reimbursement-service/search' ); - return new ApiResponse($response->getStatusCode(), $response->getHeaders(), $this->apiClient->getSerializer()->deserialize($response->getData(), '\PostFinanceCheckout\Sdk\Model\InvoiceReimbursement[]', $response->getHeaders())); + return new ApiResponse($response->getStatusCode(), $response->getHeaders(), $this->apiClient->getSerializer()->deserialize($response->getData(), '\PostFinanceCheckout\Sdk\Model\InvoiceReimbursementWithRefundReference[]', $response->getHeaders())); } catch (ApiException $e) { switch ($e->getCode()) { case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\PostFinanceCheckout\Sdk\Model\InvoiceReimbursement[]', + '\PostFinanceCheckout\Sdk\Model\InvoiceReimbursementWithRefundReference[]', $e->getResponseHeaders() ); $e->setResponseObject($data);