From 1e75b2870b45e48f04ed13356b8229d1482e822f Mon Sep 17 00:00:00 2001 From: jilling Date: Mon, 19 Feb 2024 09:49:16 +0100 Subject: [PATCH 1/2] add to array method in mustache templates and assert it's faster than json parsing --- src/Adyen/Model/Checkout/AccountInfo.php | 28 +- src/Adyen/Model/Checkout/AcctInfo.php | 28 +- src/Adyen/Model/Checkout/AchDetails.php | 28 +- .../Model/Checkout/AdditionalData3DSecure.php | 28 +- .../Model/Checkout/AdditionalDataAirline.php | 28 +- .../Checkout/AdditionalDataCarRental.php | 28 +- .../Model/Checkout/AdditionalDataCommon.php | 28 +- .../Model/Checkout/AdditionalDataLevel23.php | 28 +- .../Model/Checkout/AdditionalDataLodging.php | 28 +- .../Checkout/AdditionalDataOpenInvoice.php | 28 +- .../Model/Checkout/AdditionalDataOpi.php | 28 +- .../Model/Checkout/AdditionalDataRatepay.php | 28 +- .../Model/Checkout/AdditionalDataRetry.php | 28 +- .../Model/Checkout/AdditionalDataRisk.php | 28 +- .../Checkout/AdditionalDataRiskStandalone.php | 28 +- .../Checkout/AdditionalDataSubMerchant.php | 28 +- .../AdditionalDataTemporaryServices.php | 28 +- .../Model/Checkout/AdditionalDataWallets.php | 28 +- src/Adyen/Model/Checkout/Address.php | 28 +- src/Adyen/Model/Checkout/AfterpayDetails.php | 28 +- src/Adyen/Model/Checkout/AmazonPayDetails.php | 28 +- src/Adyen/Model/Checkout/Amount.php | 28 +- .../Model/Checkout/AndroidPayDetails.php | 28 +- src/Adyen/Model/Checkout/ApplePayDetails.php | 30 +- .../Model/Checkout/ApplePayDonations.php | 623 ---------- .../Model/Checkout/ApplePaySessionRequest.php | 28 +- .../Checkout/ApplePaySessionResponse.php | 28 +- src/Adyen/Model/Checkout/ApplicationInfo.php | 28 +- .../Model/Checkout/AuthenticationData.php | 28 +- src/Adyen/Model/Checkout/Avs.php | 28 +- .../Model/Checkout/BacsDirectDebitDetails.php | 28 +- .../Model/Checkout/BalanceCheckRequest.php | 30 +- .../Model/Checkout/BalanceCheckResponse.php | 28 +- src/Adyen/Model/Checkout/BankAccount.php | 28 +- src/Adyen/Model/Checkout/BillDeskDetails.php | 40 +- src/Adyen/Model/Checkout/BillingAddress.php | 28 +- src/Adyen/Model/Checkout/BlikDetails.php | 28 +- src/Adyen/Model/Checkout/BrowserInfo.php | 28 +- .../Model/Checkout/CancelOrderRequest.php | 28 +- .../Model/Checkout/CancelOrderResponse.php | 28 +- src/Adyen/Model/Checkout/Card.php | 28 +- src/Adyen/Model/Checkout/CardBrandDetails.php | 28 +- src/Adyen/Model/Checkout/CardDetails.php | 34 +- .../Model/Checkout/CardDetailsRequest.php | 28 +- .../Model/Checkout/CardDetailsResponse.php | 28 +- src/Adyen/Model/Checkout/CardDonations.php | 1072 ----------------- src/Adyen/Model/Checkout/CellulantDetails.php | 28 +- .../Model/Checkout/CheckoutAwaitAction.php | 30 +- .../CheckoutDelegatedAuthenticationAction.php | 30 +- .../Checkout/CheckoutNativeRedirectAction.php | 28 +- .../Model/Checkout/CheckoutOrderResponse.php | 28 +- .../Model/Checkout/CheckoutPaymentMethod.php | 66 +- .../Model/Checkout/CheckoutQrCodeAction.php | 30 +- .../Model/Checkout/CheckoutRedirectAction.php | 28 +- .../Model/Checkout/CheckoutSDKAction.php | 30 +- .../CheckoutSessionInstallmentOption.php | 28 +- .../Model/Checkout/CheckoutThreeDS2Action.php | 30 +- .../Model/Checkout/CheckoutVoucherAction.php | 30 +- src/Adyen/Model/Checkout/CommonField.php | 28 +- src/Adyen/Model/Checkout/Company.php | 28 +- src/Adyen/Model/Checkout/Configuration.php | 28 +- .../Checkout/CreateCheckoutSessionRequest.php | 98 +- .../CreateCheckoutSessionResponse.php | 144 +-- .../Model/Checkout/CreateOrderRequest.php | 28 +- .../Model/Checkout/CreateOrderResponse.php | 28 +- src/Adyen/Model/Checkout/DeliveryAddress.php | 28 +- .../DetailsRequestAuthenticationData.php | 28 +- .../Model/Checkout/DeviceRenderOptions.php | 28 +- src/Adyen/Model/Checkout/DokuDetails.php | 28 +- .../Model/Checkout/DonationPaymentMethod.php | 62 +- .../Model/Checkout/DonationPaymentRequest.php | 35 +- .../Checkout/DonationPaymentResponse.php | 28 +- src/Adyen/Model/Checkout/DotpayDetails.php | 28 +- src/Adyen/Model/Checkout/DragonpayDetails.php | 28 +- .../Model/Checkout/EcontextVoucherDetails.php | 28 +- .../Model/Checkout/EncryptedOrderData.php | 28 +- src/Adyen/Model/Checkout/ExternalPlatform.php | 28 +- src/Adyen/Model/Checkout/ForexQuote.php | 28 +- src/Adyen/Model/Checkout/FraudCheckResult.php | 28 +- src/Adyen/Model/Checkout/FraudResult.php | 28 +- src/Adyen/Model/Checkout/FundOrigin.php | 142 +-- src/Adyen/Model/Checkout/FundRecipient.php | 28 +- .../GenericIssuerPaymentMethodDetails.php | 28 +- src/Adyen/Model/Checkout/GiropayDetails.php | 28 +- src/Adyen/Model/Checkout/GooglePayDetails.php | 64 +- .../Model/Checkout/GooglePayDonations.php | 657 ---------- src/Adyen/Model/Checkout/IdealDetails.php | 28 +- src/Adyen/Model/Checkout/IdealDonations.php | 556 --------- src/Adyen/Model/Checkout/InputDetail.php | 28 +- .../Model/Checkout/InstallmentOption.php | 28 +- src/Adyen/Model/Checkout/Installments.php | 28 +- .../Model/Checkout/InstallmentsNumber.php | 28 +- src/Adyen/Model/Checkout/Item.php | 28 +- src/Adyen/Model/Checkout/KlarnaDetails.php | 28 +- src/Adyen/Model/Checkout/LineItem.php | 28 +- .../ListStoredPaymentMethodsResponse.php | 28 +- src/Adyen/Model/Checkout/Mandate.php | 28 +- .../Model/Checkout/MasterpassDetails.php | 30 +- src/Adyen/Model/Checkout/MbwayDetails.php | 32 +- src/Adyen/Model/Checkout/MerchantDevice.php | 28 +- .../Model/Checkout/MerchantRiskIndicator.php | 28 +- src/Adyen/Model/Checkout/MobilePayDetails.php | 28 +- src/Adyen/Model/Checkout/ModelInterface.php | 2 +- src/Adyen/Model/Checkout/MolPayDetails.php | 28 +- src/Adyen/Model/Checkout/Name.php | 28 +- src/Adyen/Model/Checkout/ObjectSerializer.php | 15 +- .../Model/Checkout/OpenInvoiceDetails.php | 28 +- src/Adyen/Model/Checkout/PayPalDetails.php | 28 +- src/Adyen/Model/Checkout/PayUUpiDetails.php | 28 +- .../Model/Checkout/PayWithGoogleDetails.php | 30 +- .../Model/Checkout/PayWithGoogleDonations.php | 623 ---------- .../Checkout/PaymentAmountUpdateRequest.php | 28 +- .../Checkout/PaymentAmountUpdateResponse.php | 28 +- .../Model/Checkout/PaymentCancelRequest.php | 28 +- .../Model/Checkout/PaymentCancelResponse.php | 28 +- .../Model/Checkout/PaymentCaptureRequest.php | 28 +- .../Model/Checkout/PaymentCaptureResponse.php | 28 +- .../Checkout/PaymentCompletionDetails.php | 28 +- src/Adyen/Model/Checkout/PaymentDetails.php | 28 +- .../Model/Checkout/PaymentDetailsRequest.php | 30 +- .../Model/Checkout/PaymentDetailsResponse.php | 28 +- .../Model/Checkout/PaymentLinkRequest.php | 28 +- .../Model/Checkout/PaymentLinkResponse.php | 28 +- src/Adyen/Model/Checkout/PaymentMethod.php | 30 +- .../Model/Checkout/PaymentMethodGroup.php | 28 +- .../Model/Checkout/PaymentMethodIssuer.php | 28 +- .../Model/Checkout/PaymentMethodsRequest.php | 30 +- .../Model/Checkout/PaymentMethodsResponse.php | 28 +- .../Model/Checkout/PaymentRefundRequest.php | 74 +- .../Model/Checkout/PaymentRefundResponse.php | 74 +- src/Adyen/Model/Checkout/PaymentRequest.php | 30 +- src/Adyen/Model/Checkout/PaymentResponse.php | 28 +- .../Model/Checkout/PaymentResponseAction.php | 30 +- .../Model/Checkout/PaymentReversalRequest.php | 28 +- .../Checkout/PaymentReversalResponse.php | 28 +- .../Model/Checkout/PaymentSetupRequest.php | 30 +- .../Model/Checkout/PaymentSetupResponse.php | 28 +- .../Checkout/PaymentVerificationRequest.php | 28 +- .../Checkout/PaymentVerificationResponse.php | 28 +- src/Adyen/Model/Checkout/Phone.php | 28 +- .../Checkout/PlatformChargebackLogic.php | 28 +- src/Adyen/Model/Checkout/RatepayDetails.php | 28 +- src/Adyen/Model/Checkout/Recurring.php | 28 +- src/Adyen/Model/Checkout/RecurringDetail.php | 30 +- .../ResponseAdditionalData3DSecure.php | 28 +- .../ResponseAdditionalDataBillingAddress.php | 28 +- .../Checkout/ResponseAdditionalDataCard.php | 28 +- .../Checkout/ResponseAdditionalDataCommon.php | 28 +- .../ResponseAdditionalDataDomesticError.php | 418 ------- .../ResponseAdditionalDataInstallments.php | 28 +- .../ResponseAdditionalDataNetworkTokens.php | 28 +- .../Checkout/ResponseAdditionalDataOpi.php | 28 +- .../Checkout/ResponseAdditionalDataSepa.php | 28 +- .../Model/Checkout/ResponsePaymentMethod.php | 28 +- src/Adyen/Model/Checkout/RiskData.php | 28 +- src/Adyen/Model/Checkout/SDKEphemPubKey.php | 28 +- .../Model/Checkout/SamsungPayDetails.php | 30 +- .../Model/Checkout/SepaDirectDebitDetails.php | 28 +- src/Adyen/Model/Checkout/ServiceError.php | 28 +- .../Model/Checkout/ServiceErrorDetails.php | 28 +- .../Model/Checkout/SessionResultResponse.php | 28 +- src/Adyen/Model/Checkout/ShopperInput.php | 28 +- .../Checkout/ShopperInteractionDevice.php | 28 +- src/Adyen/Model/Checkout/Split.php | 30 +- src/Adyen/Model/Checkout/SplitAmount.php | 28 +- .../StandalonePaymentCancelRequest.php | 28 +- .../StandalonePaymentCancelResponse.php | 28 +- src/Adyen/Model/Checkout/StoredDetails.php | 28 +- .../Model/Checkout/StoredPaymentMethod.php | 130 +- .../Checkout/StoredPaymentMethodDetails.php | 28 +- .../Checkout/StoredPaymentMethodResource.php | 28 +- src/Adyen/Model/Checkout/SubInputDetail.php | 28 +- src/Adyen/Model/Checkout/SubMerchant.php | 28 +- src/Adyen/Model/Checkout/SubMerchantInfo.php | 28 +- .../Model/Checkout/ThreeDS2RequestData.php | 97 +- .../Model/Checkout/ThreeDS2RequestFields.php | 97 +- .../Model/Checkout/ThreeDS2ResponseData.php | 28 +- src/Adyen/Model/Checkout/ThreeDS2Result.php | 28 +- .../Model/Checkout/ThreeDSRequestData.php | 28 +- .../ThreeDSRequestorAuthenticationInfo.php | 28 +- ...hreeDSRequestorPriorAuthenticationInfo.php | 28 +- src/Adyen/Model/Checkout/ThreeDSecureData.php | 28 +- .../Checkout/UpdatePaymentLinkRequest.php | 28 +- .../Model/Checkout/UpiCollectDetails.php | 28 +- src/Adyen/Model/Checkout/UpiIntentDetails.php | 28 +- src/Adyen/Model/Checkout/UtilityRequest.php | 28 +- src/Adyen/Model/Checkout/UtilityResponse.php | 28 +- src/Adyen/Model/Checkout/VippsDetails.php | 30 +- .../Model/Checkout/VisaCheckoutDetails.php | 30 +- src/Adyen/Model/Checkout/WeChatPayDetails.php | 28 +- .../Checkout/WeChatPayMiniProgramDetails.php | 28 +- src/Adyen/Model/Checkout/ZipDetails.php | 28 +- templates/model_generic.mustache | 26 + tests/Unit/ModelBasedCheckoutTest.php | 24 + tests/Unit/TestCaseMock.php | 9 + 195 files changed, 5092 insertions(+), 4896 deletions(-) delete mode 100644 src/Adyen/Model/Checkout/ApplePayDonations.php delete mode 100644 src/Adyen/Model/Checkout/CardDonations.php delete mode 100644 src/Adyen/Model/Checkout/GooglePayDonations.php delete mode 100644 src/Adyen/Model/Checkout/IdealDonations.php delete mode 100644 src/Adyen/Model/Checkout/PayWithGoogleDonations.php delete mode 100644 src/Adyen/Model/Checkout/ResponseAdditionalDataDomesticError.php diff --git a/src/Adyen/Model/Checkout/AccountInfo.php b/src/Adyen/Model/Checkout/AccountInfo.php index 1dfed679b..f61373f81 100644 --- a/src/Adyen/Model/Checkout/AccountInfo.php +++ b/src/Adyen/Model/Checkout/AccountInfo.php @@ -5,7 +5,7 @@ * * The version of the OpenAPI document: 71 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 6.0.1 + * OpenAPI Generator version: 6.4.0 * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -1205,6 +1205,32 @@ public function jsonSerialize() return ObjectSerializer::sanitizeForSerialization($this); } + public function toArray(): array + { + $array = []; + foreach (self::$openAPITypes as $propertyName => $propertyType) { + $propertyValue = $this[$propertyName]; + if ($propertyValue !== null) { + // Check if the property value is an object and has a toArray() method + if (is_object($propertyValue) && method_exists($propertyValue, 'toArray')) { + $array[$propertyName] = $propertyValue->toArray(); + // Check if it's type datetime + } elseif ($propertyValue instanceof \DateTime) { + $array[$propertyName] = $propertyValue->format(DATE_ATOM); + // If it's an array type we should check whether it contains objects and if so call toArray method + } elseif (is_array($propertyValue)) { + $array[$propertyName] = array_map(function ($item) { + return $item instanceof ModelInterface ? $item->toArray() : $item; + }, $propertyValue); + } else { + // Otherwise, directly assign the property value to the array + $array[$propertyName] = $propertyValue; + } + } + } + return $array; + } + /** * Gets the string presentation of the object * diff --git a/src/Adyen/Model/Checkout/AcctInfo.php b/src/Adyen/Model/Checkout/AcctInfo.php index a2f5c76b3..bd5c4a3c4 100644 --- a/src/Adyen/Model/Checkout/AcctInfo.php +++ b/src/Adyen/Model/Checkout/AcctInfo.php @@ -5,7 +5,7 @@ * * The version of the OpenAPI document: 71 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 6.0.1 + * OpenAPI Generator version: 6.4.0 * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -1136,6 +1136,32 @@ public function jsonSerialize() return ObjectSerializer::sanitizeForSerialization($this); } + public function toArray(): array + { + $array = []; + foreach (self::$openAPITypes as $propertyName => $propertyType) { + $propertyValue = $this[$propertyName]; + if ($propertyValue !== null) { + // Check if the property value is an object and has a toArray() method + if (is_object($propertyValue) && method_exists($propertyValue, 'toArray')) { + $array[$propertyName] = $propertyValue->toArray(); + // Check if it's type datetime + } elseif ($propertyValue instanceof \DateTime) { + $array[$propertyName] = $propertyValue->format(DATE_ATOM); + // If it's an array type we should check whether it contains objects and if so call toArray method + } elseif (is_array($propertyValue)) { + $array[$propertyName] = array_map(function ($item) { + return $item instanceof ModelInterface ? $item->toArray() : $item; + }, $propertyValue); + } else { + // Otherwise, directly assign the property value to the array + $array[$propertyName] = $propertyValue; + } + } + } + return $array; + } + /** * Gets the string presentation of the object * diff --git a/src/Adyen/Model/Checkout/AchDetails.php b/src/Adyen/Model/Checkout/AchDetails.php index 6c2188185..f2592da7f 100644 --- a/src/Adyen/Model/Checkout/AchDetails.php +++ b/src/Adyen/Model/Checkout/AchDetails.php @@ -5,7 +5,7 @@ * * The version of the OpenAPI document: 71 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 6.0.1 + * OpenAPI Generator version: 6.4.0 * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -756,6 +756,32 @@ public function jsonSerialize() return ObjectSerializer::sanitizeForSerialization($this); } + public function toArray(): array + { + $array = []; + foreach (self::$openAPITypes as $propertyName => $propertyType) { + $propertyValue = $this[$propertyName]; + if ($propertyValue !== null) { + // Check if the property value is an object and has a toArray() method + if (is_object($propertyValue) && method_exists($propertyValue, 'toArray')) { + $array[$propertyName] = $propertyValue->toArray(); + // Check if it's type datetime + } elseif ($propertyValue instanceof \DateTime) { + $array[$propertyName] = $propertyValue->format(DATE_ATOM); + // If it's an array type we should check whether it contains objects and if so call toArray method + } elseif (is_array($propertyValue)) { + $array[$propertyName] = array_map(function ($item) { + return $item instanceof ModelInterface ? $item->toArray() : $item; + }, $propertyValue); + } else { + // Otherwise, directly assign the property value to the array + $array[$propertyName] = $propertyValue; + } + } + } + return $array; + } + /** * Gets the string presentation of the object * diff --git a/src/Adyen/Model/Checkout/AdditionalData3DSecure.php b/src/Adyen/Model/Checkout/AdditionalData3DSecure.php index 03bc1bd65..696db3d17 100644 --- a/src/Adyen/Model/Checkout/AdditionalData3DSecure.php +++ b/src/Adyen/Model/Checkout/AdditionalData3DSecure.php @@ -5,7 +5,7 @@ * * The version of the OpenAPI document: 71 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 6.0.1 + * OpenAPI Generator version: 6.4.0 * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -582,6 +582,32 @@ public function jsonSerialize() return ObjectSerializer::sanitizeForSerialization($this); } + public function toArray(): array + { + $array = []; + foreach (self::$openAPITypes as $propertyName => $propertyType) { + $propertyValue = $this[$propertyName]; + if ($propertyValue !== null) { + // Check if the property value is an object and has a toArray() method + if (is_object($propertyValue) && method_exists($propertyValue, 'toArray')) { + $array[$propertyName] = $propertyValue->toArray(); + // Check if it's type datetime + } elseif ($propertyValue instanceof \DateTime) { + $array[$propertyName] = $propertyValue->format(DATE_ATOM); + // If it's an array type we should check whether it contains objects and if so call toArray method + } elseif (is_array($propertyValue)) { + $array[$propertyName] = array_map(function ($item) { + return $item instanceof ModelInterface ? $item->toArray() : $item; + }, $propertyValue); + } else { + // Otherwise, directly assign the property value to the array + $array[$propertyName] = $propertyValue; + } + } + } + return $array; + } + /** * Gets the string presentation of the object * diff --git a/src/Adyen/Model/Checkout/AdditionalDataAirline.php b/src/Adyen/Model/Checkout/AdditionalDataAirline.php index 0377b28e8..bcae308a0 100644 --- a/src/Adyen/Model/Checkout/AdditionalDataAirline.php +++ b/src/Adyen/Model/Checkout/AdditionalDataAirline.php @@ -5,7 +5,7 @@ * * The version of the OpenAPI document: 71 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 6.0.1 + * OpenAPI Generator version: 6.4.0 * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -1290,6 +1290,32 @@ public function jsonSerialize() return ObjectSerializer::sanitizeForSerialization($this); } + public function toArray(): array + { + $array = []; + foreach (self::$openAPITypes as $propertyName => $propertyType) { + $propertyValue = $this[$propertyName]; + if ($propertyValue !== null) { + // Check if the property value is an object and has a toArray() method + if (is_object($propertyValue) && method_exists($propertyValue, 'toArray')) { + $array[$propertyName] = $propertyValue->toArray(); + // Check if it's type datetime + } elseif ($propertyValue instanceof \DateTime) { + $array[$propertyName] = $propertyValue->format(DATE_ATOM); + // If it's an array type we should check whether it contains objects and if so call toArray method + } elseif (is_array($propertyValue)) { + $array[$propertyName] = array_map(function ($item) { + return $item instanceof ModelInterface ? $item->toArray() : $item; + }, $propertyValue); + } else { + // Otherwise, directly assign the property value to the array + $array[$propertyName] = $propertyValue; + } + } + } + return $array; + } + /** * Gets the string presentation of the object * diff --git a/src/Adyen/Model/Checkout/AdditionalDataCarRental.php b/src/Adyen/Model/Checkout/AdditionalDataCarRental.php index ac0f9d613..571351604 100644 --- a/src/Adyen/Model/Checkout/AdditionalDataCarRental.php +++ b/src/Adyen/Model/Checkout/AdditionalDataCarRental.php @@ -5,7 +5,7 @@ * * The version of the OpenAPI document: 71 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 6.0.1 + * OpenAPI Generator version: 6.4.0 * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -1117,6 +1117,32 @@ public function jsonSerialize() return ObjectSerializer::sanitizeForSerialization($this); } + public function toArray(): array + { + $array = []; + foreach (self::$openAPITypes as $propertyName => $propertyType) { + $propertyValue = $this[$propertyName]; + if ($propertyValue !== null) { + // Check if the property value is an object and has a toArray() method + if (is_object($propertyValue) && method_exists($propertyValue, 'toArray')) { + $array[$propertyName] = $propertyValue->toArray(); + // Check if it's type datetime + } elseif ($propertyValue instanceof \DateTime) { + $array[$propertyName] = $propertyValue->format(DATE_ATOM); + // If it's an array type we should check whether it contains objects and if so call toArray method + } elseif (is_array($propertyValue)) { + $array[$propertyName] = array_map(function ($item) { + return $item instanceof ModelInterface ? $item->toArray() : $item; + }, $propertyValue); + } else { + // Otherwise, directly assign the property value to the array + $array[$propertyName] = $propertyValue; + } + } + } + return $array; + } + /** * Gets the string presentation of the object * diff --git a/src/Adyen/Model/Checkout/AdditionalDataCommon.php b/src/Adyen/Model/Checkout/AdditionalDataCommon.php index ac0475271..12ed56c13 100644 --- a/src/Adyen/Model/Checkout/AdditionalDataCommon.php +++ b/src/Adyen/Model/Checkout/AdditionalDataCommon.php @@ -5,7 +5,7 @@ * * The version of the OpenAPI document: 71 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 6.0.1 + * OpenAPI Generator version: 6.4.0 * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -912,6 +912,32 @@ public function jsonSerialize() return ObjectSerializer::sanitizeForSerialization($this); } + public function toArray(): array + { + $array = []; + foreach (self::$openAPITypes as $propertyName => $propertyType) { + $propertyValue = $this[$propertyName]; + if ($propertyValue !== null) { + // Check if the property value is an object and has a toArray() method + if (is_object($propertyValue) && method_exists($propertyValue, 'toArray')) { + $array[$propertyName] = $propertyValue->toArray(); + // Check if it's type datetime + } elseif ($propertyValue instanceof \DateTime) { + $array[$propertyName] = $propertyValue->format(DATE_ATOM); + // If it's an array type we should check whether it contains objects and if so call toArray method + } elseif (is_array($propertyValue)) { + $array[$propertyName] = array_map(function ($item) { + return $item instanceof ModelInterface ? $item->toArray() : $item; + }, $propertyValue); + } else { + // Otherwise, directly assign the property value to the array + $array[$propertyName] = $propertyValue; + } + } + } + return $array; + } + /** * Gets the string presentation of the object * diff --git a/src/Adyen/Model/Checkout/AdditionalDataLevel23.php b/src/Adyen/Model/Checkout/AdditionalDataLevel23.php index a382d6f7a..a3a766c96 100644 --- a/src/Adyen/Model/Checkout/AdditionalDataLevel23.php +++ b/src/Adyen/Model/Checkout/AdditionalDataLevel23.php @@ -5,7 +5,7 @@ * * The version of the OpenAPI document: 71 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 6.0.1 + * OpenAPI Generator version: 6.4.0 * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -913,6 +913,32 @@ public function jsonSerialize() return ObjectSerializer::sanitizeForSerialization($this); } + public function toArray(): array + { + $array = []; + foreach (self::$openAPITypes as $propertyName => $propertyType) { + $propertyValue = $this[$propertyName]; + if ($propertyValue !== null) { + // Check if the property value is an object and has a toArray() method + if (is_object($propertyValue) && method_exists($propertyValue, 'toArray')) { + $array[$propertyName] = $propertyValue->toArray(); + // Check if it's type datetime + } elseif ($propertyValue instanceof \DateTime) { + $array[$propertyName] = $propertyValue->format(DATE_ATOM); + // If it's an array type we should check whether it contains objects and if so call toArray method + } elseif (is_array($propertyValue)) { + $array[$propertyName] = array_map(function ($item) { + return $item instanceof ModelInterface ? $item->toArray() : $item; + }, $propertyValue); + } else { + // Otherwise, directly assign the property value to the array + $array[$propertyName] = $propertyValue; + } + } + } + return $array; + } + /** * Gets the string presentation of the object * diff --git a/src/Adyen/Model/Checkout/AdditionalDataLodging.php b/src/Adyen/Model/Checkout/AdditionalDataLodging.php index 5a0ea90a1..e80968e3c 100644 --- a/src/Adyen/Model/Checkout/AdditionalDataLodging.php +++ b/src/Adyen/Model/Checkout/AdditionalDataLodging.php @@ -5,7 +5,7 @@ * * The version of the OpenAPI document: 71 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 6.0.1 + * OpenAPI Generator version: 6.4.0 * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -879,6 +879,32 @@ public function jsonSerialize() return ObjectSerializer::sanitizeForSerialization($this); } + public function toArray(): array + { + $array = []; + foreach (self::$openAPITypes as $propertyName => $propertyType) { + $propertyValue = $this[$propertyName]; + if ($propertyValue !== null) { + // Check if the property value is an object and has a toArray() method + if (is_object($propertyValue) && method_exists($propertyValue, 'toArray')) { + $array[$propertyName] = $propertyValue->toArray(); + // Check if it's type datetime + } elseif ($propertyValue instanceof \DateTime) { + $array[$propertyName] = $propertyValue->format(DATE_ATOM); + // If it's an array type we should check whether it contains objects and if so call toArray method + } elseif (is_array($propertyValue)) { + $array[$propertyName] = array_map(function ($item) { + return $item instanceof ModelInterface ? $item->toArray() : $item; + }, $propertyValue); + } else { + // Otherwise, directly assign the property value to the array + $array[$propertyName] = $propertyValue; + } + } + } + return $array; + } + /** * Gets the string presentation of the object * diff --git a/src/Adyen/Model/Checkout/AdditionalDataOpenInvoice.php b/src/Adyen/Model/Checkout/AdditionalDataOpenInvoice.php index ec258a967..20230ecb0 100644 --- a/src/Adyen/Model/Checkout/AdditionalDataOpenInvoice.php +++ b/src/Adyen/Model/Checkout/AdditionalDataOpenInvoice.php @@ -5,7 +5,7 @@ * * The version of the OpenAPI document: 71 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 6.0.1 + * OpenAPI Generator version: 6.4.0 * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -947,6 +947,32 @@ public function jsonSerialize() return ObjectSerializer::sanitizeForSerialization($this); } + public function toArray(): array + { + $array = []; + foreach (self::$openAPITypes as $propertyName => $propertyType) { + $propertyValue = $this[$propertyName]; + if ($propertyValue !== null) { + // Check if the property value is an object and has a toArray() method + if (is_object($propertyValue) && method_exists($propertyValue, 'toArray')) { + $array[$propertyName] = $propertyValue->toArray(); + // Check if it's type datetime + } elseif ($propertyValue instanceof \DateTime) { + $array[$propertyName] = $propertyValue->format(DATE_ATOM); + // If it's an array type we should check whether it contains objects and if so call toArray method + } elseif (is_array($propertyValue)) { + $array[$propertyName] = array_map(function ($item) { + return $item instanceof ModelInterface ? $item->toArray() : $item; + }, $propertyValue); + } else { + // Otherwise, directly assign the property value to the array + $array[$propertyName] = $propertyValue; + } + } + } + return $array; + } + /** * Gets the string presentation of the object * diff --git a/src/Adyen/Model/Checkout/AdditionalDataOpi.php b/src/Adyen/Model/Checkout/AdditionalDataOpi.php index d9891d229..f6e85253f 100644 --- a/src/Adyen/Model/Checkout/AdditionalDataOpi.php +++ b/src/Adyen/Model/Checkout/AdditionalDataOpi.php @@ -5,7 +5,7 @@ * * The version of the OpenAPI document: 71 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 6.0.1 + * OpenAPI Generator version: 6.4.0 * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -369,6 +369,32 @@ public function jsonSerialize() return ObjectSerializer::sanitizeForSerialization($this); } + public function toArray(): array + { + $array = []; + foreach (self::$openAPITypes as $propertyName => $propertyType) { + $propertyValue = $this[$propertyName]; + if ($propertyValue !== null) { + // Check if the property value is an object and has a toArray() method + if (is_object($propertyValue) && method_exists($propertyValue, 'toArray')) { + $array[$propertyName] = $propertyValue->toArray(); + // Check if it's type datetime + } elseif ($propertyValue instanceof \DateTime) { + $array[$propertyName] = $propertyValue->format(DATE_ATOM); + // If it's an array type we should check whether it contains objects and if so call toArray method + } elseif (is_array($propertyValue)) { + $array[$propertyName] = array_map(function ($item) { + return $item instanceof ModelInterface ? $item->toArray() : $item; + }, $propertyValue); + } else { + // Otherwise, directly assign the property value to the array + $array[$propertyName] = $propertyValue; + } + } + } + return $array; + } + /** * Gets the string presentation of the object * diff --git a/src/Adyen/Model/Checkout/AdditionalDataRatepay.php b/src/Adyen/Model/Checkout/AdditionalDataRatepay.php index 56677942c..6ba300859 100644 --- a/src/Adyen/Model/Checkout/AdditionalDataRatepay.php +++ b/src/Adyen/Model/Checkout/AdditionalDataRatepay.php @@ -5,7 +5,7 @@ * * The version of the OpenAPI document: 71 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 6.0.1 + * OpenAPI Generator version: 6.4.0 * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -607,6 +607,32 @@ public function jsonSerialize() return ObjectSerializer::sanitizeForSerialization($this); } + public function toArray(): array + { + $array = []; + foreach (self::$openAPITypes as $propertyName => $propertyType) { + $propertyValue = $this[$propertyName]; + if ($propertyValue !== null) { + // Check if the property value is an object and has a toArray() method + if (is_object($propertyValue) && method_exists($propertyValue, 'toArray')) { + $array[$propertyName] = $propertyValue->toArray(); + // Check if it's type datetime + } elseif ($propertyValue instanceof \DateTime) { + $array[$propertyName] = $propertyValue->format(DATE_ATOM); + // If it's an array type we should check whether it contains objects and if so call toArray method + } elseif (is_array($propertyValue)) { + $array[$propertyName] = array_map(function ($item) { + return $item instanceof ModelInterface ? $item->toArray() : $item; + }, $propertyValue); + } else { + // Otherwise, directly assign the property value to the array + $array[$propertyName] = $propertyValue; + } + } + } + return $array; + } + /** * Gets the string presentation of the object * diff --git a/src/Adyen/Model/Checkout/AdditionalDataRetry.php b/src/Adyen/Model/Checkout/AdditionalDataRetry.php index 0e82b6a7d..2bb2e0b2a 100644 --- a/src/Adyen/Model/Checkout/AdditionalDataRetry.php +++ b/src/Adyen/Model/Checkout/AdditionalDataRetry.php @@ -5,7 +5,7 @@ * * The version of the OpenAPI document: 71 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 6.0.1 + * OpenAPI Generator version: 6.4.0 * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -437,6 +437,32 @@ public function jsonSerialize() return ObjectSerializer::sanitizeForSerialization($this); } + public function toArray(): array + { + $array = []; + foreach (self::$openAPITypes as $propertyName => $propertyType) { + $propertyValue = $this[$propertyName]; + if ($propertyValue !== null) { + // Check if the property value is an object and has a toArray() method + if (is_object($propertyValue) && method_exists($propertyValue, 'toArray')) { + $array[$propertyName] = $propertyValue->toArray(); + // Check if it's type datetime + } elseif ($propertyValue instanceof \DateTime) { + $array[$propertyName] = $propertyValue->format(DATE_ATOM); + // If it's an array type we should check whether it contains objects and if so call toArray method + } elseif (is_array($propertyValue)) { + $array[$propertyName] = array_map(function ($item) { + return $item instanceof ModelInterface ? $item->toArray() : $item; + }, $propertyValue); + } else { + // Otherwise, directly assign the property value to the array + $array[$propertyName] = $propertyValue; + } + } + } + return $array; + } + /** * Gets the string presentation of the object * diff --git a/src/Adyen/Model/Checkout/AdditionalDataRisk.php b/src/Adyen/Model/Checkout/AdditionalDataRisk.php index c0901c440..27830bc3e 100644 --- a/src/Adyen/Model/Checkout/AdditionalDataRisk.php +++ b/src/Adyen/Model/Checkout/AdditionalDataRisk.php @@ -5,7 +5,7 @@ * * The version of the OpenAPI document: 71 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 6.0.1 + * OpenAPI Generator version: 6.4.0 * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -1049,6 +1049,32 @@ public function jsonSerialize() return ObjectSerializer::sanitizeForSerialization($this); } + public function toArray(): array + { + $array = []; + foreach (self::$openAPITypes as $propertyName => $propertyType) { + $propertyValue = $this[$propertyName]; + if ($propertyValue !== null) { + // Check if the property value is an object and has a toArray() method + if (is_object($propertyValue) && method_exists($propertyValue, 'toArray')) { + $array[$propertyName] = $propertyValue->toArray(); + // Check if it's type datetime + } elseif ($propertyValue instanceof \DateTime) { + $array[$propertyName] = $propertyValue->format(DATE_ATOM); + // If it's an array type we should check whether it contains objects and if so call toArray method + } elseif (is_array($propertyValue)) { + $array[$propertyName] = array_map(function ($item) { + return $item instanceof ModelInterface ? $item->toArray() : $item; + }, $propertyValue); + } else { + // Otherwise, directly assign the property value to the array + $array[$propertyName] = $propertyValue; + } + } + } + return $array; + } + /** * Gets the string presentation of the object * diff --git a/src/Adyen/Model/Checkout/AdditionalDataRiskStandalone.php b/src/Adyen/Model/Checkout/AdditionalDataRiskStandalone.php index e044f870b..3bb5c51d0 100644 --- a/src/Adyen/Model/Checkout/AdditionalDataRiskStandalone.php +++ b/src/Adyen/Model/Checkout/AdditionalDataRiskStandalone.php @@ -5,7 +5,7 @@ * * The version of the OpenAPI document: 71 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 6.0.1 + * OpenAPI Generator version: 6.4.0 * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -845,6 +845,32 @@ public function jsonSerialize() return ObjectSerializer::sanitizeForSerialization($this); } + public function toArray(): array + { + $array = []; + foreach (self::$openAPITypes as $propertyName => $propertyType) { + $propertyValue = $this[$propertyName]; + if ($propertyValue !== null) { + // Check if the property value is an object and has a toArray() method + if (is_object($propertyValue) && method_exists($propertyValue, 'toArray')) { + $array[$propertyName] = $propertyValue->toArray(); + // Check if it's type datetime + } elseif ($propertyValue instanceof \DateTime) { + $array[$propertyName] = $propertyValue->format(DATE_ATOM); + // If it's an array type we should check whether it contains objects and if so call toArray method + } elseif (is_array($propertyValue)) { + $array[$propertyName] = array_map(function ($item) { + return $item instanceof ModelInterface ? $item->toArray() : $item; + }, $propertyValue); + } else { + // Otherwise, directly assign the property value to the array + $array[$propertyName] = $propertyValue; + } + } + } + return $array; + } + /** * Gets the string presentation of the object * diff --git a/src/Adyen/Model/Checkout/AdditionalDataSubMerchant.php b/src/Adyen/Model/Checkout/AdditionalDataSubMerchant.php index f3dad0dad..240b2fe26 100644 --- a/src/Adyen/Model/Checkout/AdditionalDataSubMerchant.php +++ b/src/Adyen/Model/Checkout/AdditionalDataSubMerchant.php @@ -5,7 +5,7 @@ * * The version of the OpenAPI document: 71 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 6.0.1 + * OpenAPI Generator version: 6.4.0 * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -675,6 +675,32 @@ public function jsonSerialize() return ObjectSerializer::sanitizeForSerialization($this); } + public function toArray(): array + { + $array = []; + foreach (self::$openAPITypes as $propertyName => $propertyType) { + $propertyValue = $this[$propertyName]; + if ($propertyValue !== null) { + // Check if the property value is an object and has a toArray() method + if (is_object($propertyValue) && method_exists($propertyValue, 'toArray')) { + $array[$propertyName] = $propertyValue->toArray(); + // Check if it's type datetime + } elseif ($propertyValue instanceof \DateTime) { + $array[$propertyName] = $propertyValue->format(DATE_ATOM); + // If it's an array type we should check whether it contains objects and if so call toArray method + } elseif (is_array($propertyValue)) { + $array[$propertyName] = array_map(function ($item) { + return $item instanceof ModelInterface ? $item->toArray() : $item; + }, $propertyValue); + } else { + // Otherwise, directly assign the property value to the array + $array[$propertyName] = $propertyValue; + } + } + } + return $array; + } + /** * Gets the string presentation of the object * diff --git a/src/Adyen/Model/Checkout/AdditionalDataTemporaryServices.php b/src/Adyen/Model/Checkout/AdditionalDataTemporaryServices.php index af5bfbebc..fce5490d1 100644 --- a/src/Adyen/Model/Checkout/AdditionalDataTemporaryServices.php +++ b/src/Adyen/Model/Checkout/AdditionalDataTemporaryServices.php @@ -5,7 +5,7 @@ * * The version of the OpenAPI document: 71 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 6.0.1 + * OpenAPI Generator version: 6.4.0 * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -641,6 +641,32 @@ public function jsonSerialize() return ObjectSerializer::sanitizeForSerialization($this); } + public function toArray(): array + { + $array = []; + foreach (self::$openAPITypes as $propertyName => $propertyType) { + $propertyValue = $this[$propertyName]; + if ($propertyValue !== null) { + // Check if the property value is an object and has a toArray() method + if (is_object($propertyValue) && method_exists($propertyValue, 'toArray')) { + $array[$propertyName] = $propertyValue->toArray(); + // Check if it's type datetime + } elseif ($propertyValue instanceof \DateTime) { + $array[$propertyName] = $propertyValue->format(DATE_ATOM); + // If it's an array type we should check whether it contains objects and if so call toArray method + } elseif (is_array($propertyValue)) { + $array[$propertyName] = array_map(function ($item) { + return $item instanceof ModelInterface ? $item->toArray() : $item; + }, $propertyValue); + } else { + // Otherwise, directly assign the property value to the array + $array[$propertyName] = $propertyValue; + } + } + } + return $array; + } + /** * Gets the string presentation of the object * diff --git a/src/Adyen/Model/Checkout/AdditionalDataWallets.php b/src/Adyen/Model/Checkout/AdditionalDataWallets.php index 2ddbf6995..1bd47121d 100644 --- a/src/Adyen/Model/Checkout/AdditionalDataWallets.php +++ b/src/Adyen/Model/Checkout/AdditionalDataWallets.php @@ -5,7 +5,7 @@ * * The version of the OpenAPI document: 71 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 6.0.1 + * OpenAPI Generator version: 6.4.0 * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -539,6 +539,32 @@ public function jsonSerialize() return ObjectSerializer::sanitizeForSerialization($this); } + public function toArray(): array + { + $array = []; + foreach (self::$openAPITypes as $propertyName => $propertyType) { + $propertyValue = $this[$propertyName]; + if ($propertyValue !== null) { + // Check if the property value is an object and has a toArray() method + if (is_object($propertyValue) && method_exists($propertyValue, 'toArray')) { + $array[$propertyName] = $propertyValue->toArray(); + // Check if it's type datetime + } elseif ($propertyValue instanceof \DateTime) { + $array[$propertyName] = $propertyValue->format(DATE_ATOM); + // If it's an array type we should check whether it contains objects and if so call toArray method + } elseif (is_array($propertyValue)) { + $array[$propertyName] = array_map(function ($item) { + return $item instanceof ModelInterface ? $item->toArray() : $item; + }, $propertyValue); + } else { + // Otherwise, directly assign the property value to the array + $array[$propertyName] = $propertyValue; + } + } + } + return $array; + } + /** * Gets the string presentation of the object * diff --git a/src/Adyen/Model/Checkout/Address.php b/src/Adyen/Model/Checkout/Address.php index c1949a378..29cb61d98 100644 --- a/src/Adyen/Model/Checkout/Address.php +++ b/src/Adyen/Model/Checkout/Address.php @@ -5,7 +5,7 @@ * * The version of the OpenAPI document: 71 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 6.0.1 + * OpenAPI Generator version: 6.4.0 * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -554,6 +554,32 @@ public function jsonSerialize() return ObjectSerializer::sanitizeForSerialization($this); } + public function toArray(): array + { + $array = []; + foreach (self::$openAPITypes as $propertyName => $propertyType) { + $propertyValue = $this[$propertyName]; + if ($propertyValue !== null) { + // Check if the property value is an object and has a toArray() method + if (is_object($propertyValue) && method_exists($propertyValue, 'toArray')) { + $array[$propertyName] = $propertyValue->toArray(); + // Check if it's type datetime + } elseif ($propertyValue instanceof \DateTime) { + $array[$propertyName] = $propertyValue->format(DATE_ATOM); + // If it's an array type we should check whether it contains objects and if so call toArray method + } elseif (is_array($propertyValue)) { + $array[$propertyName] = array_map(function ($item) { + return $item instanceof ModelInterface ? $item->toArray() : $item; + }, $propertyValue); + } else { + // Otherwise, directly assign the property value to the array + $array[$propertyName] = $propertyValue; + } + } + } + return $array; + } + /** * Gets the string presentation of the object * diff --git a/src/Adyen/Model/Checkout/AfterpayDetails.php b/src/Adyen/Model/Checkout/AfterpayDetails.php index 9f52e0fa6..7b7a45008 100644 --- a/src/Adyen/Model/Checkout/AfterpayDetails.php +++ b/src/Adyen/Model/Checkout/AfterpayDetails.php @@ -5,7 +5,7 @@ * * The version of the OpenAPI document: 71 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 6.0.1 + * OpenAPI Generator version: 6.4.0 * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -615,6 +615,32 @@ public function jsonSerialize() return ObjectSerializer::sanitizeForSerialization($this); } + public function toArray(): array + { + $array = []; + foreach (self::$openAPITypes as $propertyName => $propertyType) { + $propertyValue = $this[$propertyName]; + if ($propertyValue !== null) { + // Check if the property value is an object and has a toArray() method + if (is_object($propertyValue) && method_exists($propertyValue, 'toArray')) { + $array[$propertyName] = $propertyValue->toArray(); + // Check if it's type datetime + } elseif ($propertyValue instanceof \DateTime) { + $array[$propertyName] = $propertyValue->format(DATE_ATOM); + // If it's an array type we should check whether it contains objects and if so call toArray method + } elseif (is_array($propertyValue)) { + $array[$propertyName] = array_map(function ($item) { + return $item instanceof ModelInterface ? $item->toArray() : $item; + }, $propertyValue); + } else { + // Otherwise, directly assign the property value to the array + $array[$propertyName] = $propertyValue; + } + } + } + return $array; + } + /** * Gets the string presentation of the object * diff --git a/src/Adyen/Model/Checkout/AmazonPayDetails.php b/src/Adyen/Model/Checkout/AmazonPayDetails.php index a472b41b5..2c28be87b 100644 --- a/src/Adyen/Model/Checkout/AmazonPayDetails.php +++ b/src/Adyen/Model/Checkout/AmazonPayDetails.php @@ -5,7 +5,7 @@ * * The version of the OpenAPI document: 71 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 6.0.1 + * OpenAPI Generator version: 6.4.0 * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -502,6 +502,32 @@ public function jsonSerialize() return ObjectSerializer::sanitizeForSerialization($this); } + public function toArray(): array + { + $array = []; + foreach (self::$openAPITypes as $propertyName => $propertyType) { + $propertyValue = $this[$propertyName]; + if ($propertyValue !== null) { + // Check if the property value is an object and has a toArray() method + if (is_object($propertyValue) && method_exists($propertyValue, 'toArray')) { + $array[$propertyName] = $propertyValue->toArray(); + // Check if it's type datetime + } elseif ($propertyValue instanceof \DateTime) { + $array[$propertyName] = $propertyValue->format(DATE_ATOM); + // If it's an array type we should check whether it contains objects and if so call toArray method + } elseif (is_array($propertyValue)) { + $array[$propertyName] = array_map(function ($item) { + return $item instanceof ModelInterface ? $item->toArray() : $item; + }, $propertyValue); + } else { + // Otherwise, directly assign the property value to the array + $array[$propertyName] = $propertyValue; + } + } + } + return $array; + } + /** * Gets the string presentation of the object * diff --git a/src/Adyen/Model/Checkout/Amount.php b/src/Adyen/Model/Checkout/Amount.php index b069e038f..720e36adf 100644 --- a/src/Adyen/Model/Checkout/Amount.php +++ b/src/Adyen/Model/Checkout/Amount.php @@ -5,7 +5,7 @@ * * The version of the OpenAPI document: 71 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 6.0.1 + * OpenAPI Generator version: 6.4.0 * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -409,6 +409,32 @@ public function jsonSerialize() return ObjectSerializer::sanitizeForSerialization($this); } + public function toArray(): array + { + $array = []; + foreach (self::$openAPITypes as $propertyName => $propertyType) { + $propertyValue = $this[$propertyName]; + if ($propertyValue !== null) { + // Check if the property value is an object and has a toArray() method + if (is_object($propertyValue) && method_exists($propertyValue, 'toArray')) { + $array[$propertyName] = $propertyValue->toArray(); + // Check if it's type datetime + } elseif ($propertyValue instanceof \DateTime) { + $array[$propertyName] = $propertyValue->format(DATE_ATOM); + // If it's an array type we should check whether it contains objects and if so call toArray method + } elseif (is_array($propertyValue)) { + $array[$propertyName] = array_map(function ($item) { + return $item instanceof ModelInterface ? $item->toArray() : $item; + }, $propertyValue); + } else { + // Otherwise, directly assign the property value to the array + $array[$propertyName] = $propertyValue; + } + } + } + return $array; + } + /** * Gets the string presentation of the object * diff --git a/src/Adyen/Model/Checkout/AndroidPayDetails.php b/src/Adyen/Model/Checkout/AndroidPayDetails.php index 7d12eeb89..baa458730 100644 --- a/src/Adyen/Model/Checkout/AndroidPayDetails.php +++ b/src/Adyen/Model/Checkout/AndroidPayDetails.php @@ -5,7 +5,7 @@ * * The version of the OpenAPI document: 71 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 6.0.1 + * OpenAPI Generator version: 6.4.0 * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -434,6 +434,32 @@ public function jsonSerialize() return ObjectSerializer::sanitizeForSerialization($this); } + public function toArray(): array + { + $array = []; + foreach (self::$openAPITypes as $propertyName => $propertyType) { + $propertyValue = $this[$propertyName]; + if ($propertyValue !== null) { + // Check if the property value is an object and has a toArray() method + if (is_object($propertyValue) && method_exists($propertyValue, 'toArray')) { + $array[$propertyName] = $propertyValue->toArray(); + // Check if it's type datetime + } elseif ($propertyValue instanceof \DateTime) { + $array[$propertyName] = $propertyValue->format(DATE_ATOM); + // If it's an array type we should check whether it contains objects and if so call toArray method + } elseif (is_array($propertyValue)) { + $array[$propertyName] = array_map(function ($item) { + return $item instanceof ModelInterface ? $item->toArray() : $item; + }, $propertyValue); + } else { + // Otherwise, directly assign the property value to the array + $array[$propertyName] = $propertyValue; + } + } + } + return $array; + } + /** * Gets the string presentation of the object * diff --git a/src/Adyen/Model/Checkout/ApplePayDetails.php b/src/Adyen/Model/Checkout/ApplePayDetails.php index c824d6a61..43cacf792 100644 --- a/src/Adyen/Model/Checkout/ApplePayDetails.php +++ b/src/Adyen/Model/Checkout/ApplePayDetails.php @@ -5,7 +5,7 @@ * * The version of the OpenAPI document: 71 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 6.0.1 + * OpenAPI Generator version: 6.4.0 * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -245,7 +245,6 @@ public function getModelName() return self::$openAPIModelName; } - public const FUNDING_SOURCE_CREDIT = 'credit'; public const FUNDING_SOURCE_DEBIT = 'debit'; public const TYPE_APPLEPAY = 'applepay'; @@ -257,7 +256,6 @@ public function getModelName() public function getFundingSourceAllowableValues() { return [ - self::FUNDING_SOURCE_CREDIT, self::FUNDING_SOURCE_DEBIT, ]; } @@ -608,6 +606,32 @@ public function jsonSerialize() return ObjectSerializer::sanitizeForSerialization($this); } + public function toArray(): array + { + $array = []; + foreach (self::$openAPITypes as $propertyName => $propertyType) { + $propertyValue = $this[$propertyName]; + if ($propertyValue !== null) { + // Check if the property value is an object and has a toArray() method + if (is_object($propertyValue) && method_exists($propertyValue, 'toArray')) { + $array[$propertyName] = $propertyValue->toArray(); + // Check if it's type datetime + } elseif ($propertyValue instanceof \DateTime) { + $array[$propertyName] = $propertyValue->format(DATE_ATOM); + // If it's an array type we should check whether it contains objects and if so call toArray method + } elseif (is_array($propertyValue)) { + $array[$propertyName] = array_map(function ($item) { + return $item instanceof ModelInterface ? $item->toArray() : $item; + }, $propertyValue); + } else { + // Otherwise, directly assign the property value to the array + $array[$propertyName] = $propertyValue; + } + } + } + return $array; + } + /** * Gets the string presentation of the object * diff --git a/src/Adyen/Model/Checkout/ApplePayDonations.php b/src/Adyen/Model/Checkout/ApplePayDonations.php deleted file mode 100644 index 852d32e4e..000000000 --- a/src/Adyen/Model/Checkout/ApplePayDonations.php +++ /dev/null @@ -1,623 +0,0 @@ - - */ -class ApplePayDonations implements ModelInterface, ArrayAccess, \JsonSerializable -{ - public const DISCRIMINATOR = null; - - /** - * The original name of the model. - * - * @var string - */ - protected static $openAPIModelName = 'ApplePayDonations'; - - /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ - protected static $openAPITypes = [ - 'applePayToken' => 'string', - 'checkoutAttemptId' => 'string', - 'fundingSource' => 'string', - 'recurringDetailReference' => 'string', - 'storedPaymentMethodId' => 'string', - 'type' => 'string' - ]; - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ - protected static $openAPIFormats = [ - 'applePayToken' => null, - 'checkoutAttemptId' => null, - 'fundingSource' => null, - 'recurringDetailReference' => null, - 'storedPaymentMethodId' => null, - 'type' => null - ]; - - /** - * Array of nullable properties. Used for (de)serialization - * - * @var boolean[] - */ - protected static $openAPINullables = [ - 'applePayToken' => false, - 'checkoutAttemptId' => false, - 'fundingSource' => false, - 'recurringDetailReference' => false, - 'storedPaymentMethodId' => false, - '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 = [ - 'applePayToken' => 'applePayToken', - 'checkoutAttemptId' => 'checkoutAttemptId', - 'fundingSource' => 'fundingSource', - 'recurringDetailReference' => 'recurringDetailReference', - 'storedPaymentMethodId' => 'storedPaymentMethodId', - 'type' => 'type' - ]; - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @var string[] - */ - protected static $setters = [ - 'applePayToken' => 'setApplePayToken', - 'checkoutAttemptId' => 'setCheckoutAttemptId', - 'fundingSource' => 'setFundingSource', - 'recurringDetailReference' => 'setRecurringDetailReference', - 'storedPaymentMethodId' => 'setStoredPaymentMethodId', - 'type' => 'setType' - ]; - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @var string[] - */ - protected static $getters = [ - 'applePayToken' => 'getApplePayToken', - 'checkoutAttemptId' => 'getCheckoutAttemptId', - 'fundingSource' => 'getFundingSource', - 'recurringDetailReference' => 'getRecurringDetailReference', - 'storedPaymentMethodId' => 'getStoredPaymentMethodId', - 'type' => 'getType' - ]; - - /** - * 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; - } - - public const FUNDING_SOURCE_CREDIT = 'credit'; - public const FUNDING_SOURCE_DEBIT = 'debit'; - public const TYPE_APPLEPAY = 'applepay'; - - /** - * Gets allowable values of the enum - * - * @return string[] - */ - public function getFundingSourceAllowableValues() - { - return [ - self::FUNDING_SOURCE_CREDIT, - self::FUNDING_SOURCE_DEBIT, - ]; - } - /** - * Gets allowable values of the enum - * - * @return string[] - */ - public function getTypeAllowableValues() - { - return [ - self::TYPE_APPLEPAY, - ]; - } - /** - * 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('applePayToken', $data ?? [], null); - $this->setIfExists('checkoutAttemptId', $data ?? [], null); - $this->setIfExists('fundingSource', $data ?? [], null); - $this->setIfExists('recurringDetailReference', $data ?? [], null); - $this->setIfExists('storedPaymentMethodId', $data ?? [], null); - $this->setIfExists('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 = []; - - if ($this->container['applePayToken'] === null) { - $invalidProperties[] = "'applePayToken' can't be null"; - } - $allowedValues = $this->getFundingSourceAllowableValues(); - if (!is_null($this->container['fundingSource']) && !in_array($this->container['fundingSource'], $allowedValues, true)) { - $invalidProperties[] = sprintf( - "invalid value '%s' for 'fundingSource', must be one of '%s'", - $this->container['fundingSource'], - implode("', '", $allowedValues) - ); - } - - $allowedValues = $this->getTypeAllowableValues(); - if (!is_null($this->container['type']) && !in_array($this->container['type'], $allowedValues, true)) { - $invalidProperties[] = sprintf( - "invalid value '%s' for 'type', must be one of '%s'", - $this->container['type'], - implode("', '", $allowedValues) - ); - } - - 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 applePayToken - * - * @return string - */ - public function getApplePayToken() - { - return $this->container['applePayToken']; - } - - /** - * Sets applePayToken - * - * @param string $applePayToken The stringified and base64 encoded `paymentData` you retrieved from the Apple framework. - * - * @return self - */ - public function setApplePayToken($applePayToken) - { - if (is_null($applePayToken)) { - throw new \InvalidArgumentException('non-nullable applePayToken cannot be null'); - } - $this->container['applePayToken'] = $applePayToken; - - return $this; - } - - /** - * Gets checkoutAttemptId - * - * @return string|null - */ - public function getCheckoutAttemptId() - { - return $this->container['checkoutAttemptId']; - } - - /** - * Sets checkoutAttemptId - * - * @param string|null $checkoutAttemptId The checkout attempt identifier. - * - * @return self - */ - public function setCheckoutAttemptId($checkoutAttemptId) - { - if (is_null($checkoutAttemptId)) { - throw new \InvalidArgumentException('non-nullable checkoutAttemptId cannot be null'); - } - $this->container['checkoutAttemptId'] = $checkoutAttemptId; - - return $this; - } - - /** - * Gets fundingSource - * - * @return string|null - */ - public function getFundingSource() - { - return $this->container['fundingSource']; - } - - /** - * Sets fundingSource - * - * @param string|null $fundingSource The funding source that should be used when multiple sources are available. For Brazilian combo cards, by default the funding source is credit. To use debit, set this value to **debit**. - * - * @return self - */ - public function setFundingSource($fundingSource) - { - if (is_null($fundingSource)) { - throw new \InvalidArgumentException('non-nullable fundingSource cannot be null'); - } - $allowedValues = $this->getFundingSourceAllowableValues(); - if (!in_array($fundingSource, $allowedValues, true)) { - throw new \InvalidArgumentException( - sprintf( - "Invalid value '%s' for 'fundingSource', must be one of '%s'", - $fundingSource, - implode("', '", $allowedValues) - ) - ); - } - $this->container['fundingSource'] = $fundingSource; - - return $this; - } - - /** - * Gets recurringDetailReference - * - * @return string|null - * @deprecated - */ - public function getRecurringDetailReference() - { - return $this->container['recurringDetailReference']; - } - - /** - * Sets recurringDetailReference - * - * @param string|null $recurringDetailReference This is the `recurringDetailReference` returned in the response when you created the token. - * - * @return self - * @deprecated - */ - public function setRecurringDetailReference($recurringDetailReference) - { - if (is_null($recurringDetailReference)) { - throw new \InvalidArgumentException('non-nullable recurringDetailReference cannot be null'); - } - $this->container['recurringDetailReference'] = $recurringDetailReference; - - return $this; - } - - /** - * Gets storedPaymentMethodId - * - * @return string|null - */ - public function getStoredPaymentMethodId() - { - return $this->container['storedPaymentMethodId']; - } - - /** - * Sets storedPaymentMethodId - * - * @param string|null $storedPaymentMethodId This is the `recurringDetailReference` returned in the response when you created the token. - * - * @return self - */ - public function setStoredPaymentMethodId($storedPaymentMethodId) - { - if (is_null($storedPaymentMethodId)) { - throw new \InvalidArgumentException('non-nullable storedPaymentMethodId cannot be null'); - } - $this->container['storedPaymentMethodId'] = $storedPaymentMethodId; - - return $this; - } - - /** - * Gets type - * - * @return string|null - */ - public function getType() - { - return $this->container['type']; - } - - /** - * Sets type - * - * @param string|null $type **applepay** - * - * @return self - */ - public function setType($type) - { - if (is_null($type)) { - throw new \InvalidArgumentException('non-nullable type cannot be null'); - } - $allowedValues = $this->getTypeAllowableValues(); - if (!in_array($type, $allowedValues, true)) { - throw new \InvalidArgumentException( - sprintf( - "Invalid value '%s' for 'type', must be one of '%s'", - $type, - implode("', '", $allowedValues) - ) - ); - } - $this->container['type'] = $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 - ); - } -} diff --git a/src/Adyen/Model/Checkout/ApplePaySessionRequest.php b/src/Adyen/Model/Checkout/ApplePaySessionRequest.php index b2eb387ba..0b9ba4d98 100644 --- a/src/Adyen/Model/Checkout/ApplePaySessionRequest.php +++ b/src/Adyen/Model/Checkout/ApplePaySessionRequest.php @@ -5,7 +5,7 @@ * * The version of the OpenAPI document: 71 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 6.0.1 + * OpenAPI Generator version: 6.4.0 * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -446,6 +446,32 @@ public function jsonSerialize() return ObjectSerializer::sanitizeForSerialization($this); } + public function toArray(): array + { + $array = []; + foreach (self::$openAPITypes as $propertyName => $propertyType) { + $propertyValue = $this[$propertyName]; + if ($propertyValue !== null) { + // Check if the property value is an object and has a toArray() method + if (is_object($propertyValue) && method_exists($propertyValue, 'toArray')) { + $array[$propertyName] = $propertyValue->toArray(); + // Check if it's type datetime + } elseif ($propertyValue instanceof \DateTime) { + $array[$propertyName] = $propertyValue->format(DATE_ATOM); + // If it's an array type we should check whether it contains objects and if so call toArray method + } elseif (is_array($propertyValue)) { + $array[$propertyName] = array_map(function ($item) { + return $item instanceof ModelInterface ? $item->toArray() : $item; + }, $propertyValue); + } else { + // Otherwise, directly assign the property value to the array + $array[$propertyName] = $propertyValue; + } + } + } + return $array; + } + /** * Gets the string presentation of the object * diff --git a/src/Adyen/Model/Checkout/ApplePaySessionResponse.php b/src/Adyen/Model/Checkout/ApplePaySessionResponse.php index 3edcd83dd..a8fa4967b 100644 --- a/src/Adyen/Model/Checkout/ApplePaySessionResponse.php +++ b/src/Adyen/Model/Checkout/ApplePaySessionResponse.php @@ -5,7 +5,7 @@ * * The version of the OpenAPI document: 71 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 6.0.1 + * OpenAPI Generator version: 6.4.0 * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -372,6 +372,32 @@ public function jsonSerialize() return ObjectSerializer::sanitizeForSerialization($this); } + public function toArray(): array + { + $array = []; + foreach (self::$openAPITypes as $propertyName => $propertyType) { + $propertyValue = $this[$propertyName]; + if ($propertyValue !== null) { + // Check if the property value is an object and has a toArray() method + if (is_object($propertyValue) && method_exists($propertyValue, 'toArray')) { + $array[$propertyName] = $propertyValue->toArray(); + // Check if it's type datetime + } elseif ($propertyValue instanceof \DateTime) { + $array[$propertyName] = $propertyValue->format(DATE_ATOM); + // If it's an array type we should check whether it contains objects and if so call toArray method + } elseif (is_array($propertyValue)) { + $array[$propertyName] = array_map(function ($item) { + return $item instanceof ModelInterface ? $item->toArray() : $item; + }, $propertyValue); + } else { + // Otherwise, directly assign the property value to the array + $array[$propertyName] = $propertyValue; + } + } + } + return $array; + } + /** * Gets the string presentation of the object * diff --git a/src/Adyen/Model/Checkout/ApplicationInfo.php b/src/Adyen/Model/Checkout/ApplicationInfo.php index 8caca5b79..4c0c5d014 100644 --- a/src/Adyen/Model/Checkout/ApplicationInfo.php +++ b/src/Adyen/Model/Checkout/ApplicationInfo.php @@ -5,7 +5,7 @@ * * The version of the OpenAPI document: 71 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 6.0.1 + * OpenAPI Generator version: 6.4.0 * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -539,6 +539,32 @@ public function jsonSerialize() return ObjectSerializer::sanitizeForSerialization($this); } + public function toArray(): array + { + $array = []; + foreach (self::$openAPITypes as $propertyName => $propertyType) { + $propertyValue = $this[$propertyName]; + if ($propertyValue !== null) { + // Check if the property value is an object and has a toArray() method + if (is_object($propertyValue) && method_exists($propertyValue, 'toArray')) { + $array[$propertyName] = $propertyValue->toArray(); + // Check if it's type datetime + } elseif ($propertyValue instanceof \DateTime) { + $array[$propertyName] = $propertyValue->format(DATE_ATOM); + // If it's an array type we should check whether it contains objects and if so call toArray method + } elseif (is_array($propertyValue)) { + $array[$propertyName] = array_map(function ($item) { + return $item instanceof ModelInterface ? $item->toArray() : $item; + }, $propertyValue); + } else { + // Otherwise, directly assign the property value to the array + $array[$propertyName] = $propertyValue; + } + } + } + return $array; + } + /** * Gets the string presentation of the object * diff --git a/src/Adyen/Model/Checkout/AuthenticationData.php b/src/Adyen/Model/Checkout/AuthenticationData.php index 0fd4f769d..0cd2af6ee 100644 --- a/src/Adyen/Model/Checkout/AuthenticationData.php +++ b/src/Adyen/Model/Checkout/AuthenticationData.php @@ -5,7 +5,7 @@ * * The version of the OpenAPI document: 71 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 6.0.1 + * OpenAPI Generator version: 6.4.0 * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -470,6 +470,32 @@ public function jsonSerialize() return ObjectSerializer::sanitizeForSerialization($this); } + public function toArray(): array + { + $array = []; + foreach (self::$openAPITypes as $propertyName => $propertyType) { + $propertyValue = $this[$propertyName]; + if ($propertyValue !== null) { + // Check if the property value is an object and has a toArray() method + if (is_object($propertyValue) && method_exists($propertyValue, 'toArray')) { + $array[$propertyName] = $propertyValue->toArray(); + // Check if it's type datetime + } elseif ($propertyValue instanceof \DateTime) { + $array[$propertyName] = $propertyValue->format(DATE_ATOM); + // If it's an array type we should check whether it contains objects and if so call toArray method + } elseif (is_array($propertyValue)) { + $array[$propertyName] = array_map(function ($item) { + return $item instanceof ModelInterface ? $item->toArray() : $item; + }, $propertyValue); + } else { + // Otherwise, directly assign the property value to the array + $array[$propertyName] = $propertyValue; + } + } + } + return $array; + } + /** * Gets the string presentation of the object * diff --git a/src/Adyen/Model/Checkout/Avs.php b/src/Adyen/Model/Checkout/Avs.php index a19609fd6..d80a02412 100644 --- a/src/Adyen/Model/Checkout/Avs.php +++ b/src/Adyen/Model/Checkout/Avs.php @@ -5,7 +5,7 @@ * * The version of the OpenAPI document: 71 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 6.0.1 + * OpenAPI Generator version: 6.4.0 * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -438,6 +438,32 @@ public function jsonSerialize() return ObjectSerializer::sanitizeForSerialization($this); } + public function toArray(): array + { + $array = []; + foreach (self::$openAPITypes as $propertyName => $propertyType) { + $propertyValue = $this[$propertyName]; + if ($propertyValue !== null) { + // Check if the property value is an object and has a toArray() method + if (is_object($propertyValue) && method_exists($propertyValue, 'toArray')) { + $array[$propertyName] = $propertyValue->toArray(); + // Check if it's type datetime + } elseif ($propertyValue instanceof \DateTime) { + $array[$propertyName] = $propertyValue->format(DATE_ATOM); + // If it's an array type we should check whether it contains objects and if so call toArray method + } elseif (is_array($propertyValue)) { + $array[$propertyName] = array_map(function ($item) { + return $item instanceof ModelInterface ? $item->toArray() : $item; + }, $propertyValue); + } else { + // Otherwise, directly assign the property value to the array + $array[$propertyName] = $propertyValue; + } + } + } + return $array; + } + /** * Gets the string presentation of the object * diff --git a/src/Adyen/Model/Checkout/BacsDirectDebitDetails.php b/src/Adyen/Model/Checkout/BacsDirectDebitDetails.php index fb75f9c41..303f20107 100644 --- a/src/Adyen/Model/Checkout/BacsDirectDebitDetails.php +++ b/src/Adyen/Model/Checkout/BacsDirectDebitDetails.php @@ -5,7 +5,7 @@ * * The version of the OpenAPI document: 71 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 6.0.1 + * OpenAPI Generator version: 6.4.0 * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -606,6 +606,32 @@ public function jsonSerialize() return ObjectSerializer::sanitizeForSerialization($this); } + public function toArray(): array + { + $array = []; + foreach (self::$openAPITypes as $propertyName => $propertyType) { + $propertyValue = $this[$propertyName]; + if ($propertyValue !== null) { + // Check if the property value is an object and has a toArray() method + if (is_object($propertyValue) && method_exists($propertyValue, 'toArray')) { + $array[$propertyName] = $propertyValue->toArray(); + // Check if it's type datetime + } elseif ($propertyValue instanceof \DateTime) { + $array[$propertyName] = $propertyValue->format(DATE_ATOM); + // If it's an array type we should check whether it contains objects and if so call toArray method + } elseif (is_array($propertyValue)) { + $array[$propertyName] = array_map(function ($item) { + return $item instanceof ModelInterface ? $item->toArray() : $item; + }, $propertyValue); + } else { + // Otherwise, directly assign the property value to the array + $array[$propertyName] = $propertyValue; + } + } + } + return $array; + } + /** * Gets the string presentation of the object * diff --git a/src/Adyen/Model/Checkout/BalanceCheckRequest.php b/src/Adyen/Model/Checkout/BalanceCheckRequest.php index bdb0c91ab..ef4e4d8c2 100644 --- a/src/Adyen/Model/Checkout/BalanceCheckRequest.php +++ b/src/Adyen/Model/Checkout/BalanceCheckRequest.php @@ -5,7 +5,7 @@ * * The version of the OpenAPI document: 71 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 6.0.1 + * OpenAPI Generator version: 6.4.0 * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -1693,7 +1693,7 @@ public function getStore() /** * Sets store * - * @param string|null $store Required for Adyen for Platforms integrations if you have a platform setup. This is your [reference](https://docs.adyen.com/api-explorer/Management/3/post/merchants/(merchantId)/stores#request-reference) (on [balance platform](https://docs.adyen.com/marketplaces-and-platforms/classic/platforms-for-partners#route-payments)) or the [storeReference](https://docs.adyen.com/api-explorer/Account/latest/post/updateAccountHolder#request-accountHolderDetails-storeDetails-storeReference) (in the [classic integration](https://docs.adyen.com/marketplaces-and-platforms/processing-payments/route-payment-to-store/#route-a-payment-to-a-store)) for the ecommerce or point-of-sale store that is processing the payment. + * @param string|null $store The ecommerce or point-of-sale store that is processing the payment. Used in: * [Partner platform integrations](https://docs.adyen.com/marketplaces-and-platforms/classic/platforms-for-partners#route-payments) for the [Classic Platforms integration](https://docs.adyen.com/marketplaces-and-platforms/classic). * [Platform setup integrations](https://docs.adyen.com/marketplaces-and-platforms/additional-for-platform-setup/route-payment-to-store) for the [Balance Platform](https://docs.adyen.com/marketplaces-and-platforms). * * @return self */ @@ -1910,6 +1910,32 @@ public function jsonSerialize() return ObjectSerializer::sanitizeForSerialization($this); } + public function toArray(): array + { + $array = []; + foreach (self::$openAPITypes as $propertyName => $propertyType) { + $propertyValue = $this[$propertyName]; + if ($propertyValue !== null) { + // Check if the property value is an object and has a toArray() method + if (is_object($propertyValue) && method_exists($propertyValue, 'toArray')) { + $array[$propertyName] = $propertyValue->toArray(); + // Check if it's type datetime + } elseif ($propertyValue instanceof \DateTime) { + $array[$propertyName] = $propertyValue->format(DATE_ATOM); + // If it's an array type we should check whether it contains objects and if so call toArray method + } elseif (is_array($propertyValue)) { + $array[$propertyName] = array_map(function ($item) { + return $item instanceof ModelInterface ? $item->toArray() : $item; + }, $propertyValue); + } else { + // Otherwise, directly assign the property value to the array + $array[$propertyName] = $propertyValue; + } + } + } + return $array; + } + /** * Gets the string presentation of the object * diff --git a/src/Adyen/Model/Checkout/BalanceCheckResponse.php b/src/Adyen/Model/Checkout/BalanceCheckResponse.php index f6e9a3722..a9720e0e7 100644 --- a/src/Adyen/Model/Checkout/BalanceCheckResponse.php +++ b/src/Adyen/Model/Checkout/BalanceCheckResponse.php @@ -5,7 +5,7 @@ * * The version of the OpenAPI document: 71 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 6.0.1 + * OpenAPI Generator version: 6.4.0 * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -614,6 +614,32 @@ public function jsonSerialize() return ObjectSerializer::sanitizeForSerialization($this); } + public function toArray(): array + { + $array = []; + foreach (self::$openAPITypes as $propertyName => $propertyType) { + $propertyValue = $this[$propertyName]; + if ($propertyValue !== null) { + // Check if the property value is an object and has a toArray() method + if (is_object($propertyValue) && method_exists($propertyValue, 'toArray')) { + $array[$propertyName] = $propertyValue->toArray(); + // Check if it's type datetime + } elseif ($propertyValue instanceof \DateTime) { + $array[$propertyName] = $propertyValue->format(DATE_ATOM); + // If it's an array type we should check whether it contains objects and if so call toArray method + } elseif (is_array($propertyValue)) { + $array[$propertyName] = array_map(function ($item) { + return $item instanceof ModelInterface ? $item->toArray() : $item; + }, $propertyValue); + } else { + // Otherwise, directly assign the property value to the array + $array[$propertyName] = $propertyValue; + } + } + } + return $array; + } + /** * Gets the string presentation of the object * diff --git a/src/Adyen/Model/Checkout/BankAccount.php b/src/Adyen/Model/Checkout/BankAccount.php index 01a3f510f..909c20cd2 100644 --- a/src/Adyen/Model/Checkout/BankAccount.php +++ b/src/Adyen/Model/Checkout/BankAccount.php @@ -5,7 +5,7 @@ * * The version of the OpenAPI document: 71 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 6.0.1 + * OpenAPI Generator version: 6.4.0 * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -641,6 +641,32 @@ public function jsonSerialize() return ObjectSerializer::sanitizeForSerialization($this); } + public function toArray(): array + { + $array = []; + foreach (self::$openAPITypes as $propertyName => $propertyType) { + $propertyValue = $this[$propertyName]; + if ($propertyValue !== null) { + // Check if the property value is an object and has a toArray() method + if (is_object($propertyValue) && method_exists($propertyValue, 'toArray')) { + $array[$propertyName] = $propertyValue->toArray(); + // Check if it's type datetime + } elseif ($propertyValue instanceof \DateTime) { + $array[$propertyName] = $propertyValue->format(DATE_ATOM); + // If it's an array type we should check whether it contains objects and if so call toArray method + } elseif (is_array($propertyValue)) { + $array[$propertyName] = array_map(function ($item) { + return $item instanceof ModelInterface ? $item->toArray() : $item; + }, $propertyValue); + } else { + // Otherwise, directly assign the property value to the array + $array[$propertyName] = $propertyValue; + } + } + } + return $array; + } + /** * Gets the string presentation of the object * diff --git a/src/Adyen/Model/Checkout/BillDeskDetails.php b/src/Adyen/Model/Checkout/BillDeskDetails.php index e676453fd..d58730905 100644 --- a/src/Adyen/Model/Checkout/BillDeskDetails.php +++ b/src/Adyen/Model/Checkout/BillDeskDetails.php @@ -5,7 +5,7 @@ * * The version of the OpenAPI document: 71 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 6.0.1 + * OpenAPI Generator version: 6.4.0 * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -227,8 +227,10 @@ public function getModelName() return self::$openAPIModelName; } - public const TYPE_ONLINE = 'billdesk_online'; - public const TYPE_WALLET = 'billdesk_wallet'; + public const TYPE_BILLDESK_ONLINE = 'billdesk_online'; + public const TYPE_BILLDESK_WALLET = 'billdesk_wallet'; + public const TYPE_ONLINEBANKING_IN = 'onlinebanking_IN'; + public const TYPE_WALLET_IN = 'wallet_IN'; /** * Gets allowable values of the enum @@ -238,8 +240,10 @@ public function getModelName() public function getTypeAllowableValues() { return [ - self::TYPE_ONLINE, - self::TYPE_WALLET, + self::TYPE_BILLDESK_ONLINE, + self::TYPE_BILLDESK_WALLET, + self::TYPE_ONLINEBANKING_IN, + self::TYPE_WALLET_IN, ]; } /** @@ -476,6 +480,32 @@ public function jsonSerialize() return ObjectSerializer::sanitizeForSerialization($this); } + public function toArray(): array + { + $array = []; + foreach (self::$openAPITypes as $propertyName => $propertyType) { + $propertyValue = $this[$propertyName]; + if ($propertyValue !== null) { + // Check if the property value is an object and has a toArray() method + if (is_object($propertyValue) && method_exists($propertyValue, 'toArray')) { + $array[$propertyName] = $propertyValue->toArray(); + // Check if it's type datetime + } elseif ($propertyValue instanceof \DateTime) { + $array[$propertyName] = $propertyValue->format(DATE_ATOM); + // If it's an array type we should check whether it contains objects and if so call toArray method + } elseif (is_array($propertyValue)) { + $array[$propertyName] = array_map(function ($item) { + return $item instanceof ModelInterface ? $item->toArray() : $item; + }, $propertyValue); + } else { + // Otherwise, directly assign the property value to the array + $array[$propertyName] = $propertyValue; + } + } + } + return $array; + } + /** * Gets the string presentation of the object * diff --git a/src/Adyen/Model/Checkout/BillingAddress.php b/src/Adyen/Model/Checkout/BillingAddress.php index a060c1e20..08a5f7620 100644 --- a/src/Adyen/Model/Checkout/BillingAddress.php +++ b/src/Adyen/Model/Checkout/BillingAddress.php @@ -5,7 +5,7 @@ * * The version of the OpenAPI document: 71 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 6.0.1 + * OpenAPI Generator version: 6.4.0 * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -554,6 +554,32 @@ public function jsonSerialize() return ObjectSerializer::sanitizeForSerialization($this); } + public function toArray(): array + { + $array = []; + foreach (self::$openAPITypes as $propertyName => $propertyType) { + $propertyValue = $this[$propertyName]; + if ($propertyValue !== null) { + // Check if the property value is an object and has a toArray() method + if (is_object($propertyValue) && method_exists($propertyValue, 'toArray')) { + $array[$propertyName] = $propertyValue->toArray(); + // Check if it's type datetime + } elseif ($propertyValue instanceof \DateTime) { + $array[$propertyName] = $propertyValue->format(DATE_ATOM); + // If it's an array type we should check whether it contains objects and if so call toArray method + } elseif (is_array($propertyValue)) { + $array[$propertyName] = array_map(function ($item) { + return $item instanceof ModelInterface ? $item->toArray() : $item; + }, $propertyValue); + } else { + // Otherwise, directly assign the property value to the array + $array[$propertyName] = $propertyValue; + } + } + } + return $array; + } + /** * Gets the string presentation of the object * diff --git a/src/Adyen/Model/Checkout/BlikDetails.php b/src/Adyen/Model/Checkout/BlikDetails.php index 635e73ef7..596e61821 100644 --- a/src/Adyen/Model/Checkout/BlikDetails.php +++ b/src/Adyen/Model/Checkout/BlikDetails.php @@ -5,7 +5,7 @@ * * The version of the OpenAPI document: 71 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 6.0.1 + * OpenAPI Generator version: 6.4.0 * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -538,6 +538,32 @@ public function jsonSerialize() return ObjectSerializer::sanitizeForSerialization($this); } + public function toArray(): array + { + $array = []; + foreach (self::$openAPITypes as $propertyName => $propertyType) { + $propertyValue = $this[$propertyName]; + if ($propertyValue !== null) { + // Check if the property value is an object and has a toArray() method + if (is_object($propertyValue) && method_exists($propertyValue, 'toArray')) { + $array[$propertyName] = $propertyValue->toArray(); + // Check if it's type datetime + } elseif ($propertyValue instanceof \DateTime) { + $array[$propertyName] = $propertyValue->format(DATE_ATOM); + // If it's an array type we should check whether it contains objects and if so call toArray method + } elseif (is_array($propertyValue)) { + $array[$propertyName] = array_map(function ($item) { + return $item instanceof ModelInterface ? $item->toArray() : $item; + }, $propertyValue); + } else { + // Otherwise, directly assign the property value to the array + $array[$propertyName] = $propertyValue; + } + } + } + return $array; + } + /** * Gets the string presentation of the object * diff --git a/src/Adyen/Model/Checkout/BrowserInfo.php b/src/Adyen/Model/Checkout/BrowserInfo.php index f1af627f0..1356ea750 100644 --- a/src/Adyen/Model/Checkout/BrowserInfo.php +++ b/src/Adyen/Model/Checkout/BrowserInfo.php @@ -5,7 +5,7 @@ * * The version of the OpenAPI document: 71 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 6.0.1 + * OpenAPI Generator version: 6.4.0 * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -657,6 +657,32 @@ public function jsonSerialize() return ObjectSerializer::sanitizeForSerialization($this); } + public function toArray(): array + { + $array = []; + foreach (self::$openAPITypes as $propertyName => $propertyType) { + $propertyValue = $this[$propertyName]; + if ($propertyValue !== null) { + // Check if the property value is an object and has a toArray() method + if (is_object($propertyValue) && method_exists($propertyValue, 'toArray')) { + $array[$propertyName] = $propertyValue->toArray(); + // Check if it's type datetime + } elseif ($propertyValue instanceof \DateTime) { + $array[$propertyName] = $propertyValue->format(DATE_ATOM); + // If it's an array type we should check whether it contains objects and if so call toArray method + } elseif (is_array($propertyValue)) { + $array[$propertyName] = array_map(function ($item) { + return $item instanceof ModelInterface ? $item->toArray() : $item; + }, $propertyValue); + } else { + // Otherwise, directly assign the property value to the array + $array[$propertyName] = $propertyValue; + } + } + } + return $array; + } + /** * Gets the string presentation of the object * diff --git a/src/Adyen/Model/Checkout/CancelOrderRequest.php b/src/Adyen/Model/Checkout/CancelOrderRequest.php index 1f1ece2aa..61691fad1 100644 --- a/src/Adyen/Model/Checkout/CancelOrderRequest.php +++ b/src/Adyen/Model/Checkout/CancelOrderRequest.php @@ -5,7 +5,7 @@ * * The version of the OpenAPI document: 71 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 6.0.1 + * OpenAPI Generator version: 6.4.0 * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -409,6 +409,32 @@ public function jsonSerialize() return ObjectSerializer::sanitizeForSerialization($this); } + public function toArray(): array + { + $array = []; + foreach (self::$openAPITypes as $propertyName => $propertyType) { + $propertyValue = $this[$propertyName]; + if ($propertyValue !== null) { + // Check if the property value is an object and has a toArray() method + if (is_object($propertyValue) && method_exists($propertyValue, 'toArray')) { + $array[$propertyName] = $propertyValue->toArray(); + // Check if it's type datetime + } elseif ($propertyValue instanceof \DateTime) { + $array[$propertyName] = $propertyValue->format(DATE_ATOM); + // If it's an array type we should check whether it contains objects and if so call toArray method + } elseif (is_array($propertyValue)) { + $array[$propertyName] = array_map(function ($item) { + return $item instanceof ModelInterface ? $item->toArray() : $item; + }, $propertyValue); + } else { + // Otherwise, directly assign the property value to the array + $array[$propertyName] = $propertyValue; + } + } + } + return $array; + } + /** * Gets the string presentation of the object * diff --git a/src/Adyen/Model/Checkout/CancelOrderResponse.php b/src/Adyen/Model/Checkout/CancelOrderResponse.php index 57dd3143f..bf07b0e70 100644 --- a/src/Adyen/Model/Checkout/CancelOrderResponse.php +++ b/src/Adyen/Model/Checkout/CancelOrderResponse.php @@ -5,7 +5,7 @@ * * The version of the OpenAPI document: 71 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 6.0.1 + * OpenAPI Generator version: 6.4.0 * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -440,6 +440,32 @@ public function jsonSerialize() return ObjectSerializer::sanitizeForSerialization($this); } + public function toArray(): array + { + $array = []; + foreach (self::$openAPITypes as $propertyName => $propertyType) { + $propertyValue = $this[$propertyName]; + if ($propertyValue !== null) { + // Check if the property value is an object and has a toArray() method + if (is_object($propertyValue) && method_exists($propertyValue, 'toArray')) { + $array[$propertyName] = $propertyValue->toArray(); + // Check if it's type datetime + } elseif ($propertyValue instanceof \DateTime) { + $array[$propertyName] = $propertyValue->format(DATE_ATOM); + // If it's an array type we should check whether it contains objects and if so call toArray method + } elseif (is_array($propertyValue)) { + $array[$propertyName] = array_map(function ($item) { + return $item instanceof ModelInterface ? $item->toArray() : $item; + }, $propertyValue); + } else { + // Otherwise, directly assign the property value to the array + $array[$propertyName] = $propertyValue; + } + } + } + return $array; + } + /** * Gets the string presentation of the object * diff --git a/src/Adyen/Model/Checkout/Card.php b/src/Adyen/Model/Checkout/Card.php index 2c7659fa2..56ed6fa41 100644 --- a/src/Adyen/Model/Checkout/Card.php +++ b/src/Adyen/Model/Checkout/Card.php @@ -5,7 +5,7 @@ * * The version of the OpenAPI document: 71 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 6.0.1 + * OpenAPI Generator version: 6.4.0 * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -607,6 +607,32 @@ public function jsonSerialize() return ObjectSerializer::sanitizeForSerialization($this); } + public function toArray(): array + { + $array = []; + foreach (self::$openAPITypes as $propertyName => $propertyType) { + $propertyValue = $this[$propertyName]; + if ($propertyValue !== null) { + // Check if the property value is an object and has a toArray() method + if (is_object($propertyValue) && method_exists($propertyValue, 'toArray')) { + $array[$propertyName] = $propertyValue->toArray(); + // Check if it's type datetime + } elseif ($propertyValue instanceof \DateTime) { + $array[$propertyName] = $propertyValue->format(DATE_ATOM); + // If it's an array type we should check whether it contains objects and if so call toArray method + } elseif (is_array($propertyValue)) { + $array[$propertyName] = array_map(function ($item) { + return $item instanceof ModelInterface ? $item->toArray() : $item; + }, $propertyValue); + } else { + // Otherwise, directly assign the property value to the array + $array[$propertyName] = $propertyValue; + } + } + } + return $array; + } + /** * Gets the string presentation of the object * diff --git a/src/Adyen/Model/Checkout/CardBrandDetails.php b/src/Adyen/Model/Checkout/CardBrandDetails.php index 114393cec..f092506d3 100644 --- a/src/Adyen/Model/Checkout/CardBrandDetails.php +++ b/src/Adyen/Model/Checkout/CardBrandDetails.php @@ -5,7 +5,7 @@ * * The version of the OpenAPI document: 71 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 6.0.1 + * OpenAPI Generator version: 6.4.0 * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -403,6 +403,32 @@ public function jsonSerialize() return ObjectSerializer::sanitizeForSerialization($this); } + public function toArray(): array + { + $array = []; + foreach (self::$openAPITypes as $propertyName => $propertyType) { + $propertyValue = $this[$propertyName]; + if ($propertyValue !== null) { + // Check if the property value is an object and has a toArray() method + if (is_object($propertyValue) && method_exists($propertyValue, 'toArray')) { + $array[$propertyName] = $propertyValue->toArray(); + // Check if it's type datetime + } elseif ($propertyValue instanceof \DateTime) { + $array[$propertyName] = $propertyValue->format(DATE_ATOM); + // If it's an array type we should check whether it contains objects and if so call toArray method + } elseif (is_array($propertyValue)) { + $array[$propertyName] = array_map(function ($item) { + return $item instanceof ModelInterface ? $item->toArray() : $item; + }, $propertyValue); + } else { + // Otherwise, directly assign the property value to the array + $array[$propertyName] = $propertyValue; + } + } + } + return $array; + } + /** * Gets the string presentation of the object * diff --git a/src/Adyen/Model/Checkout/CardDetails.php b/src/Adyen/Model/Checkout/CardDetails.php index a5d5b8384..2ae33c582 100644 --- a/src/Adyen/Model/Checkout/CardDetails.php +++ b/src/Adyen/Model/Checkout/CardDetails.php @@ -5,7 +5,7 @@ * * The version of the OpenAPI document: 71 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 6.0.1 + * OpenAPI Generator version: 6.4.0 * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -323,12 +323,9 @@ public function getModelName() return self::$openAPIModelName; } - public const FUNDING_SOURCE_CREDIT = 'credit'; public const FUNDING_SOURCE_DEBIT = 'debit'; - public const TYPE_BCMC = 'bcmc'; public const TYPE_SCHEME = 'scheme'; public const TYPE_NETWORK_TOKEN = 'networkToken'; - public const TYPE_GIFTCARD = 'giftcard'; public const TYPE_CARD = 'card'; /** @@ -339,7 +336,6 @@ public function getModelName() public function getFundingSourceAllowableValues() { return [ - self::FUNDING_SOURCE_CREDIT, self::FUNDING_SOURCE_DEBIT, ]; } @@ -351,10 +347,8 @@ public function getFundingSourceAllowableValues() public function getTypeAllowableValues() { return [ - self::TYPE_BCMC, self::TYPE_SCHEME, self::TYPE_NETWORK_TOKEN, - self::TYPE_GIFTCARD, self::TYPE_CARD, ]; } @@ -1057,6 +1051,32 @@ public function jsonSerialize() return ObjectSerializer::sanitizeForSerialization($this); } + public function toArray(): array + { + $array = []; + foreach (self::$openAPITypes as $propertyName => $propertyType) { + $propertyValue = $this[$propertyName]; + if ($propertyValue !== null) { + // Check if the property value is an object and has a toArray() method + if (is_object($propertyValue) && method_exists($propertyValue, 'toArray')) { + $array[$propertyName] = $propertyValue->toArray(); + // Check if it's type datetime + } elseif ($propertyValue instanceof \DateTime) { + $array[$propertyName] = $propertyValue->format(DATE_ATOM); + // If it's an array type we should check whether it contains objects and if so call toArray method + } elseif (is_array($propertyValue)) { + $array[$propertyName] = array_map(function ($item) { + return $item instanceof ModelInterface ? $item->toArray() : $item; + }, $propertyValue); + } else { + // Otherwise, directly assign the property value to the array + $array[$propertyName] = $propertyValue; + } + } + } + return $array; + } + /** * Gets the string presentation of the object * diff --git a/src/Adyen/Model/Checkout/CardDetailsRequest.php b/src/Adyen/Model/Checkout/CardDetailsRequest.php index 1d50f1559..5285a9b0d 100644 --- a/src/Adyen/Model/Checkout/CardDetailsRequest.php +++ b/src/Adyen/Model/Checkout/CardDetailsRequest.php @@ -5,7 +5,7 @@ * * The version of the OpenAPI document: 71 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 6.0.1 + * OpenAPI Generator version: 6.4.0 * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -511,6 +511,32 @@ public function jsonSerialize() return ObjectSerializer::sanitizeForSerialization($this); } + public function toArray(): array + { + $array = []; + foreach (self::$openAPITypes as $propertyName => $propertyType) { + $propertyValue = $this[$propertyName]; + if ($propertyValue !== null) { + // Check if the property value is an object and has a toArray() method + if (is_object($propertyValue) && method_exists($propertyValue, 'toArray')) { + $array[$propertyName] = $propertyValue->toArray(); + // Check if it's type datetime + } elseif ($propertyValue instanceof \DateTime) { + $array[$propertyName] = $propertyValue->format(DATE_ATOM); + // If it's an array type we should check whether it contains objects and if so call toArray method + } elseif (is_array($propertyValue)) { + $array[$propertyName] = array_map(function ($item) { + return $item instanceof ModelInterface ? $item->toArray() : $item; + }, $propertyValue); + } else { + // Otherwise, directly assign the property value to the array + $array[$propertyName] = $propertyValue; + } + } + } + return $array; + } + /** * Gets the string presentation of the object * diff --git a/src/Adyen/Model/Checkout/CardDetailsResponse.php b/src/Adyen/Model/Checkout/CardDetailsResponse.php index cc6c71a1f..af3fc80ce 100644 --- a/src/Adyen/Model/Checkout/CardDetailsResponse.php +++ b/src/Adyen/Model/Checkout/CardDetailsResponse.php @@ -5,7 +5,7 @@ * * The version of the OpenAPI document: 71 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 6.0.1 + * OpenAPI Generator version: 6.4.0 * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -369,6 +369,32 @@ public function jsonSerialize() return ObjectSerializer::sanitizeForSerialization($this); } + public function toArray(): array + { + $array = []; + foreach (self::$openAPITypes as $propertyName => $propertyType) { + $propertyValue = $this[$propertyName]; + if ($propertyValue !== null) { + // Check if the property value is an object and has a toArray() method + if (is_object($propertyValue) && method_exists($propertyValue, 'toArray')) { + $array[$propertyName] = $propertyValue->toArray(); + // Check if it's type datetime + } elseif ($propertyValue instanceof \DateTime) { + $array[$propertyName] = $propertyValue->format(DATE_ATOM); + // If it's an array type we should check whether it contains objects and if so call toArray method + } elseif (is_array($propertyValue)) { + $array[$propertyName] = array_map(function ($item) { + return $item instanceof ModelInterface ? $item->toArray() : $item; + }, $propertyValue); + } else { + // Otherwise, directly assign the property value to the array + $array[$propertyName] = $propertyValue; + } + } + } + return $array; + } + /** * Gets the string presentation of the object * diff --git a/src/Adyen/Model/Checkout/CardDonations.php b/src/Adyen/Model/Checkout/CardDonations.php deleted file mode 100644 index 56e236e97..000000000 --- a/src/Adyen/Model/Checkout/CardDonations.php +++ /dev/null @@ -1,1072 +0,0 @@ - - */ -class CardDonations implements ModelInterface, ArrayAccess, \JsonSerializable -{ - public const DISCRIMINATOR = null; - - /** - * The original name of the model. - * - * @var string - */ - protected static $openAPIModelName = 'CardDonations'; - - /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ - protected static $openAPITypes = [ - 'brand' => 'string', - 'checkoutAttemptId' => 'string', - 'cupsecureplusSmscode' => 'string', - 'cvc' => 'string', - 'encryptedCardNumber' => 'string', - 'encryptedExpiryMonth' => 'string', - 'encryptedExpiryYear' => 'string', - 'encryptedSecurityCode' => 'string', - 'expiryMonth' => 'string', - 'expiryYear' => 'string', - 'fundingSource' => 'string', - 'holderName' => 'string', - 'networkPaymentReference' => 'string', - 'number' => 'string', - 'recurringDetailReference' => 'string', - 'shopperNotificationReference' => 'string', - 'storedPaymentMethodId' => 'string', - 'threeDS2SdkVersion' => 'string', - 'type' => 'string' - ]; - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ - protected static $openAPIFormats = [ - 'brand' => null, - 'checkoutAttemptId' => null, - 'cupsecureplusSmscode' => null, - 'cvc' => null, - 'encryptedCardNumber' => null, - 'encryptedExpiryMonth' => null, - 'encryptedExpiryYear' => null, - 'encryptedSecurityCode' => null, - 'expiryMonth' => null, - 'expiryYear' => null, - 'fundingSource' => null, - 'holderName' => null, - 'networkPaymentReference' => null, - 'number' => null, - 'recurringDetailReference' => null, - 'shopperNotificationReference' => null, - 'storedPaymentMethodId' => null, - 'threeDS2SdkVersion' => null, - 'type' => null - ]; - - /** - * Array of nullable properties. Used for (de)serialization - * - * @var boolean[] - */ - protected static $openAPINullables = [ - 'brand' => false, - 'checkoutAttemptId' => false, - 'cupsecureplusSmscode' => false, - 'cvc' => false, - 'encryptedCardNumber' => false, - 'encryptedExpiryMonth' => false, - 'encryptedExpiryYear' => false, - 'encryptedSecurityCode' => false, - 'expiryMonth' => false, - 'expiryYear' => false, - 'fundingSource' => false, - 'holderName' => false, - 'networkPaymentReference' => false, - 'number' => false, - 'recurringDetailReference' => false, - 'shopperNotificationReference' => false, - 'storedPaymentMethodId' => false, - 'threeDS2SdkVersion' => false, - '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 = [ - 'brand' => 'brand', - 'checkoutAttemptId' => 'checkoutAttemptId', - 'cupsecureplusSmscode' => 'cupsecureplus.smscode', - 'cvc' => 'cvc', - 'encryptedCardNumber' => 'encryptedCardNumber', - 'encryptedExpiryMonth' => 'encryptedExpiryMonth', - 'encryptedExpiryYear' => 'encryptedExpiryYear', - 'encryptedSecurityCode' => 'encryptedSecurityCode', - 'expiryMonth' => 'expiryMonth', - 'expiryYear' => 'expiryYear', - 'fundingSource' => 'fundingSource', - 'holderName' => 'holderName', - 'networkPaymentReference' => 'networkPaymentReference', - 'number' => 'number', - 'recurringDetailReference' => 'recurringDetailReference', - 'shopperNotificationReference' => 'shopperNotificationReference', - 'storedPaymentMethodId' => 'storedPaymentMethodId', - 'threeDS2SdkVersion' => 'threeDS2SdkVersion', - 'type' => 'type' - ]; - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @var string[] - */ - protected static $setters = [ - 'brand' => 'setBrand', - 'checkoutAttemptId' => 'setCheckoutAttemptId', - 'cupsecureplusSmscode' => 'setCupsecureplusSmscode', - 'cvc' => 'setCvc', - 'encryptedCardNumber' => 'setEncryptedCardNumber', - 'encryptedExpiryMonth' => 'setEncryptedExpiryMonth', - 'encryptedExpiryYear' => 'setEncryptedExpiryYear', - 'encryptedSecurityCode' => 'setEncryptedSecurityCode', - 'expiryMonth' => 'setExpiryMonth', - 'expiryYear' => 'setExpiryYear', - 'fundingSource' => 'setFundingSource', - 'holderName' => 'setHolderName', - 'networkPaymentReference' => 'setNetworkPaymentReference', - 'number' => 'setNumber', - 'recurringDetailReference' => 'setRecurringDetailReference', - 'shopperNotificationReference' => 'setShopperNotificationReference', - 'storedPaymentMethodId' => 'setStoredPaymentMethodId', - 'threeDS2SdkVersion' => 'setThreeDS2SdkVersion', - 'type' => 'setType' - ]; - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @var string[] - */ - protected static $getters = [ - 'brand' => 'getBrand', - 'checkoutAttemptId' => 'getCheckoutAttemptId', - 'cupsecureplusSmscode' => 'getCupsecureplusSmscode', - 'cvc' => 'getCvc', - 'encryptedCardNumber' => 'getEncryptedCardNumber', - 'encryptedExpiryMonth' => 'getEncryptedExpiryMonth', - 'encryptedExpiryYear' => 'getEncryptedExpiryYear', - 'encryptedSecurityCode' => 'getEncryptedSecurityCode', - 'expiryMonth' => 'getExpiryMonth', - 'expiryYear' => 'getExpiryYear', - 'fundingSource' => 'getFundingSource', - 'holderName' => 'getHolderName', - 'networkPaymentReference' => 'getNetworkPaymentReference', - 'number' => 'getNumber', - 'recurringDetailReference' => 'getRecurringDetailReference', - 'shopperNotificationReference' => 'getShopperNotificationReference', - 'storedPaymentMethodId' => 'getStoredPaymentMethodId', - 'threeDS2SdkVersion' => 'getThreeDS2SdkVersion', - 'type' => 'getType' - ]; - - /** - * 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; - } - - public const FUNDING_SOURCE_CREDIT = 'credit'; - public const FUNDING_SOURCE_DEBIT = 'debit'; - public const TYPE_BCMC = 'bcmc'; - public const TYPE_SCHEME = 'scheme'; - public const TYPE_NETWORK_TOKEN = 'networkToken'; - public const TYPE_GIFTCARD = 'giftcard'; - public const TYPE_CARD = 'card'; - - /** - * Gets allowable values of the enum - * - * @return string[] - */ - public function getFundingSourceAllowableValues() - { - return [ - self::FUNDING_SOURCE_CREDIT, - self::FUNDING_SOURCE_DEBIT, - ]; - } - /** - * Gets allowable values of the enum - * - * @return string[] - */ - public function getTypeAllowableValues() - { - return [ - self::TYPE_BCMC, - self::TYPE_SCHEME, - self::TYPE_NETWORK_TOKEN, - self::TYPE_GIFTCARD, - self::TYPE_CARD, - ]; - } - /** - * 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('brand', $data ?? [], null); - $this->setIfExists('checkoutAttemptId', $data ?? [], null); - $this->setIfExists('cupsecureplusSmscode', $data ?? [], null); - $this->setIfExists('cvc', $data ?? [], null); - $this->setIfExists('encryptedCardNumber', $data ?? [], null); - $this->setIfExists('encryptedExpiryMonth', $data ?? [], null); - $this->setIfExists('encryptedExpiryYear', $data ?? [], null); - $this->setIfExists('encryptedSecurityCode', $data ?? [], null); - $this->setIfExists('expiryMonth', $data ?? [], null); - $this->setIfExists('expiryYear', $data ?? [], null); - $this->setIfExists('fundingSource', $data ?? [], null); - $this->setIfExists('holderName', $data ?? [], null); - $this->setIfExists('networkPaymentReference', $data ?? [], null); - $this->setIfExists('number', $data ?? [], null); - $this->setIfExists('recurringDetailReference', $data ?? [], null); - $this->setIfExists('shopperNotificationReference', $data ?? [], null); - $this->setIfExists('storedPaymentMethodId', $data ?? [], null); - $this->setIfExists('threeDS2SdkVersion', $data ?? [], null); - $this->setIfExists('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 = []; - - $allowedValues = $this->getFundingSourceAllowableValues(); - if (!is_null($this->container['fundingSource']) && !in_array($this->container['fundingSource'], $allowedValues, true)) { - $invalidProperties[] = sprintf( - "invalid value '%s' for 'fundingSource', must be one of '%s'", - $this->container['fundingSource'], - implode("', '", $allowedValues) - ); - } - - $allowedValues = $this->getTypeAllowableValues(); - if (!is_null($this->container['type']) && !in_array($this->container['type'], $allowedValues, true)) { - $invalidProperties[] = sprintf( - "invalid value '%s' for 'type', must be one of '%s'", - $this->container['type'], - implode("', '", $allowedValues) - ); - } - - 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 brand - * - * @return string|null - */ - public function getBrand() - { - return $this->container['brand']; - } - - /** - * Sets brand - * - * @param string|null $brand Secondary brand of the card. For example: **plastix**, **hmclub**. - * - * @return self - */ - public function setBrand($brand) - { - if (is_null($brand)) { - throw new \InvalidArgumentException('non-nullable brand cannot be null'); - } - $this->container['brand'] = $brand; - - return $this; - } - - /** - * Gets checkoutAttemptId - * - * @return string|null - */ - public function getCheckoutAttemptId() - { - return $this->container['checkoutAttemptId']; - } - - /** - * Sets checkoutAttemptId - * - * @param string|null $checkoutAttemptId The checkout attempt identifier. - * - * @return self - */ - public function setCheckoutAttemptId($checkoutAttemptId) - { - if (is_null($checkoutAttemptId)) { - throw new \InvalidArgumentException('non-nullable checkoutAttemptId cannot be null'); - } - $this->container['checkoutAttemptId'] = $checkoutAttemptId; - - return $this; - } - - /** - * Gets cupsecureplusSmscode - * - * @return string|null - * @deprecated - */ - public function getCupsecureplusSmscode() - { - return $this->container['cupsecureplusSmscode']; - } - - /** - * Sets cupsecureplusSmscode - * - * @param string|null $cupsecureplusSmscode cupsecureplusSmscode - * - * @return self - * @deprecated - */ - public function setCupsecureplusSmscode($cupsecureplusSmscode) - { - if (is_null($cupsecureplusSmscode)) { - throw new \InvalidArgumentException('non-nullable cupsecureplusSmscode cannot be null'); - } - $this->container['cupsecureplusSmscode'] = $cupsecureplusSmscode; - - return $this; - } - - /** - * Gets cvc - * - * @return string|null - */ - public function getCvc() - { - return $this->container['cvc']; - } - - /** - * Sets cvc - * - * @param string|null $cvc The card verification code. Only collect raw card data if you are [fully PCI compliant](https://docs.adyen.com/development-resources/pci-dss-compliance-guide). - * - * @return self - */ - public function setCvc($cvc) - { - if (is_null($cvc)) { - throw new \InvalidArgumentException('non-nullable cvc cannot be null'); - } - $this->container['cvc'] = $cvc; - - return $this; - } - - /** - * Gets encryptedCardNumber - * - * @return string|null - */ - public function getEncryptedCardNumber() - { - return $this->container['encryptedCardNumber']; - } - - /** - * Sets encryptedCardNumber - * - * @param string|null $encryptedCardNumber The encrypted card number. - * - * @return self - */ - public function setEncryptedCardNumber($encryptedCardNumber) - { - if (is_null($encryptedCardNumber)) { - throw new \InvalidArgumentException('non-nullable encryptedCardNumber cannot be null'); - } - $this->container['encryptedCardNumber'] = $encryptedCardNumber; - - return $this; - } - - /** - * Gets encryptedExpiryMonth - * - * @return string|null - */ - public function getEncryptedExpiryMonth() - { - return $this->container['encryptedExpiryMonth']; - } - - /** - * Sets encryptedExpiryMonth - * - * @param string|null $encryptedExpiryMonth The encrypted card expiry month. - * - * @return self - */ - public function setEncryptedExpiryMonth($encryptedExpiryMonth) - { - if (is_null($encryptedExpiryMonth)) { - throw new \InvalidArgumentException('non-nullable encryptedExpiryMonth cannot be null'); - } - $this->container['encryptedExpiryMonth'] = $encryptedExpiryMonth; - - return $this; - } - - /** - * Gets encryptedExpiryYear - * - * @return string|null - */ - public function getEncryptedExpiryYear() - { - return $this->container['encryptedExpiryYear']; - } - - /** - * Sets encryptedExpiryYear - * - * @param string|null $encryptedExpiryYear The encrypted card expiry year. - * - * @return self - */ - public function setEncryptedExpiryYear($encryptedExpiryYear) - { - if (is_null($encryptedExpiryYear)) { - throw new \InvalidArgumentException('non-nullable encryptedExpiryYear cannot be null'); - } - $this->container['encryptedExpiryYear'] = $encryptedExpiryYear; - - return $this; - } - - /** - * Gets encryptedSecurityCode - * - * @return string|null - */ - public function getEncryptedSecurityCode() - { - return $this->container['encryptedSecurityCode']; - } - - /** - * Sets encryptedSecurityCode - * - * @param string|null $encryptedSecurityCode The encrypted card verification code. - * - * @return self - */ - public function setEncryptedSecurityCode($encryptedSecurityCode) - { - if (is_null($encryptedSecurityCode)) { - throw new \InvalidArgumentException('non-nullable encryptedSecurityCode cannot be null'); - } - $this->container['encryptedSecurityCode'] = $encryptedSecurityCode; - - return $this; - } - - /** - * Gets expiryMonth - * - * @return string|null - */ - public function getExpiryMonth() - { - return $this->container['expiryMonth']; - } - - /** - * Sets expiryMonth - * - * @param string|null $expiryMonth The card expiry month. Only collect raw card data if you are [fully PCI compliant](https://docs.adyen.com/development-resources/pci-dss-compliance-guide). - * - * @return self - */ - public function setExpiryMonth($expiryMonth) - { - if (is_null($expiryMonth)) { - throw new \InvalidArgumentException('non-nullable expiryMonth cannot be null'); - } - $this->container['expiryMonth'] = $expiryMonth; - - return $this; - } - - /** - * Gets expiryYear - * - * @return string|null - */ - public function getExpiryYear() - { - return $this->container['expiryYear']; - } - - /** - * Sets expiryYear - * - * @param string|null $expiryYear The card expiry year. Only collect raw card data if you are [fully PCI compliant](https://docs.adyen.com/development-resources/pci-dss-compliance-guide). - * - * @return self - */ - public function setExpiryYear($expiryYear) - { - if (is_null($expiryYear)) { - throw new \InvalidArgumentException('non-nullable expiryYear cannot be null'); - } - $this->container['expiryYear'] = $expiryYear; - - return $this; - } - - /** - * Gets fundingSource - * - * @return string|null - */ - public function getFundingSource() - { - return $this->container['fundingSource']; - } - - /** - * Sets fundingSource - * - * @param string|null $fundingSource The funding source that should be used when multiple sources are available. For Brazilian combo cards, by default the funding source is credit. To use debit, set this value to **debit**. - * - * @return self - */ - public function setFundingSource($fundingSource) - { - if (is_null($fundingSource)) { - throw new \InvalidArgumentException('non-nullable fundingSource cannot be null'); - } - $allowedValues = $this->getFundingSourceAllowableValues(); - if (!in_array($fundingSource, $allowedValues, true)) { - throw new \InvalidArgumentException( - sprintf( - "Invalid value '%s' for 'fundingSource', must be one of '%s'", - $fundingSource, - implode("', '", $allowedValues) - ) - ); - } - $this->container['fundingSource'] = $fundingSource; - - return $this; - } - - /** - * Gets holderName - * - * @return string|null - */ - public function getHolderName() - { - return $this->container['holderName']; - } - - /** - * Sets holderName - * - * @param string|null $holderName The name of the card holder. - * - * @return self - */ - public function setHolderName($holderName) - { - if (is_null($holderName)) { - throw new \InvalidArgumentException('non-nullable holderName cannot be null'); - } - $this->container['holderName'] = $holderName; - - return $this; - } - - /** - * Gets networkPaymentReference - * - * @return string|null - */ - public function getNetworkPaymentReference() - { - return $this->container['networkPaymentReference']; - } - - /** - * Sets networkPaymentReference - * - * @param string|null $networkPaymentReference The network token reference. This is the [`networkTxReference`](https://docs.adyen.com/api-explorer/#/CheckoutService/latest/post/payments__resParam_additionalData-ResponseAdditionalDataCommon-networkTxReference) from the response to the first payment. - * - * @return self - */ - public function setNetworkPaymentReference($networkPaymentReference) - { - if (is_null($networkPaymentReference)) { - throw new \InvalidArgumentException('non-nullable networkPaymentReference cannot be null'); - } - $this->container['networkPaymentReference'] = $networkPaymentReference; - - return $this; - } - - /** - * Gets number - * - * @return string|null - */ - public function getNumber() - { - return $this->container['number']; - } - - /** - * Sets number - * - * @param string|null $number The card number. Only collect raw card data if you are [fully PCI compliant](https://docs.adyen.com/development-resources/pci-dss-compliance-guide). - * - * @return self - */ - public function setNumber($number) - { - if (is_null($number)) { - throw new \InvalidArgumentException('non-nullable number cannot be null'); - } - $this->container['number'] = $number; - - return $this; - } - - /** - * Gets recurringDetailReference - * - * @return string|null - * @deprecated - */ - public function getRecurringDetailReference() - { - return $this->container['recurringDetailReference']; - } - - /** - * Sets recurringDetailReference - * - * @param string|null $recurringDetailReference This is the `recurringDetailReference` returned in the response when you created the token. - * - * @return self - * @deprecated - */ - public function setRecurringDetailReference($recurringDetailReference) - { - if (is_null($recurringDetailReference)) { - throw new \InvalidArgumentException('non-nullable recurringDetailReference cannot be null'); - } - $this->container['recurringDetailReference'] = $recurringDetailReference; - - return $this; - } - - /** - * Gets shopperNotificationReference - * - * @return string|null - */ - public function getShopperNotificationReference() - { - return $this->container['shopperNotificationReference']; - } - - /** - * Sets shopperNotificationReference - * - * @param string|null $shopperNotificationReference The `shopperNotificationReference` returned in the response when you requested to notify the shopper. Used only for recurring payments in India. - * - * @return self - */ - public function setShopperNotificationReference($shopperNotificationReference) - { - if (is_null($shopperNotificationReference)) { - throw new \InvalidArgumentException('non-nullable shopperNotificationReference cannot be null'); - } - $this->container['shopperNotificationReference'] = $shopperNotificationReference; - - return $this; - } - - /** - * Gets storedPaymentMethodId - * - * @return string|null - */ - public function getStoredPaymentMethodId() - { - return $this->container['storedPaymentMethodId']; - } - - /** - * Sets storedPaymentMethodId - * - * @param string|null $storedPaymentMethodId This is the `recurringDetailReference` returned in the response when you created the token. - * - * @return self - */ - public function setStoredPaymentMethodId($storedPaymentMethodId) - { - if (is_null($storedPaymentMethodId)) { - throw new \InvalidArgumentException('non-nullable storedPaymentMethodId cannot be null'); - } - $this->container['storedPaymentMethodId'] = $storedPaymentMethodId; - - return $this; - } - - /** - * Gets threeDS2SdkVersion - * - * @return string|null - */ - public function getThreeDS2SdkVersion() - { - return $this->container['threeDS2SdkVersion']; - } - - /** - * Sets threeDS2SdkVersion - * - * @param string|null $threeDS2SdkVersion Required for mobile integrations. Version of the 3D Secure 2 mobile SDK. - * - * @return self - */ - public function setThreeDS2SdkVersion($threeDS2SdkVersion) - { - if (is_null($threeDS2SdkVersion)) { - throw new \InvalidArgumentException('non-nullable threeDS2SdkVersion cannot be null'); - } - $this->container['threeDS2SdkVersion'] = $threeDS2SdkVersion; - - return $this; - } - - /** - * Gets type - * - * @return string|null - */ - public function getType() - { - return $this->container['type']; - } - - /** - * Sets type - * - * @param string|null $type Default payment method details. Common for scheme payment methods, and for simple payment method details. - * - * @return self - */ - public function setType($type) - { - if (is_null($type)) { - throw new \InvalidArgumentException('non-nullable type cannot be null'); - } - $allowedValues = $this->getTypeAllowableValues(); - if (!in_array($type, $allowedValues, true)) { - throw new \InvalidArgumentException( - sprintf( - "Invalid value '%s' for 'type', must be one of '%s'", - $type, - implode("', '", $allowedValues) - ) - ); - } - $this->container['type'] = $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 - ); - } -} diff --git a/src/Adyen/Model/Checkout/CellulantDetails.php b/src/Adyen/Model/Checkout/CellulantDetails.php index 83334ef51..a29de0cc8 100644 --- a/src/Adyen/Model/Checkout/CellulantDetails.php +++ b/src/Adyen/Model/Checkout/CellulantDetails.php @@ -5,7 +5,7 @@ * * The version of the OpenAPI document: 71 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 6.0.1 + * OpenAPI Generator version: 6.4.0 * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -468,6 +468,32 @@ public function jsonSerialize() return ObjectSerializer::sanitizeForSerialization($this); } + public function toArray(): array + { + $array = []; + foreach (self::$openAPITypes as $propertyName => $propertyType) { + $propertyValue = $this[$propertyName]; + if ($propertyValue !== null) { + // Check if the property value is an object and has a toArray() method + if (is_object($propertyValue) && method_exists($propertyValue, 'toArray')) { + $array[$propertyName] = $propertyValue->toArray(); + // Check if it's type datetime + } elseif ($propertyValue instanceof \DateTime) { + $array[$propertyName] = $propertyValue->format(DATE_ATOM); + // If it's an array type we should check whether it contains objects and if so call toArray method + } elseif (is_array($propertyValue)) { + $array[$propertyName] = array_map(function ($item) { + return $item instanceof ModelInterface ? $item->toArray() : $item; + }, $propertyValue); + } else { + // Otherwise, directly assign the property value to the array + $array[$propertyName] = $propertyValue; + } + } + } + return $array; + } + /** * Gets the string presentation of the object * diff --git a/src/Adyen/Model/Checkout/CheckoutAwaitAction.php b/src/Adyen/Model/Checkout/CheckoutAwaitAction.php index 699701044..7910952d3 100644 --- a/src/Adyen/Model/Checkout/CheckoutAwaitAction.php +++ b/src/Adyen/Model/Checkout/CheckoutAwaitAction.php @@ -5,7 +5,7 @@ * * The version of the OpenAPI document: 71 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 6.0.1 + * OpenAPI Generator version: 6.4.0 * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -334,7 +334,7 @@ public function getPaymentData() /** * Sets paymentData * - * @param string|null $paymentData Encoded payment data. + * @param string|null $paymentData A value that must be submitted to the `/payments/details` endpoint to verify this payment. * * @return self */ @@ -505,6 +505,32 @@ public function jsonSerialize() return ObjectSerializer::sanitizeForSerialization($this); } + public function toArray(): array + { + $array = []; + foreach (self::$openAPITypes as $propertyName => $propertyType) { + $propertyValue = $this[$propertyName]; + if ($propertyValue !== null) { + // Check if the property value is an object and has a toArray() method + if (is_object($propertyValue) && method_exists($propertyValue, 'toArray')) { + $array[$propertyName] = $propertyValue->toArray(); + // Check if it's type datetime + } elseif ($propertyValue instanceof \DateTime) { + $array[$propertyName] = $propertyValue->format(DATE_ATOM); + // If it's an array type we should check whether it contains objects and if so call toArray method + } elseif (is_array($propertyValue)) { + $array[$propertyName] = array_map(function ($item) { + return $item instanceof ModelInterface ? $item->toArray() : $item; + }, $propertyValue); + } else { + // Otherwise, directly assign the property value to the array + $array[$propertyName] = $propertyValue; + } + } + } + return $array; + } + /** * Gets the string presentation of the object * diff --git a/src/Adyen/Model/Checkout/CheckoutDelegatedAuthenticationAction.php b/src/Adyen/Model/Checkout/CheckoutDelegatedAuthenticationAction.php index 5561764ac..bde74f03c 100644 --- a/src/Adyen/Model/Checkout/CheckoutDelegatedAuthenticationAction.php +++ b/src/Adyen/Model/Checkout/CheckoutDelegatedAuthenticationAction.php @@ -5,7 +5,7 @@ * * The version of the OpenAPI document: 71 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 6.0.1 + * OpenAPI Generator version: 6.4.0 * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -375,7 +375,7 @@ public function getPaymentData() /** * Sets paymentData * - * @param string|null $paymentData Encoded payment data. + * @param string|null $paymentData A value that must be submitted to the `/payments/details` endpoint to verify this payment. * * @return self */ @@ -573,6 +573,32 @@ public function jsonSerialize() return ObjectSerializer::sanitizeForSerialization($this); } + public function toArray(): array + { + $array = []; + foreach (self::$openAPITypes as $propertyName => $propertyType) { + $propertyValue = $this[$propertyName]; + if ($propertyValue !== null) { + // Check if the property value is an object and has a toArray() method + if (is_object($propertyValue) && method_exists($propertyValue, 'toArray')) { + $array[$propertyName] = $propertyValue->toArray(); + // Check if it's type datetime + } elseif ($propertyValue instanceof \DateTime) { + $array[$propertyName] = $propertyValue->format(DATE_ATOM); + // If it's an array type we should check whether it contains objects and if so call toArray method + } elseif (is_array($propertyValue)) { + $array[$propertyName] = array_map(function ($item) { + return $item instanceof ModelInterface ? $item->toArray() : $item; + }, $propertyValue); + } else { + // Otherwise, directly assign the property value to the array + $array[$propertyName] = $propertyValue; + } + } + } + return $array; + } + /** * Gets the string presentation of the object * diff --git a/src/Adyen/Model/Checkout/CheckoutNativeRedirectAction.php b/src/Adyen/Model/Checkout/CheckoutNativeRedirectAction.php index 62fe8cf5e..990bc48d3 100644 --- a/src/Adyen/Model/Checkout/CheckoutNativeRedirectAction.php +++ b/src/Adyen/Model/Checkout/CheckoutNativeRedirectAction.php @@ -5,7 +5,7 @@ * * The version of the OpenAPI document: 71 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 6.0.1 + * OpenAPI Generator version: 6.4.0 * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -573,6 +573,32 @@ public function jsonSerialize() return ObjectSerializer::sanitizeForSerialization($this); } + public function toArray(): array + { + $array = []; + foreach (self::$openAPITypes as $propertyName => $propertyType) { + $propertyValue = $this[$propertyName]; + if ($propertyValue !== null) { + // Check if the property value is an object and has a toArray() method + if (is_object($propertyValue) && method_exists($propertyValue, 'toArray')) { + $array[$propertyName] = $propertyValue->toArray(); + // Check if it's type datetime + } elseif ($propertyValue instanceof \DateTime) { + $array[$propertyName] = $propertyValue->format(DATE_ATOM); + // If it's an array type we should check whether it contains objects and if so call toArray method + } elseif (is_array($propertyValue)) { + $array[$propertyName] = array_map(function ($item) { + return $item instanceof ModelInterface ? $item->toArray() : $item; + }, $propertyValue); + } else { + // Otherwise, directly assign the property value to the array + $array[$propertyName] = $propertyValue; + } + } + } + return $array; + } + /** * Gets the string presentation of the object * diff --git a/src/Adyen/Model/Checkout/CheckoutOrderResponse.php b/src/Adyen/Model/Checkout/CheckoutOrderResponse.php index 9f869297e..3354cfcc8 100644 --- a/src/Adyen/Model/Checkout/CheckoutOrderResponse.php +++ b/src/Adyen/Model/Checkout/CheckoutOrderResponse.php @@ -5,7 +5,7 @@ * * The version of the OpenAPI document: 71 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 6.0.1 + * OpenAPI Generator version: 6.4.0 * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -542,6 +542,32 @@ public function jsonSerialize() return ObjectSerializer::sanitizeForSerialization($this); } + public function toArray(): array + { + $array = []; + foreach (self::$openAPITypes as $propertyName => $propertyType) { + $propertyValue = $this[$propertyName]; + if ($propertyValue !== null) { + // Check if the property value is an object and has a toArray() method + if (is_object($propertyValue) && method_exists($propertyValue, 'toArray')) { + $array[$propertyName] = $propertyValue->toArray(); + // Check if it's type datetime + } elseif ($propertyValue instanceof \DateTime) { + $array[$propertyName] = $propertyValue->format(DATE_ATOM); + // If it's an array type we should check whether it contains objects and if so call toArray method + } elseif (is_array($propertyValue)) { + $array[$propertyName] = array_map(function ($item) { + return $item instanceof ModelInterface ? $item->toArray() : $item; + }, $propertyValue); + } else { + // Otherwise, directly assign the property value to the array + $array[$propertyName] = $propertyValue; + } + } + } + return $array; + } + /** * Gets the string presentation of the object * diff --git a/src/Adyen/Model/Checkout/CheckoutPaymentMethod.php b/src/Adyen/Model/Checkout/CheckoutPaymentMethod.php index e58f131d1..6cf4a44e5 100644 --- a/src/Adyen/Model/Checkout/CheckoutPaymentMethod.php +++ b/src/Adyen/Model/Checkout/CheckoutPaymentMethod.php @@ -5,7 +5,7 @@ * * The version of the OpenAPI document: 71 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 6.0.1 + * OpenAPI Generator version: 6.4.0 * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -82,7 +82,6 @@ class CheckoutPaymentMethod implements ModelInterface, ArrayAccess, \JsonSeriali 'lastName' => 'string', 'shopperEmail' => 'string', 'telephoneNumber' => 'string', - 'googlePayCardNetwork' => 'string', 'googlePayToken' => 'string', 'subtype' => 'string', 'masterpassTransactionId' => 'string', @@ -145,7 +144,6 @@ class CheckoutPaymentMethod implements ModelInterface, ArrayAccess, \JsonSeriali 'lastName' => null, 'shopperEmail' => null, 'telephoneNumber' => null, - 'googlePayCardNetwork' => null, 'googlePayToken' => null, 'subtype' => null, 'masterpassTransactionId' => null, @@ -206,7 +204,6 @@ class CheckoutPaymentMethod implements ModelInterface, ArrayAccess, \JsonSeriali 'lastName' => false, 'shopperEmail' => false, 'telephoneNumber' => false, - 'googlePayCardNetwork' => false, 'googlePayToken' => false, 'subtype' => false, 'masterpassTransactionId' => false, @@ -347,7 +344,6 @@ public function isNullableSetToNull(string $property): bool 'lastName' => 'lastName', 'shopperEmail' => 'shopperEmail', 'telephoneNumber' => 'telephoneNumber', - 'googlePayCardNetwork' => 'googlePayCardNetwork', 'googlePayToken' => 'googlePayToken', 'subtype' => 'subtype', 'masterpassTransactionId' => 'masterpassTransactionId', @@ -408,7 +404,6 @@ public function isNullableSetToNull(string $property): bool 'lastName' => 'setLastName', 'shopperEmail' => 'setShopperEmail', 'telephoneNumber' => 'setTelephoneNumber', - 'googlePayCardNetwork' => 'setGooglePayCardNetwork', 'googlePayToken' => 'setGooglePayToken', 'subtype' => 'setSubtype', 'masterpassTransactionId' => 'setMasterpassTransactionId', @@ -469,7 +464,6 @@ public function isNullableSetToNull(string $property): bool 'lastName' => 'getLastName', 'shopperEmail' => 'getShopperEmail', 'telephoneNumber' => 'getTelephoneNumber', - 'googlePayCardNetwork' => 'getGooglePayCardNetwork', 'googlePayToken' => 'getGooglePayToken', 'subtype' => 'getSubtype', 'masterpassTransactionId' => 'getMasterpassTransactionId', @@ -580,7 +574,6 @@ public function __construct(array $data = null) $this->setIfExists('lastName', $data ?? [], null); $this->setIfExists('shopperEmail', $data ?? [], null); $this->setIfExists('telephoneNumber', $data ?? [], null); - $this->setIfExists('googlePayCardNetwork', $data ?? [], null); $this->setIfExists('googlePayToken', $data ?? [], null); $this->setIfExists('subtype', $data ?? [], null); $this->setIfExists('masterpassTransactionId', $data ?? [], null); @@ -1651,7 +1644,7 @@ public function getShopperEmail() /** * Sets shopperEmail * - * @param string $shopperEmail + * @param string $shopperEmail * * @return self */ @@ -1678,7 +1671,7 @@ public function getTelephoneNumber() /** * Sets telephoneNumber * - * @param string $telephoneNumber + * @param string $telephoneNumber * * @return self */ @@ -1692,33 +1685,6 @@ public function setTelephoneNumber($telephoneNumber) return $this; } - /** - * Gets googlePayCardNetwork - * - * @return string|null - */ - public function getGooglePayCardNetwork() - { - return $this->container['googlePayCardNetwork']; - } - - /** - * Sets googlePayCardNetwork - * - * @param string|null $googlePayCardNetwork The selected payment card network. - * - * @return self - */ - public function setGooglePayCardNetwork($googlePayCardNetwork) - { - if (is_null($googlePayCardNetwork)) { - throw new \InvalidArgumentException('non-nullable googlePayCardNetwork cannot be null'); - } - $this->container['googlePayCardNetwork'] = $googlePayCardNetwork; - - return $this; - } - /** * Gets googlePayToken * @@ -2190,6 +2156,32 @@ public function jsonSerialize() return ObjectSerializer::sanitizeForSerialization($this); } + public function toArray(): array + { + $array = []; + foreach (self::$openAPITypes as $propertyName => $propertyType) { + $propertyValue = $this[$propertyName]; + if ($propertyValue !== null) { + // Check if the property value is an object and has a toArray() method + if (is_object($propertyValue) && method_exists($propertyValue, 'toArray')) { + $array[$propertyName] = $propertyValue->toArray(); + // Check if it's type datetime + } elseif ($propertyValue instanceof \DateTime) { + $array[$propertyName] = $propertyValue->format(DATE_ATOM); + // If it's an array type we should check whether it contains objects and if so call toArray method + } elseif (is_array($propertyValue)) { + $array[$propertyName] = array_map(function ($item) { + return $item instanceof ModelInterface ? $item->toArray() : $item; + }, $propertyValue); + } else { + // Otherwise, directly assign the property value to the array + $array[$propertyName] = $propertyValue; + } + } + } + return $array; + } + /** * Gets the string presentation of the object * diff --git a/src/Adyen/Model/Checkout/CheckoutQrCodeAction.php b/src/Adyen/Model/Checkout/CheckoutQrCodeAction.php index 3d1639d9f..a435317bb 100644 --- a/src/Adyen/Model/Checkout/CheckoutQrCodeAction.php +++ b/src/Adyen/Model/Checkout/CheckoutQrCodeAction.php @@ -5,7 +5,7 @@ * * The version of the OpenAPI document: 71 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 6.0.1 + * OpenAPI Generator version: 6.4.0 * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -375,7 +375,7 @@ public function getPaymentData() /** * Sets paymentData * - * @param string|null $paymentData Encoded payment data. + * @param string|null $paymentData A value that must be submitted to the `/payments/details` endpoint to verify this payment. * * @return self */ @@ -573,6 +573,32 @@ public function jsonSerialize() return ObjectSerializer::sanitizeForSerialization($this); } + public function toArray(): array + { + $array = []; + foreach (self::$openAPITypes as $propertyName => $propertyType) { + $propertyValue = $this[$propertyName]; + if ($propertyValue !== null) { + // Check if the property value is an object and has a toArray() method + if (is_object($propertyValue) && method_exists($propertyValue, 'toArray')) { + $array[$propertyName] = $propertyValue->toArray(); + // Check if it's type datetime + } elseif ($propertyValue instanceof \DateTime) { + $array[$propertyName] = $propertyValue->format(DATE_ATOM); + // If it's an array type we should check whether it contains objects and if so call toArray method + } elseif (is_array($propertyValue)) { + $array[$propertyName] = array_map(function ($item) { + return $item instanceof ModelInterface ? $item->toArray() : $item; + }, $propertyValue); + } else { + // Otherwise, directly assign the property value to the array + $array[$propertyName] = $propertyValue; + } + } + } + return $array; + } + /** * Gets the string presentation of the object * diff --git a/src/Adyen/Model/Checkout/CheckoutRedirectAction.php b/src/Adyen/Model/Checkout/CheckoutRedirectAction.php index c3fd6f4fe..379be6ea5 100644 --- a/src/Adyen/Model/Checkout/CheckoutRedirectAction.php +++ b/src/Adyen/Model/Checkout/CheckoutRedirectAction.php @@ -5,7 +5,7 @@ * * The version of the OpenAPI document: 71 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 6.0.1 + * OpenAPI Generator version: 6.4.0 * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -539,6 +539,32 @@ public function jsonSerialize() return ObjectSerializer::sanitizeForSerialization($this); } + public function toArray(): array + { + $array = []; + foreach (self::$openAPITypes as $propertyName => $propertyType) { + $propertyValue = $this[$propertyName]; + if ($propertyValue !== null) { + // Check if the property value is an object and has a toArray() method + if (is_object($propertyValue) && method_exists($propertyValue, 'toArray')) { + $array[$propertyName] = $propertyValue->toArray(); + // Check if it's type datetime + } elseif ($propertyValue instanceof \DateTime) { + $array[$propertyName] = $propertyValue->format(DATE_ATOM); + // If it's an array type we should check whether it contains objects and if so call toArray method + } elseif (is_array($propertyValue)) { + $array[$propertyName] = array_map(function ($item) { + return $item instanceof ModelInterface ? $item->toArray() : $item; + }, $propertyValue); + } else { + // Otherwise, directly assign the property value to the array + $array[$propertyName] = $propertyValue; + } + } + } + return $array; + } + /** * Gets the string presentation of the object * diff --git a/src/Adyen/Model/Checkout/CheckoutSDKAction.php b/src/Adyen/Model/Checkout/CheckoutSDKAction.php index 30c89c85c..ece4f0754 100644 --- a/src/Adyen/Model/Checkout/CheckoutSDKAction.php +++ b/src/Adyen/Model/Checkout/CheckoutSDKAction.php @@ -5,7 +5,7 @@ * * The version of the OpenAPI document: 71 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 6.0.1 + * OpenAPI Generator version: 6.4.0 * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -343,7 +343,7 @@ public function getPaymentData() /** * Sets paymentData * - * @param string|null $paymentData Encoded payment data. + * @param string|null $paymentData A value that must be submitted to the `/payments/details` endpoint to verify this payment. * * @return self */ @@ -541,6 +541,32 @@ public function jsonSerialize() return ObjectSerializer::sanitizeForSerialization($this); } + public function toArray(): array + { + $array = []; + foreach (self::$openAPITypes as $propertyName => $propertyType) { + $propertyValue = $this[$propertyName]; + if ($propertyValue !== null) { + // Check if the property value is an object and has a toArray() method + if (is_object($propertyValue) && method_exists($propertyValue, 'toArray')) { + $array[$propertyName] = $propertyValue->toArray(); + // Check if it's type datetime + } elseif ($propertyValue instanceof \DateTime) { + $array[$propertyName] = $propertyValue->format(DATE_ATOM); + // If it's an array type we should check whether it contains objects and if so call toArray method + } elseif (is_array($propertyValue)) { + $array[$propertyName] = array_map(function ($item) { + return $item instanceof ModelInterface ? $item->toArray() : $item; + }, $propertyValue); + } else { + // Otherwise, directly assign the property value to the array + $array[$propertyName] = $propertyValue; + } + } + } + return $array; + } + /** * Gets the string presentation of the object * diff --git a/src/Adyen/Model/Checkout/CheckoutSessionInstallmentOption.php b/src/Adyen/Model/Checkout/CheckoutSessionInstallmentOption.php index 0a17d2f4b..4c33a5905 100644 --- a/src/Adyen/Model/Checkout/CheckoutSessionInstallmentOption.php +++ b/src/Adyen/Model/Checkout/CheckoutSessionInstallmentOption.php @@ -5,7 +5,7 @@ * * The version of the OpenAPI document: 71 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 6.0.1 + * OpenAPI Generator version: 6.4.0 * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -458,6 +458,32 @@ public function jsonSerialize() return ObjectSerializer::sanitizeForSerialization($this); } + public function toArray(): array + { + $array = []; + foreach (self::$openAPITypes as $propertyName => $propertyType) { + $propertyValue = $this[$propertyName]; + if ($propertyValue !== null) { + // Check if the property value is an object and has a toArray() method + if (is_object($propertyValue) && method_exists($propertyValue, 'toArray')) { + $array[$propertyName] = $propertyValue->toArray(); + // Check if it's type datetime + } elseif ($propertyValue instanceof \DateTime) { + $array[$propertyName] = $propertyValue->format(DATE_ATOM); + // If it's an array type we should check whether it contains objects and if so call toArray method + } elseif (is_array($propertyValue)) { + $array[$propertyName] = array_map(function ($item) { + return $item instanceof ModelInterface ? $item->toArray() : $item; + }, $propertyValue); + } else { + // Otherwise, directly assign the property value to the array + $array[$propertyName] = $propertyValue; + } + } + } + return $array; + } + /** * Gets the string presentation of the object * diff --git a/src/Adyen/Model/Checkout/CheckoutThreeDS2Action.php b/src/Adyen/Model/Checkout/CheckoutThreeDS2Action.php index baf01352e..3e07b22e0 100644 --- a/src/Adyen/Model/Checkout/CheckoutThreeDS2Action.php +++ b/src/Adyen/Model/Checkout/CheckoutThreeDS2Action.php @@ -5,7 +5,7 @@ * * The version of the OpenAPI document: 71 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 6.0.1 + * OpenAPI Generator version: 6.4.0 * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -382,7 +382,7 @@ public function getPaymentData() /** * Sets paymentData * - * @param string|null $paymentData Encoded payment data. + * @param string|null $paymentData A value that must be submitted to the `/payments/details` endpoint to verify this payment. * * @return self */ @@ -607,6 +607,32 @@ public function jsonSerialize() return ObjectSerializer::sanitizeForSerialization($this); } + public function toArray(): array + { + $array = []; + foreach (self::$openAPITypes as $propertyName => $propertyType) { + $propertyValue = $this[$propertyName]; + if ($propertyValue !== null) { + // Check if the property value is an object and has a toArray() method + if (is_object($propertyValue) && method_exists($propertyValue, 'toArray')) { + $array[$propertyName] = $propertyValue->toArray(); + // Check if it's type datetime + } elseif ($propertyValue instanceof \DateTime) { + $array[$propertyName] = $propertyValue->format(DATE_ATOM); + // If it's an array type we should check whether it contains objects and if so call toArray method + } elseif (is_array($propertyValue)) { + $array[$propertyName] = array_map(function ($item) { + return $item instanceof ModelInterface ? $item->toArray() : $item; + }, $propertyValue); + } else { + // Otherwise, directly assign the property value to the array + $array[$propertyName] = $propertyValue; + } + } + } + return $array; + } + /** * Gets the string presentation of the object * diff --git a/src/Adyen/Model/Checkout/CheckoutVoucherAction.php b/src/Adyen/Model/Checkout/CheckoutVoucherAction.php index 417f5f7f4..6e4930d14 100644 --- a/src/Adyen/Model/Checkout/CheckoutVoucherAction.php +++ b/src/Adyen/Model/Checkout/CheckoutVoucherAction.php @@ -5,7 +5,7 @@ * * The version of the OpenAPI document: 71 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 6.0.1 + * OpenAPI Generator version: 6.4.0 * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -777,7 +777,7 @@ public function getPaymentData() /** * Sets paymentData * - * @param string|null $paymentData Encoded payment data. + * @param string|null $paymentData A value that must be submitted to the `/payments/details` endpoint to verify this payment. * * @return self */ @@ -1083,6 +1083,32 @@ public function jsonSerialize() return ObjectSerializer::sanitizeForSerialization($this); } + public function toArray(): array + { + $array = []; + foreach (self::$openAPITypes as $propertyName => $propertyType) { + $propertyValue = $this[$propertyName]; + if ($propertyValue !== null) { + // Check if the property value is an object and has a toArray() method + if (is_object($propertyValue) && method_exists($propertyValue, 'toArray')) { + $array[$propertyName] = $propertyValue->toArray(); + // Check if it's type datetime + } elseif ($propertyValue instanceof \DateTime) { + $array[$propertyName] = $propertyValue->format(DATE_ATOM); + // If it's an array type we should check whether it contains objects and if so call toArray method + } elseif (is_array($propertyValue)) { + $array[$propertyName] = array_map(function ($item) { + return $item instanceof ModelInterface ? $item->toArray() : $item; + }, $propertyValue); + } else { + // Otherwise, directly assign the property value to the array + $array[$propertyName] = $propertyValue; + } + } + } + return $array; + } + /** * Gets the string presentation of the object * diff --git a/src/Adyen/Model/Checkout/CommonField.php b/src/Adyen/Model/Checkout/CommonField.php index 3ef6a90f7..3220a2379 100644 --- a/src/Adyen/Model/Checkout/CommonField.php +++ b/src/Adyen/Model/Checkout/CommonField.php @@ -5,7 +5,7 @@ * * The version of the OpenAPI document: 71 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 6.0.1 + * OpenAPI Generator version: 6.4.0 * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -403,6 +403,32 @@ public function jsonSerialize() return ObjectSerializer::sanitizeForSerialization($this); } + public function toArray(): array + { + $array = []; + foreach (self::$openAPITypes as $propertyName => $propertyType) { + $propertyValue = $this[$propertyName]; + if ($propertyValue !== null) { + // Check if the property value is an object and has a toArray() method + if (is_object($propertyValue) && method_exists($propertyValue, 'toArray')) { + $array[$propertyName] = $propertyValue->toArray(); + // Check if it's type datetime + } elseif ($propertyValue instanceof \DateTime) { + $array[$propertyName] = $propertyValue->format(DATE_ATOM); + // If it's an array type we should check whether it contains objects and if so call toArray method + } elseif (is_array($propertyValue)) { + $array[$propertyName] = array_map(function ($item) { + return $item instanceof ModelInterface ? $item->toArray() : $item; + }, $propertyValue); + } else { + // Otherwise, directly assign the property value to the array + $array[$propertyName] = $propertyValue; + } + } + } + return $array; + } + /** * Gets the string presentation of the object * diff --git a/src/Adyen/Model/Checkout/Company.php b/src/Adyen/Model/Checkout/Company.php index 553a01ca5..e178cb605 100644 --- a/src/Adyen/Model/Checkout/Company.php +++ b/src/Adyen/Model/Checkout/Company.php @@ -5,7 +5,7 @@ * * The version of the OpenAPI document: 71 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 6.0.1 + * OpenAPI Generator version: 6.4.0 * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -539,6 +539,32 @@ public function jsonSerialize() return ObjectSerializer::sanitizeForSerialization($this); } + public function toArray(): array + { + $array = []; + foreach (self::$openAPITypes as $propertyName => $propertyType) { + $propertyValue = $this[$propertyName]; + if ($propertyValue !== null) { + // Check if the property value is an object and has a toArray() method + if (is_object($propertyValue) && method_exists($propertyValue, 'toArray')) { + $array[$propertyName] = $propertyValue->toArray(); + // Check if it's type datetime + } elseif ($propertyValue instanceof \DateTime) { + $array[$propertyName] = $propertyValue->format(DATE_ATOM); + // If it's an array type we should check whether it contains objects and if so call toArray method + } elseif (is_array($propertyValue)) { + $array[$propertyName] = array_map(function ($item) { + return $item instanceof ModelInterface ? $item->toArray() : $item; + }, $propertyValue); + } else { + // Otherwise, directly assign the property value to the array + $array[$propertyName] = $propertyValue; + } + } + } + return $array; + } + /** * Gets the string presentation of the object * diff --git a/src/Adyen/Model/Checkout/Configuration.php b/src/Adyen/Model/Checkout/Configuration.php index b7aae8cd0..bcd93bc6b 100644 --- a/src/Adyen/Model/Checkout/Configuration.php +++ b/src/Adyen/Model/Checkout/Configuration.php @@ -5,7 +5,7 @@ * * The version of the OpenAPI document: 71 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 6.0.1 + * OpenAPI Generator version: 6.4.0 * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -506,6 +506,32 @@ public function jsonSerialize() return ObjectSerializer::sanitizeForSerialization($this); } + public function toArray(): array + { + $array = []; + foreach (self::$openAPITypes as $propertyName => $propertyType) { + $propertyValue = $this[$propertyName]; + if ($propertyValue !== null) { + // Check if the property value is an object and has a toArray() method + if (is_object($propertyValue) && method_exists($propertyValue, 'toArray')) { + $array[$propertyName] = $propertyValue->toArray(); + // Check if it's type datetime + } elseif ($propertyValue instanceof \DateTime) { + $array[$propertyName] = $propertyValue->format(DATE_ATOM); + // If it's an array type we should check whether it contains objects and if so call toArray method + } elseif (is_array($propertyValue)) { + $array[$propertyName] = array_map(function ($item) { + return $item instanceof ModelInterface ? $item->toArray() : $item; + }, $propertyValue); + } else { + // Otherwise, directly assign the property value to the array + $array[$propertyName] = $propertyValue; + } + } + } + return $array; + } + /** * Gets the string presentation of the object * diff --git a/src/Adyen/Model/Checkout/CreateCheckoutSessionRequest.php b/src/Adyen/Model/Checkout/CreateCheckoutSessionRequest.php index 8d435bd29..fb8ae3758 100644 --- a/src/Adyen/Model/Checkout/CreateCheckoutSessionRequest.php +++ b/src/Adyen/Model/Checkout/CreateCheckoutSessionRequest.php @@ -5,7 +5,7 @@ * * The version of the OpenAPI document: 71 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 6.0.1 + * OpenAPI Generator version: 6.4.0 * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -92,7 +92,6 @@ class CreateCheckoutSessionRequest implements ModelInterface, ArrayAccess, \Json 'shopperReference' => 'string', 'shopperStatement' => 'string', 'showInstallmentAmount' => 'bool', - 'showRemovePaymentMethodButton' => 'bool', 'socialSecurityNumber' => 'string', 'splitCardFundingSources' => 'bool', 'splits' => '\Adyen\Model\Checkout\Split[]', @@ -100,7 +99,6 @@ class CreateCheckoutSessionRequest implements ModelInterface, ArrayAccess, \Json 'storePaymentMethod' => 'bool', 'storePaymentMethodMode' => 'string', 'telephoneNumber' => 'string', - 'themeId' => 'string', 'threeDSAuthenticationOnly' => 'bool', 'trustedShopper' => 'bool' ]; @@ -161,7 +159,6 @@ class CreateCheckoutSessionRequest implements ModelInterface, ArrayAccess, \Json 'shopperReference' => null, 'shopperStatement' => null, 'showInstallmentAmount' => null, - 'showRemovePaymentMethodButton' => null, 'socialSecurityNumber' => null, 'splitCardFundingSources' => null, 'splits' => null, @@ -169,7 +166,6 @@ class CreateCheckoutSessionRequest implements ModelInterface, ArrayAccess, \Json 'storePaymentMethod' => null, 'storePaymentMethodMode' => null, 'telephoneNumber' => null, - 'themeId' => null, 'threeDSAuthenticationOnly' => null, 'trustedShopper' => null ]; @@ -228,7 +224,6 @@ class CreateCheckoutSessionRequest implements ModelInterface, ArrayAccess, \Json 'shopperReference' => false, 'shopperStatement' => false, 'showInstallmentAmount' => false, - 'showRemovePaymentMethodButton' => false, 'socialSecurityNumber' => false, 'splitCardFundingSources' => false, 'splits' => false, @@ -236,7 +231,6 @@ class CreateCheckoutSessionRequest implements ModelInterface, ArrayAccess, \Json 'storePaymentMethod' => false, 'storePaymentMethodMode' => false, 'telephoneNumber' => false, - 'themeId' => false, 'threeDSAuthenticationOnly' => false, 'trustedShopper' => false ]; @@ -375,7 +369,6 @@ public function isNullableSetToNull(string $property): bool 'shopperReference' => 'shopperReference', 'shopperStatement' => 'shopperStatement', 'showInstallmentAmount' => 'showInstallmentAmount', - 'showRemovePaymentMethodButton' => 'showRemovePaymentMethodButton', 'socialSecurityNumber' => 'socialSecurityNumber', 'splitCardFundingSources' => 'splitCardFundingSources', 'splits' => 'splits', @@ -383,7 +376,6 @@ public function isNullableSetToNull(string $property): bool 'storePaymentMethod' => 'storePaymentMethod', 'storePaymentMethodMode' => 'storePaymentMethodMode', 'telephoneNumber' => 'telephoneNumber', - 'themeId' => 'themeId', 'threeDSAuthenticationOnly' => 'threeDSAuthenticationOnly', 'trustedShopper' => 'trustedShopper' ]; @@ -442,7 +434,6 @@ public function isNullableSetToNull(string $property): bool 'shopperReference' => 'setShopperReference', 'shopperStatement' => 'setShopperStatement', 'showInstallmentAmount' => 'setShowInstallmentAmount', - 'showRemovePaymentMethodButton' => 'setShowRemovePaymentMethodButton', 'socialSecurityNumber' => 'setSocialSecurityNumber', 'splitCardFundingSources' => 'setSplitCardFundingSources', 'splits' => 'setSplits', @@ -450,7 +441,6 @@ public function isNullableSetToNull(string $property): bool 'storePaymentMethod' => 'setStorePaymentMethod', 'storePaymentMethodMode' => 'setStorePaymentMethodMode', 'telephoneNumber' => 'setTelephoneNumber', - 'themeId' => 'setThemeId', 'threeDSAuthenticationOnly' => 'setThreeDSAuthenticationOnly', 'trustedShopper' => 'setTrustedShopper' ]; @@ -509,7 +499,6 @@ public function isNullableSetToNull(string $property): bool 'shopperReference' => 'getShopperReference', 'shopperStatement' => 'getShopperStatement', 'showInstallmentAmount' => 'getShowInstallmentAmount', - 'showRemovePaymentMethodButton' => 'getShowRemovePaymentMethodButton', 'socialSecurityNumber' => 'getSocialSecurityNumber', 'splitCardFundingSources' => 'getSplitCardFundingSources', 'splits' => 'getSplits', @@ -517,7 +506,6 @@ public function isNullableSetToNull(string $property): bool 'storePaymentMethod' => 'getStorePaymentMethod', 'storePaymentMethodMode' => 'getStorePaymentMethodMode', 'telephoneNumber' => 'getTelephoneNumber', - 'themeId' => 'getThemeId', 'threeDSAuthenticationOnly' => 'getThreeDSAuthenticationOnly', 'trustedShopper' => 'getTrustedShopper' ]; @@ -707,7 +695,6 @@ public function __construct(array $data = null) $this->setIfExists('shopperReference', $data ?? [], null); $this->setIfExists('shopperStatement', $data ?? [], null); $this->setIfExists('showInstallmentAmount', $data ?? [], null); - $this->setIfExists('showRemovePaymentMethodButton', $data ?? [], null); $this->setIfExists('socialSecurityNumber', $data ?? [], null); $this->setIfExists('splitCardFundingSources', $data ?? [], null); $this->setIfExists('splits', $data ?? [], null); @@ -715,7 +702,6 @@ public function __construct(array $data = null) $this->setIfExists('storePaymentMethod', $data ?? [], null); $this->setIfExists('storePaymentMethodMode', $data ?? [], null); $this->setIfExists('telephoneNumber', $data ?? [], null); - $this->setIfExists('themeId', $data ?? [], null); $this->setIfExists('threeDSAuthenticationOnly', $data ?? [], null); $this->setIfExists('trustedShopper', $data ?? [], null); } @@ -2153,33 +2139,6 @@ public function setShowInstallmentAmount($showInstallmentAmount) return $this; } - /** - * Gets showRemovePaymentMethodButton - * - * @return bool|null - */ - public function getShowRemovePaymentMethodButton() - { - return $this->container['showRemovePaymentMethodButton']; - } - - /** - * Sets showRemovePaymentMethodButton - * - * @param bool|null $showRemovePaymentMethodButton Set to **true** to show a button that lets the shopper remove a stored payment method. - * - * @return self - */ - public function setShowRemovePaymentMethodButton($showRemovePaymentMethodButton) - { - if (is_null($showRemovePaymentMethodButton)) { - throw new \InvalidArgumentException('non-nullable showRemovePaymentMethodButton cannot be null'); - } - $this->container['showRemovePaymentMethodButton'] = $showRemovePaymentMethodButton; - - return $this; - } - /** * Gets socialSecurityNumber * @@ -2274,7 +2233,7 @@ public function getStore() /** * Sets store * - * @param string|null $store Required for Adyen for Platforms integrations if you have a platform setup. This is your [reference](https://docs.adyen.com/api-explorer/Management/3/post/merchants/(merchantId)/stores#request-reference) (on [balance platform](https://docs.adyen.com/marketplaces-and-platforms/classic/platforms-for-partners#route-payments)) or the [storeReference](https://docs.adyen.com/api-explorer/Account/latest/post/updateAccountHolder#request-accountHolderDetails-storeDetails-storeReference) (in the [classic integration](https://docs.adyen.com/marketplaces-and-platforms/processing-payments/route-payment-to-store/#route-a-payment-to-a-store)) for the ecommerce or point-of-sale store that is processing the payment. + * @param string|null $store The ecommerce or point-of-sale store that is processing the payment. Used in: * [Partner platform integrations](https://docs.adyen.com/marketplaces-and-platforms/classic/platforms-for-partners#route-payments) for the [Classic Platforms integration](https://docs.adyen.com/marketplaces-and-platforms/classic). * [Platform setup integrations](https://docs.adyen.com/marketplaces-and-platforms/additional-for-platform-setup/route-payment-to-store) for the [Balance Platform](https://docs.adyen.com/marketplaces-and-platforms). * * @return self */ @@ -2379,33 +2338,6 @@ public function setTelephoneNumber($telephoneNumber) return $this; } - /** - * Gets themeId - * - * @return string|null - */ - public function getThemeId() - { - return $this->container['themeId']; - } - - /** - * Sets themeId - * - * @param string|null $themeId Sets a custom theme for [Hosted Checkout](https://docs.adyen.com/online-payments/build-your-integration/?platform=Web&integration=Hosted+Checkout). The value can be any of the **Theme ID** values from your Customer Area. - * - * @return self - */ - public function setThemeId($themeId) - { - if (is_null($themeId)) { - throw new \InvalidArgumentException('non-nullable themeId cannot be null'); - } - $this->container['themeId'] = $themeId; - - return $this; - } - /** * Gets threeDSAuthenticationOnly * @@ -2528,6 +2460,32 @@ public function jsonSerialize() return ObjectSerializer::sanitizeForSerialization($this); } + public function toArray(): array + { + $array = []; + foreach (self::$openAPITypes as $propertyName => $propertyType) { + $propertyValue = $this[$propertyName]; + if ($propertyValue !== null) { + // Check if the property value is an object and has a toArray() method + if (is_object($propertyValue) && method_exists($propertyValue, 'toArray')) { + $array[$propertyName] = $propertyValue->toArray(); + // Check if it's type datetime + } elseif ($propertyValue instanceof \DateTime) { + $array[$propertyName] = $propertyValue->format(DATE_ATOM); + // If it's an array type we should check whether it contains objects and if so call toArray method + } elseif (is_array($propertyValue)) { + $array[$propertyName] = array_map(function ($item) { + return $item instanceof ModelInterface ? $item->toArray() : $item; + }, $propertyValue); + } else { + // Otherwise, directly assign the property value to the array + $array[$propertyName] = $propertyValue; + } + } + } + return $array; + } + /** * Gets the string presentation of the object * diff --git a/src/Adyen/Model/Checkout/CreateCheckoutSessionResponse.php b/src/Adyen/Model/Checkout/CreateCheckoutSessionResponse.php index 80134cf83..a58e36447 100644 --- a/src/Adyen/Model/Checkout/CreateCheckoutSessionResponse.php +++ b/src/Adyen/Model/Checkout/CreateCheckoutSessionResponse.php @@ -5,7 +5,7 @@ * * The version of the OpenAPI document: 71 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 6.0.1 + * OpenAPI Generator version: 6.4.0 * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -94,7 +94,6 @@ class CreateCheckoutSessionResponse implements ModelInterface, ArrayAccess, \Jso 'shopperReference' => 'string', 'shopperStatement' => 'string', 'showInstallmentAmount' => 'bool', - 'showRemovePaymentMethodButton' => 'bool', 'socialSecurityNumber' => 'string', 'splitCardFundingSources' => 'bool', 'splits' => '\Adyen\Model\Checkout\Split[]', @@ -102,10 +101,8 @@ class CreateCheckoutSessionResponse implements ModelInterface, ArrayAccess, \Jso 'storePaymentMethod' => 'bool', 'storePaymentMethodMode' => 'string', 'telephoneNumber' => 'string', - 'themeId' => 'string', 'threeDSAuthenticationOnly' => 'bool', - 'trustedShopper' => 'bool', - 'url' => 'string' + 'trustedShopper' => 'bool' ]; /** @@ -166,7 +163,6 @@ class CreateCheckoutSessionResponse implements ModelInterface, ArrayAccess, \Jso 'shopperReference' => null, 'shopperStatement' => null, 'showInstallmentAmount' => null, - 'showRemovePaymentMethodButton' => null, 'socialSecurityNumber' => null, 'splitCardFundingSources' => null, 'splits' => null, @@ -174,10 +170,8 @@ class CreateCheckoutSessionResponse implements ModelInterface, ArrayAccess, \Jso 'storePaymentMethod' => null, 'storePaymentMethodMode' => null, 'telephoneNumber' => null, - 'themeId' => null, 'threeDSAuthenticationOnly' => null, - 'trustedShopper' => null, - 'url' => null + 'trustedShopper' => null ]; /** @@ -236,7 +230,6 @@ class CreateCheckoutSessionResponse implements ModelInterface, ArrayAccess, \Jso 'shopperReference' => false, 'shopperStatement' => false, 'showInstallmentAmount' => false, - 'showRemovePaymentMethodButton' => false, 'socialSecurityNumber' => false, 'splitCardFundingSources' => false, 'splits' => false, @@ -244,10 +237,8 @@ class CreateCheckoutSessionResponse implements ModelInterface, ArrayAccess, \Jso 'storePaymentMethod' => false, 'storePaymentMethodMode' => false, 'telephoneNumber' => false, - 'themeId' => false, 'threeDSAuthenticationOnly' => false, - 'trustedShopper' => false, - 'url' => false + 'trustedShopper' => false ]; /** @@ -386,7 +377,6 @@ public function isNullableSetToNull(string $property): bool 'shopperReference' => 'shopperReference', 'shopperStatement' => 'shopperStatement', 'showInstallmentAmount' => 'showInstallmentAmount', - 'showRemovePaymentMethodButton' => 'showRemovePaymentMethodButton', 'socialSecurityNumber' => 'socialSecurityNumber', 'splitCardFundingSources' => 'splitCardFundingSources', 'splits' => 'splits', @@ -394,10 +384,8 @@ public function isNullableSetToNull(string $property): bool 'storePaymentMethod' => 'storePaymentMethod', 'storePaymentMethodMode' => 'storePaymentMethodMode', 'telephoneNumber' => 'telephoneNumber', - 'themeId' => 'themeId', 'threeDSAuthenticationOnly' => 'threeDSAuthenticationOnly', - 'trustedShopper' => 'trustedShopper', - 'url' => 'url' + 'trustedShopper' => 'trustedShopper' ]; /** @@ -456,7 +444,6 @@ public function isNullableSetToNull(string $property): bool 'shopperReference' => 'setShopperReference', 'shopperStatement' => 'setShopperStatement', 'showInstallmentAmount' => 'setShowInstallmentAmount', - 'showRemovePaymentMethodButton' => 'setShowRemovePaymentMethodButton', 'socialSecurityNumber' => 'setSocialSecurityNumber', 'splitCardFundingSources' => 'setSplitCardFundingSources', 'splits' => 'setSplits', @@ -464,10 +451,8 @@ public function isNullableSetToNull(string $property): bool 'storePaymentMethod' => 'setStorePaymentMethod', 'storePaymentMethodMode' => 'setStorePaymentMethodMode', 'telephoneNumber' => 'setTelephoneNumber', - 'themeId' => 'setThemeId', 'threeDSAuthenticationOnly' => 'setThreeDSAuthenticationOnly', - 'trustedShopper' => 'setTrustedShopper', - 'url' => 'setUrl' + 'trustedShopper' => 'setTrustedShopper' ]; /** @@ -526,7 +511,6 @@ public function isNullableSetToNull(string $property): bool 'shopperReference' => 'getShopperReference', 'shopperStatement' => 'getShopperStatement', 'showInstallmentAmount' => 'getShowInstallmentAmount', - 'showRemovePaymentMethodButton' => 'getShowRemovePaymentMethodButton', 'socialSecurityNumber' => 'getSocialSecurityNumber', 'splitCardFundingSources' => 'getSplitCardFundingSources', 'splits' => 'getSplits', @@ -534,10 +518,8 @@ public function isNullableSetToNull(string $property): bool 'storePaymentMethod' => 'getStorePaymentMethod', 'storePaymentMethodMode' => 'getStorePaymentMethodMode', 'telephoneNumber' => 'getTelephoneNumber', - 'themeId' => 'getThemeId', 'threeDSAuthenticationOnly' => 'getThreeDSAuthenticationOnly', - 'trustedShopper' => 'getTrustedShopper', - 'url' => 'getUrl' + 'trustedShopper' => 'getTrustedShopper' ]; /** @@ -727,7 +709,6 @@ public function __construct(array $data = null) $this->setIfExists('shopperReference', $data ?? [], null); $this->setIfExists('shopperStatement', $data ?? [], null); $this->setIfExists('showInstallmentAmount', $data ?? [], null); - $this->setIfExists('showRemovePaymentMethodButton', $data ?? [], null); $this->setIfExists('socialSecurityNumber', $data ?? [], null); $this->setIfExists('splitCardFundingSources', $data ?? [], null); $this->setIfExists('splits', $data ?? [], null); @@ -735,10 +716,8 @@ public function __construct(array $data = null) $this->setIfExists('storePaymentMethod', $data ?? [], null); $this->setIfExists('storePaymentMethodMode', $data ?? [], null); $this->setIfExists('telephoneNumber', $data ?? [], null); - $this->setIfExists('themeId', $data ?? [], null); $this->setIfExists('threeDSAuthenticationOnly', $data ?? [], null); $this->setIfExists('trustedShopper', $data ?? [], null); - $this->setIfExists('url', $data ?? [], null); } /** @@ -2234,33 +2213,6 @@ public function setShowInstallmentAmount($showInstallmentAmount) return $this; } - /** - * Gets showRemovePaymentMethodButton - * - * @return bool|null - */ - public function getShowRemovePaymentMethodButton() - { - return $this->container['showRemovePaymentMethodButton']; - } - - /** - * Sets showRemovePaymentMethodButton - * - * @param bool|null $showRemovePaymentMethodButton Set to **true** to show a button that lets the shopper remove a stored payment method. - * - * @return self - */ - public function setShowRemovePaymentMethodButton($showRemovePaymentMethodButton) - { - if (is_null($showRemovePaymentMethodButton)) { - throw new \InvalidArgumentException('non-nullable showRemovePaymentMethodButton cannot be null'); - } - $this->container['showRemovePaymentMethodButton'] = $showRemovePaymentMethodButton; - - return $this; - } - /** * Gets socialSecurityNumber * @@ -2355,7 +2307,7 @@ public function getStore() /** * Sets store * - * @param string|null $store Required for Adyen for Platforms integrations if you have a platform setup. This is your [reference](https://docs.adyen.com/api-explorer/Management/3/post/merchants/(merchantId)/stores#request-reference) (on [balance platform](https://docs.adyen.com/marketplaces-and-platforms/classic/platforms-for-partners#route-payments)) or the [storeReference](https://docs.adyen.com/api-explorer/Account/latest/post/updateAccountHolder#request-accountHolderDetails-storeDetails-storeReference) (in the [classic integration](https://docs.adyen.com/marketplaces-and-platforms/processing-payments/route-payment-to-store/#route-a-payment-to-a-store)) for the ecommerce or point-of-sale store that is processing the payment. + * @param string|null $store The ecommerce or point-of-sale store that is processing the payment. Used in: * [Partner platform integrations](https://docs.adyen.com/marketplaces-and-platforms/classic/platforms-for-partners#route-payments) for the [Classic Platforms integration](https://docs.adyen.com/marketplaces-and-platforms/classic). * [Platform setup integrations](https://docs.adyen.com/marketplaces-and-platforms/additional-for-platform-setup/route-payment-to-store) for the [Balance Platform](https://docs.adyen.com/marketplaces-and-platforms). * * @return self */ @@ -2460,33 +2412,6 @@ public function setTelephoneNumber($telephoneNumber) return $this; } - /** - * Gets themeId - * - * @return string|null - */ - public function getThemeId() - { - return $this->container['themeId']; - } - - /** - * Sets themeId - * - * @param string|null $themeId Sets a custom theme for [Hosted Checkout](https://docs.adyen.com/online-payments/build-your-integration/?platform=Web&integration=Hosted+Checkout). The value can be any of the **Theme ID** values from your Customer Area. - * - * @return self - */ - public function setThemeId($themeId) - { - if (is_null($themeId)) { - throw new \InvalidArgumentException('non-nullable themeId cannot be null'); - } - $this->container['themeId'] = $themeId; - - return $this; - } - /** * Gets threeDSAuthenticationOnly * @@ -2542,33 +2467,6 @@ public function setTrustedShopper($trustedShopper) return $this; } - - /** - * Gets url - * - * @return string|null - */ - public function getUrl() - { - return $this->container['url']; - } - - /** - * Sets url - * - * @param string|null $url The URL for the Hosted Checkout page. Redirect the shopper to this URL so they can make the payment. - * - * @return self - */ - public function setUrl($url) - { - if (is_null($url)) { - throw new \InvalidArgumentException('non-nullable url cannot be null'); - } - $this->container['url'] = $url; - - return $this; - } /** * Returns true if offset exists. False otherwise. * @@ -2636,6 +2534,32 @@ public function jsonSerialize() return ObjectSerializer::sanitizeForSerialization($this); } + public function toArray(): array + { + $array = []; + foreach (self::$openAPITypes as $propertyName => $propertyType) { + $propertyValue = $this[$propertyName]; + if ($propertyValue !== null) { + // Check if the property value is an object and has a toArray() method + if (is_object($propertyValue) && method_exists($propertyValue, 'toArray')) { + $array[$propertyName] = $propertyValue->toArray(); + // Check if it's type datetime + } elseif ($propertyValue instanceof \DateTime) { + $array[$propertyName] = $propertyValue->format(DATE_ATOM); + // If it's an array type we should check whether it contains objects and if so call toArray method + } elseif (is_array($propertyValue)) { + $array[$propertyName] = array_map(function ($item) { + return $item instanceof ModelInterface ? $item->toArray() : $item; + }, $propertyValue); + } else { + // Otherwise, directly assign the property value to the array + $array[$propertyName] = $propertyValue; + } + } + } + return $array; + } + /** * Gets the string presentation of the object * diff --git a/src/Adyen/Model/Checkout/CreateOrderRequest.php b/src/Adyen/Model/Checkout/CreateOrderRequest.php index a4f0cb2ab..ff9900089 100644 --- a/src/Adyen/Model/Checkout/CreateOrderRequest.php +++ b/src/Adyen/Model/Checkout/CreateOrderRequest.php @@ -5,7 +5,7 @@ * * The version of the OpenAPI document: 71 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 6.0.1 + * OpenAPI Generator version: 6.4.0 * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -480,6 +480,32 @@ public function jsonSerialize() return ObjectSerializer::sanitizeForSerialization($this); } + public function toArray(): array + { + $array = []; + foreach (self::$openAPITypes as $propertyName => $propertyType) { + $propertyValue = $this[$propertyName]; + if ($propertyValue !== null) { + // Check if the property value is an object and has a toArray() method + if (is_object($propertyValue) && method_exists($propertyValue, 'toArray')) { + $array[$propertyName] = $propertyValue->toArray(); + // Check if it's type datetime + } elseif ($propertyValue instanceof \DateTime) { + $array[$propertyName] = $propertyValue->format(DATE_ATOM); + // If it's an array type we should check whether it contains objects and if so call toArray method + } elseif (is_array($propertyValue)) { + $array[$propertyName] = array_map(function ($item) { + return $item instanceof ModelInterface ? $item->toArray() : $item; + }, $propertyValue); + } else { + // Otherwise, directly assign the property value to the array + $array[$propertyName] = $propertyValue; + } + } + } + return $array; + } + /** * Gets the string presentation of the object * diff --git a/src/Adyen/Model/Checkout/CreateOrderResponse.php b/src/Adyen/Model/Checkout/CreateOrderResponse.php index 277237313..e3d62d13f 100644 --- a/src/Adyen/Model/Checkout/CreateOrderResponse.php +++ b/src/Adyen/Model/Checkout/CreateOrderResponse.php @@ -5,7 +5,7 @@ * * The version of the OpenAPI document: 71 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 6.0.1 + * OpenAPI Generator version: 6.4.0 * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -721,6 +721,32 @@ public function jsonSerialize() return ObjectSerializer::sanitizeForSerialization($this); } + public function toArray(): array + { + $array = []; + foreach (self::$openAPITypes as $propertyName => $propertyType) { + $propertyValue = $this[$propertyName]; + if ($propertyValue !== null) { + // Check if the property value is an object and has a toArray() method + if (is_object($propertyValue) && method_exists($propertyValue, 'toArray')) { + $array[$propertyName] = $propertyValue->toArray(); + // Check if it's type datetime + } elseif ($propertyValue instanceof \DateTime) { + $array[$propertyName] = $propertyValue->format(DATE_ATOM); + // If it's an array type we should check whether it contains objects and if so call toArray method + } elseif (is_array($propertyValue)) { + $array[$propertyName] = array_map(function ($item) { + return $item instanceof ModelInterface ? $item->toArray() : $item; + }, $propertyValue); + } else { + // Otherwise, directly assign the property value to the array + $array[$propertyName] = $propertyValue; + } + } + } + return $array; + } + /** * Gets the string presentation of the object * diff --git a/src/Adyen/Model/Checkout/DeliveryAddress.php b/src/Adyen/Model/Checkout/DeliveryAddress.php index 144917909..de08f1acc 100644 --- a/src/Adyen/Model/Checkout/DeliveryAddress.php +++ b/src/Adyen/Model/Checkout/DeliveryAddress.php @@ -5,7 +5,7 @@ * * The version of the OpenAPI document: 71 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 6.0.1 + * OpenAPI Generator version: 6.4.0 * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -622,6 +622,32 @@ public function jsonSerialize() return ObjectSerializer::sanitizeForSerialization($this); } + public function toArray(): array + { + $array = []; + foreach (self::$openAPITypes as $propertyName => $propertyType) { + $propertyValue = $this[$propertyName]; + if ($propertyValue !== null) { + // Check if the property value is an object and has a toArray() method + if (is_object($propertyValue) && method_exists($propertyValue, 'toArray')) { + $array[$propertyName] = $propertyValue->toArray(); + // Check if it's type datetime + } elseif ($propertyValue instanceof \DateTime) { + $array[$propertyName] = $propertyValue->format(DATE_ATOM); + // If it's an array type we should check whether it contains objects and if so call toArray method + } elseif (is_array($propertyValue)) { + $array[$propertyName] = array_map(function ($item) { + return $item instanceof ModelInterface ? $item->toArray() : $item; + }, $propertyValue); + } else { + // Otherwise, directly assign the property value to the array + $array[$propertyName] = $propertyValue; + } + } + } + return $array; + } + /** * Gets the string presentation of the object * diff --git a/src/Adyen/Model/Checkout/DetailsRequestAuthenticationData.php b/src/Adyen/Model/Checkout/DetailsRequestAuthenticationData.php index ef65cbd0d..31ccbb35b 100644 --- a/src/Adyen/Model/Checkout/DetailsRequestAuthenticationData.php +++ b/src/Adyen/Model/Checkout/DetailsRequestAuthenticationData.php @@ -5,7 +5,7 @@ * * The version of the OpenAPI document: 71 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 6.0.1 + * OpenAPI Generator version: 6.4.0 * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -369,6 +369,32 @@ public function jsonSerialize() return ObjectSerializer::sanitizeForSerialization($this); } + public function toArray(): array + { + $array = []; + foreach (self::$openAPITypes as $propertyName => $propertyType) { + $propertyValue = $this[$propertyName]; + if ($propertyValue !== null) { + // Check if the property value is an object and has a toArray() method + if (is_object($propertyValue) && method_exists($propertyValue, 'toArray')) { + $array[$propertyName] = $propertyValue->toArray(); + // Check if it's type datetime + } elseif ($propertyValue instanceof \DateTime) { + $array[$propertyName] = $propertyValue->format(DATE_ATOM); + // If it's an array type we should check whether it contains objects and if so call toArray method + } elseif (is_array($propertyValue)) { + $array[$propertyName] = array_map(function ($item) { + return $item instanceof ModelInterface ? $item->toArray() : $item; + }, $propertyValue); + } else { + // Otherwise, directly assign the property value to the array + $array[$propertyName] = $propertyValue; + } + } + } + return $array; + } + /** * Gets the string presentation of the object * diff --git a/src/Adyen/Model/Checkout/DeviceRenderOptions.php b/src/Adyen/Model/Checkout/DeviceRenderOptions.php index b3a868a14..52f6d5006 100644 --- a/src/Adyen/Model/Checkout/DeviceRenderOptions.php +++ b/src/Adyen/Model/Checkout/DeviceRenderOptions.php @@ -5,7 +5,7 @@ * * The version of the OpenAPI document: 71 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 6.0.1 + * OpenAPI Generator version: 6.4.0 * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -467,6 +467,32 @@ public function jsonSerialize() return ObjectSerializer::sanitizeForSerialization($this); } + public function toArray(): array + { + $array = []; + foreach (self::$openAPITypes as $propertyName => $propertyType) { + $propertyValue = $this[$propertyName]; + if ($propertyValue !== null) { + // Check if the property value is an object and has a toArray() method + if (is_object($propertyValue) && method_exists($propertyValue, 'toArray')) { + $array[$propertyName] = $propertyValue->toArray(); + // Check if it's type datetime + } elseif ($propertyValue instanceof \DateTime) { + $array[$propertyName] = $propertyValue->format(DATE_ATOM); + // If it's an array type we should check whether it contains objects and if so call toArray method + } elseif (is_array($propertyValue)) { + $array[$propertyName] = array_map(function ($item) { + return $item instanceof ModelInterface ? $item->toArray() : $item; + }, $propertyValue); + } else { + // Otherwise, directly assign the property value to the array + $array[$propertyName] = $propertyValue; + } + } + } + return $array; + } + /** * Gets the string presentation of the object * diff --git a/src/Adyen/Model/Checkout/DokuDetails.php b/src/Adyen/Model/Checkout/DokuDetails.php index 2a6e428c7..90ca95079 100644 --- a/src/Adyen/Model/Checkout/DokuDetails.php +++ b/src/Adyen/Model/Checkout/DokuDetails.php @@ -5,7 +5,7 @@ * * The version of the OpenAPI document: 71 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 6.0.1 + * OpenAPI Generator version: 6.4.0 * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -568,6 +568,32 @@ public function jsonSerialize() return ObjectSerializer::sanitizeForSerialization($this); } + public function toArray(): array + { + $array = []; + foreach (self::$openAPITypes as $propertyName => $propertyType) { + $propertyValue = $this[$propertyName]; + if ($propertyValue !== null) { + // Check if the property value is an object and has a toArray() method + if (is_object($propertyValue) && method_exists($propertyValue, 'toArray')) { + $array[$propertyName] = $propertyValue->toArray(); + // Check if it's type datetime + } elseif ($propertyValue instanceof \DateTime) { + $array[$propertyName] = $propertyValue->format(DATE_ATOM); + // If it's an array type we should check whether it contains objects and if so call toArray method + } elseif (is_array($propertyValue)) { + $array[$propertyName] = array_map(function ($item) { + return $item instanceof ModelInterface ? $item->toArray() : $item; + }, $propertyValue); + } else { + // Otherwise, directly assign the property value to the array + $array[$propertyName] = $propertyValue; + } + } + } + return $array; + } + /** * Gets the string presentation of the object * diff --git a/src/Adyen/Model/Checkout/DonationPaymentMethod.php b/src/Adyen/Model/Checkout/DonationPaymentMethod.php index d0dfa3d7f..7201dd587 100644 --- a/src/Adyen/Model/Checkout/DonationPaymentMethod.php +++ b/src/Adyen/Model/Checkout/DonationPaymentMethod.php @@ -5,7 +5,7 @@ * * The version of the OpenAPI document: 71 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 6.0.1 + * OpenAPI Generator version: 6.4.0 * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -65,7 +65,6 @@ class DonationPaymentMethod implements ModelInterface, ArrayAccess, \JsonSeriali 'number' => 'string', 'shopperNotificationReference' => 'string', 'threeDS2SdkVersion' => 'string', - 'googlePayCardNetwork' => 'string', 'googlePayToken' => 'string', 'issuer' => 'string' ]; @@ -98,7 +97,6 @@ class DonationPaymentMethod implements ModelInterface, ArrayAccess, \JsonSeriali 'number' => null, 'shopperNotificationReference' => null, 'threeDS2SdkVersion' => null, - 'googlePayCardNetwork' => null, 'googlePayToken' => null, 'issuer' => null ]; @@ -129,7 +127,6 @@ class DonationPaymentMethod implements ModelInterface, ArrayAccess, \JsonSeriali 'number' => false, 'shopperNotificationReference' => false, 'threeDS2SdkVersion' => false, - 'googlePayCardNetwork' => false, 'googlePayToken' => false, 'issuer' => false ]; @@ -240,7 +237,6 @@ public function isNullableSetToNull(string $property): bool 'number' => 'number', 'shopperNotificationReference' => 'shopperNotificationReference', 'threeDS2SdkVersion' => 'threeDS2SdkVersion', - 'googlePayCardNetwork' => 'googlePayCardNetwork', 'googlePayToken' => 'googlePayToken', 'issuer' => 'issuer' ]; @@ -271,7 +267,6 @@ public function isNullableSetToNull(string $property): bool 'number' => 'setNumber', 'shopperNotificationReference' => 'setShopperNotificationReference', 'threeDS2SdkVersion' => 'setThreeDS2SdkVersion', - 'googlePayCardNetwork' => 'setGooglePayCardNetwork', 'googlePayToken' => 'setGooglePayToken', 'issuer' => 'setIssuer' ]; @@ -302,7 +297,6 @@ public function isNullableSetToNull(string $property): bool 'number' => 'getNumber', 'shopperNotificationReference' => 'getShopperNotificationReference', 'threeDS2SdkVersion' => 'getThreeDS2SdkVersion', - 'googlePayCardNetwork' => 'getGooglePayCardNetwork', 'googlePayToken' => 'getGooglePayToken', 'issuer' => 'getIssuer' ]; @@ -383,7 +377,6 @@ public function __construct(array $data = null) $this->setIfExists('number', $data ?? [], null); $this->setIfExists('shopperNotificationReference', $data ?? [], null); $this->setIfExists('threeDS2SdkVersion', $data ?? [], null); - $this->setIfExists('googlePayCardNetwork', $data ?? [], null); $this->setIfExists('googlePayToken', $data ?? [], null); $this->setIfExists('issuer', $data ?? [], null); } @@ -985,33 +978,6 @@ public function setThreeDS2SdkVersion($threeDS2SdkVersion) return $this; } - /** - * Gets googlePayCardNetwork - * - * @return string|null - */ - public function getGooglePayCardNetwork() - { - return $this->container['googlePayCardNetwork']; - } - - /** - * Sets googlePayCardNetwork - * - * @param string|null $googlePayCardNetwork The selected payment card network. - * - * @return self - */ - public function setGooglePayCardNetwork($googlePayCardNetwork) - { - if (is_null($googlePayCardNetwork)) { - throw new \InvalidArgumentException('non-nullable googlePayCardNetwork cannot be null'); - } - $this->container['googlePayCardNetwork'] = $googlePayCardNetwork; - - return $this; - } - /** * Gets googlePayToken * @@ -1132,6 +1098,32 @@ public function jsonSerialize() return ObjectSerializer::sanitizeForSerialization($this); } + public function toArray(): array + { + $array = []; + foreach (self::$openAPITypes as $propertyName => $propertyType) { + $propertyValue = $this[$propertyName]; + if ($propertyValue !== null) { + // Check if the property value is an object and has a toArray() method + if (is_object($propertyValue) && method_exists($propertyValue, 'toArray')) { + $array[$propertyName] = $propertyValue->toArray(); + // Check if it's type datetime + } elseif ($propertyValue instanceof \DateTime) { + $array[$propertyName] = $propertyValue->format(DATE_ATOM); + // If it's an array type we should check whether it contains objects and if so call toArray method + } elseif (is_array($propertyValue)) { + $array[$propertyName] = array_map(function ($item) { + return $item instanceof ModelInterface ? $item->toArray() : $item; + }, $propertyValue); + } else { + // Otherwise, directly assign the property value to the array + $array[$propertyName] = $propertyValue; + } + } + } + return $array; + } + /** * Gets the string presentation of the object * diff --git a/src/Adyen/Model/Checkout/DonationPaymentRequest.php b/src/Adyen/Model/Checkout/DonationPaymentRequest.php index f705b2bd2..0aede4647 100644 --- a/src/Adyen/Model/Checkout/DonationPaymentRequest.php +++ b/src/Adyen/Model/Checkout/DonationPaymentRequest.php @@ -5,7 +5,7 @@ * * The version of the OpenAPI document: 71 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 6.0.1 + * OpenAPI Generator version: 6.4.0 * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -603,6 +603,9 @@ public function listInvalidProperties() ); } + if ($this->container['donationAccount'] === null) { + $invalidProperties[] = "'donationAccount' can't be null"; + } if ($this->container['merchantAccount'] === null) { $invalidProperties[] = "'merchantAccount' can't be null"; } @@ -1068,7 +1071,7 @@ public function setDeviceFingerprint($deviceFingerprint) /** * Gets donationAccount * - * @return string|null + * @return string */ public function getDonationAccount() { @@ -1078,7 +1081,7 @@ public function getDonationAccount() /** * Sets donationAccount * - * @param string|null $donationAccount Donation account to which the transaction is credited. + * @param string $donationAccount Donation account to which the transaction is credited. * * @return self */ @@ -1855,6 +1858,32 @@ public function jsonSerialize() return ObjectSerializer::sanitizeForSerialization($this); } + public function toArray(): array + { + $array = []; + foreach (self::$openAPITypes as $propertyName => $propertyType) { + $propertyValue = $this[$propertyName]; + if ($propertyValue !== null) { + // Check if the property value is an object and has a toArray() method + if (is_object($propertyValue) && method_exists($propertyValue, 'toArray')) { + $array[$propertyName] = $propertyValue->toArray(); + // Check if it's type datetime + } elseif ($propertyValue instanceof \DateTime) { + $array[$propertyName] = $propertyValue->format(DATE_ATOM); + // If it's an array type we should check whether it contains objects and if so call toArray method + } elseif (is_array($propertyValue)) { + $array[$propertyName] = array_map(function ($item) { + return $item instanceof ModelInterface ? $item->toArray() : $item; + }, $propertyValue); + } else { + // Otherwise, directly assign the property value to the array + $array[$propertyName] = $propertyValue; + } + } + } + return $array; + } + /** * Gets the string presentation of the object * diff --git a/src/Adyen/Model/Checkout/DonationPaymentResponse.php b/src/Adyen/Model/Checkout/DonationPaymentResponse.php index 749d65837..0b849f6e3 100644 --- a/src/Adyen/Model/Checkout/DonationPaymentResponse.php +++ b/src/Adyen/Model/Checkout/DonationPaymentResponse.php @@ -5,7 +5,7 @@ * * The version of the OpenAPI document: 71 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 6.0.1 + * OpenAPI Generator version: 6.4.0 * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -608,6 +608,32 @@ public function jsonSerialize() return ObjectSerializer::sanitizeForSerialization($this); } + public function toArray(): array + { + $array = []; + foreach (self::$openAPITypes as $propertyName => $propertyType) { + $propertyValue = $this[$propertyName]; + if ($propertyValue !== null) { + // Check if the property value is an object and has a toArray() method + if (is_object($propertyValue) && method_exists($propertyValue, 'toArray')) { + $array[$propertyName] = $propertyValue->toArray(); + // Check if it's type datetime + } elseif ($propertyValue instanceof \DateTime) { + $array[$propertyName] = $propertyValue->format(DATE_ATOM); + // If it's an array type we should check whether it contains objects and if so call toArray method + } elseif (is_array($propertyValue)) { + $array[$propertyName] = array_map(function ($item) { + return $item instanceof ModelInterface ? $item->toArray() : $item; + }, $propertyValue); + } else { + // Otherwise, directly assign the property value to the array + $array[$propertyName] = $propertyValue; + } + } + } + return $array; + } + /** * Gets the string presentation of the object * diff --git a/src/Adyen/Model/Checkout/DotpayDetails.php b/src/Adyen/Model/Checkout/DotpayDetails.php index 4f06d239f..94b172b4c 100644 --- a/src/Adyen/Model/Checkout/DotpayDetails.php +++ b/src/Adyen/Model/Checkout/DotpayDetails.php @@ -5,7 +5,7 @@ * * The version of the OpenAPI document: 71 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 6.0.1 + * OpenAPI Generator version: 6.4.0 * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -471,6 +471,32 @@ public function jsonSerialize() return ObjectSerializer::sanitizeForSerialization($this); } + public function toArray(): array + { + $array = []; + foreach (self::$openAPITypes as $propertyName => $propertyType) { + $propertyValue = $this[$propertyName]; + if ($propertyValue !== null) { + // Check if the property value is an object and has a toArray() method + if (is_object($propertyValue) && method_exists($propertyValue, 'toArray')) { + $array[$propertyName] = $propertyValue->toArray(); + // Check if it's type datetime + } elseif ($propertyValue instanceof \DateTime) { + $array[$propertyName] = $propertyValue->format(DATE_ATOM); + // If it's an array type we should check whether it contains objects and if so call toArray method + } elseif (is_array($propertyValue)) { + $array[$propertyName] = array_map(function ($item) { + return $item instanceof ModelInterface ? $item->toArray() : $item; + }, $propertyValue); + } else { + // Otherwise, directly assign the property value to the array + $array[$propertyName] = $propertyValue; + } + } + } + return $array; + } + /** * Gets the string presentation of the object * diff --git a/src/Adyen/Model/Checkout/DragonpayDetails.php b/src/Adyen/Model/Checkout/DragonpayDetails.php index 82316fe45..28842394f 100644 --- a/src/Adyen/Model/Checkout/DragonpayDetails.php +++ b/src/Adyen/Model/Checkout/DragonpayDetails.php @@ -5,7 +5,7 @@ * * The version of the OpenAPI document: 71 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 6.0.1 + * OpenAPI Generator version: 6.4.0 * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -514,6 +514,32 @@ public function jsonSerialize() return ObjectSerializer::sanitizeForSerialization($this); } + public function toArray(): array + { + $array = []; + foreach (self::$openAPITypes as $propertyName => $propertyType) { + $propertyValue = $this[$propertyName]; + if ($propertyValue !== null) { + // Check if the property value is an object and has a toArray() method + if (is_object($propertyValue) && method_exists($propertyValue, 'toArray')) { + $array[$propertyName] = $propertyValue->toArray(); + // Check if it's type datetime + } elseif ($propertyValue instanceof \DateTime) { + $array[$propertyName] = $propertyValue->format(DATE_ATOM); + // If it's an array type we should check whether it contains objects and if so call toArray method + } elseif (is_array($propertyValue)) { + $array[$propertyName] = array_map(function ($item) { + return $item instanceof ModelInterface ? $item->toArray() : $item; + }, $propertyValue); + } else { + // Otherwise, directly assign the property value to the array + $array[$propertyName] = $propertyValue; + } + } + } + return $array; + } + /** * Gets the string presentation of the object * diff --git a/src/Adyen/Model/Checkout/EcontextVoucherDetails.php b/src/Adyen/Model/Checkout/EcontextVoucherDetails.php index 6a690c8c9..fab1a244a 100644 --- a/src/Adyen/Model/Checkout/EcontextVoucherDetails.php +++ b/src/Adyen/Model/Checkout/EcontextVoucherDetails.php @@ -5,7 +5,7 @@ * * The version of the OpenAPI document: 71 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 6.0.1 + * OpenAPI Generator version: 6.4.0 * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -587,6 +587,32 @@ public function jsonSerialize() return ObjectSerializer::sanitizeForSerialization($this); } + public function toArray(): array + { + $array = []; + foreach (self::$openAPITypes as $propertyName => $propertyType) { + $propertyValue = $this[$propertyName]; + if ($propertyValue !== null) { + // Check if the property value is an object and has a toArray() method + if (is_object($propertyValue) && method_exists($propertyValue, 'toArray')) { + $array[$propertyName] = $propertyValue->toArray(); + // Check if it's type datetime + } elseif ($propertyValue instanceof \DateTime) { + $array[$propertyName] = $propertyValue->format(DATE_ATOM); + // If it's an array type we should check whether it contains objects and if so call toArray method + } elseif (is_array($propertyValue)) { + $array[$propertyName] = array_map(function ($item) { + return $item instanceof ModelInterface ? $item->toArray() : $item; + }, $propertyValue); + } else { + // Otherwise, directly assign the property value to the array + $array[$propertyName] = $propertyValue; + } + } + } + return $array; + } + /** * Gets the string presentation of the object * diff --git a/src/Adyen/Model/Checkout/EncryptedOrderData.php b/src/Adyen/Model/Checkout/EncryptedOrderData.php index 004257872..fe12e9910 100644 --- a/src/Adyen/Model/Checkout/EncryptedOrderData.php +++ b/src/Adyen/Model/Checkout/EncryptedOrderData.php @@ -5,7 +5,7 @@ * * The version of the OpenAPI document: 71 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 6.0.1 + * OpenAPI Generator version: 6.4.0 * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -409,6 +409,32 @@ public function jsonSerialize() return ObjectSerializer::sanitizeForSerialization($this); } + public function toArray(): array + { + $array = []; + foreach (self::$openAPITypes as $propertyName => $propertyType) { + $propertyValue = $this[$propertyName]; + if ($propertyValue !== null) { + // Check if the property value is an object and has a toArray() method + if (is_object($propertyValue) && method_exists($propertyValue, 'toArray')) { + $array[$propertyName] = $propertyValue->toArray(); + // Check if it's type datetime + } elseif ($propertyValue instanceof \DateTime) { + $array[$propertyName] = $propertyValue->format(DATE_ATOM); + // If it's an array type we should check whether it contains objects and if so call toArray method + } elseif (is_array($propertyValue)) { + $array[$propertyName] = array_map(function ($item) { + return $item instanceof ModelInterface ? $item->toArray() : $item; + }, $propertyValue); + } else { + // Otherwise, directly assign the property value to the array + $array[$propertyName] = $propertyValue; + } + } + } + return $array; + } + /** * Gets the string presentation of the object * diff --git a/src/Adyen/Model/Checkout/ExternalPlatform.php b/src/Adyen/Model/Checkout/ExternalPlatform.php index a87f8391f..ddf5df76e 100644 --- a/src/Adyen/Model/Checkout/ExternalPlatform.php +++ b/src/Adyen/Model/Checkout/ExternalPlatform.php @@ -5,7 +5,7 @@ * * The version of the OpenAPI document: 71 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 6.0.1 + * OpenAPI Generator version: 6.4.0 * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -437,6 +437,32 @@ public function jsonSerialize() return ObjectSerializer::sanitizeForSerialization($this); } + public function toArray(): array + { + $array = []; + foreach (self::$openAPITypes as $propertyName => $propertyType) { + $propertyValue = $this[$propertyName]; + if ($propertyValue !== null) { + // Check if the property value is an object and has a toArray() method + if (is_object($propertyValue) && method_exists($propertyValue, 'toArray')) { + $array[$propertyName] = $propertyValue->toArray(); + // Check if it's type datetime + } elseif ($propertyValue instanceof \DateTime) { + $array[$propertyName] = $propertyValue->format(DATE_ATOM); + // If it's an array type we should check whether it contains objects and if so call toArray method + } elseif (is_array($propertyValue)) { + $array[$propertyName] = array_map(function ($item) { + return $item instanceof ModelInterface ? $item->toArray() : $item; + }, $propertyValue); + } else { + // Otherwise, directly assign the property value to the array + $array[$propertyName] = $propertyValue; + } + } + } + return $array; + } + /** * Gets the string presentation of the object * diff --git a/src/Adyen/Model/Checkout/ForexQuote.php b/src/Adyen/Model/Checkout/ForexQuote.php index 17f4e62d6..d975c28f9 100644 --- a/src/Adyen/Model/Checkout/ForexQuote.php +++ b/src/Adyen/Model/Checkout/ForexQuote.php @@ -5,7 +5,7 @@ * * The version of the OpenAPI document: 71 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 6.0.1 + * OpenAPI Generator version: 6.4.0 * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -747,6 +747,32 @@ public function jsonSerialize() return ObjectSerializer::sanitizeForSerialization($this); } + public function toArray(): array + { + $array = []; + foreach (self::$openAPITypes as $propertyName => $propertyType) { + $propertyValue = $this[$propertyName]; + if ($propertyValue !== null) { + // Check if the property value is an object and has a toArray() method + if (is_object($propertyValue) && method_exists($propertyValue, 'toArray')) { + $array[$propertyName] = $propertyValue->toArray(); + // Check if it's type datetime + } elseif ($propertyValue instanceof \DateTime) { + $array[$propertyName] = $propertyValue->format(DATE_ATOM); + // If it's an array type we should check whether it contains objects and if so call toArray method + } elseif (is_array($propertyValue)) { + $array[$propertyName] = array_map(function ($item) { + return $item instanceof ModelInterface ? $item->toArray() : $item; + }, $propertyValue); + } else { + // Otherwise, directly assign the property value to the array + $array[$propertyName] = $propertyValue; + } + } + } + return $array; + } + /** * Gets the string presentation of the object * diff --git a/src/Adyen/Model/Checkout/FraudCheckResult.php b/src/Adyen/Model/Checkout/FraudCheckResult.php index d743ad334..31368e236 100644 --- a/src/Adyen/Model/Checkout/FraudCheckResult.php +++ b/src/Adyen/Model/Checkout/FraudCheckResult.php @@ -5,7 +5,7 @@ * * The version of the OpenAPI document: 71 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 6.0.1 + * OpenAPI Generator version: 6.4.0 * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -442,6 +442,32 @@ public function jsonSerialize() return ObjectSerializer::sanitizeForSerialization($this); } + public function toArray(): array + { + $array = []; + foreach (self::$openAPITypes as $propertyName => $propertyType) { + $propertyValue = $this[$propertyName]; + if ($propertyValue !== null) { + // Check if the property value is an object and has a toArray() method + if (is_object($propertyValue) && method_exists($propertyValue, 'toArray')) { + $array[$propertyName] = $propertyValue->toArray(); + // Check if it's type datetime + } elseif ($propertyValue instanceof \DateTime) { + $array[$propertyName] = $propertyValue->format(DATE_ATOM); + // If it's an array type we should check whether it contains objects and if so call toArray method + } elseif (is_array($propertyValue)) { + $array[$propertyName] = array_map(function ($item) { + return $item instanceof ModelInterface ? $item->toArray() : $item; + }, $propertyValue); + } else { + // Otherwise, directly assign the property value to the array + $array[$propertyName] = $propertyValue; + } + } + } + return $array; + } + /** * Gets the string presentation of the object * diff --git a/src/Adyen/Model/Checkout/FraudResult.php b/src/Adyen/Model/Checkout/FraudResult.php index e21cf0279..3671e0621 100644 --- a/src/Adyen/Model/Checkout/FraudResult.php +++ b/src/Adyen/Model/Checkout/FraudResult.php @@ -5,7 +5,7 @@ * * The version of the OpenAPI document: 71 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 6.0.1 + * OpenAPI Generator version: 6.4.0 * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -404,6 +404,32 @@ public function jsonSerialize() return ObjectSerializer::sanitizeForSerialization($this); } + public function toArray(): array + { + $array = []; + foreach (self::$openAPITypes as $propertyName => $propertyType) { + $propertyValue = $this[$propertyName]; + if ($propertyValue !== null) { + // Check if the property value is an object and has a toArray() method + if (is_object($propertyValue) && method_exists($propertyValue, 'toArray')) { + $array[$propertyName] = $propertyValue->toArray(); + // Check if it's type datetime + } elseif ($propertyValue instanceof \DateTime) { + $array[$propertyName] = $propertyValue->format(DATE_ATOM); + // If it's an array type we should check whether it contains objects and if so call toArray method + } elseif (is_array($propertyValue)) { + $array[$propertyName] = array_map(function ($item) { + return $item instanceof ModelInterface ? $item->toArray() : $item; + }, $propertyValue); + } else { + // Otherwise, directly assign the property value to the array + $array[$propertyName] = $propertyValue; + } + } + } + return $array; + } + /** * Gets the string presentation of the object * diff --git a/src/Adyen/Model/Checkout/FundOrigin.php b/src/Adyen/Model/Checkout/FundOrigin.php index 24e9340cf..d17b49b22 100644 --- a/src/Adyen/Model/Checkout/FundOrigin.php +++ b/src/Adyen/Model/Checkout/FundOrigin.php @@ -5,7 +5,7 @@ * * The version of the OpenAPI document: 71 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 6.0.1 + * OpenAPI Generator version: 6.4.0 * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -45,10 +45,7 @@ class FundOrigin implements ModelInterface, ArrayAccess, \JsonSerializable */ protected static $openAPITypes = [ 'billingAddress' => '\Adyen\Model\Checkout\Address', - 'shopperEmail' => 'string', - 'shopperName' => '\Adyen\Model\Checkout\Name', - 'telephoneNumber' => 'string', - 'walletIdentifier' => 'string' + 'shopperName' => '\Adyen\Model\Checkout\Name' ]; /** @@ -60,10 +57,7 @@ class FundOrigin implements ModelInterface, ArrayAccess, \JsonSerializable */ protected static $openAPIFormats = [ 'billingAddress' => null, - 'shopperEmail' => null, - 'shopperName' => null, - 'telephoneNumber' => null, - 'walletIdentifier' => null + 'shopperName' => null ]; /** @@ -73,10 +67,7 @@ class FundOrigin implements ModelInterface, ArrayAccess, \JsonSerializable */ protected static $openAPINullables = [ 'billingAddress' => false, - 'shopperEmail' => false, - 'shopperName' => false, - 'telephoneNumber' => false, - 'walletIdentifier' => false + 'shopperName' => false ]; /** @@ -166,10 +157,7 @@ public function isNullableSetToNull(string $property): bool */ protected static $attributeMap = [ 'billingAddress' => 'billingAddress', - 'shopperEmail' => 'shopperEmail', - 'shopperName' => 'shopperName', - 'telephoneNumber' => 'telephoneNumber', - 'walletIdentifier' => 'walletIdentifier' + 'shopperName' => 'shopperName' ]; /** @@ -179,10 +167,7 @@ public function isNullableSetToNull(string $property): bool */ protected static $setters = [ 'billingAddress' => 'setBillingAddress', - 'shopperEmail' => 'setShopperEmail', - 'shopperName' => 'setShopperName', - 'telephoneNumber' => 'setTelephoneNumber', - 'walletIdentifier' => 'setWalletIdentifier' + 'shopperName' => 'setShopperName' ]; /** @@ -192,10 +177,7 @@ public function isNullableSetToNull(string $property): bool */ protected static $getters = [ 'billingAddress' => 'getBillingAddress', - 'shopperEmail' => 'getShopperEmail', - 'shopperName' => 'getShopperName', - 'telephoneNumber' => 'getTelephoneNumber', - 'walletIdentifier' => 'getWalletIdentifier' + 'shopperName' => 'getShopperName' ]; /** @@ -256,10 +238,7 @@ public function getModelName() public function __construct(array $data = null) { $this->setIfExists('billingAddress', $data ?? [], null); - $this->setIfExists('shopperEmail', $data ?? [], null); $this->setIfExists('shopperName', $data ?? [], null); - $this->setIfExists('telephoneNumber', $data ?? [], null); - $this->setIfExists('walletIdentifier', $data ?? [], null); } /** @@ -331,33 +310,6 @@ public function setBillingAddress($billingAddress) return $this; } - /** - * Gets shopperEmail - * - * @return string|null - */ - public function getShopperEmail() - { - return $this->container['shopperEmail']; - } - - /** - * Sets shopperEmail - * - * @param string|null $shopperEmail Email address of the person. - * - * @return self - */ - public function setShopperEmail($shopperEmail) - { - if (is_null($shopperEmail)) { - throw new \InvalidArgumentException('non-nullable shopperEmail cannot be null'); - } - $this->container['shopperEmail'] = $shopperEmail; - - return $this; - } - /** * Gets shopperName * @@ -384,60 +336,6 @@ public function setShopperName($shopperName) return $this; } - - /** - * Gets telephoneNumber - * - * @return string|null - */ - public function getTelephoneNumber() - { - return $this->container['telephoneNumber']; - } - - /** - * Sets telephoneNumber - * - * @param string|null $telephoneNumber Phone number of the person - * - * @return self - */ - public function setTelephoneNumber($telephoneNumber) - { - if (is_null($telephoneNumber)) { - throw new \InvalidArgumentException('non-nullable telephoneNumber cannot be null'); - } - $this->container['telephoneNumber'] = $telephoneNumber; - - return $this; - } - - /** - * Gets walletIdentifier - * - * @return string|null - */ - public function getWalletIdentifier() - { - return $this->container['walletIdentifier']; - } - - /** - * Sets walletIdentifier - * - * @param string|null $walletIdentifier walletIdentifier - * - * @return self - */ - public function setWalletIdentifier($walletIdentifier) - { - if (is_null($walletIdentifier)) { - throw new \InvalidArgumentException('non-nullable walletIdentifier cannot be null'); - } - $this->container['walletIdentifier'] = $walletIdentifier; - - return $this; - } /** * Returns true if offset exists. False otherwise. * @@ -505,6 +403,32 @@ public function jsonSerialize() return ObjectSerializer::sanitizeForSerialization($this); } + public function toArray(): array + { + $array = []; + foreach (self::$openAPITypes as $propertyName => $propertyType) { + $propertyValue = $this[$propertyName]; + if ($propertyValue !== null) { + // Check if the property value is an object and has a toArray() method + if (is_object($propertyValue) && method_exists($propertyValue, 'toArray')) { + $array[$propertyName] = $propertyValue->toArray(); + // Check if it's type datetime + } elseif ($propertyValue instanceof \DateTime) { + $array[$propertyName] = $propertyValue->format(DATE_ATOM); + // If it's an array type we should check whether it contains objects and if so call toArray method + } elseif (is_array($propertyValue)) { + $array[$propertyName] = array_map(function ($item) { + return $item instanceof ModelInterface ? $item->toArray() : $item; + }, $propertyValue); + } else { + // Otherwise, directly assign the property value to the array + $array[$propertyName] = $propertyValue; + } + } + } + return $array; + } + /** * Gets the string presentation of the object * diff --git a/src/Adyen/Model/Checkout/FundRecipient.php b/src/Adyen/Model/Checkout/FundRecipient.php index 6354f61a1..d5b48f54b 100644 --- a/src/Adyen/Model/Checkout/FundRecipient.php +++ b/src/Adyen/Model/Checkout/FundRecipient.php @@ -5,7 +5,7 @@ * * The version of the OpenAPI document: 71 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 6.0.1 + * OpenAPI Generator version: 6.4.0 * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -675,6 +675,32 @@ public function jsonSerialize() return ObjectSerializer::sanitizeForSerialization($this); } + public function toArray(): array + { + $array = []; + foreach (self::$openAPITypes as $propertyName => $propertyType) { + $propertyValue = $this[$propertyName]; + if ($propertyValue !== null) { + // Check if the property value is an object and has a toArray() method + if (is_object($propertyValue) && method_exists($propertyValue, 'toArray')) { + $array[$propertyName] = $propertyValue->toArray(); + // Check if it's type datetime + } elseif ($propertyValue instanceof \DateTime) { + $array[$propertyName] = $propertyValue->format(DATE_ATOM); + // If it's an array type we should check whether it contains objects and if so call toArray method + } elseif (is_array($propertyValue)) { + $array[$propertyName] = array_map(function ($item) { + return $item instanceof ModelInterface ? $item->toArray() : $item; + }, $propertyValue); + } else { + // Otherwise, directly assign the property value to the array + $array[$propertyName] = $propertyValue; + } + } + } + return $array; + } + /** * Gets the string presentation of the object * diff --git a/src/Adyen/Model/Checkout/GenericIssuerPaymentMethodDetails.php b/src/Adyen/Model/Checkout/GenericIssuerPaymentMethodDetails.php index 0568f60b1..727b9474e 100644 --- a/src/Adyen/Model/Checkout/GenericIssuerPaymentMethodDetails.php +++ b/src/Adyen/Model/Checkout/GenericIssuerPaymentMethodDetails.php @@ -5,7 +5,7 @@ * * The version of the OpenAPI document: 71 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 6.0.1 + * OpenAPI Generator version: 6.4.0 * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -550,6 +550,32 @@ public function jsonSerialize() return ObjectSerializer::sanitizeForSerialization($this); } + public function toArray(): array + { + $array = []; + foreach (self::$openAPITypes as $propertyName => $propertyType) { + $propertyValue = $this[$propertyName]; + if ($propertyValue !== null) { + // Check if the property value is an object and has a toArray() method + if (is_object($propertyValue) && method_exists($propertyValue, 'toArray')) { + $array[$propertyName] = $propertyValue->toArray(); + // Check if it's type datetime + } elseif ($propertyValue instanceof \DateTime) { + $array[$propertyName] = $propertyValue->format(DATE_ATOM); + // If it's an array type we should check whether it contains objects and if so call toArray method + } elseif (is_array($propertyValue)) { + $array[$propertyName] = array_map(function ($item) { + return $item instanceof ModelInterface ? $item->toArray() : $item; + }, $propertyValue); + } else { + // Otherwise, directly assign the property value to the array + $array[$propertyName] = $propertyValue; + } + } + } + return $array; + } + /** * Gets the string presentation of the object * diff --git a/src/Adyen/Model/Checkout/GiropayDetails.php b/src/Adyen/Model/Checkout/GiropayDetails.php index 00a6543a5..728476592 100644 --- a/src/Adyen/Model/Checkout/GiropayDetails.php +++ b/src/Adyen/Model/Checkout/GiropayDetails.php @@ -5,7 +5,7 @@ * * The version of the OpenAPI document: 71 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 6.0.1 + * OpenAPI Generator version: 6.4.0 * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -504,6 +504,32 @@ public function jsonSerialize() return ObjectSerializer::sanitizeForSerialization($this); } + public function toArray(): array + { + $array = []; + foreach (self::$openAPITypes as $propertyName => $propertyType) { + $propertyValue = $this[$propertyName]; + if ($propertyValue !== null) { + // Check if the property value is an object and has a toArray() method + if (is_object($propertyValue) && method_exists($propertyValue, 'toArray')) { + $array[$propertyName] = $propertyValue->toArray(); + // Check if it's type datetime + } elseif ($propertyValue instanceof \DateTime) { + $array[$propertyName] = $propertyValue->format(DATE_ATOM); + // If it's an array type we should check whether it contains objects and if so call toArray method + } elseif (is_array($propertyValue)) { + $array[$propertyName] = array_map(function ($item) { + return $item instanceof ModelInterface ? $item->toArray() : $item; + }, $propertyValue); + } else { + // Otherwise, directly assign the property value to the array + $array[$propertyName] = $propertyValue; + } + } + } + return $array; + } + /** * Gets the string presentation of the object * diff --git a/src/Adyen/Model/Checkout/GooglePayDetails.php b/src/Adyen/Model/Checkout/GooglePayDetails.php index 541a70b1c..b37370b84 100644 --- a/src/Adyen/Model/Checkout/GooglePayDetails.php +++ b/src/Adyen/Model/Checkout/GooglePayDetails.php @@ -5,7 +5,7 @@ * * The version of the OpenAPI document: 71 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 6.0.1 + * OpenAPI Generator version: 6.4.0 * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -46,7 +46,6 @@ class GooglePayDetails implements ModelInterface, ArrayAccess, \JsonSerializable protected static $openAPITypes = [ 'checkoutAttemptId' => 'string', 'fundingSource' => 'string', - 'googlePayCardNetwork' => 'string', 'googlePayToken' => 'string', 'recurringDetailReference' => 'string', 'storedPaymentMethodId' => 'string', @@ -63,7 +62,6 @@ class GooglePayDetails implements ModelInterface, ArrayAccess, \JsonSerializable protected static $openAPIFormats = [ 'checkoutAttemptId' => null, 'fundingSource' => null, - 'googlePayCardNetwork' => null, 'googlePayToken' => null, 'recurringDetailReference' => null, 'storedPaymentMethodId' => null, @@ -78,7 +76,6 @@ class GooglePayDetails implements ModelInterface, ArrayAccess, \JsonSerializable protected static $openAPINullables = [ 'checkoutAttemptId' => false, 'fundingSource' => false, - 'googlePayCardNetwork' => false, 'googlePayToken' => false, 'recurringDetailReference' => false, 'storedPaymentMethodId' => false, @@ -173,7 +170,6 @@ public function isNullableSetToNull(string $property): bool protected static $attributeMap = [ 'checkoutAttemptId' => 'checkoutAttemptId', 'fundingSource' => 'fundingSource', - 'googlePayCardNetwork' => 'googlePayCardNetwork', 'googlePayToken' => 'googlePayToken', 'recurringDetailReference' => 'recurringDetailReference', 'storedPaymentMethodId' => 'storedPaymentMethodId', @@ -188,7 +184,6 @@ public function isNullableSetToNull(string $property): bool protected static $setters = [ 'checkoutAttemptId' => 'setCheckoutAttemptId', 'fundingSource' => 'setFundingSource', - 'googlePayCardNetwork' => 'setGooglePayCardNetwork', 'googlePayToken' => 'setGooglePayToken', 'recurringDetailReference' => 'setRecurringDetailReference', 'storedPaymentMethodId' => 'setStoredPaymentMethodId', @@ -203,7 +198,6 @@ public function isNullableSetToNull(string $property): bool protected static $getters = [ 'checkoutAttemptId' => 'getCheckoutAttemptId', 'fundingSource' => 'getFundingSource', - 'googlePayCardNetwork' => 'getGooglePayCardNetwork', 'googlePayToken' => 'getGooglePayToken', 'recurringDetailReference' => 'getRecurringDetailReference', 'storedPaymentMethodId' => 'getStoredPaymentMethodId', @@ -251,7 +245,6 @@ public function getModelName() return self::$openAPIModelName; } - public const FUNDING_SOURCE_CREDIT = 'credit'; public const FUNDING_SOURCE_DEBIT = 'debit'; public const TYPE_GOOGLEPAY = 'googlepay'; @@ -263,7 +256,6 @@ public function getModelName() public function getFundingSourceAllowableValues() { return [ - self::FUNDING_SOURCE_CREDIT, self::FUNDING_SOURCE_DEBIT, ]; } @@ -295,7 +287,6 @@ public function __construct(array $data = null) { $this->setIfExists('checkoutAttemptId', $data ?? [], null); $this->setIfExists('fundingSource', $data ?? [], null); - $this->setIfExists('googlePayCardNetwork', $data ?? [], null); $this->setIfExists('googlePayToken', $data ?? [], null); $this->setIfExists('recurringDetailReference', $data ?? [], null); $this->setIfExists('storedPaymentMethodId', $data ?? [], null); @@ -429,33 +420,6 @@ public function setFundingSource($fundingSource) return $this; } - /** - * Gets googlePayCardNetwork - * - * @return string|null - */ - public function getGooglePayCardNetwork() - { - return $this->container['googlePayCardNetwork']; - } - - /** - * Sets googlePayCardNetwork - * - * @param string|null $googlePayCardNetwork The selected payment card network. - * - * @return self - */ - public function setGooglePayCardNetwork($googlePayCardNetwork) - { - if (is_null($googlePayCardNetwork)) { - throw new \InvalidArgumentException('non-nullable googlePayCardNetwork cannot be null'); - } - $this->container['googlePayCardNetwork'] = $googlePayCardNetwork; - - return $this; - } - /** * Gets googlePayToken * @@ -642,6 +606,32 @@ public function jsonSerialize() return ObjectSerializer::sanitizeForSerialization($this); } + public function toArray(): array + { + $array = []; + foreach (self::$openAPITypes as $propertyName => $propertyType) { + $propertyValue = $this[$propertyName]; + if ($propertyValue !== null) { + // Check if the property value is an object and has a toArray() method + if (is_object($propertyValue) && method_exists($propertyValue, 'toArray')) { + $array[$propertyName] = $propertyValue->toArray(); + // Check if it's type datetime + } elseif ($propertyValue instanceof \DateTime) { + $array[$propertyName] = $propertyValue->format(DATE_ATOM); + // If it's an array type we should check whether it contains objects and if so call toArray method + } elseif (is_array($propertyValue)) { + $array[$propertyName] = array_map(function ($item) { + return $item instanceof ModelInterface ? $item->toArray() : $item; + }, $propertyValue); + } else { + // Otherwise, directly assign the property value to the array + $array[$propertyName] = $propertyValue; + } + } + } + return $array; + } + /** * Gets the string presentation of the object * diff --git a/src/Adyen/Model/Checkout/GooglePayDonations.php b/src/Adyen/Model/Checkout/GooglePayDonations.php deleted file mode 100644 index 9c4effa39..000000000 --- a/src/Adyen/Model/Checkout/GooglePayDonations.php +++ /dev/null @@ -1,657 +0,0 @@ - - */ -class GooglePayDonations implements ModelInterface, ArrayAccess, \JsonSerializable -{ - public const DISCRIMINATOR = null; - - /** - * The original name of the model. - * - * @var string - */ - protected static $openAPIModelName = 'GooglePayDonations'; - - /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ - protected static $openAPITypes = [ - 'checkoutAttemptId' => 'string', - 'fundingSource' => 'string', - 'googlePayCardNetwork' => 'string', - 'googlePayToken' => 'string', - 'recurringDetailReference' => 'string', - 'storedPaymentMethodId' => 'string', - 'type' => 'string' - ]; - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ - protected static $openAPIFormats = [ - 'checkoutAttemptId' => null, - 'fundingSource' => null, - 'googlePayCardNetwork' => null, - 'googlePayToken' => null, - 'recurringDetailReference' => null, - 'storedPaymentMethodId' => null, - 'type' => null - ]; - - /** - * Array of nullable properties. Used for (de)serialization - * - * @var boolean[] - */ - protected static $openAPINullables = [ - 'checkoutAttemptId' => false, - 'fundingSource' => false, - 'googlePayCardNetwork' => false, - 'googlePayToken' => false, - 'recurringDetailReference' => false, - 'storedPaymentMethodId' => false, - '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 = [ - 'checkoutAttemptId' => 'checkoutAttemptId', - 'fundingSource' => 'fundingSource', - 'googlePayCardNetwork' => 'googlePayCardNetwork', - 'googlePayToken' => 'googlePayToken', - 'recurringDetailReference' => 'recurringDetailReference', - 'storedPaymentMethodId' => 'storedPaymentMethodId', - 'type' => 'type' - ]; - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @var string[] - */ - protected static $setters = [ - 'checkoutAttemptId' => 'setCheckoutAttemptId', - 'fundingSource' => 'setFundingSource', - 'googlePayCardNetwork' => 'setGooglePayCardNetwork', - 'googlePayToken' => 'setGooglePayToken', - 'recurringDetailReference' => 'setRecurringDetailReference', - 'storedPaymentMethodId' => 'setStoredPaymentMethodId', - 'type' => 'setType' - ]; - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @var string[] - */ - protected static $getters = [ - 'checkoutAttemptId' => 'getCheckoutAttemptId', - 'fundingSource' => 'getFundingSource', - 'googlePayCardNetwork' => 'getGooglePayCardNetwork', - 'googlePayToken' => 'getGooglePayToken', - 'recurringDetailReference' => 'getRecurringDetailReference', - 'storedPaymentMethodId' => 'getStoredPaymentMethodId', - 'type' => 'getType' - ]; - - /** - * 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; - } - - public const FUNDING_SOURCE_CREDIT = 'credit'; - public const FUNDING_SOURCE_DEBIT = 'debit'; - public const TYPE_GOOGLEPAY = 'googlepay'; - - /** - * Gets allowable values of the enum - * - * @return string[] - */ - public function getFundingSourceAllowableValues() - { - return [ - self::FUNDING_SOURCE_CREDIT, - self::FUNDING_SOURCE_DEBIT, - ]; - } - /** - * Gets allowable values of the enum - * - * @return string[] - */ - public function getTypeAllowableValues() - { - return [ - self::TYPE_GOOGLEPAY, - ]; - } - /** - * 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('checkoutAttemptId', $data ?? [], null); - $this->setIfExists('fundingSource', $data ?? [], null); - $this->setIfExists('googlePayCardNetwork', $data ?? [], null); - $this->setIfExists('googlePayToken', $data ?? [], null); - $this->setIfExists('recurringDetailReference', $data ?? [], null); - $this->setIfExists('storedPaymentMethodId', $data ?? [], null); - $this->setIfExists('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 = []; - - $allowedValues = $this->getFundingSourceAllowableValues(); - if (!is_null($this->container['fundingSource']) && !in_array($this->container['fundingSource'], $allowedValues, true)) { - $invalidProperties[] = sprintf( - "invalid value '%s' for 'fundingSource', must be one of '%s'", - $this->container['fundingSource'], - implode("', '", $allowedValues) - ); - } - - if ($this->container['googlePayToken'] === null) { - $invalidProperties[] = "'googlePayToken' can't be null"; - } - $allowedValues = $this->getTypeAllowableValues(); - if (!is_null($this->container['type']) && !in_array($this->container['type'], $allowedValues, true)) { - $invalidProperties[] = sprintf( - "invalid value '%s' for 'type', must be one of '%s'", - $this->container['type'], - implode("', '", $allowedValues) - ); - } - - 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 checkoutAttemptId - * - * @return string|null - */ - public function getCheckoutAttemptId() - { - return $this->container['checkoutAttemptId']; - } - - /** - * Sets checkoutAttemptId - * - * @param string|null $checkoutAttemptId The checkout attempt identifier. - * - * @return self - */ - public function setCheckoutAttemptId($checkoutAttemptId) - { - if (is_null($checkoutAttemptId)) { - throw new \InvalidArgumentException('non-nullable checkoutAttemptId cannot be null'); - } - $this->container['checkoutAttemptId'] = $checkoutAttemptId; - - return $this; - } - - /** - * Gets fundingSource - * - * @return string|null - */ - public function getFundingSource() - { - return $this->container['fundingSource']; - } - - /** - * Sets fundingSource - * - * @param string|null $fundingSource The funding source that should be used when multiple sources are available. For Brazilian combo cards, by default the funding source is credit. To use debit, set this value to **debit**. - * - * @return self - */ - public function setFundingSource($fundingSource) - { - if (is_null($fundingSource)) { - throw new \InvalidArgumentException('non-nullable fundingSource cannot be null'); - } - $allowedValues = $this->getFundingSourceAllowableValues(); - if (!in_array($fundingSource, $allowedValues, true)) { - throw new \InvalidArgumentException( - sprintf( - "Invalid value '%s' for 'fundingSource', must be one of '%s'", - $fundingSource, - implode("', '", $allowedValues) - ) - ); - } - $this->container['fundingSource'] = $fundingSource; - - return $this; - } - - /** - * Gets googlePayCardNetwork - * - * @return string|null - */ - public function getGooglePayCardNetwork() - { - return $this->container['googlePayCardNetwork']; - } - - /** - * Sets googlePayCardNetwork - * - * @param string|null $googlePayCardNetwork The selected payment card network. - * - * @return self - */ - public function setGooglePayCardNetwork($googlePayCardNetwork) - { - if (is_null($googlePayCardNetwork)) { - throw new \InvalidArgumentException('non-nullable googlePayCardNetwork cannot be null'); - } - $this->container['googlePayCardNetwork'] = $googlePayCardNetwork; - - return $this; - } - - /** - * Gets googlePayToken - * - * @return string - */ - public function getGooglePayToken() - { - return $this->container['googlePayToken']; - } - - /** - * Sets googlePayToken - * - * @param string $googlePayToken The `token` that you obtained from the [Google Pay API](https://developers.google.com/pay/api/web/reference/response-objects#PaymentData) `PaymentData` response. - * - * @return self - */ - public function setGooglePayToken($googlePayToken) - { - if (is_null($googlePayToken)) { - throw new \InvalidArgumentException('non-nullable googlePayToken cannot be null'); - } - $this->container['googlePayToken'] = $googlePayToken; - - return $this; - } - - /** - * Gets recurringDetailReference - * - * @return string|null - * @deprecated - */ - public function getRecurringDetailReference() - { - return $this->container['recurringDetailReference']; - } - - /** - * Sets recurringDetailReference - * - * @param string|null $recurringDetailReference This is the `recurringDetailReference` returned in the response when you created the token. - * - * @return self - * @deprecated - */ - public function setRecurringDetailReference($recurringDetailReference) - { - if (is_null($recurringDetailReference)) { - throw new \InvalidArgumentException('non-nullable recurringDetailReference cannot be null'); - } - $this->container['recurringDetailReference'] = $recurringDetailReference; - - return $this; - } - - /** - * Gets storedPaymentMethodId - * - * @return string|null - */ - public function getStoredPaymentMethodId() - { - return $this->container['storedPaymentMethodId']; - } - - /** - * Sets storedPaymentMethodId - * - * @param string|null $storedPaymentMethodId This is the `recurringDetailReference` returned in the response when you created the token. - * - * @return self - */ - public function setStoredPaymentMethodId($storedPaymentMethodId) - { - if (is_null($storedPaymentMethodId)) { - throw new \InvalidArgumentException('non-nullable storedPaymentMethodId cannot be null'); - } - $this->container['storedPaymentMethodId'] = $storedPaymentMethodId; - - return $this; - } - - /** - * Gets type - * - * @return string|null - */ - public function getType() - { - return $this->container['type']; - } - - /** - * Sets type - * - * @param string|null $type **googlepay**, **paywithgoogle** - * - * @return self - */ - public function setType($type) - { - if (is_null($type)) { - throw new \InvalidArgumentException('non-nullable type cannot be null'); - } - $allowedValues = $this->getTypeAllowableValues(); - if (!in_array($type, $allowedValues, true)) { - throw new \InvalidArgumentException( - sprintf( - "Invalid value '%s' for 'type', must be one of '%s'", - $type, - implode("', '", $allowedValues) - ) - ); - } - $this->container['type'] = $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 - ); - } -} diff --git a/src/Adyen/Model/Checkout/IdealDetails.php b/src/Adyen/Model/Checkout/IdealDetails.php index 2e4e906f9..35c5566c3 100644 --- a/src/Adyen/Model/Checkout/IdealDetails.php +++ b/src/Adyen/Model/Checkout/IdealDetails.php @@ -5,7 +5,7 @@ * * The version of the OpenAPI document: 71 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 6.0.1 + * OpenAPI Generator version: 6.4.0 * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -541,6 +541,32 @@ public function jsonSerialize() return ObjectSerializer::sanitizeForSerialization($this); } + public function toArray(): array + { + $array = []; + foreach (self::$openAPITypes as $propertyName => $propertyType) { + $propertyValue = $this[$propertyName]; + if ($propertyValue !== null) { + // Check if the property value is an object and has a toArray() method + if (is_object($propertyValue) && method_exists($propertyValue, 'toArray')) { + $array[$propertyName] = $propertyValue->toArray(); + // Check if it's type datetime + } elseif ($propertyValue instanceof \DateTime) { + $array[$propertyName] = $propertyValue->format(DATE_ATOM); + // If it's an array type we should check whether it contains objects and if so call toArray method + } elseif (is_array($propertyValue)) { + $array[$propertyName] = array_map(function ($item) { + return $item instanceof ModelInterface ? $item->toArray() : $item; + }, $propertyValue); + } else { + // Otherwise, directly assign the property value to the array + $array[$propertyName] = $propertyValue; + } + } + } + return $array; + } + /** * Gets the string presentation of the object * diff --git a/src/Adyen/Model/Checkout/IdealDonations.php b/src/Adyen/Model/Checkout/IdealDonations.php deleted file mode 100644 index 208f4360c..000000000 --- a/src/Adyen/Model/Checkout/IdealDonations.php +++ /dev/null @@ -1,556 +0,0 @@ - - */ -class IdealDonations implements ModelInterface, ArrayAccess, \JsonSerializable -{ - public const DISCRIMINATOR = null; - - /** - * The original name of the model. - * - * @var string - */ - protected static $openAPIModelName = 'IdealDonations'; - - /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ - protected static $openAPITypes = [ - 'checkoutAttemptId' => 'string', - 'issuer' => 'string', - 'recurringDetailReference' => 'string', - 'storedPaymentMethodId' => 'string', - 'type' => 'string' - ]; - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ - protected static $openAPIFormats = [ - 'checkoutAttemptId' => null, - 'issuer' => null, - 'recurringDetailReference' => null, - 'storedPaymentMethodId' => null, - 'type' => null - ]; - - /** - * Array of nullable properties. Used for (de)serialization - * - * @var boolean[] - */ - protected static $openAPINullables = [ - 'checkoutAttemptId' => false, - 'issuer' => false, - 'recurringDetailReference' => false, - 'storedPaymentMethodId' => false, - '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 = [ - 'checkoutAttemptId' => 'checkoutAttemptId', - 'issuer' => 'issuer', - 'recurringDetailReference' => 'recurringDetailReference', - 'storedPaymentMethodId' => 'storedPaymentMethodId', - 'type' => 'type' - ]; - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @var string[] - */ - protected static $setters = [ - 'checkoutAttemptId' => 'setCheckoutAttemptId', - 'issuer' => 'setIssuer', - 'recurringDetailReference' => 'setRecurringDetailReference', - 'storedPaymentMethodId' => 'setStoredPaymentMethodId', - 'type' => 'setType' - ]; - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @var string[] - */ - protected static $getters = [ - 'checkoutAttemptId' => 'getCheckoutAttemptId', - 'issuer' => 'getIssuer', - 'recurringDetailReference' => 'getRecurringDetailReference', - 'storedPaymentMethodId' => 'getStoredPaymentMethodId', - 'type' => 'getType' - ]; - - /** - * 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; - } - - public const TYPE_IDEAL = 'ideal'; - - /** - * Gets allowable values of the enum - * - * @return string[] - */ - public function getTypeAllowableValues() - { - return [ - self::TYPE_IDEAL, - ]; - } - /** - * 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('checkoutAttemptId', $data ?? [], null); - $this->setIfExists('issuer', $data ?? [], null); - $this->setIfExists('recurringDetailReference', $data ?? [], null); - $this->setIfExists('storedPaymentMethodId', $data ?? [], null); - $this->setIfExists('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 = []; - - if ($this->container['issuer'] === null) { - $invalidProperties[] = "'issuer' can't be null"; - } - $allowedValues = $this->getTypeAllowableValues(); - if (!is_null($this->container['type']) && !in_array($this->container['type'], $allowedValues, true)) { - $invalidProperties[] = sprintf( - "invalid value '%s' for 'type', must be one of '%s'", - $this->container['type'], - implode("', '", $allowedValues) - ); - } - - 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 checkoutAttemptId - * - * @return string|null - */ - public function getCheckoutAttemptId() - { - return $this->container['checkoutAttemptId']; - } - - /** - * Sets checkoutAttemptId - * - * @param string|null $checkoutAttemptId The checkout attempt identifier. - * - * @return self - */ - public function setCheckoutAttemptId($checkoutAttemptId) - { - if (is_null($checkoutAttemptId)) { - throw new \InvalidArgumentException('non-nullable checkoutAttemptId cannot be null'); - } - $this->container['checkoutAttemptId'] = $checkoutAttemptId; - - return $this; - } - - /** - * Gets issuer - * - * @return string - */ - public function getIssuer() - { - return $this->container['issuer']; - } - - /** - * Sets issuer - * - * @param string $issuer The iDEAL issuer value of the shopper's selected bank. Set this to an **id** of an iDEAL issuer to preselect it. - * - * @return self - */ - public function setIssuer($issuer) - { - if (is_null($issuer)) { - throw new \InvalidArgumentException('non-nullable issuer cannot be null'); - } - $this->container['issuer'] = $issuer; - - return $this; - } - - /** - * Gets recurringDetailReference - * - * @return string|null - * @deprecated - */ - public function getRecurringDetailReference() - { - return $this->container['recurringDetailReference']; - } - - /** - * Sets recurringDetailReference - * - * @param string|null $recurringDetailReference This is the `recurringDetailReference` returned in the response when you created the token. - * - * @return self - * @deprecated - */ - public function setRecurringDetailReference($recurringDetailReference) - { - if (is_null($recurringDetailReference)) { - throw new \InvalidArgumentException('non-nullable recurringDetailReference cannot be null'); - } - $this->container['recurringDetailReference'] = $recurringDetailReference; - - return $this; - } - - /** - * Gets storedPaymentMethodId - * - * @return string|null - */ - public function getStoredPaymentMethodId() - { - return $this->container['storedPaymentMethodId']; - } - - /** - * Sets storedPaymentMethodId - * - * @param string|null $storedPaymentMethodId This is the `recurringDetailReference` returned in the response when you created the token. - * - * @return self - */ - public function setStoredPaymentMethodId($storedPaymentMethodId) - { - if (is_null($storedPaymentMethodId)) { - throw new \InvalidArgumentException('non-nullable storedPaymentMethodId cannot be null'); - } - $this->container['storedPaymentMethodId'] = $storedPaymentMethodId; - - return $this; - } - - /** - * Gets type - * - * @return string|null - */ - public function getType() - { - return $this->container['type']; - } - - /** - * Sets type - * - * @param string|null $type **ideal** - * - * @return self - */ - public function setType($type) - { - if (is_null($type)) { - throw new \InvalidArgumentException('non-nullable type cannot be null'); - } - $allowedValues = $this->getTypeAllowableValues(); - if (!in_array($type, $allowedValues, true)) { - throw new \InvalidArgumentException( - sprintf( - "Invalid value '%s' for 'type', must be one of '%s'", - $type, - implode("', '", $allowedValues) - ) - ); - } - $this->container['type'] = $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 - ); - } -} diff --git a/src/Adyen/Model/Checkout/InputDetail.php b/src/Adyen/Model/Checkout/InputDetail.php index 2a9f71bee..4160ffadf 100644 --- a/src/Adyen/Model/Checkout/InputDetail.php +++ b/src/Adyen/Model/Checkout/InputDetail.php @@ -5,7 +5,7 @@ * * The version of the OpenAPI document: 71 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 6.0.1 + * OpenAPI Generator version: 6.4.0 * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -643,6 +643,32 @@ public function jsonSerialize() return ObjectSerializer::sanitizeForSerialization($this); } + public function toArray(): array + { + $array = []; + foreach (self::$openAPITypes as $propertyName => $propertyType) { + $propertyValue = $this[$propertyName]; + if ($propertyValue !== null) { + // Check if the property value is an object and has a toArray() method + if (is_object($propertyValue) && method_exists($propertyValue, 'toArray')) { + $array[$propertyName] = $propertyValue->toArray(); + // Check if it's type datetime + } elseif ($propertyValue instanceof \DateTime) { + $array[$propertyName] = $propertyValue->format(DATE_ATOM); + // If it's an array type we should check whether it contains objects and if so call toArray method + } elseif (is_array($propertyValue)) { + $array[$propertyName] = array_map(function ($item) { + return $item instanceof ModelInterface ? $item->toArray() : $item; + }, $propertyValue); + } else { + // Otherwise, directly assign the property value to the array + $array[$propertyName] = $propertyValue; + } + } + } + return $array; + } + /** * Gets the string presentation of the object * diff --git a/src/Adyen/Model/Checkout/InstallmentOption.php b/src/Adyen/Model/Checkout/InstallmentOption.php index d0915e04d..140cf4422 100644 --- a/src/Adyen/Model/Checkout/InstallmentOption.php +++ b/src/Adyen/Model/Checkout/InstallmentOption.php @@ -5,7 +5,7 @@ * * The version of the OpenAPI document: 71 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 6.0.1 + * OpenAPI Generator version: 6.4.0 * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -490,6 +490,32 @@ public function jsonSerialize() return ObjectSerializer::sanitizeForSerialization($this); } + public function toArray(): array + { + $array = []; + foreach (self::$openAPITypes as $propertyName => $propertyType) { + $propertyValue = $this[$propertyName]; + if ($propertyValue !== null) { + // Check if the property value is an object and has a toArray() method + if (is_object($propertyValue) && method_exists($propertyValue, 'toArray')) { + $array[$propertyName] = $propertyValue->toArray(); + // Check if it's type datetime + } elseif ($propertyValue instanceof \DateTime) { + $array[$propertyName] = $propertyValue->format(DATE_ATOM); + // If it's an array type we should check whether it contains objects and if so call toArray method + } elseif (is_array($propertyValue)) { + $array[$propertyName] = array_map(function ($item) { + return $item instanceof ModelInterface ? $item->toArray() : $item; + }, $propertyValue); + } else { + // Otherwise, directly assign the property value to the array + $array[$propertyName] = $propertyValue; + } + } + } + return $array; + } + /** * Gets the string presentation of the object * diff --git a/src/Adyen/Model/Checkout/Installments.php b/src/Adyen/Model/Checkout/Installments.php index 9742f80c0..ae625800e 100644 --- a/src/Adyen/Model/Checkout/Installments.php +++ b/src/Adyen/Model/Checkout/Installments.php @@ -5,7 +5,7 @@ * * The version of the OpenAPI document: 71 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 6.0.1 + * OpenAPI Generator version: 6.4.0 * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -437,6 +437,32 @@ public function jsonSerialize() return ObjectSerializer::sanitizeForSerialization($this); } + public function toArray(): array + { + $array = []; + foreach (self::$openAPITypes as $propertyName => $propertyType) { + $propertyValue = $this[$propertyName]; + if ($propertyValue !== null) { + // Check if the property value is an object and has a toArray() method + if (is_object($propertyValue) && method_exists($propertyValue, 'toArray')) { + $array[$propertyName] = $propertyValue->toArray(); + // Check if it's type datetime + } elseif ($propertyValue instanceof \DateTime) { + $array[$propertyName] = $propertyValue->format(DATE_ATOM); + // If it's an array type we should check whether it contains objects and if so call toArray method + } elseif (is_array($propertyValue)) { + $array[$propertyName] = array_map(function ($item) { + return $item instanceof ModelInterface ? $item->toArray() : $item; + }, $propertyValue); + } else { + // Otherwise, directly assign the property value to the array + $array[$propertyName] = $propertyValue; + } + } + } + return $array; + } + /** * Gets the string presentation of the object * diff --git a/src/Adyen/Model/Checkout/InstallmentsNumber.php b/src/Adyen/Model/Checkout/InstallmentsNumber.php index 33d210608..061894318 100644 --- a/src/Adyen/Model/Checkout/InstallmentsNumber.php +++ b/src/Adyen/Model/Checkout/InstallmentsNumber.php @@ -5,7 +5,7 @@ * * The version of the OpenAPI document: 71 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 6.0.1 + * OpenAPI Generator version: 6.4.0 * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -370,6 +370,32 @@ public function jsonSerialize() return ObjectSerializer::sanitizeForSerialization($this); } + public function toArray(): array + { + $array = []; + foreach (self::$openAPITypes as $propertyName => $propertyType) { + $propertyValue = $this[$propertyName]; + if ($propertyValue !== null) { + // Check if the property value is an object and has a toArray() method + if (is_object($propertyValue) && method_exists($propertyValue, 'toArray')) { + $array[$propertyName] = $propertyValue->toArray(); + // Check if it's type datetime + } elseif ($propertyValue instanceof \DateTime) { + $array[$propertyName] = $propertyValue->format(DATE_ATOM); + // If it's an array type we should check whether it contains objects and if so call toArray method + } elseif (is_array($propertyValue)) { + $array[$propertyName] = array_map(function ($item) { + return $item instanceof ModelInterface ? $item->toArray() : $item; + }, $propertyValue); + } else { + // Otherwise, directly assign the property value to the array + $array[$propertyName] = $propertyValue; + } + } + } + return $array; + } + /** * Gets the string presentation of the object * diff --git a/src/Adyen/Model/Checkout/Item.php b/src/Adyen/Model/Checkout/Item.php index 3693d15e9..cb78573ec 100644 --- a/src/Adyen/Model/Checkout/Item.php +++ b/src/Adyen/Model/Checkout/Item.php @@ -5,7 +5,7 @@ * * The version of the OpenAPI document: 71 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 6.0.1 + * OpenAPI Generator version: 6.4.0 * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -403,6 +403,32 @@ public function jsonSerialize() return ObjectSerializer::sanitizeForSerialization($this); } + public function toArray(): array + { + $array = []; + foreach (self::$openAPITypes as $propertyName => $propertyType) { + $propertyValue = $this[$propertyName]; + if ($propertyValue !== null) { + // Check if the property value is an object and has a toArray() method + if (is_object($propertyValue) && method_exists($propertyValue, 'toArray')) { + $array[$propertyName] = $propertyValue->toArray(); + // Check if it's type datetime + } elseif ($propertyValue instanceof \DateTime) { + $array[$propertyName] = $propertyValue->format(DATE_ATOM); + // If it's an array type we should check whether it contains objects and if so call toArray method + } elseif (is_array($propertyValue)) { + $array[$propertyName] = array_map(function ($item) { + return $item instanceof ModelInterface ? $item->toArray() : $item; + }, $propertyValue); + } else { + // Otherwise, directly assign the property value to the array + $array[$propertyName] = $propertyValue; + } + } + } + return $array; + } + /** * Gets the string presentation of the object * diff --git a/src/Adyen/Model/Checkout/KlarnaDetails.php b/src/Adyen/Model/Checkout/KlarnaDetails.php index ee23617db..23eefe315 100644 --- a/src/Adyen/Model/Checkout/KlarnaDetails.php +++ b/src/Adyen/Model/Checkout/KlarnaDetails.php @@ -5,7 +5,7 @@ * * The version of the OpenAPI document: 71 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 6.0.1 + * OpenAPI Generator version: 6.4.0 * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -655,6 +655,32 @@ public function jsonSerialize() return ObjectSerializer::sanitizeForSerialization($this); } + public function toArray(): array + { + $array = []; + foreach (self::$openAPITypes as $propertyName => $propertyType) { + $propertyValue = $this[$propertyName]; + if ($propertyValue !== null) { + // Check if the property value is an object and has a toArray() method + if (is_object($propertyValue) && method_exists($propertyValue, 'toArray')) { + $array[$propertyName] = $propertyValue->toArray(); + // Check if it's type datetime + } elseif ($propertyValue instanceof \DateTime) { + $array[$propertyName] = $propertyValue->format(DATE_ATOM); + // If it's an array type we should check whether it contains objects and if so call toArray method + } elseif (is_array($propertyValue)) { + $array[$propertyName] = array_map(function ($item) { + return $item instanceof ModelInterface ? $item->toArray() : $item; + }, $propertyValue); + } else { + // Otherwise, directly assign the property value to the array + $array[$propertyName] = $propertyValue; + } + } + } + return $array; + } + /** * Gets the string presentation of the object * diff --git a/src/Adyen/Model/Checkout/LineItem.php b/src/Adyen/Model/Checkout/LineItem.php index ef80aa933..346452e57 100644 --- a/src/Adyen/Model/Checkout/LineItem.php +++ b/src/Adyen/Model/Checkout/LineItem.php @@ -5,7 +5,7 @@ * * The version of the OpenAPI document: 71 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 6.0.1 + * OpenAPI Generator version: 6.4.0 * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -913,6 +913,32 @@ public function jsonSerialize() return ObjectSerializer::sanitizeForSerialization($this); } + public function toArray(): array + { + $array = []; + foreach (self::$openAPITypes as $propertyName => $propertyType) { + $propertyValue = $this[$propertyName]; + if ($propertyValue !== null) { + // Check if the property value is an object and has a toArray() method + if (is_object($propertyValue) && method_exists($propertyValue, 'toArray')) { + $array[$propertyName] = $propertyValue->toArray(); + // Check if it's type datetime + } elseif ($propertyValue instanceof \DateTime) { + $array[$propertyName] = $propertyValue->format(DATE_ATOM); + // If it's an array type we should check whether it contains objects and if so call toArray method + } elseif (is_array($propertyValue)) { + $array[$propertyName] = array_map(function ($item) { + return $item instanceof ModelInterface ? $item->toArray() : $item; + }, $propertyValue); + } else { + // Otherwise, directly assign the property value to the array + $array[$propertyName] = $propertyValue; + } + } + } + return $array; + } + /** * Gets the string presentation of the object * diff --git a/src/Adyen/Model/Checkout/ListStoredPaymentMethodsResponse.php b/src/Adyen/Model/Checkout/ListStoredPaymentMethodsResponse.php index 88214bb72..5a44e39ba 100644 --- a/src/Adyen/Model/Checkout/ListStoredPaymentMethodsResponse.php +++ b/src/Adyen/Model/Checkout/ListStoredPaymentMethodsResponse.php @@ -5,7 +5,7 @@ * * The version of the OpenAPI document: 71 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 6.0.1 + * OpenAPI Generator version: 6.4.0 * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -437,6 +437,32 @@ public function jsonSerialize() return ObjectSerializer::sanitizeForSerialization($this); } + public function toArray(): array + { + $array = []; + foreach (self::$openAPITypes as $propertyName => $propertyType) { + $propertyValue = $this[$propertyName]; + if ($propertyValue !== null) { + // Check if the property value is an object and has a toArray() method + if (is_object($propertyValue) && method_exists($propertyValue, 'toArray')) { + $array[$propertyName] = $propertyValue->toArray(); + // Check if it's type datetime + } elseif ($propertyValue instanceof \DateTime) { + $array[$propertyName] = $propertyValue->format(DATE_ATOM); + // If it's an array type we should check whether it contains objects and if so call toArray method + } elseif (is_array($propertyValue)) { + $array[$propertyName] = array_map(function ($item) { + return $item instanceof ModelInterface ? $item->toArray() : $item; + }, $propertyValue); + } else { + // Otherwise, directly assign the property value to the array + $array[$propertyName] = $propertyValue; + } + } + } + return $array; + } + /** * Gets the string presentation of the object * diff --git a/src/Adyen/Model/Checkout/Mandate.php b/src/Adyen/Model/Checkout/Mandate.php index 70a646ddf..9bb093c34 100644 --- a/src/Adyen/Model/Checkout/Mandate.php +++ b/src/Adyen/Model/Checkout/Mandate.php @@ -5,7 +5,7 @@ * * The version of the OpenAPI document: 71 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 6.0.1 + * OpenAPI Generator version: 6.4.0 * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -729,6 +729,32 @@ public function jsonSerialize() return ObjectSerializer::sanitizeForSerialization($this); } + public function toArray(): array + { + $array = []; + foreach (self::$openAPITypes as $propertyName => $propertyType) { + $propertyValue = $this[$propertyName]; + if ($propertyValue !== null) { + // Check if the property value is an object and has a toArray() method + if (is_object($propertyValue) && method_exists($propertyValue, 'toArray')) { + $array[$propertyName] = $propertyValue->toArray(); + // Check if it's type datetime + } elseif ($propertyValue instanceof \DateTime) { + $array[$propertyName] = $propertyValue->format(DATE_ATOM); + // If it's an array type we should check whether it contains objects and if so call toArray method + } elseif (is_array($propertyValue)) { + $array[$propertyName] = array_map(function ($item) { + return $item instanceof ModelInterface ? $item->toArray() : $item; + }, $propertyValue); + } else { + // Otherwise, directly assign the property value to the array + $array[$propertyName] = $propertyValue; + } + } + } + return $array; + } + /** * Gets the string presentation of the object * diff --git a/src/Adyen/Model/Checkout/MasterpassDetails.php b/src/Adyen/Model/Checkout/MasterpassDetails.php index 2e9709355..b6cf7914c 100644 --- a/src/Adyen/Model/Checkout/MasterpassDetails.php +++ b/src/Adyen/Model/Checkout/MasterpassDetails.php @@ -5,7 +5,7 @@ * * The version of the OpenAPI document: 71 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 6.0.1 + * OpenAPI Generator version: 6.4.0 * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -233,7 +233,6 @@ public function getModelName() return self::$openAPIModelName; } - public const FUNDING_SOURCE_CREDIT = 'credit'; public const FUNDING_SOURCE_DEBIT = 'debit'; public const TYPE_MASTERPASS = 'masterpass'; @@ -245,7 +244,6 @@ public function getModelName() public function getFundingSourceAllowableValues() { return [ - self::FUNDING_SOURCE_CREDIT, self::FUNDING_SOURCE_DEBIT, ]; } @@ -538,6 +536,32 @@ public function jsonSerialize() return ObjectSerializer::sanitizeForSerialization($this); } + public function toArray(): array + { + $array = []; + foreach (self::$openAPITypes as $propertyName => $propertyType) { + $propertyValue = $this[$propertyName]; + if ($propertyValue !== null) { + // Check if the property value is an object and has a toArray() method + if (is_object($propertyValue) && method_exists($propertyValue, 'toArray')) { + $array[$propertyName] = $propertyValue->toArray(); + // Check if it's type datetime + } elseif ($propertyValue instanceof \DateTime) { + $array[$propertyName] = $propertyValue->format(DATE_ATOM); + // If it's an array type we should check whether it contains objects and if so call toArray method + } elseif (is_array($propertyValue)) { + $array[$propertyName] = array_map(function ($item) { + return $item instanceof ModelInterface ? $item->toArray() : $item; + }, $propertyValue); + } else { + // Otherwise, directly assign the property value to the array + $array[$propertyName] = $propertyValue; + } + } + } + return $array; + } + /** * Gets the string presentation of the object * diff --git a/src/Adyen/Model/Checkout/MbwayDetails.php b/src/Adyen/Model/Checkout/MbwayDetails.php index 5e3c7b6d9..dea25486e 100644 --- a/src/Adyen/Model/Checkout/MbwayDetails.php +++ b/src/Adyen/Model/Checkout/MbwayDetails.php @@ -5,7 +5,7 @@ * * The version of the OpenAPI document: 71 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 6.0.1 + * OpenAPI Generator version: 6.4.0 * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -364,7 +364,7 @@ public function getShopperEmail() /** * Sets shopperEmail * - * @param string $shopperEmail + * @param string $shopperEmail * * @return self */ @@ -391,7 +391,7 @@ public function getTelephoneNumber() /** * Sets telephoneNumber * - * @param string $telephoneNumber + * @param string $telephoneNumber * * @return self */ @@ -508,6 +508,32 @@ public function jsonSerialize() return ObjectSerializer::sanitizeForSerialization($this); } + public function toArray(): array + { + $array = []; + foreach (self::$openAPITypes as $propertyName => $propertyType) { + $propertyValue = $this[$propertyName]; + if ($propertyValue !== null) { + // Check if the property value is an object and has a toArray() method + if (is_object($propertyValue) && method_exists($propertyValue, 'toArray')) { + $array[$propertyName] = $propertyValue->toArray(); + // Check if it's type datetime + } elseif ($propertyValue instanceof \DateTime) { + $array[$propertyName] = $propertyValue->format(DATE_ATOM); + // If it's an array type we should check whether it contains objects and if so call toArray method + } elseif (is_array($propertyValue)) { + $array[$propertyName] = array_map(function ($item) { + return $item instanceof ModelInterface ? $item->toArray() : $item; + }, $propertyValue); + } else { + // Otherwise, directly assign the property value to the array + $array[$propertyName] = $propertyValue; + } + } + } + return $array; + } + /** * Gets the string presentation of the object * diff --git a/src/Adyen/Model/Checkout/MerchantDevice.php b/src/Adyen/Model/Checkout/MerchantDevice.php index a471e76dd..e6d220583 100644 --- a/src/Adyen/Model/Checkout/MerchantDevice.php +++ b/src/Adyen/Model/Checkout/MerchantDevice.php @@ -5,7 +5,7 @@ * * The version of the OpenAPI document: 71 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 6.0.1 + * OpenAPI Generator version: 6.4.0 * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -437,6 +437,32 @@ public function jsonSerialize() return ObjectSerializer::sanitizeForSerialization($this); } + public function toArray(): array + { + $array = []; + foreach (self::$openAPITypes as $propertyName => $propertyType) { + $propertyValue = $this[$propertyName]; + if ($propertyValue !== null) { + // Check if the property value is an object and has a toArray() method + if (is_object($propertyValue) && method_exists($propertyValue, 'toArray')) { + $array[$propertyName] = $propertyValue->toArray(); + // Check if it's type datetime + } elseif ($propertyValue instanceof \DateTime) { + $array[$propertyName] = $propertyValue->format(DATE_ATOM); + // If it's an array type we should check whether it contains objects and if so call toArray method + } elseif (is_array($propertyValue)) { + $array[$propertyName] = array_map(function ($item) { + return $item instanceof ModelInterface ? $item->toArray() : $item; + }, $propertyValue); + } else { + // Otherwise, directly assign the property value to the array + $array[$propertyName] = $propertyValue; + } + } + } + return $array; + } + /** * Gets the string presentation of the object * diff --git a/src/Adyen/Model/Checkout/MerchantRiskIndicator.php b/src/Adyen/Model/Checkout/MerchantRiskIndicator.php index 17ad8213b..b6d6c3fad 100644 --- a/src/Adyen/Model/Checkout/MerchantRiskIndicator.php +++ b/src/Adyen/Model/Checkout/MerchantRiskIndicator.php @@ -5,7 +5,7 @@ * * The version of the OpenAPI document: 71 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 6.0.1 + * OpenAPI Generator version: 6.4.0 * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -891,6 +891,32 @@ public function jsonSerialize() return ObjectSerializer::sanitizeForSerialization($this); } + public function toArray(): array + { + $array = []; + foreach (self::$openAPITypes as $propertyName => $propertyType) { + $propertyValue = $this[$propertyName]; + if ($propertyValue !== null) { + // Check if the property value is an object and has a toArray() method + if (is_object($propertyValue) && method_exists($propertyValue, 'toArray')) { + $array[$propertyName] = $propertyValue->toArray(); + // Check if it's type datetime + } elseif ($propertyValue instanceof \DateTime) { + $array[$propertyName] = $propertyValue->format(DATE_ATOM); + // If it's an array type we should check whether it contains objects and if so call toArray method + } elseif (is_array($propertyValue)) { + $array[$propertyName] = array_map(function ($item) { + return $item instanceof ModelInterface ? $item->toArray() : $item; + }, $propertyValue); + } else { + // Otherwise, directly assign the property value to the array + $array[$propertyName] = $propertyValue; + } + } + } + return $array; + } + /** * Gets the string presentation of the object * diff --git a/src/Adyen/Model/Checkout/MobilePayDetails.php b/src/Adyen/Model/Checkout/MobilePayDetails.php index de4f9ae12..2795c76e9 100644 --- a/src/Adyen/Model/Checkout/MobilePayDetails.php +++ b/src/Adyen/Model/Checkout/MobilePayDetails.php @@ -5,7 +5,7 @@ * * The version of the OpenAPI document: 71 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 6.0.1 + * OpenAPI Generator version: 6.4.0 * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -434,6 +434,32 @@ public function jsonSerialize() return ObjectSerializer::sanitizeForSerialization($this); } + public function toArray(): array + { + $array = []; + foreach (self::$openAPITypes as $propertyName => $propertyType) { + $propertyValue = $this[$propertyName]; + if ($propertyValue !== null) { + // Check if the property value is an object and has a toArray() method + if (is_object($propertyValue) && method_exists($propertyValue, 'toArray')) { + $array[$propertyName] = $propertyValue->toArray(); + // Check if it's type datetime + } elseif ($propertyValue instanceof \DateTime) { + $array[$propertyName] = $propertyValue->format(DATE_ATOM); + // If it's an array type we should check whether it contains objects and if so call toArray method + } elseif (is_array($propertyValue)) { + $array[$propertyName] = array_map(function ($item) { + return $item instanceof ModelInterface ? $item->toArray() : $item; + }, $propertyValue); + } else { + // Otherwise, directly assign the property value to the array + $array[$propertyName] = $propertyValue; + } + } + } + return $array; + } + /** * Gets the string presentation of the object * diff --git a/src/Adyen/Model/Checkout/ModelInterface.php b/src/Adyen/Model/Checkout/ModelInterface.php index db5493a75..661c821be 100644 --- a/src/Adyen/Model/Checkout/ModelInterface.php +++ b/src/Adyen/Model/Checkout/ModelInterface.php @@ -5,7 +5,7 @@ * * The version of the OpenAPI document: 71 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 6.0.1 + * OpenAPI Generator version: 6.4.0 * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech diff --git a/src/Adyen/Model/Checkout/MolPayDetails.php b/src/Adyen/Model/Checkout/MolPayDetails.php index 041e740f6..f9168907f 100644 --- a/src/Adyen/Model/Checkout/MolPayDetails.php +++ b/src/Adyen/Model/Checkout/MolPayDetails.php @@ -5,7 +5,7 @@ * * The version of the OpenAPI document: 71 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 6.0.1 + * OpenAPI Generator version: 6.4.0 * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -476,6 +476,32 @@ public function jsonSerialize() return ObjectSerializer::sanitizeForSerialization($this); } + public function toArray(): array + { + $array = []; + foreach (self::$openAPITypes as $propertyName => $propertyType) { + $propertyValue = $this[$propertyName]; + if ($propertyValue !== null) { + // Check if the property value is an object and has a toArray() method + if (is_object($propertyValue) && method_exists($propertyValue, 'toArray')) { + $array[$propertyName] = $propertyValue->toArray(); + // Check if it's type datetime + } elseif ($propertyValue instanceof \DateTime) { + $array[$propertyName] = $propertyValue->format(DATE_ATOM); + // If it's an array type we should check whether it contains objects and if so call toArray method + } elseif (is_array($propertyValue)) { + $array[$propertyName] = array_map(function ($item) { + return $item instanceof ModelInterface ? $item->toArray() : $item; + }, $propertyValue); + } else { + // Otherwise, directly assign the property value to the array + $array[$propertyName] = $propertyValue; + } + } + } + return $array; + } + /** * Gets the string presentation of the object * diff --git a/src/Adyen/Model/Checkout/Name.php b/src/Adyen/Model/Checkout/Name.php index 35c27d373..ec413e9fc 100644 --- a/src/Adyen/Model/Checkout/Name.php +++ b/src/Adyen/Model/Checkout/Name.php @@ -5,7 +5,7 @@ * * The version of the OpenAPI document: 71 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 6.0.1 + * OpenAPI Generator version: 6.4.0 * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -409,6 +409,32 @@ public function jsonSerialize() return ObjectSerializer::sanitizeForSerialization($this); } + public function toArray(): array + { + $array = []; + foreach (self::$openAPITypes as $propertyName => $propertyType) { + $propertyValue = $this[$propertyName]; + if ($propertyValue !== null) { + // Check if the property value is an object and has a toArray() method + if (is_object($propertyValue) && method_exists($propertyValue, 'toArray')) { + $array[$propertyName] = $propertyValue->toArray(); + // Check if it's type datetime + } elseif ($propertyValue instanceof \DateTime) { + $array[$propertyName] = $propertyValue->format(DATE_ATOM); + // If it's an array type we should check whether it contains objects and if so call toArray method + } elseif (is_array($propertyValue)) { + $array[$propertyName] = array_map(function ($item) { + return $item instanceof ModelInterface ? $item->toArray() : $item; + }, $propertyValue); + } else { + // Otherwise, directly assign the property value to the array + $array[$propertyName] = $propertyValue; + } + } + } + return $array; + } + /** * Gets the string presentation of the object * diff --git a/src/Adyen/Model/Checkout/ObjectSerializer.php b/src/Adyen/Model/Checkout/ObjectSerializer.php index 2b682c18f..af2506e25 100644 --- a/src/Adyen/Model/Checkout/ObjectSerializer.php +++ b/src/Adyen/Model/Checkout/ObjectSerializer.php @@ -5,7 +5,7 @@ * * The version of the OpenAPI document: 71 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 6.0.1 + * OpenAPI Generator version: 6.4.0 * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -65,7 +65,7 @@ public static function sanitizeForSerialization($data, $type = null, $format = n foreach ($data::openAPITypes() as $property => $openAPIType) { $getter = $data::getters()[$property]; $value = $data->$getter(); - if ($value !== null && !in_array($openAPIType, ['\DateTime', '\SplFileObject', 'array', 'bool', 'boolean', 'byte', 'double', 'float', 'int', 'integer', 'mixed', 'number', 'object', 'string', 'void'], true)) { + if ($value !== null && !in_array($openAPIType, ['\DateTime', '\SplFileObject', 'array', 'bool', 'boolean', 'byte', 'float', 'int', 'integer', 'mixed', 'number', 'object', 'string', 'void'], true)) { $callable = [$openAPIType, 'getAllowableEnumValues']; if (is_callable($callable)) { /** array $callable */ @@ -81,7 +81,7 @@ public static function sanitizeForSerialization($data, $type = null, $format = n } } } else { - foreach ($data as $property => $value) { + foreach($data as $property => $value) { $values[$property] = self::sanitizeForSerialization($value); } } @@ -117,9 +117,7 @@ public static function sanitizeFilename($filename) */ public static function sanitizeTimestamp($timestamp) { - if (!is_string($timestamp)) { - return $timestamp; - } + if (!is_string($timestamp)) return $timestamp; return preg_replace('/(:\d{2}.\d{6})\d*/', '$1', $timestamp); } @@ -242,7 +240,8 @@ public static function deserialize($data, $class, $httpHeaders = null) /** @var \Psr\Http\Message\StreamInterface $data */ // determine file name - if (is_array($httpHeaders) + if ( + is_array($httpHeaders) && array_key_exists('Content-Disposition', $httpHeaders) && preg_match('/inline; filename=[\'"]?([^\'"\s]+)[\'"]?$/i', $httpHeaders['Content-Disposition'], $match) ) { @@ -261,7 +260,7 @@ public static function deserialize($data, $class, $httpHeaders = null) } /** @psalm-suppress ParadoxicalCondition */ - if (in_array($class, ['\DateTime', '\SplFileObject', 'array', 'bool', 'boolean', 'byte', 'double', 'float', 'int', 'integer', 'mixed', 'number', 'object', 'string', 'void'], true)) { + if (in_array($class, ['\DateTime', '\SplFileObject', 'array', 'bool', 'boolean', 'byte', 'float', 'int', 'integer', 'mixed', 'number', 'object', 'string', 'void'], true)) { settype($data, $class); return $data; } diff --git a/src/Adyen/Model/Checkout/OpenInvoiceDetails.php b/src/Adyen/Model/Checkout/OpenInvoiceDetails.php index c7cb7c02c..e8f68ed9b 100644 --- a/src/Adyen/Model/Checkout/OpenInvoiceDetails.php +++ b/src/Adyen/Model/Checkout/OpenInvoiceDetails.php @@ -5,7 +5,7 @@ * * The version of the OpenAPI document: 71 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 6.0.1 + * OpenAPI Generator version: 6.4.0 * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -610,6 +610,32 @@ public function jsonSerialize() return ObjectSerializer::sanitizeForSerialization($this); } + public function toArray(): array + { + $array = []; + foreach (self::$openAPITypes as $propertyName => $propertyType) { + $propertyValue = $this[$propertyName]; + if ($propertyValue !== null) { + // Check if the property value is an object and has a toArray() method + if (is_object($propertyValue) && method_exists($propertyValue, 'toArray')) { + $array[$propertyName] = $propertyValue->toArray(); + // Check if it's type datetime + } elseif ($propertyValue instanceof \DateTime) { + $array[$propertyName] = $propertyValue->format(DATE_ATOM); + // If it's an array type we should check whether it contains objects and if so call toArray method + } elseif (is_array($propertyValue)) { + $array[$propertyName] = array_map(function ($item) { + return $item instanceof ModelInterface ? $item->toArray() : $item; + }, $propertyValue); + } else { + // Otherwise, directly assign the property value to the array + $array[$propertyName] = $propertyValue; + } + } + } + return $array; + } + /** * Gets the string presentation of the object * diff --git a/src/Adyen/Model/Checkout/PayPalDetails.php b/src/Adyen/Model/Checkout/PayPalDetails.php index 5837e901e..431344c60 100644 --- a/src/Adyen/Model/Checkout/PayPalDetails.php +++ b/src/Adyen/Model/Checkout/PayPalDetails.php @@ -5,7 +5,7 @@ * * The version of the OpenAPI document: 71 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 6.0.1 + * OpenAPI Generator version: 6.4.0 * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -710,6 +710,32 @@ public function jsonSerialize() return ObjectSerializer::sanitizeForSerialization($this); } + public function toArray(): array + { + $array = []; + foreach (self::$openAPITypes as $propertyName => $propertyType) { + $propertyValue = $this[$propertyName]; + if ($propertyValue !== null) { + // Check if the property value is an object and has a toArray() method + if (is_object($propertyValue) && method_exists($propertyValue, 'toArray')) { + $array[$propertyName] = $propertyValue->toArray(); + // Check if it's type datetime + } elseif ($propertyValue instanceof \DateTime) { + $array[$propertyName] = $propertyValue->format(DATE_ATOM); + // If it's an array type we should check whether it contains objects and if so call toArray method + } elseif (is_array($propertyValue)) { + $array[$propertyName] = array_map(function ($item) { + return $item instanceof ModelInterface ? $item->toArray() : $item; + }, $propertyValue); + } else { + // Otherwise, directly assign the property value to the array + $array[$propertyName] = $propertyValue; + } + } + } + return $array; + } + /** * Gets the string presentation of the object * diff --git a/src/Adyen/Model/Checkout/PayUUpiDetails.php b/src/Adyen/Model/Checkout/PayUUpiDetails.php index 497cceaf9..21a4e36f0 100644 --- a/src/Adyen/Model/Checkout/PayUUpiDetails.php +++ b/src/Adyen/Model/Checkout/PayUUpiDetails.php @@ -5,7 +5,7 @@ * * The version of the OpenAPI document: 71 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 6.0.1 + * OpenAPI Generator version: 6.4.0 * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -575,6 +575,32 @@ public function jsonSerialize() return ObjectSerializer::sanitizeForSerialization($this); } + public function toArray(): array + { + $array = []; + foreach (self::$openAPITypes as $propertyName => $propertyType) { + $propertyValue = $this[$propertyName]; + if ($propertyValue !== null) { + // Check if the property value is an object and has a toArray() method + if (is_object($propertyValue) && method_exists($propertyValue, 'toArray')) { + $array[$propertyName] = $propertyValue->toArray(); + // Check if it's type datetime + } elseif ($propertyValue instanceof \DateTime) { + $array[$propertyName] = $propertyValue->format(DATE_ATOM); + // If it's an array type we should check whether it contains objects and if so call toArray method + } elseif (is_array($propertyValue)) { + $array[$propertyName] = array_map(function ($item) { + return $item instanceof ModelInterface ? $item->toArray() : $item; + }, $propertyValue); + } else { + // Otherwise, directly assign the property value to the array + $array[$propertyName] = $propertyValue; + } + } + } + return $array; + } + /** * Gets the string presentation of the object * diff --git a/src/Adyen/Model/Checkout/PayWithGoogleDetails.php b/src/Adyen/Model/Checkout/PayWithGoogleDetails.php index fe3e5c4ff..face3c089 100644 --- a/src/Adyen/Model/Checkout/PayWithGoogleDetails.php +++ b/src/Adyen/Model/Checkout/PayWithGoogleDetails.php @@ -5,7 +5,7 @@ * * The version of the OpenAPI document: 71 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 6.0.1 + * OpenAPI Generator version: 6.4.0 * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -245,7 +245,6 @@ public function getModelName() return self::$openAPIModelName; } - public const FUNDING_SOURCE_CREDIT = 'credit'; public const FUNDING_SOURCE_DEBIT = 'debit'; public const TYPE_PAYWITHGOOGLE = 'paywithgoogle'; @@ -257,7 +256,6 @@ public function getModelName() public function getFundingSourceAllowableValues() { return [ - self::FUNDING_SOURCE_CREDIT, self::FUNDING_SOURCE_DEBIT, ]; } @@ -608,6 +606,32 @@ public function jsonSerialize() return ObjectSerializer::sanitizeForSerialization($this); } + public function toArray(): array + { + $array = []; + foreach (self::$openAPITypes as $propertyName => $propertyType) { + $propertyValue = $this[$propertyName]; + if ($propertyValue !== null) { + // Check if the property value is an object and has a toArray() method + if (is_object($propertyValue) && method_exists($propertyValue, 'toArray')) { + $array[$propertyName] = $propertyValue->toArray(); + // Check if it's type datetime + } elseif ($propertyValue instanceof \DateTime) { + $array[$propertyName] = $propertyValue->format(DATE_ATOM); + // If it's an array type we should check whether it contains objects and if so call toArray method + } elseif (is_array($propertyValue)) { + $array[$propertyName] = array_map(function ($item) { + return $item instanceof ModelInterface ? $item->toArray() : $item; + }, $propertyValue); + } else { + // Otherwise, directly assign the property value to the array + $array[$propertyName] = $propertyValue; + } + } + } + return $array; + } + /** * Gets the string presentation of the object * diff --git a/src/Adyen/Model/Checkout/PayWithGoogleDonations.php b/src/Adyen/Model/Checkout/PayWithGoogleDonations.php deleted file mode 100644 index 8b7c85f2c..000000000 --- a/src/Adyen/Model/Checkout/PayWithGoogleDonations.php +++ /dev/null @@ -1,623 +0,0 @@ - - */ -class PayWithGoogleDonations implements ModelInterface, ArrayAccess, \JsonSerializable -{ - public const DISCRIMINATOR = null; - - /** - * The original name of the model. - * - * @var string - */ - protected static $openAPIModelName = 'PayWithGoogleDonations'; - - /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ - protected static $openAPITypes = [ - 'checkoutAttemptId' => 'string', - 'fundingSource' => 'string', - 'googlePayToken' => 'string', - 'recurringDetailReference' => 'string', - 'storedPaymentMethodId' => 'string', - 'type' => 'string' - ]; - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ - protected static $openAPIFormats = [ - 'checkoutAttemptId' => null, - 'fundingSource' => null, - 'googlePayToken' => null, - 'recurringDetailReference' => null, - 'storedPaymentMethodId' => null, - 'type' => null - ]; - - /** - * Array of nullable properties. Used for (de)serialization - * - * @var boolean[] - */ - protected static $openAPINullables = [ - 'checkoutAttemptId' => false, - 'fundingSource' => false, - 'googlePayToken' => false, - 'recurringDetailReference' => false, - 'storedPaymentMethodId' => false, - '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 = [ - 'checkoutAttemptId' => 'checkoutAttemptId', - 'fundingSource' => 'fundingSource', - 'googlePayToken' => 'googlePayToken', - 'recurringDetailReference' => 'recurringDetailReference', - 'storedPaymentMethodId' => 'storedPaymentMethodId', - 'type' => 'type' - ]; - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @var string[] - */ - protected static $setters = [ - 'checkoutAttemptId' => 'setCheckoutAttemptId', - 'fundingSource' => 'setFundingSource', - 'googlePayToken' => 'setGooglePayToken', - 'recurringDetailReference' => 'setRecurringDetailReference', - 'storedPaymentMethodId' => 'setStoredPaymentMethodId', - 'type' => 'setType' - ]; - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @var string[] - */ - protected static $getters = [ - 'checkoutAttemptId' => 'getCheckoutAttemptId', - 'fundingSource' => 'getFundingSource', - 'googlePayToken' => 'getGooglePayToken', - 'recurringDetailReference' => 'getRecurringDetailReference', - 'storedPaymentMethodId' => 'getStoredPaymentMethodId', - 'type' => 'getType' - ]; - - /** - * 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; - } - - public const FUNDING_SOURCE_CREDIT = 'credit'; - public const FUNDING_SOURCE_DEBIT = 'debit'; - public const TYPE_PAYWITHGOOGLE = 'paywithgoogle'; - - /** - * Gets allowable values of the enum - * - * @return string[] - */ - public function getFundingSourceAllowableValues() - { - return [ - self::FUNDING_SOURCE_CREDIT, - self::FUNDING_SOURCE_DEBIT, - ]; - } - /** - * Gets allowable values of the enum - * - * @return string[] - */ - public function getTypeAllowableValues() - { - return [ - self::TYPE_PAYWITHGOOGLE, - ]; - } - /** - * 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('checkoutAttemptId', $data ?? [], null); - $this->setIfExists('fundingSource', $data ?? [], null); - $this->setIfExists('googlePayToken', $data ?? [], null); - $this->setIfExists('recurringDetailReference', $data ?? [], null); - $this->setIfExists('storedPaymentMethodId', $data ?? [], null); - $this->setIfExists('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 = []; - - $allowedValues = $this->getFundingSourceAllowableValues(); - if (!is_null($this->container['fundingSource']) && !in_array($this->container['fundingSource'], $allowedValues, true)) { - $invalidProperties[] = sprintf( - "invalid value '%s' for 'fundingSource', must be one of '%s'", - $this->container['fundingSource'], - implode("', '", $allowedValues) - ); - } - - if ($this->container['googlePayToken'] === null) { - $invalidProperties[] = "'googlePayToken' can't be null"; - } - $allowedValues = $this->getTypeAllowableValues(); - if (!is_null($this->container['type']) && !in_array($this->container['type'], $allowedValues, true)) { - $invalidProperties[] = sprintf( - "invalid value '%s' for 'type', must be one of '%s'", - $this->container['type'], - implode("', '", $allowedValues) - ); - } - - 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 checkoutAttemptId - * - * @return string|null - */ - public function getCheckoutAttemptId() - { - return $this->container['checkoutAttemptId']; - } - - /** - * Sets checkoutAttemptId - * - * @param string|null $checkoutAttemptId The checkout attempt identifier. - * - * @return self - */ - public function setCheckoutAttemptId($checkoutAttemptId) - { - if (is_null($checkoutAttemptId)) { - throw new \InvalidArgumentException('non-nullable checkoutAttemptId cannot be null'); - } - $this->container['checkoutAttemptId'] = $checkoutAttemptId; - - return $this; - } - - /** - * Gets fundingSource - * - * @return string|null - */ - public function getFundingSource() - { - return $this->container['fundingSource']; - } - - /** - * Sets fundingSource - * - * @param string|null $fundingSource The funding source that should be used when multiple sources are available. For Brazilian combo cards, by default the funding source is credit. To use debit, set this value to **debit**. - * - * @return self - */ - public function setFundingSource($fundingSource) - { - if (is_null($fundingSource)) { - throw new \InvalidArgumentException('non-nullable fundingSource cannot be null'); - } - $allowedValues = $this->getFundingSourceAllowableValues(); - if (!in_array($fundingSource, $allowedValues, true)) { - throw new \InvalidArgumentException( - sprintf( - "Invalid value '%s' for 'fundingSource', must be one of '%s'", - $fundingSource, - implode("', '", $allowedValues) - ) - ); - } - $this->container['fundingSource'] = $fundingSource; - - return $this; - } - - /** - * Gets googlePayToken - * - * @return string - */ - public function getGooglePayToken() - { - return $this->container['googlePayToken']; - } - - /** - * Sets googlePayToken - * - * @param string $googlePayToken The `token` that you obtained from the [Google Pay API](https://developers.google.com/pay/api/web/reference/response-objects#PaymentData) `PaymentData` response. - * - * @return self - */ - public function setGooglePayToken($googlePayToken) - { - if (is_null($googlePayToken)) { - throw new \InvalidArgumentException('non-nullable googlePayToken cannot be null'); - } - $this->container['googlePayToken'] = $googlePayToken; - - return $this; - } - - /** - * Gets recurringDetailReference - * - * @return string|null - * @deprecated - */ - public function getRecurringDetailReference() - { - return $this->container['recurringDetailReference']; - } - - /** - * Sets recurringDetailReference - * - * @param string|null $recurringDetailReference This is the `recurringDetailReference` returned in the response when you created the token. - * - * @return self - * @deprecated - */ - public function setRecurringDetailReference($recurringDetailReference) - { - if (is_null($recurringDetailReference)) { - throw new \InvalidArgumentException('non-nullable recurringDetailReference cannot be null'); - } - $this->container['recurringDetailReference'] = $recurringDetailReference; - - return $this; - } - - /** - * Gets storedPaymentMethodId - * - * @return string|null - */ - public function getStoredPaymentMethodId() - { - return $this->container['storedPaymentMethodId']; - } - - /** - * Sets storedPaymentMethodId - * - * @param string|null $storedPaymentMethodId This is the `recurringDetailReference` returned in the response when you created the token. - * - * @return self - */ - public function setStoredPaymentMethodId($storedPaymentMethodId) - { - if (is_null($storedPaymentMethodId)) { - throw new \InvalidArgumentException('non-nullable storedPaymentMethodId cannot be null'); - } - $this->container['storedPaymentMethodId'] = $storedPaymentMethodId; - - return $this; - } - - /** - * Gets type - * - * @return string|null - */ - public function getType() - { - return $this->container['type']; - } - - /** - * Sets type - * - * @param string|null $type **paywithgoogle** - * - * @return self - */ - public function setType($type) - { - if (is_null($type)) { - throw new \InvalidArgumentException('non-nullable type cannot be null'); - } - $allowedValues = $this->getTypeAllowableValues(); - if (!in_array($type, $allowedValues, true)) { - throw new \InvalidArgumentException( - sprintf( - "Invalid value '%s' for 'type', must be one of '%s'", - $type, - implode("', '", $allowedValues) - ) - ); - } - $this->container['type'] = $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 - ); - } -} diff --git a/src/Adyen/Model/Checkout/PaymentAmountUpdateRequest.php b/src/Adyen/Model/Checkout/PaymentAmountUpdateRequest.php index 7d1726b6d..a5c8fa504 100644 --- a/src/Adyen/Model/Checkout/PaymentAmountUpdateRequest.php +++ b/src/Adyen/Model/Checkout/PaymentAmountUpdateRequest.php @@ -5,7 +5,7 @@ * * The version of the OpenAPI document: 71 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 6.0.1 + * OpenAPI Generator version: 6.4.0 * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -614,6 +614,32 @@ public function jsonSerialize() return ObjectSerializer::sanitizeForSerialization($this); } + public function toArray(): array + { + $array = []; + foreach (self::$openAPITypes as $propertyName => $propertyType) { + $propertyValue = $this[$propertyName]; + if ($propertyValue !== null) { + // Check if the property value is an object and has a toArray() method + if (is_object($propertyValue) && method_exists($propertyValue, 'toArray')) { + $array[$propertyName] = $propertyValue->toArray(); + // Check if it's type datetime + } elseif ($propertyValue instanceof \DateTime) { + $array[$propertyName] = $propertyValue->format(DATE_ATOM); + // If it's an array type we should check whether it contains objects and if so call toArray method + } elseif (is_array($propertyValue)) { + $array[$propertyName] = array_map(function ($item) { + return $item instanceof ModelInterface ? $item->toArray() : $item; + }, $propertyValue); + } else { + // Otherwise, directly assign the property value to the array + $array[$propertyName] = $propertyValue; + } + } + } + return $array; + } + /** * Gets the string presentation of the object * diff --git a/src/Adyen/Model/Checkout/PaymentAmountUpdateResponse.php b/src/Adyen/Model/Checkout/PaymentAmountUpdateResponse.php index e2186c8f4..780a69965 100644 --- a/src/Adyen/Model/Checkout/PaymentAmountUpdateResponse.php +++ b/src/Adyen/Model/Checkout/PaymentAmountUpdateResponse.php @@ -5,7 +5,7 @@ * * The version of the OpenAPI document: 71 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 6.0.1 + * OpenAPI Generator version: 6.4.0 * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -725,6 +725,32 @@ public function jsonSerialize() return ObjectSerializer::sanitizeForSerialization($this); } + public function toArray(): array + { + $array = []; + foreach (self::$openAPITypes as $propertyName => $propertyType) { + $propertyValue = $this[$propertyName]; + if ($propertyValue !== null) { + // Check if the property value is an object and has a toArray() method + if (is_object($propertyValue) && method_exists($propertyValue, 'toArray')) { + $array[$propertyName] = $propertyValue->toArray(); + // Check if it's type datetime + } elseif ($propertyValue instanceof \DateTime) { + $array[$propertyName] = $propertyValue->format(DATE_ATOM); + // If it's an array type we should check whether it contains objects and if so call toArray method + } elseif (is_array($propertyValue)) { + $array[$propertyName] = array_map(function ($item) { + return $item instanceof ModelInterface ? $item->toArray() : $item; + }, $propertyValue); + } else { + // Otherwise, directly assign the property value to the array + $array[$propertyName] = $propertyValue; + } + } + } + return $array; + } + /** * Gets the string presentation of the object * diff --git a/src/Adyen/Model/Checkout/PaymentCancelRequest.php b/src/Adyen/Model/Checkout/PaymentCancelRequest.php index 5aa0b1c67..461043cc9 100644 --- a/src/Adyen/Model/Checkout/PaymentCancelRequest.php +++ b/src/Adyen/Model/Checkout/PaymentCancelRequest.php @@ -5,7 +5,7 @@ * * The version of the OpenAPI document: 71 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 6.0.1 + * OpenAPI Generator version: 6.4.0 * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -440,6 +440,32 @@ public function jsonSerialize() return ObjectSerializer::sanitizeForSerialization($this); } + public function toArray(): array + { + $array = []; + foreach (self::$openAPITypes as $propertyName => $propertyType) { + $propertyValue = $this[$propertyName]; + if ($propertyValue !== null) { + // Check if the property value is an object and has a toArray() method + if (is_object($propertyValue) && method_exists($propertyValue, 'toArray')) { + $array[$propertyName] = $propertyValue->toArray(); + // Check if it's type datetime + } elseif ($propertyValue instanceof \DateTime) { + $array[$propertyName] = $propertyValue->format(DATE_ATOM); + // If it's an array type we should check whether it contains objects and if so call toArray method + } elseif (is_array($propertyValue)) { + $array[$propertyName] = array_map(function ($item) { + return $item instanceof ModelInterface ? $item->toArray() : $item; + }, $propertyValue); + } else { + // Otherwise, directly assign the property value to the array + $array[$propertyName] = $propertyValue; + } + } + } + return $array; + } + /** * Gets the string presentation of the object * diff --git a/src/Adyen/Model/Checkout/PaymentCancelResponse.php b/src/Adyen/Model/Checkout/PaymentCancelResponse.php index 1e2666baa..552d50cbe 100644 --- a/src/Adyen/Model/Checkout/PaymentCancelResponse.php +++ b/src/Adyen/Model/Checkout/PaymentCancelResponse.php @@ -5,7 +5,7 @@ * * The version of the OpenAPI document: 71 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 6.0.1 + * OpenAPI Generator version: 6.4.0 * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -548,6 +548,32 @@ public function jsonSerialize() return ObjectSerializer::sanitizeForSerialization($this); } + public function toArray(): array + { + $array = []; + foreach (self::$openAPITypes as $propertyName => $propertyType) { + $propertyValue = $this[$propertyName]; + if ($propertyValue !== null) { + // Check if the property value is an object and has a toArray() method + if (is_object($propertyValue) && method_exists($propertyValue, 'toArray')) { + $array[$propertyName] = $propertyValue->toArray(); + // Check if it's type datetime + } elseif ($propertyValue instanceof \DateTime) { + $array[$propertyName] = $propertyValue->format(DATE_ATOM); + // If it's an array type we should check whether it contains objects and if so call toArray method + } elseif (is_array($propertyValue)) { + $array[$propertyName] = array_map(function ($item) { + return $item instanceof ModelInterface ? $item->toArray() : $item; + }, $propertyValue); + } else { + // Otherwise, directly assign the property value to the array + $array[$propertyName] = $propertyValue; + } + } + } + return $array; + } + /** * Gets the string presentation of the object * diff --git a/src/Adyen/Model/Checkout/PaymentCaptureRequest.php b/src/Adyen/Model/Checkout/PaymentCaptureRequest.php index 3881d1ab3..1e6c1517a 100644 --- a/src/Adyen/Model/Checkout/PaymentCaptureRequest.php +++ b/src/Adyen/Model/Checkout/PaymentCaptureRequest.php @@ -5,7 +5,7 @@ * * The version of the OpenAPI document: 71 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 6.0.1 + * OpenAPI Generator version: 6.4.0 * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -613,6 +613,32 @@ public function jsonSerialize() return ObjectSerializer::sanitizeForSerialization($this); } + public function toArray(): array + { + $array = []; + foreach (self::$openAPITypes as $propertyName => $propertyType) { + $propertyValue = $this[$propertyName]; + if ($propertyValue !== null) { + // Check if the property value is an object and has a toArray() method + if (is_object($propertyValue) && method_exists($propertyValue, 'toArray')) { + $array[$propertyName] = $propertyValue->toArray(); + // Check if it's type datetime + } elseif ($propertyValue instanceof \DateTime) { + $array[$propertyName] = $propertyValue->format(DATE_ATOM); + // If it's an array type we should check whether it contains objects and if so call toArray method + } elseif (is_array($propertyValue)) { + $array[$propertyName] = array_map(function ($item) { + return $item instanceof ModelInterface ? $item->toArray() : $item; + }, $propertyValue); + } else { + // Otherwise, directly assign the property value to the array + $array[$propertyName] = $propertyValue; + } + } + } + return $array; + } + /** * Gets the string presentation of the object * diff --git a/src/Adyen/Model/Checkout/PaymentCaptureResponse.php b/src/Adyen/Model/Checkout/PaymentCaptureResponse.php index 7636d83c8..6623b1813 100644 --- a/src/Adyen/Model/Checkout/PaymentCaptureResponse.php +++ b/src/Adyen/Model/Checkout/PaymentCaptureResponse.php @@ -5,7 +5,7 @@ * * The version of the OpenAPI document: 71 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 6.0.1 + * OpenAPI Generator version: 6.4.0 * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -721,6 +721,32 @@ public function jsonSerialize() return ObjectSerializer::sanitizeForSerialization($this); } + public function toArray(): array + { + $array = []; + foreach (self::$openAPITypes as $propertyName => $propertyType) { + $propertyValue = $this[$propertyName]; + if ($propertyValue !== null) { + // Check if the property value is an object and has a toArray() method + if (is_object($propertyValue) && method_exists($propertyValue, 'toArray')) { + $array[$propertyName] = $propertyValue->toArray(); + // Check if it's type datetime + } elseif ($propertyValue instanceof \DateTime) { + $array[$propertyName] = $propertyValue->format(DATE_ATOM); + // If it's an array type we should check whether it contains objects and if so call toArray method + } elseif (is_array($propertyValue)) { + $array[$propertyName] = array_map(function ($item) { + return $item instanceof ModelInterface ? $item->toArray() : $item; + }, $propertyValue); + } else { + // Otherwise, directly assign the property value to the array + $array[$propertyName] = $propertyValue; + } + } + } + return $array; + } + /** * Gets the string presentation of the object * diff --git a/src/Adyen/Model/Checkout/PaymentCompletionDetails.php b/src/Adyen/Model/Checkout/PaymentCompletionDetails.php index 22e27e134..ec34ddb8c 100644 --- a/src/Adyen/Model/Checkout/PaymentCompletionDetails.php +++ b/src/Adyen/Model/Checkout/PaymentCompletionDetails.php @@ -5,7 +5,7 @@ * * The version of the OpenAPI document: 71 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 6.0.1 + * OpenAPI Generator version: 6.4.0 * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -947,6 +947,32 @@ public function jsonSerialize() return ObjectSerializer::sanitizeForSerialization($this); } + public function toArray(): array + { + $array = []; + foreach (self::$openAPITypes as $propertyName => $propertyType) { + $propertyValue = $this[$propertyName]; + if ($propertyValue !== null) { + // Check if the property value is an object and has a toArray() method + if (is_object($propertyValue) && method_exists($propertyValue, 'toArray')) { + $array[$propertyName] = $propertyValue->toArray(); + // Check if it's type datetime + } elseif ($propertyValue instanceof \DateTime) { + $array[$propertyName] = $propertyValue->format(DATE_ATOM); + // If it's an array type we should check whether it contains objects and if so call toArray method + } elseif (is_array($propertyValue)) { + $array[$propertyName] = array_map(function ($item) { + return $item instanceof ModelInterface ? $item->toArray() : $item; + }, $propertyValue); + } else { + // Otherwise, directly assign the property value to the array + $array[$propertyName] = $propertyValue; + } + } + } + return $array; + } + /** * Gets the string presentation of the object * diff --git a/src/Adyen/Model/Checkout/PaymentDetails.php b/src/Adyen/Model/Checkout/PaymentDetails.php index 262007e52..71757b294 100644 --- a/src/Adyen/Model/Checkout/PaymentDetails.php +++ b/src/Adyen/Model/Checkout/PaymentDetails.php @@ -5,7 +5,7 @@ * * The version of the OpenAPI document: 71 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 6.0.1 + * OpenAPI Generator version: 6.4.0 * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -608,6 +608,32 @@ public function jsonSerialize() return ObjectSerializer::sanitizeForSerialization($this); } + public function toArray(): array + { + $array = []; + foreach (self::$openAPITypes as $propertyName => $propertyType) { + $propertyValue = $this[$propertyName]; + if ($propertyValue !== null) { + // Check if the property value is an object and has a toArray() method + if (is_object($propertyValue) && method_exists($propertyValue, 'toArray')) { + $array[$propertyName] = $propertyValue->toArray(); + // Check if it's type datetime + } elseif ($propertyValue instanceof \DateTime) { + $array[$propertyName] = $propertyValue->format(DATE_ATOM); + // If it's an array type we should check whether it contains objects and if so call toArray method + } elseif (is_array($propertyValue)) { + $array[$propertyName] = array_map(function ($item) { + return $item instanceof ModelInterface ? $item->toArray() : $item; + }, $propertyValue); + } else { + // Otherwise, directly assign the property value to the array + $array[$propertyName] = $propertyValue; + } + } + } + return $array; + } + /** * Gets the string presentation of the object * diff --git a/src/Adyen/Model/Checkout/PaymentDetailsRequest.php b/src/Adyen/Model/Checkout/PaymentDetailsRequest.php index a406b54ef..a1059faaa 100644 --- a/src/Adyen/Model/Checkout/PaymentDetailsRequest.php +++ b/src/Adyen/Model/Checkout/PaymentDetailsRequest.php @@ -5,7 +5,7 @@ * * The version of the OpenAPI document: 71 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 6.0.1 + * OpenAPI Generator version: 6.4.0 * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -367,7 +367,7 @@ public function getPaymentData() /** * Sets paymentData * - * @param string|null $paymentData Encoded payment data. For [authorizing a payment after using 3D Secure 2 Authentication-only](https://docs.adyen.com/online-payments/3d-secure/other-3ds-flows/authentication-only/#authorise-the-payment-with-adyen): If you received `resultCode`: **AuthenticationNotRequired** in the `/payments` response, use the `threeDSPaymentData` from the same response. If you received `resultCode`: **AuthenticationFinished** in the `/payments` response, use the `action.paymentData` from the same response. + * @param string|null $paymentData The `paymentData` value from the `/payments` response. Required if the `/payments` response returns this value. * * @return self */ @@ -476,6 +476,32 @@ public function jsonSerialize() return ObjectSerializer::sanitizeForSerialization($this); } + public function toArray(): array + { + $array = []; + foreach (self::$openAPITypes as $propertyName => $propertyType) { + $propertyValue = $this[$propertyName]; + if ($propertyValue !== null) { + // Check if the property value is an object and has a toArray() method + if (is_object($propertyValue) && method_exists($propertyValue, 'toArray')) { + $array[$propertyName] = $propertyValue->toArray(); + // Check if it's type datetime + } elseif ($propertyValue instanceof \DateTime) { + $array[$propertyName] = $propertyValue->format(DATE_ATOM); + // If it's an array type we should check whether it contains objects and if so call toArray method + } elseif (is_array($propertyValue)) { + $array[$propertyName] = array_map(function ($item) { + return $item instanceof ModelInterface ? $item->toArray() : $item; + }, $propertyValue); + } else { + // Otherwise, directly assign the property value to the array + $array[$propertyName] = $propertyValue; + } + } + } + return $array; + } + /** * Gets the string presentation of the object * diff --git a/src/Adyen/Model/Checkout/PaymentDetailsResponse.php b/src/Adyen/Model/Checkout/PaymentDetailsResponse.php index 19ea4eede..8a38f094e 100644 --- a/src/Adyen/Model/Checkout/PaymentDetailsResponse.php +++ b/src/Adyen/Model/Checkout/PaymentDetailsResponse.php @@ -5,7 +5,7 @@ * * The version of the OpenAPI document: 71 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 6.0.1 + * OpenAPI Generator version: 6.4.0 * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -902,6 +902,32 @@ public function jsonSerialize() return ObjectSerializer::sanitizeForSerialization($this); } + public function toArray(): array + { + $array = []; + foreach (self::$openAPITypes as $propertyName => $propertyType) { + $propertyValue = $this[$propertyName]; + if ($propertyValue !== null) { + // Check if the property value is an object and has a toArray() method + if (is_object($propertyValue) && method_exists($propertyValue, 'toArray')) { + $array[$propertyName] = $propertyValue->toArray(); + // Check if it's type datetime + } elseif ($propertyValue instanceof \DateTime) { + $array[$propertyName] = $propertyValue->format(DATE_ATOM); + // If it's an array type we should check whether it contains objects and if so call toArray method + } elseif (is_array($propertyValue)) { + $array[$propertyName] = array_map(function ($item) { + return $item instanceof ModelInterface ? $item->toArray() : $item; + }, $propertyValue); + } else { + // Otherwise, directly assign the property value to the array + $array[$propertyName] = $propertyValue; + } + } + } + return $array; + } + /** * Gets the string presentation of the object * diff --git a/src/Adyen/Model/Checkout/PaymentLinkRequest.php b/src/Adyen/Model/Checkout/PaymentLinkRequest.php index 4b2850a71..9e4afc0d2 100644 --- a/src/Adyen/Model/Checkout/PaymentLinkRequest.php +++ b/src/Adyen/Model/Checkout/PaymentLinkRequest.php @@ -5,7 +5,7 @@ * * The version of the OpenAPI document: 71 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 6.0.1 + * OpenAPI Generator version: 6.4.0 * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -1733,6 +1733,32 @@ public function jsonSerialize() return ObjectSerializer::sanitizeForSerialization($this); } + public function toArray(): array + { + $array = []; + foreach (self::$openAPITypes as $propertyName => $propertyType) { + $propertyValue = $this[$propertyName]; + if ($propertyValue !== null) { + // Check if the property value is an object and has a toArray() method + if (is_object($propertyValue) && method_exists($propertyValue, 'toArray')) { + $array[$propertyName] = $propertyValue->toArray(); + // Check if it's type datetime + } elseif ($propertyValue instanceof \DateTime) { + $array[$propertyName] = $propertyValue->format(DATE_ATOM); + // If it's an array type we should check whether it contains objects and if so call toArray method + } elseif (is_array($propertyValue)) { + $array[$propertyName] = array_map(function ($item) { + return $item instanceof ModelInterface ? $item->toArray() : $item; + }, $propertyValue); + } else { + // Otherwise, directly assign the property value to the array + $array[$propertyName] = $propertyValue; + } + } + } + return $array; + } + /** * Gets the string presentation of the object * diff --git a/src/Adyen/Model/Checkout/PaymentLinkResponse.php b/src/Adyen/Model/Checkout/PaymentLinkResponse.php index d4e072a27..7a2ec2bb8 100644 --- a/src/Adyen/Model/Checkout/PaymentLinkResponse.php +++ b/src/Adyen/Model/Checkout/PaymentLinkResponse.php @@ -5,7 +5,7 @@ * * The version of the OpenAPI document: 71 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 6.0.1 + * OpenAPI Generator version: 6.4.0 * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -1917,6 +1917,32 @@ public function jsonSerialize() return ObjectSerializer::sanitizeForSerialization($this); } + public function toArray(): array + { + $array = []; + foreach (self::$openAPITypes as $propertyName => $propertyType) { + $propertyValue = $this[$propertyName]; + if ($propertyValue !== null) { + // Check if the property value is an object and has a toArray() method + if (is_object($propertyValue) && method_exists($propertyValue, 'toArray')) { + $array[$propertyName] = $propertyValue->toArray(); + // Check if it's type datetime + } elseif ($propertyValue instanceof \DateTime) { + $array[$propertyName] = $propertyValue->format(DATE_ATOM); + // If it's an array type we should check whether it contains objects and if so call toArray method + } elseif (is_array($propertyValue)) { + $array[$propertyName] = array_map(function ($item) { + return $item instanceof ModelInterface ? $item->toArray() : $item; + }, $propertyValue); + } else { + // Otherwise, directly assign the property value to the array + $array[$propertyName] = $propertyValue; + } + } + } + return $array; + } + /** * Gets the string presentation of the object * diff --git a/src/Adyen/Model/Checkout/PaymentMethod.php b/src/Adyen/Model/Checkout/PaymentMethod.php index 3b50f8f0b..a27915740 100644 --- a/src/Adyen/Model/Checkout/PaymentMethod.php +++ b/src/Adyen/Model/Checkout/PaymentMethod.php @@ -5,7 +5,7 @@ * * The version of the OpenAPI document: 71 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 6.0.1 + * OpenAPI Generator version: 6.4.0 * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -263,7 +263,6 @@ public function getModelName() return self::$openAPIModelName; } - public const FUNDING_SOURCE_CREDIT = 'credit'; public const FUNDING_SOURCE_DEBIT = 'debit'; /** @@ -274,7 +273,6 @@ public function getModelName() public function getFundingSourceAllowableValues() { return [ - self::FUNDING_SOURCE_CREDIT, self::FUNDING_SOURCE_DEBIT, ]; } @@ -676,6 +674,32 @@ public function jsonSerialize() return ObjectSerializer::sanitizeForSerialization($this); } + public function toArray(): array + { + $array = []; + foreach (self::$openAPITypes as $propertyName => $propertyType) { + $propertyValue = $this[$propertyName]; + if ($propertyValue !== null) { + // Check if the property value is an object and has a toArray() method + if (is_object($propertyValue) && method_exists($propertyValue, 'toArray')) { + $array[$propertyName] = $propertyValue->toArray(); + // Check if it's type datetime + } elseif ($propertyValue instanceof \DateTime) { + $array[$propertyName] = $propertyValue->format(DATE_ATOM); + // If it's an array type we should check whether it contains objects and if so call toArray method + } elseif (is_array($propertyValue)) { + $array[$propertyName] = array_map(function ($item) { + return $item instanceof ModelInterface ? $item->toArray() : $item; + }, $propertyValue); + } else { + // Otherwise, directly assign the property value to the array + $array[$propertyName] = $propertyValue; + } + } + } + return $array; + } + /** * Gets the string presentation of the object * diff --git a/src/Adyen/Model/Checkout/PaymentMethodGroup.php b/src/Adyen/Model/Checkout/PaymentMethodGroup.php index 280b61468..500cda0fb 100644 --- a/src/Adyen/Model/Checkout/PaymentMethodGroup.php +++ b/src/Adyen/Model/Checkout/PaymentMethodGroup.php @@ -5,7 +5,7 @@ * * The version of the OpenAPI document: 71 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 6.0.1 + * OpenAPI Generator version: 6.4.0 * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -437,6 +437,32 @@ public function jsonSerialize() return ObjectSerializer::sanitizeForSerialization($this); } + public function toArray(): array + { + $array = []; + foreach (self::$openAPITypes as $propertyName => $propertyType) { + $propertyValue = $this[$propertyName]; + if ($propertyValue !== null) { + // Check if the property value is an object and has a toArray() method + if (is_object($propertyValue) && method_exists($propertyValue, 'toArray')) { + $array[$propertyName] = $propertyValue->toArray(); + // Check if it's type datetime + } elseif ($propertyValue instanceof \DateTime) { + $array[$propertyName] = $propertyValue->format(DATE_ATOM); + // If it's an array type we should check whether it contains objects and if so call toArray method + } elseif (is_array($propertyValue)) { + $array[$propertyName] = array_map(function ($item) { + return $item instanceof ModelInterface ? $item->toArray() : $item; + }, $propertyValue); + } else { + // Otherwise, directly assign the property value to the array + $array[$propertyName] = $propertyValue; + } + } + } + return $array; + } + /** * Gets the string presentation of the object * diff --git a/src/Adyen/Model/Checkout/PaymentMethodIssuer.php b/src/Adyen/Model/Checkout/PaymentMethodIssuer.php index 3936fbaac..82e63a005 100644 --- a/src/Adyen/Model/Checkout/PaymentMethodIssuer.php +++ b/src/Adyen/Model/Checkout/PaymentMethodIssuer.php @@ -5,7 +5,7 @@ * * The version of the OpenAPI document: 71 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 6.0.1 + * OpenAPI Generator version: 6.4.0 * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -443,6 +443,32 @@ public function jsonSerialize() return ObjectSerializer::sanitizeForSerialization($this); } + public function toArray(): array + { + $array = []; + foreach (self::$openAPITypes as $propertyName => $propertyType) { + $propertyValue = $this[$propertyName]; + if ($propertyValue !== null) { + // Check if the property value is an object and has a toArray() method + if (is_object($propertyValue) && method_exists($propertyValue, 'toArray')) { + $array[$propertyName] = $propertyValue->toArray(); + // Check if it's type datetime + } elseif ($propertyValue instanceof \DateTime) { + $array[$propertyName] = $propertyValue->format(DATE_ATOM); + // If it's an array type we should check whether it contains objects and if so call toArray method + } elseif (is_array($propertyValue)) { + $array[$propertyName] = array_map(function ($item) { + return $item instanceof ModelInterface ? $item->toArray() : $item; + }, $propertyValue); + } else { + // Otherwise, directly assign the property value to the array + $array[$propertyName] = $propertyValue; + } + } + } + return $array; + } + /** * Gets the string presentation of the object * diff --git a/src/Adyen/Model/Checkout/PaymentMethodsRequest.php b/src/Adyen/Model/Checkout/PaymentMethodsRequest.php index 6d4afc577..f2d1e4386 100644 --- a/src/Adyen/Model/Checkout/PaymentMethodsRequest.php +++ b/src/Adyen/Model/Checkout/PaymentMethodsRequest.php @@ -5,7 +5,7 @@ * * The version of the OpenAPI document: 71 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 6.0.1 + * OpenAPI Generator version: 6.4.0 * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -701,7 +701,7 @@ public function getStore() /** * Sets store * - * @param string|null $store Required for Adyen for Platforms integrations if you have a platform setup. This is your [reference](https://docs.adyen.com/api-explorer/Management/3/post/merchants/(merchantId)/stores#request-reference) (on [balance platform](https://docs.adyen.com/marketplaces-and-platforms/classic/platforms-for-partners#route-payments)) or the [storeReference](https://docs.adyen.com/api-explorer/Account/latest/post/updateAccountHolder#request-accountHolderDetails-storeDetails-storeReference) (in the [classic integration](https://docs.adyen.com/marketplaces-and-platforms/processing-payments/route-payment-to-store/#route-a-payment-to-a-store)) for the ecommerce or point-of-sale store that is processing the payment. + * @param string|null $store The ecommerce or point-of-sale store that is processing the payment. Used in: * [Partner platform integrations](https://docs.adyen.com/marketplaces-and-platforms/classic/platforms-for-partners#route-payments) for the [Classic Platforms integration](https://docs.adyen.com/marketplaces-and-platforms/classic). * [Platform setup integrations](https://docs.adyen.com/marketplaces-and-platforms/additional-for-platform-setup/route-payment-to-store) for the [Balance Platform](https://docs.adyen.com/marketplaces-and-platforms). * * @return self */ @@ -781,6 +781,32 @@ public function jsonSerialize() return ObjectSerializer::sanitizeForSerialization($this); } + public function toArray(): array + { + $array = []; + foreach (self::$openAPITypes as $propertyName => $propertyType) { + $propertyValue = $this[$propertyName]; + if ($propertyValue !== null) { + // Check if the property value is an object and has a toArray() method + if (is_object($propertyValue) && method_exists($propertyValue, 'toArray')) { + $array[$propertyName] = $propertyValue->toArray(); + // Check if it's type datetime + } elseif ($propertyValue instanceof \DateTime) { + $array[$propertyName] = $propertyValue->format(DATE_ATOM); + // If it's an array type we should check whether it contains objects and if so call toArray method + } elseif (is_array($propertyValue)) { + $array[$propertyName] = array_map(function ($item) { + return $item instanceof ModelInterface ? $item->toArray() : $item; + }, $propertyValue); + } else { + // Otherwise, directly assign the property value to the array + $array[$propertyName] = $propertyValue; + } + } + } + return $array; + } + /** * Gets the string presentation of the object * diff --git a/src/Adyen/Model/Checkout/PaymentMethodsResponse.php b/src/Adyen/Model/Checkout/PaymentMethodsResponse.php index d730b69b2..0f1fbe07d 100644 --- a/src/Adyen/Model/Checkout/PaymentMethodsResponse.php +++ b/src/Adyen/Model/Checkout/PaymentMethodsResponse.php @@ -5,7 +5,7 @@ * * The version of the OpenAPI document: 71 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 6.0.1 + * OpenAPI Generator version: 6.4.0 * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -403,6 +403,32 @@ public function jsonSerialize() return ObjectSerializer::sanitizeForSerialization($this); } + public function toArray(): array + { + $array = []; + foreach (self::$openAPITypes as $propertyName => $propertyType) { + $propertyValue = $this[$propertyName]; + if ($propertyValue !== null) { + // Check if the property value is an object and has a toArray() method + if (is_object($propertyValue) && method_exists($propertyValue, 'toArray')) { + $array[$propertyName] = $propertyValue->toArray(); + // Check if it's type datetime + } elseif ($propertyValue instanceof \DateTime) { + $array[$propertyName] = $propertyValue->format(DATE_ATOM); + // If it's an array type we should check whether it contains objects and if so call toArray method + } elseif (is_array($propertyValue)) { + $array[$propertyName] = array_map(function ($item) { + return $item instanceof ModelInterface ? $item->toArray() : $item; + }, $propertyValue); + } else { + // Otherwise, directly assign the property value to the array + $array[$propertyName] = $propertyValue; + } + } + } + return $array; + } + /** * Gets the string presentation of the object * diff --git a/src/Adyen/Model/Checkout/PaymentRefundRequest.php b/src/Adyen/Model/Checkout/PaymentRefundRequest.php index ca30a1797..47fc9a76f 100644 --- a/src/Adyen/Model/Checkout/PaymentRefundRequest.php +++ b/src/Adyen/Model/Checkout/PaymentRefundRequest.php @@ -5,7 +5,7 @@ * * The version of the OpenAPI document: 71 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 6.0.1 + * OpenAPI Generator version: 6.4.0 * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -50,8 +50,7 @@ class PaymentRefundRequest implements ModelInterface, ArrayAccess, \JsonSerializ 'merchantAccount' => 'string', 'merchantRefundReason' => 'string', 'reference' => 'string', - 'splits' => '\Adyen\Model\Checkout\Split[]', - 'store' => 'string' + 'splits' => '\Adyen\Model\Checkout\Split[]' ]; /** @@ -68,8 +67,7 @@ class PaymentRefundRequest implements ModelInterface, ArrayAccess, \JsonSerializ 'merchantAccount' => null, 'merchantRefundReason' => null, 'reference' => null, - 'splits' => null, - 'store' => null + 'splits' => null ]; /** @@ -84,8 +82,7 @@ class PaymentRefundRequest implements ModelInterface, ArrayAccess, \JsonSerializ 'merchantAccount' => false, 'merchantRefundReason' => false, 'reference' => false, - 'splits' => false, - 'store' => false + 'splits' => false ]; /** @@ -180,8 +177,7 @@ public function isNullableSetToNull(string $property): bool 'merchantAccount' => 'merchantAccount', 'merchantRefundReason' => 'merchantRefundReason', 'reference' => 'reference', - 'splits' => 'splits', - 'store' => 'store' + 'splits' => 'splits' ]; /** @@ -196,8 +192,7 @@ public function isNullableSetToNull(string $property): bool 'merchantAccount' => 'setMerchantAccount', 'merchantRefundReason' => 'setMerchantRefundReason', 'reference' => 'setReference', - 'splits' => 'setSplits', - 'store' => 'setStore' + 'splits' => 'setSplits' ]; /** @@ -212,8 +207,7 @@ public function isNullableSetToNull(string $property): bool 'merchantAccount' => 'getMerchantAccount', 'merchantRefundReason' => 'getMerchantRefundReason', 'reference' => 'getReference', - 'splits' => 'getSplits', - 'store' => 'getStore' + 'splits' => 'getSplits' ]; /** @@ -300,7 +294,6 @@ public function __construct(array $data = null) $this->setIfExists('merchantRefundReason', $data ?? [], null); $this->setIfExists('reference', $data ?? [], null); $this->setIfExists('splits', $data ?? [], null); - $this->setIfExists('store', $data ?? [], null); } /** @@ -558,33 +551,6 @@ public function setSplits($splits) return $this; } - - /** - * Gets store - * - * @return string|null - */ - public function getStore() - { - return $this->container['store']; - } - - /** - * Sets store - * - * @param string|null $store The online store or [physical store](https://docs.adyen.com/point-of-sale/design-your-integration/determine-account-structure/#create-stores) that is processing the refund. This must be the same as the store name configured in your Customer Area. Otherwise, you get an error and the refund fails. - * - * @return self - */ - public function setStore($store) - { - if (is_null($store)) { - throw new \InvalidArgumentException('non-nullable store cannot be null'); - } - $this->container['store'] = $store; - - return $this; - } /** * Returns true if offset exists. False otherwise. * @@ -652,6 +618,32 @@ public function jsonSerialize() return ObjectSerializer::sanitizeForSerialization($this); } + public function toArray(): array + { + $array = []; + foreach (self::$openAPITypes as $propertyName => $propertyType) { + $propertyValue = $this[$propertyName]; + if ($propertyValue !== null) { + // Check if the property value is an object and has a toArray() method + if (is_object($propertyValue) && method_exists($propertyValue, 'toArray')) { + $array[$propertyName] = $propertyValue->toArray(); + // Check if it's type datetime + } elseif ($propertyValue instanceof \DateTime) { + $array[$propertyName] = $propertyValue->format(DATE_ATOM); + // If it's an array type we should check whether it contains objects and if so call toArray method + } elseif (is_array($propertyValue)) { + $array[$propertyName] = array_map(function ($item) { + return $item instanceof ModelInterface ? $item->toArray() : $item; + }, $propertyValue); + } else { + // Otherwise, directly assign the property value to the array + $array[$propertyName] = $propertyValue; + } + } + } + return $array; + } + /** * Gets the string presentation of the object * diff --git a/src/Adyen/Model/Checkout/PaymentRefundResponse.php b/src/Adyen/Model/Checkout/PaymentRefundResponse.php index 8ee8287c7..061a857bd 100644 --- a/src/Adyen/Model/Checkout/PaymentRefundResponse.php +++ b/src/Adyen/Model/Checkout/PaymentRefundResponse.php @@ -5,7 +5,7 @@ * * The version of the OpenAPI document: 71 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 6.0.1 + * OpenAPI Generator version: 6.4.0 * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -52,8 +52,7 @@ class PaymentRefundResponse implements ModelInterface, ArrayAccess, \JsonSeriali 'pspReference' => 'string', 'reference' => 'string', 'splits' => '\Adyen\Model\Checkout\Split[]', - 'status' => 'string', - 'store' => 'string' + 'status' => 'string' ]; /** @@ -72,8 +71,7 @@ class PaymentRefundResponse implements ModelInterface, ArrayAccess, \JsonSeriali 'pspReference' => null, 'reference' => null, 'splits' => null, - 'status' => null, - 'store' => null + 'status' => null ]; /** @@ -90,8 +88,7 @@ class PaymentRefundResponse implements ModelInterface, ArrayAccess, \JsonSeriali 'pspReference' => false, 'reference' => false, 'splits' => false, - 'status' => false, - 'store' => false + 'status' => false ]; /** @@ -188,8 +185,7 @@ public function isNullableSetToNull(string $property): bool 'pspReference' => 'pspReference', 'reference' => 'reference', 'splits' => 'splits', - 'status' => 'status', - 'store' => 'store' + 'status' => 'status' ]; /** @@ -206,8 +202,7 @@ public function isNullableSetToNull(string $property): bool 'pspReference' => 'setPspReference', 'reference' => 'setReference', 'splits' => 'setSplits', - 'status' => 'setStatus', - 'store' => 'setStore' + 'status' => 'setStatus' ]; /** @@ -224,8 +219,7 @@ public function isNullableSetToNull(string $property): bool 'pspReference' => 'getPspReference', 'reference' => 'getReference', 'splits' => 'getSplits', - 'status' => 'getStatus', - 'store' => 'getStore' + 'status' => 'getStatus' ]; /** @@ -326,7 +320,6 @@ public function __construct(array $data = null) $this->setIfExists('reference', $data ?? [], null); $this->setIfExists('splits', $data ?? [], null); $this->setIfExists('status', $data ?? [], null); - $this->setIfExists('store', $data ?? [], null); } /** @@ -666,33 +659,6 @@ public function setStatus($status) return $this; } - - /** - * Gets store - * - * @return string|null - */ - public function getStore() - { - return $this->container['store']; - } - - /** - * Sets store - * - * @param string|null $store The online store or [physical store](https://docs.adyen.com/point-of-sale/design-your-integration/determine-account-structure/#create-stores) that is processing the refund. This must be the same as the store name configured in your Customer Area. Otherwise, you get an error and the refund fails. - * - * @return self - */ - public function setStore($store) - { - if (is_null($store)) { - throw new \InvalidArgumentException('non-nullable store cannot be null'); - } - $this->container['store'] = $store; - - return $this; - } /** * Returns true if offset exists. False otherwise. * @@ -760,6 +726,32 @@ public function jsonSerialize() return ObjectSerializer::sanitizeForSerialization($this); } + public function toArray(): array + { + $array = []; + foreach (self::$openAPITypes as $propertyName => $propertyType) { + $propertyValue = $this[$propertyName]; + if ($propertyValue !== null) { + // Check if the property value is an object and has a toArray() method + if (is_object($propertyValue) && method_exists($propertyValue, 'toArray')) { + $array[$propertyName] = $propertyValue->toArray(); + // Check if it's type datetime + } elseif ($propertyValue instanceof \DateTime) { + $array[$propertyName] = $propertyValue->format(DATE_ATOM); + // If it's an array type we should check whether it contains objects and if so call toArray method + } elseif (is_array($propertyValue)) { + $array[$propertyName] = array_map(function ($item) { + return $item instanceof ModelInterface ? $item->toArray() : $item; + }, $propertyValue); + } else { + // Otherwise, directly assign the property value to the array + $array[$propertyName] = $propertyValue; + } + } + } + return $array; + } + /** * Gets the string presentation of the object * diff --git a/src/Adyen/Model/Checkout/PaymentRequest.php b/src/Adyen/Model/Checkout/PaymentRequest.php index 045b1f261..36baa7571 100644 --- a/src/Adyen/Model/Checkout/PaymentRequest.php +++ b/src/Adyen/Model/Checkout/PaymentRequest.php @@ -5,7 +5,7 @@ * * The version of the OpenAPI document: 71 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 6.0.1 + * OpenAPI Generator version: 6.4.0 * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -2588,7 +2588,7 @@ public function getStore() /** * Sets store * - * @param string|null $store Required for Adyen for Platforms integrations if you have a platform setup. This is your [reference](https://docs.adyen.com/api-explorer/Management/3/post/merchants/(merchantId)/stores#request-reference) (on [balance platform](https://docs.adyen.com/marketplaces-and-platforms/classic/platforms-for-partners#route-payments)) or the [storeReference](https://docs.adyen.com/api-explorer/Account/latest/post/updateAccountHolder#request-accountHolderDetails-storeDetails-storeReference) (in the [classic integration](https://docs.adyen.com/marketplaces-and-platforms/processing-payments/route-payment-to-store/#route-a-payment-to-a-store)) for the ecommerce or point-of-sale store that is processing the payment. + * @param string|null $store The ecommerce or point-of-sale store that is processing the payment. Used in: * [Partner platform integrations](https://docs.adyen.com/marketplaces-and-platforms/classic/platforms-for-partners#route-payments) for the [Classic Platforms integration](https://docs.adyen.com/marketplaces-and-platforms/classic). * [Platform setup integrations](https://docs.adyen.com/marketplaces-and-platforms/additional-for-platform-setup/route-payment-to-store) for the [Balance Platform](https://docs.adyen.com/marketplaces-and-platforms). * * @return self */ @@ -2805,6 +2805,32 @@ public function jsonSerialize() return ObjectSerializer::sanitizeForSerialization($this); } + public function toArray(): array + { + $array = []; + foreach (self::$openAPITypes as $propertyName => $propertyType) { + $propertyValue = $this[$propertyName]; + if ($propertyValue !== null) { + // Check if the property value is an object and has a toArray() method + if (is_object($propertyValue) && method_exists($propertyValue, 'toArray')) { + $array[$propertyName] = $propertyValue->toArray(); + // Check if it's type datetime + } elseif ($propertyValue instanceof \DateTime) { + $array[$propertyName] = $propertyValue->format(DATE_ATOM); + // If it's an array type we should check whether it contains objects and if so call toArray method + } elseif (is_array($propertyValue)) { + $array[$propertyName] = array_map(function ($item) { + return $item instanceof ModelInterface ? $item->toArray() : $item; + }, $propertyValue); + } else { + // Otherwise, directly assign the property value to the array + $array[$propertyName] = $propertyValue; + } + } + } + return $array; + } + /** * Gets the string presentation of the object * diff --git a/src/Adyen/Model/Checkout/PaymentResponse.php b/src/Adyen/Model/Checkout/PaymentResponse.php index f9d609857..48ba79562 100644 --- a/src/Adyen/Model/Checkout/PaymentResponse.php +++ b/src/Adyen/Model/Checkout/PaymentResponse.php @@ -5,7 +5,7 @@ * * The version of the OpenAPI document: 71 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 6.0.1 + * OpenAPI Generator version: 6.4.0 * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -902,6 +902,32 @@ public function jsonSerialize() return ObjectSerializer::sanitizeForSerialization($this); } + public function toArray(): array + { + $array = []; + foreach (self::$openAPITypes as $propertyName => $propertyType) { + $propertyValue = $this[$propertyName]; + if ($propertyValue !== null) { + // Check if the property value is an object and has a toArray() method + if (is_object($propertyValue) && method_exists($propertyValue, 'toArray')) { + $array[$propertyName] = $propertyValue->toArray(); + // Check if it's type datetime + } elseif ($propertyValue instanceof \DateTime) { + $array[$propertyName] = $propertyValue->format(DATE_ATOM); + // If it's an array type we should check whether it contains objects and if so call toArray method + } elseif (is_array($propertyValue)) { + $array[$propertyName] = array_map(function ($item) { + return $item instanceof ModelInterface ? $item->toArray() : $item; + }, $propertyValue); + } else { + // Otherwise, directly assign the property value to the array + $array[$propertyName] = $propertyValue; + } + } + } + return $array; + } + /** * Gets the string presentation of the object * diff --git a/src/Adyen/Model/Checkout/PaymentResponseAction.php b/src/Adyen/Model/Checkout/PaymentResponseAction.php index 4144d958f..fc604a4c6 100644 --- a/src/Adyen/Model/Checkout/PaymentResponseAction.php +++ b/src/Adyen/Model/Checkout/PaymentResponseAction.php @@ -5,7 +5,7 @@ * * The version of the OpenAPI document: 71 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 6.0.1 + * OpenAPI Generator version: 6.4.0 * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -489,7 +489,7 @@ public function getPaymentData() /** * Sets paymentData * - * @param string|null $paymentData Encoded payment data. + * @param string|null $paymentData A value that must be submitted to the `/payments/details` endpoint to verify this payment. * * @return self */ @@ -1325,6 +1325,32 @@ public function jsonSerialize() return ObjectSerializer::sanitizeForSerialization($this); } + public function toArray(): array + { + $array = []; + foreach (self::$openAPITypes as $propertyName => $propertyType) { + $propertyValue = $this[$propertyName]; + if ($propertyValue !== null) { + // Check if the property value is an object and has a toArray() method + if (is_object($propertyValue) && method_exists($propertyValue, 'toArray')) { + $array[$propertyName] = $propertyValue->toArray(); + // Check if it's type datetime + } elseif ($propertyValue instanceof \DateTime) { + $array[$propertyName] = $propertyValue->format(DATE_ATOM); + // If it's an array type we should check whether it contains objects and if so call toArray method + } elseif (is_array($propertyValue)) { + $array[$propertyName] = array_map(function ($item) { + return $item instanceof ModelInterface ? $item->toArray() : $item; + }, $propertyValue); + } else { + // Otherwise, directly assign the property value to the array + $array[$propertyName] = $propertyValue; + } + } + } + return $array; + } + /** * Gets the string presentation of the object * diff --git a/src/Adyen/Model/Checkout/PaymentReversalRequest.php b/src/Adyen/Model/Checkout/PaymentReversalRequest.php index 10e3784f7..d4be8565d 100644 --- a/src/Adyen/Model/Checkout/PaymentReversalRequest.php +++ b/src/Adyen/Model/Checkout/PaymentReversalRequest.php @@ -5,7 +5,7 @@ * * The version of the OpenAPI document: 71 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 6.0.1 + * OpenAPI Generator version: 6.4.0 * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -440,6 +440,32 @@ public function jsonSerialize() return ObjectSerializer::sanitizeForSerialization($this); } + public function toArray(): array + { + $array = []; + foreach (self::$openAPITypes as $propertyName => $propertyType) { + $propertyValue = $this[$propertyName]; + if ($propertyValue !== null) { + // Check if the property value is an object and has a toArray() method + if (is_object($propertyValue) && method_exists($propertyValue, 'toArray')) { + $array[$propertyName] = $propertyValue->toArray(); + // Check if it's type datetime + } elseif ($propertyValue instanceof \DateTime) { + $array[$propertyName] = $propertyValue->format(DATE_ATOM); + // If it's an array type we should check whether it contains objects and if so call toArray method + } elseif (is_array($propertyValue)) { + $array[$propertyName] = array_map(function ($item) { + return $item instanceof ModelInterface ? $item->toArray() : $item; + }, $propertyValue); + } else { + // Otherwise, directly assign the property value to the array + $array[$propertyName] = $propertyValue; + } + } + } + return $array; + } + /** * Gets the string presentation of the object * diff --git a/src/Adyen/Model/Checkout/PaymentReversalResponse.php b/src/Adyen/Model/Checkout/PaymentReversalResponse.php index 739c95bb1..63fb75b1f 100644 --- a/src/Adyen/Model/Checkout/PaymentReversalResponse.php +++ b/src/Adyen/Model/Checkout/PaymentReversalResponse.php @@ -5,7 +5,7 @@ * * The version of the OpenAPI document: 71 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 6.0.1 + * OpenAPI Generator version: 6.4.0 * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -548,6 +548,32 @@ public function jsonSerialize() return ObjectSerializer::sanitizeForSerialization($this); } + public function toArray(): array + { + $array = []; + foreach (self::$openAPITypes as $propertyName => $propertyType) { + $propertyValue = $this[$propertyName]; + if ($propertyValue !== null) { + // Check if the property value is an object and has a toArray() method + if (is_object($propertyValue) && method_exists($propertyValue, 'toArray')) { + $array[$propertyName] = $propertyValue->toArray(); + // Check if it's type datetime + } elseif ($propertyValue instanceof \DateTime) { + $array[$propertyName] = $propertyValue->format(DATE_ATOM); + // If it's an array type we should check whether it contains objects and if so call toArray method + } elseif (is_array($propertyValue)) { + $array[$propertyName] = array_map(function ($item) { + return $item instanceof ModelInterface ? $item->toArray() : $item; + }, $propertyValue); + } else { + // Otherwise, directly assign the property value to the array + $array[$propertyName] = $propertyValue; + } + } + } + return $array; + } + /** * Gets the string presentation of the object * diff --git a/src/Adyen/Model/Checkout/PaymentSetupRequest.php b/src/Adyen/Model/Checkout/PaymentSetupRequest.php index 420fc0d39..ec6330fea 100644 --- a/src/Adyen/Model/Checkout/PaymentSetupRequest.php +++ b/src/Adyen/Model/Checkout/PaymentSetupRequest.php @@ -5,7 +5,7 @@ * * The version of the OpenAPI document: 71 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 6.0.1 + * OpenAPI Generator version: 6.4.0 * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -2142,7 +2142,7 @@ public function getStore() /** * Sets store * - * @param string|null $store Required for Adyen for Platforms integrations if you have a platform setup. This is your [reference](https://docs.adyen.com/api-explorer/Management/3/post/merchants/(merchantId)/stores#request-reference) (on [balance platform](https://docs.adyen.com/marketplaces-and-platforms/classic/platforms-for-partners#route-payments)) or the [storeReference](https://docs.adyen.com/api-explorer/Account/latest/post/updateAccountHolder#request-accountHolderDetails-storeDetails-storeReference) (in the [classic integration](https://docs.adyen.com/marketplaces-and-platforms/processing-payments/route-payment-to-store/#route-a-payment-to-a-store)) for the ecommerce or point-of-sale store that is processing the payment. + * @param string|null $store The ecommerce or point-of-sale store that is processing the payment. Used in: * [Partner platform integrations](https://docs.adyen.com/marketplaces-and-platforms/classic/platforms-for-partners#route-payments) for the [Classic Platforms integration](https://docs.adyen.com/marketplaces-and-platforms/classic). * [Platform setup integrations](https://docs.adyen.com/marketplaces-and-platforms/additional-for-platform-setup/route-payment-to-store) for the [Balance Platform](https://docs.adyen.com/marketplaces-and-platforms). * * @return self */ @@ -2359,6 +2359,32 @@ public function jsonSerialize() return ObjectSerializer::sanitizeForSerialization($this); } + public function toArray(): array + { + $array = []; + foreach (self::$openAPITypes as $propertyName => $propertyType) { + $propertyValue = $this[$propertyName]; + if ($propertyValue !== null) { + // Check if the property value is an object and has a toArray() method + if (is_object($propertyValue) && method_exists($propertyValue, 'toArray')) { + $array[$propertyName] = $propertyValue->toArray(); + // Check if it's type datetime + } elseif ($propertyValue instanceof \DateTime) { + $array[$propertyName] = $propertyValue->format(DATE_ATOM); + // If it's an array type we should check whether it contains objects and if so call toArray method + } elseif (is_array($propertyValue)) { + $array[$propertyName] = array_map(function ($item) { + return $item instanceof ModelInterface ? $item->toArray() : $item; + }, $propertyValue); + } else { + // Otherwise, directly assign the property value to the array + $array[$propertyName] = $propertyValue; + } + } + } + return $array; + } + /** * Gets the string presentation of the object * diff --git a/src/Adyen/Model/Checkout/PaymentSetupResponse.php b/src/Adyen/Model/Checkout/PaymentSetupResponse.php index 08c7a7f98..c7d02291d 100644 --- a/src/Adyen/Model/Checkout/PaymentSetupResponse.php +++ b/src/Adyen/Model/Checkout/PaymentSetupResponse.php @@ -5,7 +5,7 @@ * * The version of the OpenAPI document: 71 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 6.0.1 + * OpenAPI Generator version: 6.4.0 * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -405,6 +405,32 @@ public function jsonSerialize() return ObjectSerializer::sanitizeForSerialization($this); } + public function toArray(): array + { + $array = []; + foreach (self::$openAPITypes as $propertyName => $propertyType) { + $propertyValue = $this[$propertyName]; + if ($propertyValue !== null) { + // Check if the property value is an object and has a toArray() method + if (is_object($propertyValue) && method_exists($propertyValue, 'toArray')) { + $array[$propertyName] = $propertyValue->toArray(); + // Check if it's type datetime + } elseif ($propertyValue instanceof \DateTime) { + $array[$propertyName] = $propertyValue->format(DATE_ATOM); + // If it's an array type we should check whether it contains objects and if so call toArray method + } elseif (is_array($propertyValue)) { + $array[$propertyName] = array_map(function ($item) { + return $item instanceof ModelInterface ? $item->toArray() : $item; + }, $propertyValue); + } else { + // Otherwise, directly assign the property value to the array + $array[$propertyName] = $propertyValue; + } + } + } + return $array; + } + /** * Gets the string presentation of the object * diff --git a/src/Adyen/Model/Checkout/PaymentVerificationRequest.php b/src/Adyen/Model/Checkout/PaymentVerificationRequest.php index cbe96d346..443f7f864 100644 --- a/src/Adyen/Model/Checkout/PaymentVerificationRequest.php +++ b/src/Adyen/Model/Checkout/PaymentVerificationRequest.php @@ -5,7 +5,7 @@ * * The version of the OpenAPI document: 71 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 6.0.1 + * OpenAPI Generator version: 6.4.0 * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -372,6 +372,32 @@ public function jsonSerialize() return ObjectSerializer::sanitizeForSerialization($this); } + public function toArray(): array + { + $array = []; + foreach (self::$openAPITypes as $propertyName => $propertyType) { + $propertyValue = $this[$propertyName]; + if ($propertyValue !== null) { + // Check if the property value is an object and has a toArray() method + if (is_object($propertyValue) && method_exists($propertyValue, 'toArray')) { + $array[$propertyName] = $propertyValue->toArray(); + // Check if it's type datetime + } elseif ($propertyValue instanceof \DateTime) { + $array[$propertyName] = $propertyValue->format(DATE_ATOM); + // If it's an array type we should check whether it contains objects and if so call toArray method + } elseif (is_array($propertyValue)) { + $array[$propertyName] = array_map(function ($item) { + return $item instanceof ModelInterface ? $item->toArray() : $item; + }, $propertyValue); + } else { + // Otherwise, directly assign the property value to the array + $array[$propertyName] = $propertyValue; + } + } + } + return $array; + } + /** * Gets the string presentation of the object * diff --git a/src/Adyen/Model/Checkout/PaymentVerificationResponse.php b/src/Adyen/Model/Checkout/PaymentVerificationResponse.php index a994362ab..c9b977d2a 100644 --- a/src/Adyen/Model/Checkout/PaymentVerificationResponse.php +++ b/src/Adyen/Model/Checkout/PaymentVerificationResponse.php @@ -5,7 +5,7 @@ * * The version of the OpenAPI document: 71 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 6.0.1 + * OpenAPI Generator version: 6.4.0 * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -738,6 +738,32 @@ public function jsonSerialize() return ObjectSerializer::sanitizeForSerialization($this); } + public function toArray(): array + { + $array = []; + foreach (self::$openAPITypes as $propertyName => $propertyType) { + $propertyValue = $this[$propertyName]; + if ($propertyValue !== null) { + // Check if the property value is an object and has a toArray() method + if (is_object($propertyValue) && method_exists($propertyValue, 'toArray')) { + $array[$propertyName] = $propertyValue->toArray(); + // Check if it's type datetime + } elseif ($propertyValue instanceof \DateTime) { + $array[$propertyName] = $propertyValue->format(DATE_ATOM); + // If it's an array type we should check whether it contains objects and if so call toArray method + } elseif (is_array($propertyValue)) { + $array[$propertyName] = array_map(function ($item) { + return $item instanceof ModelInterface ? $item->toArray() : $item; + }, $propertyValue); + } else { + // Otherwise, directly assign the property value to the array + $array[$propertyName] = $propertyValue; + } + } + } + return $array; + } + /** * Gets the string presentation of the object * diff --git a/src/Adyen/Model/Checkout/Phone.php b/src/Adyen/Model/Checkout/Phone.php index eeb8d2285..4aa0a5146 100644 --- a/src/Adyen/Model/Checkout/Phone.php +++ b/src/Adyen/Model/Checkout/Phone.php @@ -5,7 +5,7 @@ * * The version of the OpenAPI document: 71 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 6.0.1 + * OpenAPI Generator version: 6.4.0 * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -403,6 +403,32 @@ public function jsonSerialize() return ObjectSerializer::sanitizeForSerialization($this); } + public function toArray(): array + { + $array = []; + foreach (self::$openAPITypes as $propertyName => $propertyType) { + $propertyValue = $this[$propertyName]; + if ($propertyValue !== null) { + // Check if the property value is an object and has a toArray() method + if (is_object($propertyValue) && method_exists($propertyValue, 'toArray')) { + $array[$propertyName] = $propertyValue->toArray(); + // Check if it's type datetime + } elseif ($propertyValue instanceof \DateTime) { + $array[$propertyName] = $propertyValue->format(DATE_ATOM); + // If it's an array type we should check whether it contains objects and if so call toArray method + } elseif (is_array($propertyValue)) { + $array[$propertyName] = array_map(function ($item) { + return $item instanceof ModelInterface ? $item->toArray() : $item; + }, $propertyValue); + } else { + // Otherwise, directly assign the property value to the array + $array[$propertyName] = $propertyValue; + } + } + } + return $array; + } + /** * Gets the string presentation of the object * diff --git a/src/Adyen/Model/Checkout/PlatformChargebackLogic.php b/src/Adyen/Model/Checkout/PlatformChargebackLogic.php index dacd4a0dc..644e700d3 100644 --- a/src/Adyen/Model/Checkout/PlatformChargebackLogic.php +++ b/src/Adyen/Model/Checkout/PlatformChargebackLogic.php @@ -5,7 +5,7 @@ * * The version of the OpenAPI document: 71 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 6.0.1 + * OpenAPI Generator version: 6.4.0 * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -472,6 +472,32 @@ public function jsonSerialize() return ObjectSerializer::sanitizeForSerialization($this); } + public function toArray(): array + { + $array = []; + foreach (self::$openAPITypes as $propertyName => $propertyType) { + $propertyValue = $this[$propertyName]; + if ($propertyValue !== null) { + // Check if the property value is an object and has a toArray() method + if (is_object($propertyValue) && method_exists($propertyValue, 'toArray')) { + $array[$propertyName] = $propertyValue->toArray(); + // Check if it's type datetime + } elseif ($propertyValue instanceof \DateTime) { + $array[$propertyName] = $propertyValue->format(DATE_ATOM); + // If it's an array type we should check whether it contains objects and if so call toArray method + } elseif (is_array($propertyValue)) { + $array[$propertyName] = array_map(function ($item) { + return $item instanceof ModelInterface ? $item->toArray() : $item; + }, $propertyValue); + } else { + // Otherwise, directly assign the property value to the array + $array[$propertyName] = $propertyValue; + } + } + } + return $array; + } + /** * Gets the string presentation of the object * diff --git a/src/Adyen/Model/Checkout/RatepayDetails.php b/src/Adyen/Model/Checkout/RatepayDetails.php index 1386846df..dbebc29e2 100644 --- a/src/Adyen/Model/Checkout/RatepayDetails.php +++ b/src/Adyen/Model/Checkout/RatepayDetails.php @@ -5,7 +5,7 @@ * * The version of the OpenAPI document: 71 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 6.0.1 + * OpenAPI Generator version: 6.4.0 * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -611,6 +611,32 @@ public function jsonSerialize() return ObjectSerializer::sanitizeForSerialization($this); } + public function toArray(): array + { + $array = []; + foreach (self::$openAPITypes as $propertyName => $propertyType) { + $propertyValue = $this[$propertyName]; + if ($propertyValue !== null) { + // Check if the property value is an object and has a toArray() method + if (is_object($propertyValue) && method_exists($propertyValue, 'toArray')) { + $array[$propertyName] = $propertyValue->toArray(); + // Check if it's type datetime + } elseif ($propertyValue instanceof \DateTime) { + $array[$propertyName] = $propertyValue->format(DATE_ATOM); + // If it's an array type we should check whether it contains objects and if so call toArray method + } elseif (is_array($propertyValue)) { + $array[$propertyName] = array_map(function ($item) { + return $item instanceof ModelInterface ? $item->toArray() : $item; + }, $propertyValue); + } else { + // Otherwise, directly assign the property value to the array + $array[$propertyName] = $propertyValue; + } + } + } + return $array; + } + /** * Gets the string presentation of the object * diff --git a/src/Adyen/Model/Checkout/Recurring.php b/src/Adyen/Model/Checkout/Recurring.php index 328a7a9ab..cf97d5983 100644 --- a/src/Adyen/Model/Checkout/Recurring.php +++ b/src/Adyen/Model/Checkout/Recurring.php @@ -5,7 +5,7 @@ * * The version of the OpenAPI document: 71 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 6.0.1 + * OpenAPI Generator version: 6.4.0 * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -577,6 +577,32 @@ public function jsonSerialize() return ObjectSerializer::sanitizeForSerialization($this); } + public function toArray(): array + { + $array = []; + foreach (self::$openAPITypes as $propertyName => $propertyType) { + $propertyValue = $this[$propertyName]; + if ($propertyValue !== null) { + // Check if the property value is an object and has a toArray() method + if (is_object($propertyValue) && method_exists($propertyValue, 'toArray')) { + $array[$propertyName] = $propertyValue->toArray(); + // Check if it's type datetime + } elseif ($propertyValue instanceof \DateTime) { + $array[$propertyName] = $propertyValue->format(DATE_ATOM); + // If it's an array type we should check whether it contains objects and if so call toArray method + } elseif (is_array($propertyValue)) { + $array[$propertyName] = array_map(function ($item) { + return $item instanceof ModelInterface ? $item->toArray() : $item; + }, $propertyValue); + } else { + // Otherwise, directly assign the property value to the array + $array[$propertyName] = $propertyValue; + } + } + } + return $array; + } + /** * Gets the string presentation of the object * diff --git a/src/Adyen/Model/Checkout/RecurringDetail.php b/src/Adyen/Model/Checkout/RecurringDetail.php index c0ee39c27..73afd110a 100644 --- a/src/Adyen/Model/Checkout/RecurringDetail.php +++ b/src/Adyen/Model/Checkout/RecurringDetail.php @@ -5,7 +5,7 @@ * * The version of the OpenAPI document: 71 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 6.0.1 + * OpenAPI Generator version: 6.4.0 * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -275,7 +275,6 @@ public function getModelName() return self::$openAPIModelName; } - public const FUNDING_SOURCE_CREDIT = 'credit'; public const FUNDING_SOURCE_DEBIT = 'debit'; /** @@ -286,7 +285,6 @@ public function getModelName() public function getFundingSourceAllowableValues() { return [ - self::FUNDING_SOURCE_CREDIT, self::FUNDING_SOURCE_DEBIT, ]; } @@ -744,6 +742,32 @@ public function jsonSerialize() return ObjectSerializer::sanitizeForSerialization($this); } + public function toArray(): array + { + $array = []; + foreach (self::$openAPITypes as $propertyName => $propertyType) { + $propertyValue = $this[$propertyName]; + if ($propertyValue !== null) { + // Check if the property value is an object and has a toArray() method + if (is_object($propertyValue) && method_exists($propertyValue, 'toArray')) { + $array[$propertyName] = $propertyValue->toArray(); + // Check if it's type datetime + } elseif ($propertyValue instanceof \DateTime) { + $array[$propertyName] = $propertyValue->format(DATE_ATOM); + // If it's an array type we should check whether it contains objects and if so call toArray method + } elseif (is_array($propertyValue)) { + $array[$propertyName] = array_map(function ($item) { + return $item instanceof ModelInterface ? $item->toArray() : $item; + }, $propertyValue); + } else { + // Otherwise, directly assign the property value to the array + $array[$propertyName] = $propertyValue; + } + } + } + return $array; + } + /** * Gets the string presentation of the object * diff --git a/src/Adyen/Model/Checkout/ResponseAdditionalData3DSecure.php b/src/Adyen/Model/Checkout/ResponseAdditionalData3DSecure.php index de3819532..8de34deac 100644 --- a/src/Adyen/Model/Checkout/ResponseAdditionalData3DSecure.php +++ b/src/Adyen/Model/Checkout/ResponseAdditionalData3DSecure.php @@ -5,7 +5,7 @@ * * The version of the OpenAPI document: 71 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 6.0.1 + * OpenAPI Generator version: 6.4.0 * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -505,6 +505,32 @@ public function jsonSerialize() return ObjectSerializer::sanitizeForSerialization($this); } + public function toArray(): array + { + $array = []; + foreach (self::$openAPITypes as $propertyName => $propertyType) { + $propertyValue = $this[$propertyName]; + if ($propertyValue !== null) { + // Check if the property value is an object and has a toArray() method + if (is_object($propertyValue) && method_exists($propertyValue, 'toArray')) { + $array[$propertyName] = $propertyValue->toArray(); + // Check if it's type datetime + } elseif ($propertyValue instanceof \DateTime) { + $array[$propertyName] = $propertyValue->format(DATE_ATOM); + // If it's an array type we should check whether it contains objects and if so call toArray method + } elseif (is_array($propertyValue)) { + $array[$propertyName] = array_map(function ($item) { + return $item instanceof ModelInterface ? $item->toArray() : $item; + }, $propertyValue); + } else { + // Otherwise, directly assign the property value to the array + $array[$propertyName] = $propertyValue; + } + } + } + return $array; + } + /** * Gets the string presentation of the object * diff --git a/src/Adyen/Model/Checkout/ResponseAdditionalDataBillingAddress.php b/src/Adyen/Model/Checkout/ResponseAdditionalDataBillingAddress.php index c232d9429..0fddc94e8 100644 --- a/src/Adyen/Model/Checkout/ResponseAdditionalDataBillingAddress.php +++ b/src/Adyen/Model/Checkout/ResponseAdditionalDataBillingAddress.php @@ -5,7 +5,7 @@ * * The version of the OpenAPI document: 71 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 6.0.1 + * OpenAPI Generator version: 6.4.0 * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -539,6 +539,32 @@ public function jsonSerialize() return ObjectSerializer::sanitizeForSerialization($this); } + public function toArray(): array + { + $array = []; + foreach (self::$openAPITypes as $propertyName => $propertyType) { + $propertyValue = $this[$propertyName]; + if ($propertyValue !== null) { + // Check if the property value is an object and has a toArray() method + if (is_object($propertyValue) && method_exists($propertyValue, 'toArray')) { + $array[$propertyName] = $propertyValue->toArray(); + // Check if it's type datetime + } elseif ($propertyValue instanceof \DateTime) { + $array[$propertyName] = $propertyValue->format(DATE_ATOM); + // If it's an array type we should check whether it contains objects and if so call toArray method + } elseif (is_array($propertyValue)) { + $array[$propertyName] = array_map(function ($item) { + return $item instanceof ModelInterface ? $item->toArray() : $item; + }, $propertyValue); + } else { + // Otherwise, directly assign the property value to the array + $array[$propertyName] = $propertyValue; + } + } + } + return $array; + } + /** * Gets the string presentation of the object * diff --git a/src/Adyen/Model/Checkout/ResponseAdditionalDataCard.php b/src/Adyen/Model/Checkout/ResponseAdditionalDataCard.php index 3c48d808b..0a1bc3ed2 100644 --- a/src/Adyen/Model/Checkout/ResponseAdditionalDataCard.php +++ b/src/Adyen/Model/Checkout/ResponseAdditionalDataCard.php @@ -5,7 +5,7 @@ * * The version of the OpenAPI document: 71 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 6.0.1 + * OpenAPI Generator version: 6.4.0 * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -607,6 +607,32 @@ public function jsonSerialize() return ObjectSerializer::sanitizeForSerialization($this); } + public function toArray(): array + { + $array = []; + foreach (self::$openAPITypes as $propertyName => $propertyType) { + $propertyValue = $this[$propertyName]; + if ($propertyValue !== null) { + // Check if the property value is an object and has a toArray() method + if (is_object($propertyValue) && method_exists($propertyValue, 'toArray')) { + $array[$propertyName] = $propertyValue->toArray(); + // Check if it's type datetime + } elseif ($propertyValue instanceof \DateTime) { + $array[$propertyName] = $propertyValue->format(DATE_ATOM); + // If it's an array type we should check whether it contains objects and if so call toArray method + } elseif (is_array($propertyValue)) { + $array[$propertyName] = array_map(function ($item) { + return $item instanceof ModelInterface ? $item->toArray() : $item; + }, $propertyValue); + } else { + // Otherwise, directly assign the property value to the array + $array[$propertyName] = $propertyValue; + } + } + } + return $array; + } + /** * Gets the string presentation of the object * diff --git a/src/Adyen/Model/Checkout/ResponseAdditionalDataCommon.php b/src/Adyen/Model/Checkout/ResponseAdditionalDataCommon.php index 2886cd81e..029d37da3 100644 --- a/src/Adyen/Model/Checkout/ResponseAdditionalDataCommon.php +++ b/src/Adyen/Model/Checkout/ResponseAdditionalDataCommon.php @@ -5,7 +5,7 @@ * * The version of the OpenAPI document: 71 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 6.0.1 + * OpenAPI Generator version: 6.4.0 * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -2409,6 +2409,32 @@ public function jsonSerialize() return ObjectSerializer::sanitizeForSerialization($this); } + public function toArray(): array + { + $array = []; + foreach (self::$openAPITypes as $propertyName => $propertyType) { + $propertyValue = $this[$propertyName]; + if ($propertyValue !== null) { + // Check if the property value is an object and has a toArray() method + if (is_object($propertyValue) && method_exists($propertyValue, 'toArray')) { + $array[$propertyName] = $propertyValue->toArray(); + // Check if it's type datetime + } elseif ($propertyValue instanceof \DateTime) { + $array[$propertyName] = $propertyValue->format(DATE_ATOM); + // If it's an array type we should check whether it contains objects and if so call toArray method + } elseif (is_array($propertyValue)) { + $array[$propertyName] = array_map(function ($item) { + return $item instanceof ModelInterface ? $item->toArray() : $item; + }, $propertyValue); + } else { + // Otherwise, directly assign the property value to the array + $array[$propertyName] = $propertyValue; + } + } + } + return $array; + } + /** * Gets the string presentation of the object * diff --git a/src/Adyen/Model/Checkout/ResponseAdditionalDataDomesticError.php b/src/Adyen/Model/Checkout/ResponseAdditionalDataDomesticError.php deleted file mode 100644 index da93220ef..000000000 --- a/src/Adyen/Model/Checkout/ResponseAdditionalDataDomesticError.php +++ /dev/null @@ -1,418 +0,0 @@ - - */ -class ResponseAdditionalDataDomesticError implements ModelInterface, ArrayAccess, \JsonSerializable -{ - public const DISCRIMINATOR = null; - - /** - * The original name of the model. - * - * @var string - */ - protected static $openAPIModelName = 'ResponseAdditionalDataDomesticError'; - - /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ - protected static $openAPITypes = [ - 'domesticRefusalReasonRaw' => 'string', - 'domesticShopperAdvice' => 'string' - ]; - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ - protected static $openAPIFormats = [ - 'domesticRefusalReasonRaw' => null, - 'domesticShopperAdvice' => null - ]; - - /** - * Array of nullable properties. Used for (de)serialization - * - * @var boolean[] - */ - protected static $openAPINullables = [ - 'domesticRefusalReasonRaw' => false, - 'domesticShopperAdvice' => 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 = [ - 'domesticRefusalReasonRaw' => 'domesticRefusalReasonRaw', - 'domesticShopperAdvice' => 'domesticShopperAdvice' - ]; - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @var string[] - */ - protected static $setters = [ - 'domesticRefusalReasonRaw' => 'setDomesticRefusalReasonRaw', - 'domesticShopperAdvice' => 'setDomesticShopperAdvice' - ]; - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @var string[] - */ - protected static $getters = [ - 'domesticRefusalReasonRaw' => 'getDomesticRefusalReasonRaw', - 'domesticShopperAdvice' => 'getDomesticShopperAdvice' - ]; - - /** - * 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('domesticRefusalReasonRaw', $data ?? [], null); - $this->setIfExists('domesticShopperAdvice', $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 domesticRefusalReasonRaw - * - * @return string|null - */ - public function getDomesticRefusalReasonRaw() - { - return $this->container['domesticRefusalReasonRaw']; - } - - /** - * Sets domesticRefusalReasonRaw - * - * @param string|null $domesticRefusalReasonRaw The reason the transaction was declined, given by the local issuer. Currently available for merchants in Japan. - * - * @return self - */ - public function setDomesticRefusalReasonRaw($domesticRefusalReasonRaw) - { - if (is_null($domesticRefusalReasonRaw)) { - throw new \InvalidArgumentException('non-nullable domesticRefusalReasonRaw cannot be null'); - } - $this->container['domesticRefusalReasonRaw'] = $domesticRefusalReasonRaw; - - return $this; - } - - /** - * Gets domesticShopperAdvice - * - * @return string|null - */ - public function getDomesticShopperAdvice() - { - return $this->container['domesticShopperAdvice']; - } - - /** - * Sets domesticShopperAdvice - * - * @param string|null $domesticShopperAdvice The action the shopper should take, in a local language. Currently available in Japanese, for merchants in Japan. - * - * @return self - */ - public function setDomesticShopperAdvice($domesticShopperAdvice) - { - if (is_null($domesticShopperAdvice)) { - throw new \InvalidArgumentException('non-nullable domesticShopperAdvice cannot be null'); - } - $this->container['domesticShopperAdvice'] = $domesticShopperAdvice; - - 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 - ); - } -} diff --git a/src/Adyen/Model/Checkout/ResponseAdditionalDataInstallments.php b/src/Adyen/Model/Checkout/ResponseAdditionalDataInstallments.php index 06e41418e..4da777372 100644 --- a/src/Adyen/Model/Checkout/ResponseAdditionalDataInstallments.php +++ b/src/Adyen/Model/Checkout/ResponseAdditionalDataInstallments.php @@ -5,7 +5,7 @@ * * The version of the OpenAPI document: 71 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 6.0.1 + * OpenAPI Generator version: 6.4.0 * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -743,6 +743,32 @@ public function jsonSerialize() return ObjectSerializer::sanitizeForSerialization($this); } + public function toArray(): array + { + $array = []; + foreach (self::$openAPITypes as $propertyName => $propertyType) { + $propertyValue = $this[$propertyName]; + if ($propertyValue !== null) { + // Check if the property value is an object and has a toArray() method + if (is_object($propertyValue) && method_exists($propertyValue, 'toArray')) { + $array[$propertyName] = $propertyValue->toArray(); + // Check if it's type datetime + } elseif ($propertyValue instanceof \DateTime) { + $array[$propertyName] = $propertyValue->format(DATE_ATOM); + // If it's an array type we should check whether it contains objects and if so call toArray method + } elseif (is_array($propertyValue)) { + $array[$propertyName] = array_map(function ($item) { + return $item instanceof ModelInterface ? $item->toArray() : $item; + }, $propertyValue); + } else { + // Otherwise, directly assign the property value to the array + $array[$propertyName] = $propertyValue; + } + } + } + return $array; + } + /** * Gets the string presentation of the object * diff --git a/src/Adyen/Model/Checkout/ResponseAdditionalDataNetworkTokens.php b/src/Adyen/Model/Checkout/ResponseAdditionalDataNetworkTokens.php index 25d59b246..80886a6ab 100644 --- a/src/Adyen/Model/Checkout/ResponseAdditionalDataNetworkTokens.php +++ b/src/Adyen/Model/Checkout/ResponseAdditionalDataNetworkTokens.php @@ -5,7 +5,7 @@ * * The version of the OpenAPI document: 71 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 6.0.1 + * OpenAPI Generator version: 6.4.0 * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -437,6 +437,32 @@ public function jsonSerialize() return ObjectSerializer::sanitizeForSerialization($this); } + public function toArray(): array + { + $array = []; + foreach (self::$openAPITypes as $propertyName => $propertyType) { + $propertyValue = $this[$propertyName]; + if ($propertyValue !== null) { + // Check if the property value is an object and has a toArray() method + if (is_object($propertyValue) && method_exists($propertyValue, 'toArray')) { + $array[$propertyName] = $propertyValue->toArray(); + // Check if it's type datetime + } elseif ($propertyValue instanceof \DateTime) { + $array[$propertyName] = $propertyValue->format(DATE_ATOM); + // If it's an array type we should check whether it contains objects and if so call toArray method + } elseif (is_array($propertyValue)) { + $array[$propertyName] = array_map(function ($item) { + return $item instanceof ModelInterface ? $item->toArray() : $item; + }, $propertyValue); + } else { + // Otherwise, directly assign the property value to the array + $array[$propertyName] = $propertyValue; + } + } + } + return $array; + } + /** * Gets the string presentation of the object * diff --git a/src/Adyen/Model/Checkout/ResponseAdditionalDataOpi.php b/src/Adyen/Model/Checkout/ResponseAdditionalDataOpi.php index a57145226..d277ba45b 100644 --- a/src/Adyen/Model/Checkout/ResponseAdditionalDataOpi.php +++ b/src/Adyen/Model/Checkout/ResponseAdditionalDataOpi.php @@ -5,7 +5,7 @@ * * The version of the OpenAPI document: 71 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 6.0.1 + * OpenAPI Generator version: 6.4.0 * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -369,6 +369,32 @@ public function jsonSerialize() return ObjectSerializer::sanitizeForSerialization($this); } + public function toArray(): array + { + $array = []; + foreach (self::$openAPITypes as $propertyName => $propertyType) { + $propertyValue = $this[$propertyName]; + if ($propertyValue !== null) { + // Check if the property value is an object and has a toArray() method + if (is_object($propertyValue) && method_exists($propertyValue, 'toArray')) { + $array[$propertyName] = $propertyValue->toArray(); + // Check if it's type datetime + } elseif ($propertyValue instanceof \DateTime) { + $array[$propertyName] = $propertyValue->format(DATE_ATOM); + // If it's an array type we should check whether it contains objects and if so call toArray method + } elseif (is_array($propertyValue)) { + $array[$propertyName] = array_map(function ($item) { + return $item instanceof ModelInterface ? $item->toArray() : $item; + }, $propertyValue); + } else { + // Otherwise, directly assign the property value to the array + $array[$propertyName] = $propertyValue; + } + } + } + return $array; + } + /** * Gets the string presentation of the object * diff --git a/src/Adyen/Model/Checkout/ResponseAdditionalDataSepa.php b/src/Adyen/Model/Checkout/ResponseAdditionalDataSepa.php index 85229db88..ec54984a0 100644 --- a/src/Adyen/Model/Checkout/ResponseAdditionalDataSepa.php +++ b/src/Adyen/Model/Checkout/ResponseAdditionalDataSepa.php @@ -5,7 +5,7 @@ * * The version of the OpenAPI document: 71 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 6.0.1 + * OpenAPI Generator version: 6.4.0 * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -437,6 +437,32 @@ public function jsonSerialize() return ObjectSerializer::sanitizeForSerialization($this); } + public function toArray(): array + { + $array = []; + foreach (self::$openAPITypes as $propertyName => $propertyType) { + $propertyValue = $this[$propertyName]; + if ($propertyValue !== null) { + // Check if the property value is an object and has a toArray() method + if (is_object($propertyValue) && method_exists($propertyValue, 'toArray')) { + $array[$propertyName] = $propertyValue->toArray(); + // Check if it's type datetime + } elseif ($propertyValue instanceof \DateTime) { + $array[$propertyName] = $propertyValue->format(DATE_ATOM); + // If it's an array type we should check whether it contains objects and if so call toArray method + } elseif (is_array($propertyValue)) { + $array[$propertyName] = array_map(function ($item) { + return $item instanceof ModelInterface ? $item->toArray() : $item; + }, $propertyValue); + } else { + // Otherwise, directly assign the property value to the array + $array[$propertyName] = $propertyValue; + } + } + } + return $array; + } + /** * Gets the string presentation of the object * diff --git a/src/Adyen/Model/Checkout/ResponsePaymentMethod.php b/src/Adyen/Model/Checkout/ResponsePaymentMethod.php index 8715daa60..11aa38a7e 100644 --- a/src/Adyen/Model/Checkout/ResponsePaymentMethod.php +++ b/src/Adyen/Model/Checkout/ResponsePaymentMethod.php @@ -5,7 +5,7 @@ * * The version of the OpenAPI document: 71 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 6.0.1 + * OpenAPI Generator version: 6.4.0 * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -403,6 +403,32 @@ public function jsonSerialize() return ObjectSerializer::sanitizeForSerialization($this); } + public function toArray(): array + { + $array = []; + foreach (self::$openAPITypes as $propertyName => $propertyType) { + $propertyValue = $this[$propertyName]; + if ($propertyValue !== null) { + // Check if the property value is an object and has a toArray() method + if (is_object($propertyValue) && method_exists($propertyValue, 'toArray')) { + $array[$propertyName] = $propertyValue->toArray(); + // Check if it's type datetime + } elseif ($propertyValue instanceof \DateTime) { + $array[$propertyName] = $propertyValue->format(DATE_ATOM); + // If it's an array type we should check whether it contains objects and if so call toArray method + } elseif (is_array($propertyValue)) { + $array[$propertyName] = array_map(function ($item) { + return $item instanceof ModelInterface ? $item->toArray() : $item; + }, $propertyValue); + } else { + // Otherwise, directly assign the property value to the array + $array[$propertyName] = $propertyValue; + } + } + } + return $array; + } + /** * Gets the string presentation of the object * diff --git a/src/Adyen/Model/Checkout/RiskData.php b/src/Adyen/Model/Checkout/RiskData.php index ead5c8043..ac4ef78ee 100644 --- a/src/Adyen/Model/Checkout/RiskData.php +++ b/src/Adyen/Model/Checkout/RiskData.php @@ -5,7 +5,7 @@ * * The version of the OpenAPI document: 71 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 6.0.1 + * OpenAPI Generator version: 6.4.0 * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -469,6 +469,32 @@ public function jsonSerialize() return ObjectSerializer::sanitizeForSerialization($this); } + public function toArray(): array + { + $array = []; + foreach (self::$openAPITypes as $propertyName => $propertyType) { + $propertyValue = $this[$propertyName]; + if ($propertyValue !== null) { + // Check if the property value is an object and has a toArray() method + if (is_object($propertyValue) && method_exists($propertyValue, 'toArray')) { + $array[$propertyName] = $propertyValue->toArray(); + // Check if it's type datetime + } elseif ($propertyValue instanceof \DateTime) { + $array[$propertyName] = $propertyValue->format(DATE_ATOM); + // If it's an array type we should check whether it contains objects and if so call toArray method + } elseif (is_array($propertyValue)) { + $array[$propertyName] = array_map(function ($item) { + return $item instanceof ModelInterface ? $item->toArray() : $item; + }, $propertyValue); + } else { + // Otherwise, directly assign the property value to the array + $array[$propertyName] = $propertyValue; + } + } + } + return $array; + } + /** * Gets the string presentation of the object * diff --git a/src/Adyen/Model/Checkout/SDKEphemPubKey.php b/src/Adyen/Model/Checkout/SDKEphemPubKey.php index 2057aca7b..fbce1da2c 100644 --- a/src/Adyen/Model/Checkout/SDKEphemPubKey.php +++ b/src/Adyen/Model/Checkout/SDKEphemPubKey.php @@ -5,7 +5,7 @@ * * The version of the OpenAPI document: 71 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 6.0.1 + * OpenAPI Generator version: 6.4.0 * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -471,6 +471,32 @@ public function jsonSerialize() return ObjectSerializer::sanitizeForSerialization($this); } + public function toArray(): array + { + $array = []; + foreach (self::$openAPITypes as $propertyName => $propertyType) { + $propertyValue = $this[$propertyName]; + if ($propertyValue !== null) { + // Check if the property value is an object and has a toArray() method + if (is_object($propertyValue) && method_exists($propertyValue, 'toArray')) { + $array[$propertyName] = $propertyValue->toArray(); + // Check if it's type datetime + } elseif ($propertyValue instanceof \DateTime) { + $array[$propertyName] = $propertyValue->format(DATE_ATOM); + // If it's an array type we should check whether it contains objects and if so call toArray method + } elseif (is_array($propertyValue)) { + $array[$propertyName] = array_map(function ($item) { + return $item instanceof ModelInterface ? $item->toArray() : $item; + }, $propertyValue); + } else { + // Otherwise, directly assign the property value to the array + $array[$propertyName] = $propertyValue; + } + } + } + return $array; + } + /** * Gets the string presentation of the object * diff --git a/src/Adyen/Model/Checkout/SamsungPayDetails.php b/src/Adyen/Model/Checkout/SamsungPayDetails.php index 0c094a34a..cc922c894 100644 --- a/src/Adyen/Model/Checkout/SamsungPayDetails.php +++ b/src/Adyen/Model/Checkout/SamsungPayDetails.php @@ -5,7 +5,7 @@ * * The version of the OpenAPI document: 71 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 6.0.1 + * OpenAPI Generator version: 6.4.0 * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -245,7 +245,6 @@ public function getModelName() return self::$openAPIModelName; } - public const FUNDING_SOURCE_CREDIT = 'credit'; public const FUNDING_SOURCE_DEBIT = 'debit'; public const TYPE_SAMSUNGPAY = 'samsungpay'; @@ -257,7 +256,6 @@ public function getModelName() public function getFundingSourceAllowableValues() { return [ - self::FUNDING_SOURCE_CREDIT, self::FUNDING_SOURCE_DEBIT, ]; } @@ -608,6 +606,32 @@ public function jsonSerialize() return ObjectSerializer::sanitizeForSerialization($this); } + public function toArray(): array + { + $array = []; + foreach (self::$openAPITypes as $propertyName => $propertyType) { + $propertyValue = $this[$propertyName]; + if ($propertyValue !== null) { + // Check if the property value is an object and has a toArray() method + if (is_object($propertyValue) && method_exists($propertyValue, 'toArray')) { + $array[$propertyName] = $propertyValue->toArray(); + // Check if it's type datetime + } elseif ($propertyValue instanceof \DateTime) { + $array[$propertyName] = $propertyValue->format(DATE_ATOM); + // If it's an array type we should check whether it contains objects and if so call toArray method + } elseif (is_array($propertyValue)) { + $array[$propertyName] = array_map(function ($item) { + return $item instanceof ModelInterface ? $item->toArray() : $item; + }, $propertyValue); + } else { + // Otherwise, directly assign the property value to the array + $array[$propertyName] = $propertyValue; + } + } + } + return $array; + } + /** * Gets the string presentation of the object * diff --git a/src/Adyen/Model/Checkout/SepaDirectDebitDetails.php b/src/Adyen/Model/Checkout/SepaDirectDebitDetails.php index 7f8f02d7e..0635420c6 100644 --- a/src/Adyen/Model/Checkout/SepaDirectDebitDetails.php +++ b/src/Adyen/Model/Checkout/SepaDirectDebitDetails.php @@ -5,7 +5,7 @@ * * The version of the OpenAPI document: 71 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 6.0.1 + * OpenAPI Generator version: 6.4.0 * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -580,6 +580,32 @@ public function jsonSerialize() return ObjectSerializer::sanitizeForSerialization($this); } + public function toArray(): array + { + $array = []; + foreach (self::$openAPITypes as $propertyName => $propertyType) { + $propertyValue = $this[$propertyName]; + if ($propertyValue !== null) { + // Check if the property value is an object and has a toArray() method + if (is_object($propertyValue) && method_exists($propertyValue, 'toArray')) { + $array[$propertyName] = $propertyValue->toArray(); + // Check if it's type datetime + } elseif ($propertyValue instanceof \DateTime) { + $array[$propertyName] = $propertyValue->format(DATE_ATOM); + // If it's an array type we should check whether it contains objects and if so call toArray method + } elseif (is_array($propertyValue)) { + $array[$propertyName] = array_map(function ($item) { + return $item instanceof ModelInterface ? $item->toArray() : $item; + }, $propertyValue); + } else { + // Otherwise, directly assign the property value to the array + $array[$propertyName] = $propertyValue; + } + } + } + return $array; + } + /** * Gets the string presentation of the object * diff --git a/src/Adyen/Model/Checkout/ServiceError.php b/src/Adyen/Model/Checkout/ServiceError.php index 0f3fa0073..2f97c4743 100644 --- a/src/Adyen/Model/Checkout/ServiceError.php +++ b/src/Adyen/Model/Checkout/ServiceError.php @@ -5,7 +5,7 @@ * * The version of the OpenAPI document: 71 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 6.0.1 + * OpenAPI Generator version: 6.4.0 * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -537,6 +537,32 @@ public function jsonSerialize() return ObjectSerializer::sanitizeForSerialization($this); } + public function toArray(): array + { + $array = []; + foreach (self::$openAPITypes as $propertyName => $propertyType) { + $propertyValue = $this[$propertyName]; + if ($propertyValue !== null) { + // Check if the property value is an object and has a toArray() method + if (is_object($propertyValue) && method_exists($propertyValue, 'toArray')) { + $array[$propertyName] = $propertyValue->toArray(); + // Check if it's type datetime + } elseif ($propertyValue instanceof \DateTime) { + $array[$propertyName] = $propertyValue->format(DATE_ATOM); + // If it's an array type we should check whether it contains objects and if so call toArray method + } elseif (is_array($propertyValue)) { + $array[$propertyName] = array_map(function ($item) { + return $item instanceof ModelInterface ? $item->toArray() : $item; + }, $propertyValue); + } else { + // Otherwise, directly assign the property value to the array + $array[$propertyName] = $propertyValue; + } + } + } + return $array; + } + /** * Gets the string presentation of the object * diff --git a/src/Adyen/Model/Checkout/ServiceErrorDetails.php b/src/Adyen/Model/Checkout/ServiceErrorDetails.php index abc2a8ae2..701138745 100644 --- a/src/Adyen/Model/Checkout/ServiceErrorDetails.php +++ b/src/Adyen/Model/Checkout/ServiceErrorDetails.php @@ -5,7 +5,7 @@ * * The version of the OpenAPI document: 71 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 6.0.1 + * OpenAPI Generator version: 6.4.0 * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -471,6 +471,32 @@ public function jsonSerialize() return ObjectSerializer::sanitizeForSerialization($this); } + public function toArray(): array + { + $array = []; + foreach (self::$openAPITypes as $propertyName => $propertyType) { + $propertyValue = $this[$propertyName]; + if ($propertyValue !== null) { + // Check if the property value is an object and has a toArray() method + if (is_object($propertyValue) && method_exists($propertyValue, 'toArray')) { + $array[$propertyName] = $propertyValue->toArray(); + // Check if it's type datetime + } elseif ($propertyValue instanceof \DateTime) { + $array[$propertyName] = $propertyValue->format(DATE_ATOM); + // If it's an array type we should check whether it contains objects and if so call toArray method + } elseif (is_array($propertyValue)) { + $array[$propertyName] = array_map(function ($item) { + return $item instanceof ModelInterface ? $item->toArray() : $item; + }, $propertyValue); + } else { + // Otherwise, directly assign the property value to the array + $array[$propertyName] = $propertyValue; + } + } + } + return $array; + } + /** * Gets the string presentation of the object * diff --git a/src/Adyen/Model/Checkout/SessionResultResponse.php b/src/Adyen/Model/Checkout/SessionResultResponse.php index 4afaec630..44d1ebe2a 100644 --- a/src/Adyen/Model/Checkout/SessionResultResponse.php +++ b/src/Adyen/Model/Checkout/SessionResultResponse.php @@ -5,7 +5,7 @@ * * The version of the OpenAPI document: 71 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 6.0.1 + * OpenAPI Generator version: 6.4.0 * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -444,6 +444,32 @@ public function jsonSerialize() return ObjectSerializer::sanitizeForSerialization($this); } + public function toArray(): array + { + $array = []; + foreach (self::$openAPITypes as $propertyName => $propertyType) { + $propertyValue = $this[$propertyName]; + if ($propertyValue !== null) { + // Check if the property value is an object and has a toArray() method + if (is_object($propertyValue) && method_exists($propertyValue, 'toArray')) { + $array[$propertyName] = $propertyValue->toArray(); + // Check if it's type datetime + } elseif ($propertyValue instanceof \DateTime) { + $array[$propertyName] = $propertyValue->format(DATE_ATOM); + // If it's an array type we should check whether it contains objects and if so call toArray method + } elseif (is_array($propertyValue)) { + $array[$propertyName] = array_map(function ($item) { + return $item instanceof ModelInterface ? $item->toArray() : $item; + }, $propertyValue); + } else { + // Otherwise, directly assign the property value to the array + $array[$propertyName] = $propertyValue; + } + } + } + return $array; + } + /** * Gets the string presentation of the object * diff --git a/src/Adyen/Model/Checkout/ShopperInput.php b/src/Adyen/Model/Checkout/ShopperInput.php index 17402b321..c04ab46c5 100644 --- a/src/Adyen/Model/Checkout/ShopperInput.php +++ b/src/Adyen/Model/Checkout/ShopperInput.php @@ -5,7 +5,7 @@ * * The version of the OpenAPI document: 71 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 6.0.1 + * OpenAPI Generator version: 6.4.0 * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -542,6 +542,32 @@ public function jsonSerialize() return ObjectSerializer::sanitizeForSerialization($this); } + public function toArray(): array + { + $array = []; + foreach (self::$openAPITypes as $propertyName => $propertyType) { + $propertyValue = $this[$propertyName]; + if ($propertyValue !== null) { + // Check if the property value is an object and has a toArray() method + if (is_object($propertyValue) && method_exists($propertyValue, 'toArray')) { + $array[$propertyName] = $propertyValue->toArray(); + // Check if it's type datetime + } elseif ($propertyValue instanceof \DateTime) { + $array[$propertyName] = $propertyValue->format(DATE_ATOM); + // If it's an array type we should check whether it contains objects and if so call toArray method + } elseif (is_array($propertyValue)) { + $array[$propertyName] = array_map(function ($item) { + return $item instanceof ModelInterface ? $item->toArray() : $item; + }, $propertyValue); + } else { + // Otherwise, directly assign the property value to the array + $array[$propertyName] = $propertyValue; + } + } + } + return $array; + } + /** * Gets the string presentation of the object * diff --git a/src/Adyen/Model/Checkout/ShopperInteractionDevice.php b/src/Adyen/Model/Checkout/ShopperInteractionDevice.php index bc4286b6d..14f142286 100644 --- a/src/Adyen/Model/Checkout/ShopperInteractionDevice.php +++ b/src/Adyen/Model/Checkout/ShopperInteractionDevice.php @@ -5,7 +5,7 @@ * * The version of the OpenAPI document: 71 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 6.0.1 + * OpenAPI Generator version: 6.4.0 * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -437,6 +437,32 @@ public function jsonSerialize() return ObjectSerializer::sanitizeForSerialization($this); } + public function toArray(): array + { + $array = []; + foreach (self::$openAPITypes as $propertyName => $propertyType) { + $propertyValue = $this[$propertyName]; + if ($propertyValue !== null) { + // Check if the property value is an object and has a toArray() method + if (is_object($propertyValue) && method_exists($propertyValue, 'toArray')) { + $array[$propertyName] = $propertyValue->toArray(); + // Check if it's type datetime + } elseif ($propertyValue instanceof \DateTime) { + $array[$propertyName] = $propertyValue->format(DATE_ATOM); + // If it's an array type we should check whether it contains objects and if so call toArray method + } elseif (is_array($propertyValue)) { + $array[$propertyName] = array_map(function ($item) { + return $item instanceof ModelInterface ? $item->toArray() : $item; + }, $propertyValue); + } else { + // Otherwise, directly assign the property value to the array + $array[$propertyName] = $propertyValue; + } + } + } + return $array; + } + /** * Gets the string presentation of the object * diff --git a/src/Adyen/Model/Checkout/Split.php b/src/Adyen/Model/Checkout/Split.php index 6bfdf3111..e4b270334 100644 --- a/src/Adyen/Model/Checkout/Split.php +++ b/src/Adyen/Model/Checkout/Split.php @@ -5,7 +5,7 @@ * * The version of the OpenAPI document: 71 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 6.0.1 + * OpenAPI Generator version: 6.4.0 * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -438,7 +438,7 @@ public function getReference() /** * Sets reference * - * @param string|null $reference Your unique reference for the split item. This is required if `type` is **MarketPlace** ([Classic Platforms integration](https://docs.adyen.com/marketplaces-and-platforms/classic)) or **BalanceAccount** ([Balance Platform](https://docs.adyen.com/marketplaces-and-platforms)). For the other types, we also recommend providing a **unique** reference so you can reconcile the split and the associated payment in the transaction overview and in the reports. + * @param string|null $reference Your reference for the split item. This is required if `type` is **MarketPlace** ([Classic Platforms integration](https://docs.adyen.com/marketplaces-and-platforms/classic)) or **BalanceAccount** ([Balance Platform](https://docs.adyen.com/marketplaces-and-platforms)). For the other types, we also recommend sending a reference so you can reconcile the split and the associated payment in the transaction overview and in the reports. * * @return self */ @@ -555,6 +555,32 @@ public function jsonSerialize() return ObjectSerializer::sanitizeForSerialization($this); } + public function toArray(): array + { + $array = []; + foreach (self::$openAPITypes as $propertyName => $propertyType) { + $propertyValue = $this[$propertyName]; + if ($propertyValue !== null) { + // Check if the property value is an object and has a toArray() method + if (is_object($propertyValue) && method_exists($propertyValue, 'toArray')) { + $array[$propertyName] = $propertyValue->toArray(); + // Check if it's type datetime + } elseif ($propertyValue instanceof \DateTime) { + $array[$propertyName] = $propertyValue->format(DATE_ATOM); + // If it's an array type we should check whether it contains objects and if so call toArray method + } elseif (is_array($propertyValue)) { + $array[$propertyName] = array_map(function ($item) { + return $item instanceof ModelInterface ? $item->toArray() : $item; + }, $propertyValue); + } else { + // Otherwise, directly assign the property value to the array + $array[$propertyName] = $propertyValue; + } + } + } + return $array; + } + /** * Gets the string presentation of the object * diff --git a/src/Adyen/Model/Checkout/SplitAmount.php b/src/Adyen/Model/Checkout/SplitAmount.php index b9ae9ea03..39578e506 100644 --- a/src/Adyen/Model/Checkout/SplitAmount.php +++ b/src/Adyen/Model/Checkout/SplitAmount.php @@ -5,7 +5,7 @@ * * The version of the OpenAPI document: 71 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 6.0.1 + * OpenAPI Generator version: 6.4.0 * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -406,6 +406,32 @@ public function jsonSerialize() return ObjectSerializer::sanitizeForSerialization($this); } + public function toArray(): array + { + $array = []; + foreach (self::$openAPITypes as $propertyName => $propertyType) { + $propertyValue = $this[$propertyName]; + if ($propertyValue !== null) { + // Check if the property value is an object and has a toArray() method + if (is_object($propertyValue) && method_exists($propertyValue, 'toArray')) { + $array[$propertyName] = $propertyValue->toArray(); + // Check if it's type datetime + } elseif ($propertyValue instanceof \DateTime) { + $array[$propertyName] = $propertyValue->format(DATE_ATOM); + // If it's an array type we should check whether it contains objects and if so call toArray method + } elseif (is_array($propertyValue)) { + $array[$propertyName] = array_map(function ($item) { + return $item instanceof ModelInterface ? $item->toArray() : $item; + }, $propertyValue); + } else { + // Otherwise, directly assign the property value to the array + $array[$propertyName] = $propertyValue; + } + } + } + return $array; + } + /** * Gets the string presentation of the object * diff --git a/src/Adyen/Model/Checkout/StandalonePaymentCancelRequest.php b/src/Adyen/Model/Checkout/StandalonePaymentCancelRequest.php index 60d65f325..7e17bd29d 100644 --- a/src/Adyen/Model/Checkout/StandalonePaymentCancelRequest.php +++ b/src/Adyen/Model/Checkout/StandalonePaymentCancelRequest.php @@ -5,7 +5,7 @@ * * The version of the OpenAPI document: 71 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 6.0.1 + * OpenAPI Generator version: 6.4.0 * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -477,6 +477,32 @@ public function jsonSerialize() return ObjectSerializer::sanitizeForSerialization($this); } + public function toArray(): array + { + $array = []; + foreach (self::$openAPITypes as $propertyName => $propertyType) { + $propertyValue = $this[$propertyName]; + if ($propertyValue !== null) { + // Check if the property value is an object and has a toArray() method + if (is_object($propertyValue) && method_exists($propertyValue, 'toArray')) { + $array[$propertyName] = $propertyValue->toArray(); + // Check if it's type datetime + } elseif ($propertyValue instanceof \DateTime) { + $array[$propertyName] = $propertyValue->format(DATE_ATOM); + // If it's an array type we should check whether it contains objects and if so call toArray method + } elseif (is_array($propertyValue)) { + $array[$propertyName] = array_map(function ($item) { + return $item instanceof ModelInterface ? $item->toArray() : $item; + }, $propertyValue); + } else { + // Otherwise, directly assign the property value to the array + $array[$propertyName] = $propertyValue; + } + } + } + return $array; + } + /** * Gets the string presentation of the object * diff --git a/src/Adyen/Model/Checkout/StandalonePaymentCancelResponse.php b/src/Adyen/Model/Checkout/StandalonePaymentCancelResponse.php index 5b8b65e76..4f289532e 100644 --- a/src/Adyen/Model/Checkout/StandalonePaymentCancelResponse.php +++ b/src/Adyen/Model/Checkout/StandalonePaymentCancelResponse.php @@ -5,7 +5,7 @@ * * The version of the OpenAPI document: 71 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 6.0.1 + * OpenAPI Generator version: 6.4.0 * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -548,6 +548,32 @@ public function jsonSerialize() return ObjectSerializer::sanitizeForSerialization($this); } + public function toArray(): array + { + $array = []; + foreach (self::$openAPITypes as $propertyName => $propertyType) { + $propertyValue = $this[$propertyName]; + if ($propertyValue !== null) { + // Check if the property value is an object and has a toArray() method + if (is_object($propertyValue) && method_exists($propertyValue, 'toArray')) { + $array[$propertyName] = $propertyValue->toArray(); + // Check if it's type datetime + } elseif ($propertyValue instanceof \DateTime) { + $array[$propertyName] = $propertyValue->format(DATE_ATOM); + // If it's an array type we should check whether it contains objects and if so call toArray method + } elseif (is_array($propertyValue)) { + $array[$propertyName] = array_map(function ($item) { + return $item instanceof ModelInterface ? $item->toArray() : $item; + }, $propertyValue); + } else { + // Otherwise, directly assign the property value to the array + $array[$propertyName] = $propertyValue; + } + } + } + return $array; + } + /** * Gets the string presentation of the object * diff --git a/src/Adyen/Model/Checkout/StoredDetails.php b/src/Adyen/Model/Checkout/StoredDetails.php index ba44eedbb..50df03522 100644 --- a/src/Adyen/Model/Checkout/StoredDetails.php +++ b/src/Adyen/Model/Checkout/StoredDetails.php @@ -5,7 +5,7 @@ * * The version of the OpenAPI document: 71 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 6.0.1 + * OpenAPI Generator version: 6.4.0 * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -437,6 +437,32 @@ public function jsonSerialize() return ObjectSerializer::sanitizeForSerialization($this); } + public function toArray(): array + { + $array = []; + foreach (self::$openAPITypes as $propertyName => $propertyType) { + $propertyValue = $this[$propertyName]; + if ($propertyValue !== null) { + // Check if the property value is an object and has a toArray() method + if (is_object($propertyValue) && method_exists($propertyValue, 'toArray')) { + $array[$propertyName] = $propertyValue->toArray(); + // Check if it's type datetime + } elseif ($propertyValue instanceof \DateTime) { + $array[$propertyName] = $propertyValue->format(DATE_ATOM); + // If it's an array type we should check whether it contains objects and if so call toArray method + } elseif (is_array($propertyValue)) { + $array[$propertyName] = array_map(function ($item) { + return $item instanceof ModelInterface ? $item->toArray() : $item; + }, $propertyValue); + } else { + // Otherwise, directly assign the property value to the array + $array[$propertyName] = $propertyValue; + } + } + } + return $array; + } + /** * Gets the string presentation of the object * diff --git a/src/Adyen/Model/Checkout/StoredPaymentMethod.php b/src/Adyen/Model/Checkout/StoredPaymentMethod.php index f7c314443..ce75d3d85 100644 --- a/src/Adyen/Model/Checkout/StoredPaymentMethod.php +++ b/src/Adyen/Model/Checkout/StoredPaymentMethod.php @@ -5,7 +5,7 @@ * * The version of the OpenAPI document: 71 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 6.0.1 + * OpenAPI Generator version: 6.4.0 * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -44,15 +44,12 @@ class StoredPaymentMethod implements ModelInterface, ArrayAccess, \JsonSerializa * @var string[] */ protected static $openAPITypes = [ - 'bankAccountNumber' => 'string', - 'bankLocationId' => 'string', 'brand' => 'string', 'expiryMonth' => 'string', 'expiryYear' => 'string', 'holderName' => 'string', 'iban' => 'string', 'id' => 'string', - 'label' => 'string', 'lastFour' => 'string', 'name' => 'string', 'networkTxReference' => 'string', @@ -71,15 +68,12 @@ class StoredPaymentMethod implements ModelInterface, ArrayAccess, \JsonSerializa * @psalm-var array */ protected static $openAPIFormats = [ - 'bankAccountNumber' => null, - 'bankLocationId' => null, 'brand' => null, 'expiryMonth' => null, 'expiryYear' => null, 'holderName' => null, 'iban' => null, 'id' => null, - 'label' => null, 'lastFour' => null, 'name' => null, 'networkTxReference' => null, @@ -96,15 +90,12 @@ class StoredPaymentMethod implements ModelInterface, ArrayAccess, \JsonSerializa * @var boolean[] */ protected static $openAPINullables = [ - 'bankAccountNumber' => false, - 'bankLocationId' => false, 'brand' => false, 'expiryMonth' => false, 'expiryYear' => false, 'holderName' => false, 'iban' => false, 'id' => false, - 'label' => false, 'lastFour' => false, 'name' => false, 'networkTxReference' => false, @@ -201,15 +192,12 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $attributeMap = [ - 'bankAccountNumber' => 'bankAccountNumber', - 'bankLocationId' => 'bankLocationId', 'brand' => 'brand', 'expiryMonth' => 'expiryMonth', 'expiryYear' => 'expiryYear', 'holderName' => 'holderName', 'iban' => 'iban', 'id' => 'id', - 'label' => 'label', 'lastFour' => 'lastFour', 'name' => 'name', 'networkTxReference' => 'networkTxReference', @@ -226,15 +214,12 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $setters = [ - 'bankAccountNumber' => 'setBankAccountNumber', - 'bankLocationId' => 'setBankLocationId', 'brand' => 'setBrand', 'expiryMonth' => 'setExpiryMonth', 'expiryYear' => 'setExpiryYear', 'holderName' => 'setHolderName', 'iban' => 'setIban', 'id' => 'setId', - 'label' => 'setLabel', 'lastFour' => 'setLastFour', 'name' => 'setName', 'networkTxReference' => 'setNetworkTxReference', @@ -251,15 +236,12 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $getters = [ - 'bankAccountNumber' => 'getBankAccountNumber', - 'bankLocationId' => 'getBankLocationId', 'brand' => 'getBrand', 'expiryMonth' => 'getExpiryMonth', 'expiryYear' => 'getExpiryYear', 'holderName' => 'getHolderName', 'iban' => 'getIban', 'id' => 'getId', - 'label' => 'getLabel', 'lastFour' => 'getLastFour', 'name' => 'getName', 'networkTxReference' => 'getNetworkTxReference', @@ -327,15 +309,12 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->setIfExists('bankAccountNumber', $data ?? [], null); - $this->setIfExists('bankLocationId', $data ?? [], null); $this->setIfExists('brand', $data ?? [], null); $this->setIfExists('expiryMonth', $data ?? [], null); $this->setIfExists('expiryYear', $data ?? [], null); $this->setIfExists('holderName', $data ?? [], null); $this->setIfExists('iban', $data ?? [], null); $this->setIfExists('id', $data ?? [], null); - $this->setIfExists('label', $data ?? [], null); $this->setIfExists('lastFour', $data ?? [], null); $this->setIfExists('name', $data ?? [], null); $this->setIfExists('networkTxReference', $data ?? [], null); @@ -388,60 +367,6 @@ public function valid() } - /** - * Gets bankAccountNumber - * - * @return string|null - */ - public function getBankAccountNumber() - { - return $this->container['bankAccountNumber']; - } - - /** - * Sets bankAccountNumber - * - * @param string|null $bankAccountNumber The bank account number (without separators). - * - * @return self - */ - public function setBankAccountNumber($bankAccountNumber) - { - if (is_null($bankAccountNumber)) { - throw new \InvalidArgumentException('non-nullable bankAccountNumber cannot be null'); - } - $this->container['bankAccountNumber'] = $bankAccountNumber; - - return $this; - } - - /** - * Gets bankLocationId - * - * @return string|null - */ - public function getBankLocationId() - { - return $this->container['bankLocationId']; - } - - /** - * Sets bankLocationId - * - * @param string|null $bankLocationId The location id of the bank. The field value is `nil` in most cases. - * - * @return self - */ - public function setBankLocationId($bankLocationId) - { - if (is_null($bankLocationId)) { - throw new \InvalidArgumentException('non-nullable bankLocationId cannot be null'); - } - $this->container['bankLocationId'] = $bankLocationId; - - return $this; - } - /** * Gets brand * @@ -604,33 +529,6 @@ public function setId($id) return $this; } - /** - * Gets label - * - * @return string|null - */ - public function getLabel() - { - return $this->container['label']; - } - - /** - * Sets label - * - * @param string|null $label The shopper’s issuer account label - * - * @return self - */ - public function setLabel($label) - { - if (is_null($label)) { - throw new \InvalidArgumentException('non-nullable label cannot be null'); - } - $this->container['label'] = $label; - - return $this; - } - /** * Gets lastFour * @@ -913,6 +811,32 @@ public function jsonSerialize() return ObjectSerializer::sanitizeForSerialization($this); } + public function toArray(): array + { + $array = []; + foreach (self::$openAPITypes as $propertyName => $propertyType) { + $propertyValue = $this[$propertyName]; + if ($propertyValue !== null) { + // Check if the property value is an object and has a toArray() method + if (is_object($propertyValue) && method_exists($propertyValue, 'toArray')) { + $array[$propertyName] = $propertyValue->toArray(); + // Check if it's type datetime + } elseif ($propertyValue instanceof \DateTime) { + $array[$propertyName] = $propertyValue->format(DATE_ATOM); + // If it's an array type we should check whether it contains objects and if so call toArray method + } elseif (is_array($propertyValue)) { + $array[$propertyName] = array_map(function ($item) { + return $item instanceof ModelInterface ? $item->toArray() : $item; + }, $propertyValue); + } else { + // Otherwise, directly assign the property value to the array + $array[$propertyName] = $propertyValue; + } + } + } + return $array; + } + /** * Gets the string presentation of the object * diff --git a/src/Adyen/Model/Checkout/StoredPaymentMethodDetails.php b/src/Adyen/Model/Checkout/StoredPaymentMethodDetails.php index e6af578de..e6b79cebf 100644 --- a/src/Adyen/Model/Checkout/StoredPaymentMethodDetails.php +++ b/src/Adyen/Model/Checkout/StoredPaymentMethodDetails.php @@ -5,7 +5,7 @@ * * The version of the OpenAPI document: 71 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 6.0.1 + * OpenAPI Generator version: 6.4.0 * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -538,6 +538,32 @@ public function jsonSerialize() return ObjectSerializer::sanitizeForSerialization($this); } + public function toArray(): array + { + $array = []; + foreach (self::$openAPITypes as $propertyName => $propertyType) { + $propertyValue = $this[$propertyName]; + if ($propertyValue !== null) { + // Check if the property value is an object and has a toArray() method + if (is_object($propertyValue) && method_exists($propertyValue, 'toArray')) { + $array[$propertyName] = $propertyValue->toArray(); + // Check if it's type datetime + } elseif ($propertyValue instanceof \DateTime) { + $array[$propertyName] = $propertyValue->format(DATE_ATOM); + // If it's an array type we should check whether it contains objects and if so call toArray method + } elseif (is_array($propertyValue)) { + $array[$propertyName] = array_map(function ($item) { + return $item instanceof ModelInterface ? $item->toArray() : $item; + }, $propertyValue); + } else { + // Otherwise, directly assign the property value to the array + $array[$propertyName] = $propertyValue; + } + } + } + return $array; + } + /** * Gets the string presentation of the object * diff --git a/src/Adyen/Model/Checkout/StoredPaymentMethodResource.php b/src/Adyen/Model/Checkout/StoredPaymentMethodResource.php index f3e8776d3..4ce608b05 100644 --- a/src/Adyen/Model/Checkout/StoredPaymentMethodResource.php +++ b/src/Adyen/Model/Checkout/StoredPaymentMethodResource.php @@ -5,7 +5,7 @@ * * The version of the OpenAPI document: 71 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 6.0.1 + * OpenAPI Generator version: 6.4.0 * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -913,6 +913,32 @@ public function jsonSerialize() return ObjectSerializer::sanitizeForSerialization($this); } + public function toArray(): array + { + $array = []; + foreach (self::$openAPITypes as $propertyName => $propertyType) { + $propertyValue = $this[$propertyName]; + if ($propertyValue !== null) { + // Check if the property value is an object and has a toArray() method + if (is_object($propertyValue) && method_exists($propertyValue, 'toArray')) { + $array[$propertyName] = $propertyValue->toArray(); + // Check if it's type datetime + } elseif ($propertyValue instanceof \DateTime) { + $array[$propertyName] = $propertyValue->format(DATE_ATOM); + // If it's an array type we should check whether it contains objects and if so call toArray method + } elseif (is_array($propertyValue)) { + $array[$propertyName] = array_map(function ($item) { + return $item instanceof ModelInterface ? $item->toArray() : $item; + }, $propertyValue); + } else { + // Otherwise, directly assign the property value to the array + $array[$propertyName] = $propertyValue; + } + } + } + return $array; + } + /** * Gets the string presentation of the object * diff --git a/src/Adyen/Model/Checkout/SubInputDetail.php b/src/Adyen/Model/Checkout/SubInputDetail.php index fca20edfc..482b0cb87 100644 --- a/src/Adyen/Model/Checkout/SubInputDetail.php +++ b/src/Adyen/Model/Checkout/SubInputDetail.php @@ -5,7 +5,7 @@ * * The version of the OpenAPI document: 71 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 6.0.1 + * OpenAPI Generator version: 6.4.0 * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -539,6 +539,32 @@ public function jsonSerialize() return ObjectSerializer::sanitizeForSerialization($this); } + public function toArray(): array + { + $array = []; + foreach (self::$openAPITypes as $propertyName => $propertyType) { + $propertyValue = $this[$propertyName]; + if ($propertyValue !== null) { + // Check if the property value is an object and has a toArray() method + if (is_object($propertyValue) && method_exists($propertyValue, 'toArray')) { + $array[$propertyName] = $propertyValue->toArray(); + // Check if it's type datetime + } elseif ($propertyValue instanceof \DateTime) { + $array[$propertyName] = $propertyValue->format(DATE_ATOM); + // If it's an array type we should check whether it contains objects and if so call toArray method + } elseif (is_array($propertyValue)) { + $array[$propertyName] = array_map(function ($item) { + return $item instanceof ModelInterface ? $item->toArray() : $item; + }, $propertyValue); + } else { + // Otherwise, directly assign the property value to the array + $array[$propertyName] = $propertyValue; + } + } + } + return $array; + } + /** * Gets the string presentation of the object * diff --git a/src/Adyen/Model/Checkout/SubMerchant.php b/src/Adyen/Model/Checkout/SubMerchant.php index 8c8573dd9..c668999b9 100644 --- a/src/Adyen/Model/Checkout/SubMerchant.php +++ b/src/Adyen/Model/Checkout/SubMerchant.php @@ -5,7 +5,7 @@ * * The version of the OpenAPI document: 71 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 6.0.1 + * OpenAPI Generator version: 6.4.0 * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -505,6 +505,32 @@ public function jsonSerialize() return ObjectSerializer::sanitizeForSerialization($this); } + public function toArray(): array + { + $array = []; + foreach (self::$openAPITypes as $propertyName => $propertyType) { + $propertyValue = $this[$propertyName]; + if ($propertyValue !== null) { + // Check if the property value is an object and has a toArray() method + if (is_object($propertyValue) && method_exists($propertyValue, 'toArray')) { + $array[$propertyName] = $propertyValue->toArray(); + // Check if it's type datetime + } elseif ($propertyValue instanceof \DateTime) { + $array[$propertyName] = $propertyValue->format(DATE_ATOM); + // If it's an array type we should check whether it contains objects and if so call toArray method + } elseif (is_array($propertyValue)) { + $array[$propertyName] = array_map(function ($item) { + return $item instanceof ModelInterface ? $item->toArray() : $item; + }, $propertyValue); + } else { + // Otherwise, directly assign the property value to the array + $array[$propertyName] = $propertyValue; + } + } + } + return $array; + } + /** * Gets the string presentation of the object * diff --git a/src/Adyen/Model/Checkout/SubMerchantInfo.php b/src/Adyen/Model/Checkout/SubMerchantInfo.php index 39388a3f9..99e694db2 100644 --- a/src/Adyen/Model/Checkout/SubMerchantInfo.php +++ b/src/Adyen/Model/Checkout/SubMerchantInfo.php @@ -5,7 +5,7 @@ * * The version of the OpenAPI document: 71 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 6.0.1 + * OpenAPI Generator version: 6.4.0 * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -505,6 +505,32 @@ public function jsonSerialize() return ObjectSerializer::sanitizeForSerialization($this); } + public function toArray(): array + { + $array = []; + foreach (self::$openAPITypes as $propertyName => $propertyType) { + $propertyValue = $this[$propertyName]; + if ($propertyValue !== null) { + // Check if the property value is an object and has a toArray() method + if (is_object($propertyValue) && method_exists($propertyValue, 'toArray')) { + $array[$propertyName] = $propertyValue->toArray(); + // Check if it's type datetime + } elseif ($propertyValue instanceof \DateTime) { + $array[$propertyName] = $propertyValue->format(DATE_ATOM); + // If it's an array type we should check whether it contains objects and if so call toArray method + } elseif (is_array($propertyValue)) { + $array[$propertyName] = array_map(function ($item) { + return $item instanceof ModelInterface ? $item->toArray() : $item; + }, $propertyValue); + } else { + // Otherwise, directly assign the property value to the array + $array[$propertyName] = $propertyValue; + } + } + } + return $array; + } + /** * Gets the string presentation of the object * diff --git a/src/Adyen/Model/Checkout/ThreeDS2RequestData.php b/src/Adyen/Model/Checkout/ThreeDS2RequestData.php index a82e1f9a2..17a4cf692 100644 --- a/src/Adyen/Model/Checkout/ThreeDS2RequestData.php +++ b/src/Adyen/Model/Checkout/ThreeDS2RequestData.php @@ -5,7 +5,7 @@ * * The version of the OpenAPI document: 71 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 6.0.1 + * OpenAPI Generator version: 6.4.0 * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -61,7 +61,6 @@ class ThreeDS2RequestData implements ModelInterface, ArrayAccess, \JsonSerializa 'notificationURL' => 'string', 'payTokenInd' => 'bool', 'paymentAuthenticationUseCase' => 'string', - 'platform' => 'string', 'purchaseInstalData' => 'string', 'recurringExpiry' => 'string', 'recurringFrequency' => 'string', @@ -111,7 +110,6 @@ class ThreeDS2RequestData implements ModelInterface, ArrayAccess, \JsonSerializa 'notificationURL' => null, 'payTokenInd' => null, 'paymentAuthenticationUseCase' => null, - 'platform' => null, 'purchaseInstalData' => null, 'recurringExpiry' => null, 'recurringFrequency' => null, @@ -159,7 +157,6 @@ class ThreeDS2RequestData implements ModelInterface, ArrayAccess, \JsonSerializa 'notificationURL' => false, 'payTokenInd' => false, 'paymentAuthenticationUseCase' => false, - 'platform' => false, 'purchaseInstalData' => false, 'recurringExpiry' => false, 'recurringFrequency' => false, @@ -287,7 +284,6 @@ public function isNullableSetToNull(string $property): bool 'notificationURL' => 'notificationURL', 'payTokenInd' => 'payTokenInd', 'paymentAuthenticationUseCase' => 'paymentAuthenticationUseCase', - 'platform' => 'platform', 'purchaseInstalData' => 'purchaseInstalData', 'recurringExpiry' => 'recurringExpiry', 'recurringFrequency' => 'recurringFrequency', @@ -335,7 +331,6 @@ public function isNullableSetToNull(string $property): bool 'notificationURL' => 'setNotificationURL', 'payTokenInd' => 'setPayTokenInd', 'paymentAuthenticationUseCase' => 'setPaymentAuthenticationUseCase', - 'platform' => 'setPlatform', 'purchaseInstalData' => 'setPurchaseInstalData', 'recurringExpiry' => 'setRecurringExpiry', 'recurringFrequency' => 'setRecurringFrequency', @@ -383,7 +378,6 @@ public function isNullableSetToNull(string $property): bool 'notificationURL' => 'getNotificationURL', 'payTokenInd' => 'getPayTokenInd', 'paymentAuthenticationUseCase' => 'getPaymentAuthenticationUseCase', - 'platform' => 'getPlatform', 'purchaseInstalData' => 'getPurchaseInstalData', 'recurringExpiry' => 'getRecurringExpiry', 'recurringFrequency' => 'getRecurringFrequency', @@ -458,9 +452,6 @@ public function getModelName() public const CHALLENGE_INDICATOR_REQUEST_NO_CHALLENGE = 'requestNoChallenge'; public const CHALLENGE_INDICATOR_REQUEST_CHALLENGE = 'requestChallenge'; public const CHALLENGE_INDICATOR_REQUEST_CHALLENGE_AS_MANDATE = 'requestChallengeAsMandate'; - public const PLATFORM_I_OS = 'iOS'; - public const PLATFORM_ANDROID = 'android'; - public const PLATFORM_BROWSER = 'browser'; public const THREE_DS_REQUESTOR_CHALLENGE_IND__01 = '01'; public const THREE_DS_REQUESTOR_CHALLENGE_IND__02 = '02'; public const THREE_DS_REQUESTOR_CHALLENGE_IND__03 = '03'; @@ -517,19 +508,6 @@ public function getChallengeIndicatorAllowableValues() self::CHALLENGE_INDICATOR_REQUEST_CHALLENGE_AS_MANDATE, ]; } - /** - * Gets allowable values of the enum - * - * @return string[] - */ - public function getPlatformAllowableValues() - { - return [ - self::PLATFORM_I_OS, - self::PLATFORM_ANDROID, - self::PLATFORM_BROWSER, - ]; - } /** * Gets allowable values of the enum * @@ -608,7 +586,6 @@ public function __construct(array $data = null) $this->setIfExists('notificationURL', $data ?? [], null); $this->setIfExists('payTokenInd', $data ?? [], null); $this->setIfExists('paymentAuthenticationUseCase', $data ?? [], null); - $this->setIfExists('platform', $data ?? [], null); $this->setIfExists('purchaseInstalData', $data ?? [], null); $this->setIfExists('recurringExpiry', $data ?? [], null); $this->setIfExists('recurringFrequency', $data ?? [], null); @@ -690,15 +667,6 @@ public function listInvalidProperties() if ($this->container['deviceChannel'] === null) { $invalidProperties[] = "'deviceChannel' can't be null"; } - $allowedValues = $this->getPlatformAllowableValues(); - if (!is_null($this->container['platform']) && !in_array($this->container['platform'], $allowedValues, true)) { - $invalidProperties[] = sprintf( - "invalid value '%s' for 'platform', must be one of '%s'", - $this->container['platform'], - implode("', '", $allowedValues) - ); - } - $allowedValues = $this->getThreeDSRequestorChallengeIndAllowableValues(); if (!is_null($this->container['threeDSRequestorChallengeInd']) && !in_array($this->container['threeDSRequestorChallengeInd'], $allowedValues, true)) { $invalidProperties[] = sprintf( @@ -1234,43 +1202,6 @@ public function setPaymentAuthenticationUseCase($paymentAuthenticationUseCase) return $this; } - /** - * Gets platform - * - * @return string|null - */ - public function getPlatform() - { - return $this->container['platform']; - } - - /** - * Sets platform - * - * @param string|null $platform The platform of the shopper. Allowed values: * `iOS` * `android` * `browser` - * - * @return self - */ - public function setPlatform($platform) - { - if (is_null($platform)) { - throw new \InvalidArgumentException('non-nullable platform cannot be null'); - } - $allowedValues = $this->getPlatformAllowableValues(); - if (!in_array($platform, $allowedValues, true)) { - throw new \InvalidArgumentException( - sprintf( - "Invalid value '%s' for 'platform', must be one of '%s'", - $platform, - implode("', '", $allowedValues) - ) - ); - } - $this->container['platform'] = $platform; - - return $this; - } - /** * Gets purchaseInstalData * @@ -1959,6 +1890,32 @@ public function jsonSerialize() return ObjectSerializer::sanitizeForSerialization($this); } + public function toArray(): array + { + $array = []; + foreach (self::$openAPITypes as $propertyName => $propertyType) { + $propertyValue = $this[$propertyName]; + if ($propertyValue !== null) { + // Check if the property value is an object and has a toArray() method + if (is_object($propertyValue) && method_exists($propertyValue, 'toArray')) { + $array[$propertyName] = $propertyValue->toArray(); + // Check if it's type datetime + } elseif ($propertyValue instanceof \DateTime) { + $array[$propertyName] = $propertyValue->format(DATE_ATOM); + // If it's an array type we should check whether it contains objects and if so call toArray method + } elseif (is_array($propertyValue)) { + $array[$propertyName] = array_map(function ($item) { + return $item instanceof ModelInterface ? $item->toArray() : $item; + }, $propertyValue); + } else { + // Otherwise, directly assign the property value to the array + $array[$propertyName] = $propertyValue; + } + } + } + return $array; + } + /** * Gets the string presentation of the object * diff --git a/src/Adyen/Model/Checkout/ThreeDS2RequestFields.php b/src/Adyen/Model/Checkout/ThreeDS2RequestFields.php index 5b27b90f0..b5dc0fa01 100644 --- a/src/Adyen/Model/Checkout/ThreeDS2RequestFields.php +++ b/src/Adyen/Model/Checkout/ThreeDS2RequestFields.php @@ -5,7 +5,7 @@ * * The version of the OpenAPI document: 71 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 6.0.1 + * OpenAPI Generator version: 6.4.0 * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -60,7 +60,6 @@ class ThreeDS2RequestFields implements ModelInterface, ArrayAccess, \JsonSeriali 'notificationURL' => 'string', 'payTokenInd' => 'bool', 'paymentAuthenticationUseCase' => 'string', - 'platform' => 'string', 'purchaseInstalData' => 'string', 'recurringExpiry' => 'string', 'recurringFrequency' => 'string', @@ -107,7 +106,6 @@ class ThreeDS2RequestFields implements ModelInterface, ArrayAccess, \JsonSeriali 'notificationURL' => null, 'payTokenInd' => null, 'paymentAuthenticationUseCase' => null, - 'platform' => null, 'purchaseInstalData' => null, 'recurringExpiry' => null, 'recurringFrequency' => null, @@ -152,7 +150,6 @@ class ThreeDS2RequestFields implements ModelInterface, ArrayAccess, \JsonSeriali 'notificationURL' => false, 'payTokenInd' => false, 'paymentAuthenticationUseCase' => false, - 'platform' => false, 'purchaseInstalData' => false, 'recurringExpiry' => false, 'recurringFrequency' => false, @@ -277,7 +274,6 @@ public function isNullableSetToNull(string $property): bool 'notificationURL' => 'notificationURL', 'payTokenInd' => 'payTokenInd', 'paymentAuthenticationUseCase' => 'paymentAuthenticationUseCase', - 'platform' => 'platform', 'purchaseInstalData' => 'purchaseInstalData', 'recurringExpiry' => 'recurringExpiry', 'recurringFrequency' => 'recurringFrequency', @@ -322,7 +318,6 @@ public function isNullableSetToNull(string $property): bool 'notificationURL' => 'setNotificationURL', 'payTokenInd' => 'setPayTokenInd', 'paymentAuthenticationUseCase' => 'setPaymentAuthenticationUseCase', - 'platform' => 'setPlatform', 'purchaseInstalData' => 'setPurchaseInstalData', 'recurringExpiry' => 'setRecurringExpiry', 'recurringFrequency' => 'setRecurringFrequency', @@ -367,7 +362,6 @@ public function isNullableSetToNull(string $property): bool 'notificationURL' => 'getNotificationURL', 'payTokenInd' => 'getPayTokenInd', 'paymentAuthenticationUseCase' => 'getPaymentAuthenticationUseCase', - 'platform' => 'getPlatform', 'purchaseInstalData' => 'getPurchaseInstalData', 'recurringExpiry' => 'getRecurringExpiry', 'recurringFrequency' => 'getRecurringFrequency', @@ -440,9 +434,6 @@ public function getModelName() public const CHALLENGE_INDICATOR_REQUEST_NO_CHALLENGE = 'requestNoChallenge'; public const CHALLENGE_INDICATOR_REQUEST_CHALLENGE = 'requestChallenge'; public const CHALLENGE_INDICATOR_REQUEST_CHALLENGE_AS_MANDATE = 'requestChallengeAsMandate'; - public const PLATFORM_I_OS = 'iOS'; - public const PLATFORM_ANDROID = 'android'; - public const PLATFORM_BROWSER = 'browser'; public const THREE_DS_REQUESTOR_CHALLENGE_IND__01 = '01'; public const THREE_DS_REQUESTOR_CHALLENGE_IND__02 = '02'; public const THREE_DS_REQUESTOR_CHALLENGE_IND__03 = '03'; @@ -499,19 +490,6 @@ public function getChallengeIndicatorAllowableValues() self::CHALLENGE_INDICATOR_REQUEST_CHALLENGE_AS_MANDATE, ]; } - /** - * Gets allowable values of the enum - * - * @return string[] - */ - public function getPlatformAllowableValues() - { - return [ - self::PLATFORM_I_OS, - self::PLATFORM_ANDROID, - self::PLATFORM_BROWSER, - ]; - } /** * Gets allowable values of the enum * @@ -589,7 +567,6 @@ public function __construct(array $data = null) $this->setIfExists('notificationURL', $data ?? [], null); $this->setIfExists('payTokenInd', $data ?? [], null); $this->setIfExists('paymentAuthenticationUseCase', $data ?? [], null); - $this->setIfExists('platform', $data ?? [], null); $this->setIfExists('purchaseInstalData', $data ?? [], null); $this->setIfExists('recurringExpiry', $data ?? [], null); $this->setIfExists('recurringFrequency', $data ?? [], null); @@ -666,15 +643,6 @@ public function listInvalidProperties() ); } - $allowedValues = $this->getPlatformAllowableValues(); - if (!is_null($this->container['platform']) && !in_array($this->container['platform'], $allowedValues, true)) { - $invalidProperties[] = sprintf( - "invalid value '%s' for 'platform', must be one of '%s'", - $this->container['platform'], - implode("', '", $allowedValues) - ); - } - $allowedValues = $this->getThreeDSRequestorChallengeIndAllowableValues(); if (!is_null($this->container['threeDSRequestorChallengeInd']) && !in_array($this->container['threeDSRequestorChallengeInd'], $allowedValues, true)) { $invalidProperties[] = sprintf( @@ -1183,43 +1151,6 @@ public function setPaymentAuthenticationUseCase($paymentAuthenticationUseCase) return $this; } - /** - * Gets platform - * - * @return string|null - */ - public function getPlatform() - { - return $this->container['platform']; - } - - /** - * Sets platform - * - * @param string|null $platform The platform of the shopper. Allowed values: * `iOS` * `android` * `browser` - * - * @return self - */ - public function setPlatform($platform) - { - if (is_null($platform)) { - throw new \InvalidArgumentException('non-nullable platform cannot be null'); - } - $allowedValues = $this->getPlatformAllowableValues(); - if (!in_array($platform, $allowedValues, true)) { - throw new \InvalidArgumentException( - sprintf( - "Invalid value '%s' for 'platform', must be one of '%s'", - $platform, - implode("', '", $allowedValues) - ) - ); - } - $this->container['platform'] = $platform; - - return $this; - } - /** * Gets purchaseInstalData * @@ -1854,6 +1785,32 @@ public function jsonSerialize() return ObjectSerializer::sanitizeForSerialization($this); } + public function toArray(): array + { + $array = []; + foreach (self::$openAPITypes as $propertyName => $propertyType) { + $propertyValue = $this[$propertyName]; + if ($propertyValue !== null) { + // Check if the property value is an object and has a toArray() method + if (is_object($propertyValue) && method_exists($propertyValue, 'toArray')) { + $array[$propertyName] = $propertyValue->toArray(); + // Check if it's type datetime + } elseif ($propertyValue instanceof \DateTime) { + $array[$propertyName] = $propertyValue->format(DATE_ATOM); + // If it's an array type we should check whether it contains objects and if so call toArray method + } elseif (is_array($propertyValue)) { + $array[$propertyName] = array_map(function ($item) { + return $item instanceof ModelInterface ? $item->toArray() : $item; + }, $propertyValue); + } else { + // Otherwise, directly assign the property value to the array + $array[$propertyName] = $propertyValue; + } + } + } + return $array; + } + /** * Gets the string presentation of the object * diff --git a/src/Adyen/Model/Checkout/ThreeDS2ResponseData.php b/src/Adyen/Model/Checkout/ThreeDS2ResponseData.php index 3be9cf846..814d2b134 100644 --- a/src/Adyen/Model/Checkout/ThreeDS2ResponseData.php +++ b/src/Adyen/Model/Checkout/ThreeDS2ResponseData.php @@ -5,7 +5,7 @@ * * The version of the OpenAPI document: 71 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 6.0.1 + * OpenAPI Generator version: 6.4.0 * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -981,6 +981,32 @@ public function jsonSerialize() return ObjectSerializer::sanitizeForSerialization($this); } + public function toArray(): array + { + $array = []; + foreach (self::$openAPITypes as $propertyName => $propertyType) { + $propertyValue = $this[$propertyName]; + if ($propertyValue !== null) { + // Check if the property value is an object and has a toArray() method + if (is_object($propertyValue) && method_exists($propertyValue, 'toArray')) { + $array[$propertyName] = $propertyValue->toArray(); + // Check if it's type datetime + } elseif ($propertyValue instanceof \DateTime) { + $array[$propertyName] = $propertyValue->format(DATE_ATOM); + // If it's an array type we should check whether it contains objects and if so call toArray method + } elseif (is_array($propertyValue)) { + $array[$propertyName] = array_map(function ($item) { + return $item instanceof ModelInterface ? $item->toArray() : $item; + }, $propertyValue); + } else { + // Otherwise, directly assign the property value to the array + $array[$propertyName] = $propertyValue; + } + } + } + return $array; + } + /** * Gets the string presentation of the object * diff --git a/src/Adyen/Model/Checkout/ThreeDS2Result.php b/src/Adyen/Model/Checkout/ThreeDS2Result.php index 16b89965a..1816fd270 100644 --- a/src/Adyen/Model/Checkout/ThreeDS2Result.php +++ b/src/Adyen/Model/Checkout/ThreeDS2Result.php @@ -5,7 +5,7 @@ * * The version of the OpenAPI document: 71 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 6.0.1 + * OpenAPI Generator version: 6.4.0 * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -932,6 +932,32 @@ public function jsonSerialize() return ObjectSerializer::sanitizeForSerialization($this); } + public function toArray(): array + { + $array = []; + foreach (self::$openAPITypes as $propertyName => $propertyType) { + $propertyValue = $this[$propertyName]; + if ($propertyValue !== null) { + // Check if the property value is an object and has a toArray() method + if (is_object($propertyValue) && method_exists($propertyValue, 'toArray')) { + $array[$propertyName] = $propertyValue->toArray(); + // Check if it's type datetime + } elseif ($propertyValue instanceof \DateTime) { + $array[$propertyName] = $propertyValue->format(DATE_ATOM); + // If it's an array type we should check whether it contains objects and if so call toArray method + } elseif (is_array($propertyValue)) { + $array[$propertyName] = array_map(function ($item) { + return $item instanceof ModelInterface ? $item->toArray() : $item; + }, $propertyValue); + } else { + // Otherwise, directly assign the property value to the array + $array[$propertyName] = $propertyValue; + } + } + } + return $array; + } + /** * Gets the string presentation of the object * diff --git a/src/Adyen/Model/Checkout/ThreeDSRequestData.php b/src/Adyen/Model/Checkout/ThreeDSRequestData.php index 60218dd46..75877b11a 100644 --- a/src/Adyen/Model/Checkout/ThreeDSRequestData.php +++ b/src/Adyen/Model/Checkout/ThreeDSRequestData.php @@ -5,7 +5,7 @@ * * The version of the OpenAPI document: 71 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 6.0.1 + * OpenAPI Generator version: 6.4.0 * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -607,6 +607,32 @@ public function jsonSerialize() return ObjectSerializer::sanitizeForSerialization($this); } + public function toArray(): array + { + $array = []; + foreach (self::$openAPITypes as $propertyName => $propertyType) { + $propertyValue = $this[$propertyName]; + if ($propertyValue !== null) { + // Check if the property value is an object and has a toArray() method + if (is_object($propertyValue) && method_exists($propertyValue, 'toArray')) { + $array[$propertyName] = $propertyValue->toArray(); + // Check if it's type datetime + } elseif ($propertyValue instanceof \DateTime) { + $array[$propertyName] = $propertyValue->format(DATE_ATOM); + // If it's an array type we should check whether it contains objects and if so call toArray method + } elseif (is_array($propertyValue)) { + $array[$propertyName] = array_map(function ($item) { + return $item instanceof ModelInterface ? $item->toArray() : $item; + }, $propertyValue); + } else { + // Otherwise, directly assign the property value to the array + $array[$propertyName] = $propertyValue; + } + } + } + return $array; + } + /** * Gets the string presentation of the object * diff --git a/src/Adyen/Model/Checkout/ThreeDSRequestorAuthenticationInfo.php b/src/Adyen/Model/Checkout/ThreeDSRequestorAuthenticationInfo.php index 16c5ca5f7..dfd93fbc8 100644 --- a/src/Adyen/Model/Checkout/ThreeDSRequestorAuthenticationInfo.php +++ b/src/Adyen/Model/Checkout/ThreeDSRequestorAuthenticationInfo.php @@ -5,7 +5,7 @@ * * The version of the OpenAPI document: 71 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 6.0.1 + * OpenAPI Generator version: 6.4.0 * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -478,6 +478,32 @@ public function jsonSerialize() return ObjectSerializer::sanitizeForSerialization($this); } + public function toArray(): array + { + $array = []; + foreach (self::$openAPITypes as $propertyName => $propertyType) { + $propertyValue = $this[$propertyName]; + if ($propertyValue !== null) { + // Check if the property value is an object and has a toArray() method + if (is_object($propertyValue) && method_exists($propertyValue, 'toArray')) { + $array[$propertyName] = $propertyValue->toArray(); + // Check if it's type datetime + } elseif ($propertyValue instanceof \DateTime) { + $array[$propertyName] = $propertyValue->format(DATE_ATOM); + // If it's an array type we should check whether it contains objects and if so call toArray method + } elseif (is_array($propertyValue)) { + $array[$propertyName] = array_map(function ($item) { + return $item instanceof ModelInterface ? $item->toArray() : $item; + }, $propertyValue); + } else { + // Otherwise, directly assign the property value to the array + $array[$propertyName] = $propertyValue; + } + } + } + return $array; + } + /** * Gets the string presentation of the object * diff --git a/src/Adyen/Model/Checkout/ThreeDSRequestorPriorAuthenticationInfo.php b/src/Adyen/Model/Checkout/ThreeDSRequestorPriorAuthenticationInfo.php index f4542cb1e..f5f907a99 100644 --- a/src/Adyen/Model/Checkout/ThreeDSRequestorPriorAuthenticationInfo.php +++ b/src/Adyen/Model/Checkout/ThreeDSRequestorPriorAuthenticationInfo.php @@ -5,7 +5,7 @@ * * The version of the OpenAPI document: 71 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 6.0.1 + * OpenAPI Generator version: 6.4.0 * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -508,6 +508,32 @@ public function jsonSerialize() return ObjectSerializer::sanitizeForSerialization($this); } + public function toArray(): array + { + $array = []; + foreach (self::$openAPITypes as $propertyName => $propertyType) { + $propertyValue = $this[$propertyName]; + if ($propertyValue !== null) { + // Check if the property value is an object and has a toArray() method + if (is_object($propertyValue) && method_exists($propertyValue, 'toArray')) { + $array[$propertyName] = $propertyValue->toArray(); + // Check if it's type datetime + } elseif ($propertyValue instanceof \DateTime) { + $array[$propertyName] = $propertyValue->format(DATE_ATOM); + // If it's an array type we should check whether it contains objects and if so call toArray method + } elseif (is_array($propertyValue)) { + $array[$propertyName] = array_map(function ($item) { + return $item instanceof ModelInterface ? $item->toArray() : $item; + }, $propertyValue); + } else { + // Otherwise, directly assign the property value to the array + $array[$propertyName] = $propertyValue; + } + } + } + return $array; + } + /** * Gets the string presentation of the object * diff --git a/src/Adyen/Model/Checkout/ThreeDSecureData.php b/src/Adyen/Model/Checkout/ThreeDSecureData.php index 92d359f3a..b094aa93e 100644 --- a/src/Adyen/Model/Checkout/ThreeDSecureData.php +++ b/src/Adyen/Model/Checkout/ThreeDSecureData.php @@ -5,7 +5,7 @@ * * The version of the OpenAPI document: 71 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 6.0.1 + * OpenAPI Generator version: 6.4.0 * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -868,6 +868,32 @@ public function jsonSerialize() return ObjectSerializer::sanitizeForSerialization($this); } + public function toArray(): array + { + $array = []; + foreach (self::$openAPITypes as $propertyName => $propertyType) { + $propertyValue = $this[$propertyName]; + if ($propertyValue !== null) { + // Check if the property value is an object and has a toArray() method + if (is_object($propertyValue) && method_exists($propertyValue, 'toArray')) { + $array[$propertyName] = $propertyValue->toArray(); + // Check if it's type datetime + } elseif ($propertyValue instanceof \DateTime) { + $array[$propertyName] = $propertyValue->format(DATE_ATOM); + // If it's an array type we should check whether it contains objects and if so call toArray method + } elseif (is_array($propertyValue)) { + $array[$propertyName] = array_map(function ($item) { + return $item instanceof ModelInterface ? $item->toArray() : $item; + }, $propertyValue); + } else { + // Otherwise, directly assign the property value to the array + $array[$propertyName] = $propertyValue; + } + } + } + return $array; + } + /** * Gets the string presentation of the object * diff --git a/src/Adyen/Model/Checkout/UpdatePaymentLinkRequest.php b/src/Adyen/Model/Checkout/UpdatePaymentLinkRequest.php index c964d9637..fd4bbb2a2 100644 --- a/src/Adyen/Model/Checkout/UpdatePaymentLinkRequest.php +++ b/src/Adyen/Model/Checkout/UpdatePaymentLinkRequest.php @@ -5,7 +5,7 @@ * * The version of the OpenAPI document: 71 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 6.0.1 + * OpenAPI Generator version: 6.4.0 * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -403,6 +403,32 @@ public function jsonSerialize() return ObjectSerializer::sanitizeForSerialization($this); } + public function toArray(): array + { + $array = []; + foreach (self::$openAPITypes as $propertyName => $propertyType) { + $propertyValue = $this[$propertyName]; + if ($propertyValue !== null) { + // Check if the property value is an object and has a toArray() method + if (is_object($propertyValue) && method_exists($propertyValue, 'toArray')) { + $array[$propertyName] = $propertyValue->toArray(); + // Check if it's type datetime + } elseif ($propertyValue instanceof \DateTime) { + $array[$propertyName] = $propertyValue->format(DATE_ATOM); + // If it's an array type we should check whether it contains objects and if so call toArray method + } elseif (is_array($propertyValue)) { + $array[$propertyName] = array_map(function ($item) { + return $item instanceof ModelInterface ? $item->toArray() : $item; + }, $propertyValue); + } else { + // Otherwise, directly assign the property value to the array + $array[$propertyName] = $propertyValue; + } + } + } + return $array; + } + /** * Gets the string presentation of the object * diff --git a/src/Adyen/Model/Checkout/UpiCollectDetails.php b/src/Adyen/Model/Checkout/UpiCollectDetails.php index f08fbe296..e30da7837 100644 --- a/src/Adyen/Model/Checkout/UpiCollectDetails.php +++ b/src/Adyen/Model/Checkout/UpiCollectDetails.php @@ -5,7 +5,7 @@ * * The version of the OpenAPI document: 71 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 6.0.1 + * OpenAPI Generator version: 6.4.0 * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -612,6 +612,32 @@ public function jsonSerialize() return ObjectSerializer::sanitizeForSerialization($this); } + public function toArray(): array + { + $array = []; + foreach (self::$openAPITypes as $propertyName => $propertyType) { + $propertyValue = $this[$propertyName]; + if ($propertyValue !== null) { + // Check if the property value is an object and has a toArray() method + if (is_object($propertyValue) && method_exists($propertyValue, 'toArray')) { + $array[$propertyName] = $propertyValue->toArray(); + // Check if it's type datetime + } elseif ($propertyValue instanceof \DateTime) { + $array[$propertyName] = $propertyValue->format(DATE_ATOM); + // If it's an array type we should check whether it contains objects and if so call toArray method + } elseif (is_array($propertyValue)) { + $array[$propertyName] = array_map(function ($item) { + return $item instanceof ModelInterface ? $item->toArray() : $item; + }, $propertyValue); + } else { + // Otherwise, directly assign the property value to the array + $array[$propertyName] = $propertyValue; + } + } + } + return $array; + } + /** * Gets the string presentation of the object * diff --git a/src/Adyen/Model/Checkout/UpiIntentDetails.php b/src/Adyen/Model/Checkout/UpiIntentDetails.php index 581194e81..7d102001c 100644 --- a/src/Adyen/Model/Checkout/UpiIntentDetails.php +++ b/src/Adyen/Model/Checkout/UpiIntentDetails.php @@ -5,7 +5,7 @@ * * The version of the OpenAPI document: 71 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 6.0.1 + * OpenAPI Generator version: 6.4.0 * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -541,6 +541,32 @@ public function jsonSerialize() return ObjectSerializer::sanitizeForSerialization($this); } + public function toArray(): array + { + $array = []; + foreach (self::$openAPITypes as $propertyName => $propertyType) { + $propertyValue = $this[$propertyName]; + if ($propertyValue !== null) { + // Check if the property value is an object and has a toArray() method + if (is_object($propertyValue) && method_exists($propertyValue, 'toArray')) { + $array[$propertyName] = $propertyValue->toArray(); + // Check if it's type datetime + } elseif ($propertyValue instanceof \DateTime) { + $array[$propertyName] = $propertyValue->format(DATE_ATOM); + // If it's an array type we should check whether it contains objects and if so call toArray method + } elseif (is_array($propertyValue)) { + $array[$propertyName] = array_map(function ($item) { + return $item instanceof ModelInterface ? $item->toArray() : $item; + }, $propertyValue); + } else { + // Otherwise, directly assign the property value to the array + $array[$propertyName] = $propertyValue; + } + } + } + return $array; + } + /** * Gets the string presentation of the object * diff --git a/src/Adyen/Model/Checkout/UtilityRequest.php b/src/Adyen/Model/Checkout/UtilityRequest.php index 251892a1c..7779c2e39 100644 --- a/src/Adyen/Model/Checkout/UtilityRequest.php +++ b/src/Adyen/Model/Checkout/UtilityRequest.php @@ -5,7 +5,7 @@ * * The version of the OpenAPI document: 71 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 6.0.1 + * OpenAPI Generator version: 6.4.0 * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -372,6 +372,32 @@ public function jsonSerialize() return ObjectSerializer::sanitizeForSerialization($this); } + public function toArray(): array + { + $array = []; + foreach (self::$openAPITypes as $propertyName => $propertyType) { + $propertyValue = $this[$propertyName]; + if ($propertyValue !== null) { + // Check if the property value is an object and has a toArray() method + if (is_object($propertyValue) && method_exists($propertyValue, 'toArray')) { + $array[$propertyName] = $propertyValue->toArray(); + // Check if it's type datetime + } elseif ($propertyValue instanceof \DateTime) { + $array[$propertyName] = $propertyValue->format(DATE_ATOM); + // If it's an array type we should check whether it contains objects and if so call toArray method + } elseif (is_array($propertyValue)) { + $array[$propertyName] = array_map(function ($item) { + return $item instanceof ModelInterface ? $item->toArray() : $item; + }, $propertyValue); + } else { + // Otherwise, directly assign the property value to the array + $array[$propertyName] = $propertyValue; + } + } + } + return $array; + } + /** * Gets the string presentation of the object * diff --git a/src/Adyen/Model/Checkout/UtilityResponse.php b/src/Adyen/Model/Checkout/UtilityResponse.php index 327cdeb14..471b73471 100644 --- a/src/Adyen/Model/Checkout/UtilityResponse.php +++ b/src/Adyen/Model/Checkout/UtilityResponse.php @@ -5,7 +5,7 @@ * * The version of the OpenAPI document: 71 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 6.0.1 + * OpenAPI Generator version: 6.4.0 * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -369,6 +369,32 @@ public function jsonSerialize() return ObjectSerializer::sanitizeForSerialization($this); } + public function toArray(): array + { + $array = []; + foreach (self::$openAPITypes as $propertyName => $propertyType) { + $propertyValue = $this[$propertyName]; + if ($propertyValue !== null) { + // Check if the property value is an object and has a toArray() method + if (is_object($propertyValue) && method_exists($propertyValue, 'toArray')) { + $array[$propertyName] = $propertyValue->toArray(); + // Check if it's type datetime + } elseif ($propertyValue instanceof \DateTime) { + $array[$propertyName] = $propertyValue->format(DATE_ATOM); + // If it's an array type we should check whether it contains objects and if so call toArray method + } elseif (is_array($propertyValue)) { + $array[$propertyName] = array_map(function ($item) { + return $item instanceof ModelInterface ? $item->toArray() : $item; + }, $propertyValue); + } else { + // Otherwise, directly assign the property value to the array + $array[$propertyName] = $propertyValue; + } + } + } + return $array; + } + /** * Gets the string presentation of the object * diff --git a/src/Adyen/Model/Checkout/VippsDetails.php b/src/Adyen/Model/Checkout/VippsDetails.php index 11f7d5e88..349bf169a 100644 --- a/src/Adyen/Model/Checkout/VippsDetails.php +++ b/src/Adyen/Model/Checkout/VippsDetails.php @@ -5,7 +5,7 @@ * * The version of the OpenAPI document: 71 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 6.0.1 + * OpenAPI Generator version: 6.4.0 * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -424,7 +424,7 @@ public function getTelephoneNumber() /** * Sets telephoneNumber * - * @param string $telephoneNumber + * @param string $telephoneNumber * * @return self */ @@ -541,6 +541,32 @@ public function jsonSerialize() return ObjectSerializer::sanitizeForSerialization($this); } + public function toArray(): array + { + $array = []; + foreach (self::$openAPITypes as $propertyName => $propertyType) { + $propertyValue = $this[$propertyName]; + if ($propertyValue !== null) { + // Check if the property value is an object and has a toArray() method + if (is_object($propertyValue) && method_exists($propertyValue, 'toArray')) { + $array[$propertyName] = $propertyValue->toArray(); + // Check if it's type datetime + } elseif ($propertyValue instanceof \DateTime) { + $array[$propertyName] = $propertyValue->format(DATE_ATOM); + // If it's an array type we should check whether it contains objects and if so call toArray method + } elseif (is_array($propertyValue)) { + $array[$propertyName] = array_map(function ($item) { + return $item instanceof ModelInterface ? $item->toArray() : $item; + }, $propertyValue); + } else { + // Otherwise, directly assign the property value to the array + $array[$propertyName] = $propertyValue; + } + } + } + return $array; + } + /** * Gets the string presentation of the object * diff --git a/src/Adyen/Model/Checkout/VisaCheckoutDetails.php b/src/Adyen/Model/Checkout/VisaCheckoutDetails.php index cb794ea8a..527280fc8 100644 --- a/src/Adyen/Model/Checkout/VisaCheckoutDetails.php +++ b/src/Adyen/Model/Checkout/VisaCheckoutDetails.php @@ -5,7 +5,7 @@ * * The version of the OpenAPI document: 71 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 6.0.1 + * OpenAPI Generator version: 6.4.0 * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -233,7 +233,6 @@ public function getModelName() return self::$openAPIModelName; } - public const FUNDING_SOURCE_CREDIT = 'credit'; public const FUNDING_SOURCE_DEBIT = 'debit'; public const TYPE_VISACHECKOUT = 'visacheckout'; @@ -245,7 +244,6 @@ public function getModelName() public function getFundingSourceAllowableValues() { return [ - self::FUNDING_SOURCE_CREDIT, self::FUNDING_SOURCE_DEBIT, ]; } @@ -538,6 +536,32 @@ public function jsonSerialize() return ObjectSerializer::sanitizeForSerialization($this); } + public function toArray(): array + { + $array = []; + foreach (self::$openAPITypes as $propertyName => $propertyType) { + $propertyValue = $this[$propertyName]; + if ($propertyValue !== null) { + // Check if the property value is an object and has a toArray() method + if (is_object($propertyValue) && method_exists($propertyValue, 'toArray')) { + $array[$propertyName] = $propertyValue->toArray(); + // Check if it's type datetime + } elseif ($propertyValue instanceof \DateTime) { + $array[$propertyName] = $propertyValue->format(DATE_ATOM); + // If it's an array type we should check whether it contains objects and if so call toArray method + } elseif (is_array($propertyValue)) { + $array[$propertyName] = array_map(function ($item) { + return $item instanceof ModelInterface ? $item->toArray() : $item; + }, $propertyValue); + } else { + // Otherwise, directly assign the property value to the array + $array[$propertyName] = $propertyValue; + } + } + } + return $array; + } + /** * Gets the string presentation of the object * diff --git a/src/Adyen/Model/Checkout/WeChatPayDetails.php b/src/Adyen/Model/Checkout/WeChatPayDetails.php index 9acbd8a03..2d98f3caf 100644 --- a/src/Adyen/Model/Checkout/WeChatPayDetails.php +++ b/src/Adyen/Model/Checkout/WeChatPayDetails.php @@ -5,7 +5,7 @@ * * The version of the OpenAPI document: 71 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 6.0.1 + * OpenAPI Generator version: 6.4.0 * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -436,6 +436,32 @@ public function jsonSerialize() return ObjectSerializer::sanitizeForSerialization($this); } + public function toArray(): array + { + $array = []; + foreach (self::$openAPITypes as $propertyName => $propertyType) { + $propertyValue = $this[$propertyName]; + if ($propertyValue !== null) { + // Check if the property value is an object and has a toArray() method + if (is_object($propertyValue) && method_exists($propertyValue, 'toArray')) { + $array[$propertyName] = $propertyValue->toArray(); + // Check if it's type datetime + } elseif ($propertyValue instanceof \DateTime) { + $array[$propertyName] = $propertyValue->format(DATE_ATOM); + // If it's an array type we should check whether it contains objects and if so call toArray method + } elseif (is_array($propertyValue)) { + $array[$propertyName] = array_map(function ($item) { + return $item instanceof ModelInterface ? $item->toArray() : $item; + }, $propertyValue); + } else { + // Otherwise, directly assign the property value to the array + $array[$propertyName] = $propertyValue; + } + } + } + return $array; + } + /** * Gets the string presentation of the object * diff --git a/src/Adyen/Model/Checkout/WeChatPayMiniProgramDetails.php b/src/Adyen/Model/Checkout/WeChatPayMiniProgramDetails.php index da7eb46cf..bed02e9b2 100644 --- a/src/Adyen/Model/Checkout/WeChatPayMiniProgramDetails.php +++ b/src/Adyen/Model/Checkout/WeChatPayMiniProgramDetails.php @@ -5,7 +5,7 @@ * * The version of the OpenAPI document: 71 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 6.0.1 + * OpenAPI Generator version: 6.4.0 * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -502,6 +502,32 @@ public function jsonSerialize() return ObjectSerializer::sanitizeForSerialization($this); } + public function toArray(): array + { + $array = []; + foreach (self::$openAPITypes as $propertyName => $propertyType) { + $propertyValue = $this[$propertyName]; + if ($propertyValue !== null) { + // Check if the property value is an object and has a toArray() method + if (is_object($propertyValue) && method_exists($propertyValue, 'toArray')) { + $array[$propertyName] = $propertyValue->toArray(); + // Check if it's type datetime + } elseif ($propertyValue instanceof \DateTime) { + $array[$propertyName] = $propertyValue->format(DATE_ATOM); + // If it's an array type we should check whether it contains objects and if so call toArray method + } elseif (is_array($propertyValue)) { + $array[$propertyName] = array_map(function ($item) { + return $item instanceof ModelInterface ? $item->toArray() : $item; + }, $propertyValue); + } else { + // Otherwise, directly assign the property value to the array + $array[$propertyName] = $propertyValue; + } + } + } + return $array; + } + /** * Gets the string presentation of the object * diff --git a/src/Adyen/Model/Checkout/ZipDetails.php b/src/Adyen/Model/Checkout/ZipDetails.php index bb98e95ed..b84b68f42 100644 --- a/src/Adyen/Model/Checkout/ZipDetails.php +++ b/src/Adyen/Model/Checkout/ZipDetails.php @@ -5,7 +5,7 @@ * * The version of the OpenAPI document: 71 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 6.0.1 + * OpenAPI Generator version: 6.4.0 * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -540,6 +540,32 @@ public function jsonSerialize() return ObjectSerializer::sanitizeForSerialization($this); } + public function toArray(): array + { + $array = []; + foreach (self::$openAPITypes as $propertyName => $propertyType) { + $propertyValue = $this[$propertyName]; + if ($propertyValue !== null) { + // Check if the property value is an object and has a toArray() method + if (is_object($propertyValue) && method_exists($propertyValue, 'toArray')) { + $array[$propertyName] = $propertyValue->toArray(); + // Check if it's type datetime + } elseif ($propertyValue instanceof \DateTime) { + $array[$propertyName] = $propertyValue->format(DATE_ATOM); + // If it's an array type we should check whether it contains objects and if so call toArray method + } elseif (is_array($propertyValue)) { + $array[$propertyName] = array_map(function ($item) { + return $item instanceof ModelInterface ? $item->toArray() : $item; + }, $propertyValue); + } else { + // Otherwise, directly assign the property value to the array + $array[$propertyName] = $propertyValue; + } + } + } + return $array; + } + /** * Gets the string presentation of the object * diff --git a/templates/model_generic.mustache b/templates/model_generic.mustache index 3aec550e0..732842f13 100644 --- a/templates/model_generic.mustache +++ b/templates/model_generic.mustache @@ -468,6 +468,32 @@ class {{classname}} {{#parentSchema}}extends {{{parent}}}{{/parentSchema}}{{^par return ObjectSerializer::sanitizeForSerialization($this); } + public function toArray(): array + { + $array = []; + foreach (self::$openAPITypes as $propertyName => $propertyType) { + $propertyValue = $this[$propertyName]; + if ($propertyValue !== null) { + // Check if the property value is an object and has a toArray() method + if (is_object($propertyValue) && method_exists($propertyValue, 'toArray')) { + $array[$propertyName] = $propertyValue->toArray(); + // Check if it's type datetime + } elseif ($propertyValue instanceof \DateTime) { + $array[$propertyName] = $propertyValue->format(DATE_ATOM); + // If it's an array type we should check whether it contains objects and if so call toArray method + } elseif (is_array($propertyValue)) { + $array[$propertyName] = array_map(function ($item) { + return $item instanceof ModelInterface ? $item->toArray() : $item; + }, $propertyValue); + } else { + // Otherwise, directly assign the property value to the array + $array[$propertyName] = $propertyValue; + } + } + } + return $array; + } + /** * Gets the string presentation of the object * diff --git a/tests/Unit/ModelBasedCheckoutTest.php b/tests/Unit/ModelBasedCheckoutTest.php index 822db968c..68f46b37a 100644 --- a/tests/Unit/ModelBasedCheckoutTest.php +++ b/tests/Unit/ModelBasedCheckoutTest.php @@ -49,6 +49,30 @@ public static function successPaymentMethodsProvider() ); } + /** + * @dataProvider successPaymentMethodsProvider + */ + public function testToArrayMethod($jsonFile, $httpStatus) + { + // create Checkout client + $client = $this->createMockClient($jsonFile, $httpStatus); + $service = new \Adyen\Service\Checkout\PaymentsApi($client); + $result = $service->paymentMethods(new PaymentMethodsRequest(null)); + + // first function calling to Array + $func1 = function () use ($result) { + return $result->toArray(); + }; + // second function calling to json encode + decode + $func2 = function () use ($result) { + return json_decode(json_encode($result->jsonSerialize()), true); + }; + // Assert our to array function is faster + $this->assertTrue($this->calculateRunTime($func1) < $this->calculateRunTime($func2)); + // And assert that the result is equal to a deep json encode/decode + $this->assertEquals($result->toArray(), json_decode(json_encode($result->jsonSerialize()), true)); + } + /** * @dataProvider successPaymentsProvider */ diff --git a/tests/Unit/TestCaseMock.php b/tests/Unit/TestCaseMock.php index e7c7a3b0e..19a8f5094 100644 --- a/tests/Unit/TestCaseMock.php +++ b/tests/Unit/TestCaseMock.php @@ -104,4 +104,13 @@ protected function createMockClientUrl($jsonFile, $environment = Environment::TE $client->setHttpClient($curlClient); return $client; } + + // Method for testing the effective time it cost to run a method + public function calculateRunTime($callback) + { + $startA = microtime(true); + $callback(); + $endA = microtime(true); + return $endA - $startA; + } } From 11749017969c723af9fe2753a2ba1120ad327318 Mon Sep 17 00:00:00 2001 From: jilling Date: Mon, 19 Feb 2024 12:57:15 +0100 Subject: [PATCH 2/2] phpcbf --- src/Adyen/Model/Checkout/CheckoutPaymentMethod.php | 4 ++-- src/Adyen/Model/Checkout/MbwayDetails.php | 4 ++-- src/Adyen/Model/Checkout/ObjectSerializer.php | 9 +++++---- src/Adyen/Model/Checkout/VippsDetails.php | 2 +- 4 files changed, 10 insertions(+), 9 deletions(-) diff --git a/src/Adyen/Model/Checkout/CheckoutPaymentMethod.php b/src/Adyen/Model/Checkout/CheckoutPaymentMethod.php index 6cf4a44e5..a89cbd5ed 100644 --- a/src/Adyen/Model/Checkout/CheckoutPaymentMethod.php +++ b/src/Adyen/Model/Checkout/CheckoutPaymentMethod.php @@ -1644,7 +1644,7 @@ public function getShopperEmail() /** * Sets shopperEmail * - * @param string $shopperEmail + * @param string $shopperEmail * * @return self */ @@ -1671,7 +1671,7 @@ public function getTelephoneNumber() /** * Sets telephoneNumber * - * @param string $telephoneNumber + * @param string $telephoneNumber * * @return self */ diff --git a/src/Adyen/Model/Checkout/MbwayDetails.php b/src/Adyen/Model/Checkout/MbwayDetails.php index dea25486e..40b1ecd69 100644 --- a/src/Adyen/Model/Checkout/MbwayDetails.php +++ b/src/Adyen/Model/Checkout/MbwayDetails.php @@ -364,7 +364,7 @@ public function getShopperEmail() /** * Sets shopperEmail * - * @param string $shopperEmail + * @param string $shopperEmail * * @return self */ @@ -391,7 +391,7 @@ public function getTelephoneNumber() /** * Sets telephoneNumber * - * @param string $telephoneNumber + * @param string $telephoneNumber * * @return self */ diff --git a/src/Adyen/Model/Checkout/ObjectSerializer.php b/src/Adyen/Model/Checkout/ObjectSerializer.php index af2506e25..29dd654c7 100644 --- a/src/Adyen/Model/Checkout/ObjectSerializer.php +++ b/src/Adyen/Model/Checkout/ObjectSerializer.php @@ -81,7 +81,7 @@ public static function sanitizeForSerialization($data, $type = null, $format = n } } } else { - foreach($data as $property => $value) { + foreach ($data as $property => $value) { $values[$property] = self::sanitizeForSerialization($value); } } @@ -117,7 +117,9 @@ public static function sanitizeFilename($filename) */ public static function sanitizeTimestamp($timestamp) { - if (!is_string($timestamp)) return $timestamp; + if (!is_string($timestamp)) { + return $timestamp; + } return preg_replace('/(:\d{2}.\d{6})\d*/', '$1', $timestamp); } @@ -240,8 +242,7 @@ public static function deserialize($data, $class, $httpHeaders = null) /** @var \Psr\Http\Message\StreamInterface $data */ // determine file name - if ( - is_array($httpHeaders) + if (is_array($httpHeaders) && array_key_exists('Content-Disposition', $httpHeaders) && preg_match('/inline; filename=[\'"]?([^\'"\s]+)[\'"]?$/i', $httpHeaders['Content-Disposition'], $match) ) { diff --git a/src/Adyen/Model/Checkout/VippsDetails.php b/src/Adyen/Model/Checkout/VippsDetails.php index 349bf169a..620d0cb87 100644 --- a/src/Adyen/Model/Checkout/VippsDetails.php +++ b/src/Adyen/Model/Checkout/VippsDetails.php @@ -424,7 +424,7 @@ public function getTelephoneNumber() /** * Sets telephoneNumber * - * @param string $telephoneNumber + * @param string $telephoneNumber * * @return self */