From a55dc9d93f38e8394a6cf316b58442be3f083abf Mon Sep 17 00:00:00 2001 From: Robert Schulze Dieckhoff Date: Wed, 5 Feb 2025 10:20:59 +0100 Subject: [PATCH] Updated pigeon and set minimum SDK version to Flutter 3.16/Dart 3.2 --- .github/workflows/ios_clean_build.yml | 2 +- .../checkout/flutter/CheckoutPlatformApi.kt | 4 +- .../com/adyen/checkout/flutter/PlatformApi.kt | 1906 +++----- .../flutter/apiOnly/CardValidation.kt | 22 +- .../components/ComponentPlatformApi.kt | 8 +- .../action/ActionComponentCallback.kt | 6 +- .../base/ComponentAdvancedCallback.kt | 6 +- .../base/ComponentSessionCallback.kt | 2 +- .../googlepay/GooglePayAdvancedCallback.kt | 2 +- .../googlepay/GooglePayComponentManager.kt | 2 +- .../IdealComponentAdvancedCallback.kt | 2 +- .../InstantComponentAdvancedCallback.kt | 2 +- .../flutter/dropIn/DropInPlatformApi.kt | 16 +- .../flutter/utils/ConfigurationMapper.kt | 8 +- ios/Classes/PlatformApi.swift | 4156 ++++++++--------- lib/src/components/component_flutter_api.dart | 4 +- lib/src/drop_in/drop_in.dart | 2 +- lib/src/generated/platform_api.g.dart | 1351 ++---- pubspec.yaml | 9 +- 19 files changed, 3125 insertions(+), 4385 deletions(-) diff --git a/.github/workflows/ios_clean_build.yml b/.github/workflows/ios_clean_build.yml index e3a0597a..146b22e1 100644 --- a/.github/workflows/ios_clean_build.yml +++ b/.github/workflows/ios_clean_build.yml @@ -10,7 +10,7 @@ jobs: strategy: matrix: iPhone: [ "'iPhone 15'" ] - flutter-version: [ 3.19.x, 3.22.x, 3.24.x, 3.27.x ] + flutter-version: [ 3.16.x, 3.19.x, 3.22.x, 3.24.x, 3.27.x ] steps: - name: Provide more disk space diff --git a/android/src/main/kotlin/com/adyen/checkout/flutter/CheckoutPlatformApi.kt b/android/src/main/kotlin/com/adyen/checkout/flutter/CheckoutPlatformApi.kt index 91ab7299..b297bfe5 100644 --- a/android/src/main/kotlin/com/adyen/checkout/flutter/CheckoutPlatformApi.kt +++ b/android/src/main/kotlin/com/adyen/checkout/flutter/CheckoutPlatformApi.kt @@ -122,8 +122,8 @@ class CheckoutPlatformApi( is InstantPaymentConfigurationDTO -> { return when (configuration.instantPaymentType) { - InstantPaymentType.APPLEPAY -> throw IllegalStateException("Apple Pay is not supported on Android.") - InstantPaymentType.GOOGLEPAY -> configuration.mapToCheckoutConfiguration() + InstantPaymentType.APPLE_PAY -> throw IllegalStateException("Apple Pay is not supported on Android.") + InstantPaymentType.GOOGLE_PAY -> configuration.mapToCheckoutConfiguration() InstantPaymentType.INSTANT -> configuration.mapToCheckoutConfiguration() } } diff --git a/android/src/main/kotlin/com/adyen/checkout/flutter/PlatformApi.kt b/android/src/main/kotlin/com/adyen/checkout/flutter/PlatformApi.kt index b215f8b9..91888a7c 100644 --- a/android/src/main/kotlin/com/adyen/checkout/flutter/PlatformApi.kt +++ b/android/src/main/kotlin/com/adyen/checkout/flutter/PlatformApi.kt @@ -1,5 +1,6 @@ -// Autogenerated from Pigeon (v16.0.5), do not edit directly. +// Autogenerated from Pigeon (v21.1.0), do not edit directly. // See also: https://pub.dev/packages/pigeon +@file:Suppress("UNCHECKED_CAST", "ArrayInDataClass") import android.util.Log @@ -15,14 +16,14 @@ private fun wrapResult(result: Any?): List { } private fun wrapError(exception: Throwable): List { - if (exception is AdyenPigeonError) { - return listOf( + return if (exception is AdyenPigeonError) { + listOf( exception.code, exception.message, exception.details ) } else { - return listOf( + listOf( exception.javaClass.simpleName, exception.toString(), "Cause: " + exception.cause + ", Stacktrace: " + Log.getStackTraceString(exception) @@ -48,7 +49,7 @@ class AdyenPigeonError ( enum class Environment(val raw: Int) { TEST(0), EUROPE(1), - UNITEDSTATES(2), + UNITED_STATES(2), AUSTRALIA(3), INDIA(4), APSE(5); @@ -62,7 +63,7 @@ enum class Environment(val raw: Int) { enum class AddressMode(val raw: Int) { FULL(0), - POSTALCODE(1), + POSTAL_CODE(1), NONE(2); companion object { @@ -73,7 +74,7 @@ enum class AddressMode(val raw: Int) { } enum class CardAuthMethod(val raw: Int) { - PANONLY(0), + PAN_ONLY(0), CRYPTOGRAM3DS(1); companion object { @@ -84,9 +85,9 @@ enum class CardAuthMethod(val raw: Int) { } enum class TotalPriceStatus(val raw: Int) { - NOTCURRENTLYKNOWN(0), + NOT_CURRENTLY_KNOWN(0), ESTIMATED(1), - FINALPRICE(2); + FINAL_PRICE(2); companion object { fun ofRaw(raw: Int): TotalPriceStatus? { @@ -118,7 +119,7 @@ enum class CashAppPayEnvironment(val raw: Int) { } enum class PaymentResultEnum(val raw: Int) { - CANCELLEDBYUSER(0), + CANCELLED_BY_USER(0), ERROR(1), FINISHED(2); @@ -130,13 +131,13 @@ enum class PaymentResultEnum(val raw: Int) { } enum class PlatformCommunicationType(val raw: Int) { - PAYMENTCOMPONENT(0), - ADDITIONALDETAILS(1), + PAYMENT_COMPONENT(0), + ADDITIONAL_DETAILS(1), RESULT(2), - DELETESTOREDPAYMENTMETHOD(3), - BALANCECHECK(4), - REQUESTORDER(5), - CANCELORDER(6); + DELETE_STORED_PAYMENT_METHOD(3), + BALANCE_CHECK(4), + REQUEST_ORDER(5), + CANCEL_ORDER(6); companion object { fun ofRaw(raw: Int): PlatformCommunicationType? { @@ -146,8 +147,8 @@ enum class PlatformCommunicationType(val raw: Int) { } enum class ComponentCommunicationType(val raw: Int) { - ONSUBMIT(0), - ADDITIONALDETAILS(1), + ON_SUBMIT(0), + ADDITIONAL_DETAILS(1), LOADING(2), RESULT(3), RESIZE(4); @@ -184,8 +185,8 @@ enum class FieldVisibility(val raw: Int) { } enum class InstantPaymentType(val raw: Int) { - GOOGLEPAY(0), - APPLEPAY(1), + GOOGLE_PAY(0), + APPLE_PAY(1), INSTANT(2); companion object { @@ -198,8 +199,8 @@ enum class InstantPaymentType(val raw: Int) { enum class ApplePayShippingType(val raw: Int) { SHIPPING(0), DELIVERY(1), - STOREPICKUP(2), - SERVICEPICKUP(3); + STORE_PICKUP(2), + SERVICE_PICKUP(3); companion object { fun ofRaw(raw: Int): ApplePayShippingType? { @@ -232,11 +233,11 @@ enum class ApplePaySummaryItemType(val raw: Int) { enum class CardNumberValidationResultDTO(val raw: Int) { VALID(0), - INVALIDILLEGALCHARACTERS(1), - INVALIDLUHNCHECK(2), - INVALIDTOOSHORT(3), - INVALIDTOOLONG(4), - INVALIDOTHERREASON(5); + INVALID_ILLEGAL_CHARACTERS(1), + INVALID_LUHN_CHECK(2), + INVALID_TOO_SHORT(3), + INVALID_TOO_LONG(4), + INVALID_OTHER_REASON(5); companion object { fun ofRaw(raw: Int): CardNumberValidationResultDTO? { @@ -247,10 +248,10 @@ enum class CardNumberValidationResultDTO(val raw: Int) { enum class CardExpiryDateValidationResultDTO(val raw: Int) { VALID(0), - INVALIDTOOFARINTHEFUTURE(1), - INVALIDTOOOLD(2), - NONPARSEABLEDATE(3), - INVALIDOTHERREASON(4); + INVALID_TOO_FAR_IN_THE_FUTURE(1), + INVALID_TOO_OLD(2), + NON_PARSEABLE_DATE(3), + INVALID_OTHER_REASON(4); companion object { fun ofRaw(raw: Int): CardExpiryDateValidationResultDTO? { @@ -278,16 +279,16 @@ data class SessionDTO ( ) { companion object { - @Suppress("UNCHECKED_CAST") - fun fromList(list: List): SessionDTO { - val id = list[0] as String - val sessionData = list[1] as String - val paymentMethodsJson = list[2] as String + @Suppress("LocalVariableName") + fun fromList(__pigeon_list: List): SessionDTO { + val id = __pigeon_list[0] as String + val sessionData = __pigeon_list[1] as String + val paymentMethodsJson = __pigeon_list[2] as String return SessionDTO(id, sessionData, paymentMethodsJson) } } fun toList(): List { - return listOf( + return listOf( id, sessionData, paymentMethodsJson, @@ -302,15 +303,15 @@ data class AmountDTO ( ) { companion object { - @Suppress("UNCHECKED_CAST") - fun fromList(list: List): AmountDTO { - val currency = list[0] as String - val value = list[1].let { if (it is Int) it.toLong() else it as Long } + @Suppress("LocalVariableName") + fun fromList(__pigeon_list: List): AmountDTO { + val currency = __pigeon_list[0] as String + val value = __pigeon_list[1].let { num -> if (num is Int) num.toLong() else num as Long } return AmountDTO(currency, value) } } fun toList(): List { - return listOf( + return listOf( currency, value, ) @@ -324,15 +325,15 @@ data class AnalyticsOptionsDTO ( ) { companion object { - @Suppress("UNCHECKED_CAST") - fun fromList(list: List): AnalyticsOptionsDTO { - val enabled = list[0] as Boolean - val version = list[1] as String + @Suppress("LocalVariableName") + fun fromList(__pigeon_list: List): AnalyticsOptionsDTO { + val enabled = __pigeon_list[0] as Boolean + val version = __pigeon_list[1] as String return AnalyticsOptionsDTO(enabled, version) } } fun toList(): List { - return listOf( + return listOf( enabled, version, ) @@ -360,49 +361,39 @@ data class DropInConfigurationDTO ( ) { companion object { - @Suppress("UNCHECKED_CAST") - fun fromList(list: List): DropInConfigurationDTO { - val environment = Environment.ofRaw(list[0] as Int)!! - val clientKey = list[1] as String - val countryCode = list[2] as String - val amount: AmountDTO? = (list[3] as List?)?.let { - AmountDTO.fromList(it) - } - val shopperLocale = list[4] as String? - val cardConfigurationDTO: CardConfigurationDTO? = (list[5] as List?)?.let { - CardConfigurationDTO.fromList(it) - } - val applePayConfigurationDTO: ApplePayConfigurationDTO? = (list[6] as List?)?.let { - ApplePayConfigurationDTO.fromList(it) - } - val googlePayConfigurationDTO: GooglePayConfigurationDTO? = (list[7] as List?)?.let { - GooglePayConfigurationDTO.fromList(it) - } - val cashAppPayConfigurationDTO: CashAppPayConfigurationDTO? = (list[8] as List?)?.let { - CashAppPayConfigurationDTO.fromList(it) - } - val analyticsOptionsDTO = AnalyticsOptionsDTO.fromList(list[9] as List) - val showPreselectedStoredPaymentMethod = list[10] as Boolean - val skipListWhenSinglePaymentMethod = list[11] as Boolean - val isRemoveStoredPaymentMethodEnabled = list[12] as Boolean - val preselectedPaymentMethodTitle = list[13] as String? - val paymentMethodNames = list[14] as Map? - val isPartialPaymentSupported = list[15] as Boolean + @Suppress("LocalVariableName") + fun fromList(__pigeon_list: List): DropInConfigurationDTO { + val environment = __pigeon_list[0] as Environment + val clientKey = __pigeon_list[1] as String + val countryCode = __pigeon_list[2] as String + val amount = __pigeon_list[3] as AmountDTO? + val shopperLocale = __pigeon_list[4] as String? + val cardConfigurationDTO = __pigeon_list[5] as CardConfigurationDTO? + val applePayConfigurationDTO = __pigeon_list[6] as ApplePayConfigurationDTO? + val googlePayConfigurationDTO = __pigeon_list[7] as GooglePayConfigurationDTO? + val cashAppPayConfigurationDTO = __pigeon_list[8] as CashAppPayConfigurationDTO? + val analyticsOptionsDTO = __pigeon_list[9] as AnalyticsOptionsDTO + val showPreselectedStoredPaymentMethod = __pigeon_list[10] as Boolean + val skipListWhenSinglePaymentMethod = __pigeon_list[11] as Boolean + val isRemoveStoredPaymentMethodEnabled = __pigeon_list[12] as Boolean + val preselectedPaymentMethodTitle = __pigeon_list[13] as String? + val paymentMethodNames = __pigeon_list[14] as Map? + val isPartialPaymentSupported = __pigeon_list[15] as Boolean return DropInConfigurationDTO(environment, clientKey, countryCode, amount, shopperLocale, cardConfigurationDTO, applePayConfigurationDTO, googlePayConfigurationDTO, cashAppPayConfigurationDTO, analyticsOptionsDTO, showPreselectedStoredPaymentMethod, skipListWhenSinglePaymentMethod, isRemoveStoredPaymentMethodEnabled, preselectedPaymentMethodTitle, paymentMethodNames, isPartialPaymentSupported) } } fun toList(): List { - return listOf( - environment.raw, + return listOf( + environment, clientKey, countryCode, - amount?.toList(), + amount, shopperLocale, - cardConfigurationDTO?.toList(), - applePayConfigurationDTO?.toList(), - googlePayConfigurationDTO?.toList(), - cashAppPayConfigurationDTO?.toList(), - analyticsOptionsDTO.toList(), + cardConfigurationDTO, + applePayConfigurationDTO, + googlePayConfigurationDTO, + cashAppPayConfigurationDTO, + analyticsOptionsDTO, showPreselectedStoredPaymentMethod, skipListWhenSinglePaymentMethod, isRemoveStoredPaymentMethodEnabled, @@ -426,28 +417,28 @@ data class CardConfigurationDTO ( ) { companion object { - @Suppress("UNCHECKED_CAST") - fun fromList(list: List): CardConfigurationDTO { - val holderNameRequired = list[0] as Boolean - val addressMode = AddressMode.ofRaw(list[1] as Int)!! - val showStorePaymentField = list[2] as Boolean - val showCvcForStoredCard = list[3] as Boolean - val showCvc = list[4] as Boolean - val kcpFieldVisibility = FieldVisibility.ofRaw(list[5] as Int)!! - val socialSecurityNumberFieldVisibility = FieldVisibility.ofRaw(list[6] as Int)!! - val supportedCardTypes = list[7] as List + @Suppress("LocalVariableName") + fun fromList(__pigeon_list: List): CardConfigurationDTO { + val holderNameRequired = __pigeon_list[0] as Boolean + val addressMode = __pigeon_list[1] as AddressMode + val showStorePaymentField = __pigeon_list[2] as Boolean + val showCvcForStoredCard = __pigeon_list[3] as Boolean + val showCvc = __pigeon_list[4] as Boolean + val kcpFieldVisibility = __pigeon_list[5] as FieldVisibility + val socialSecurityNumberFieldVisibility = __pigeon_list[6] as FieldVisibility + val supportedCardTypes = __pigeon_list[7] as List return CardConfigurationDTO(holderNameRequired, addressMode, showStorePaymentField, showCvcForStoredCard, showCvc, kcpFieldVisibility, socialSecurityNumberFieldVisibility, supportedCardTypes) } } fun toList(): List { - return listOf( + return listOf( holderNameRequired, - addressMode.raw, + addressMode, showStorePaymentField, showCvcForStoredCard, showCvc, - kcpFieldVisibility.raw, - socialSecurityNumberFieldVisibility.raw, + kcpFieldVisibility, + socialSecurityNumberFieldVisibility, supportedCardTypes, ) } @@ -472,49 +463,41 @@ data class ApplePayConfigurationDTO ( ) { companion object { - @Suppress("UNCHECKED_CAST") - fun fromList(list: List): ApplePayConfigurationDTO { - val merchantId = list[0] as String - val merchantName = list[1] as String - val allowOnboarding = list[2] as Boolean? - val summaryItems = list[3] as List? - val requiredBillingContactFields = list[4] as List? - val billingContact: ApplePayContactDTO? = (list[5] as List?)?.let { - ApplePayContactDTO.fromList(it) - } - val requiredShippingContactFields = list[6] as List? - val shippingContact: ApplePayContactDTO? = (list[7] as List?)?.let { - ApplePayContactDTO.fromList(it) - } - val applePayShippingType: ApplePayShippingType? = (list[8] as Int?)?.let { - ApplePayShippingType.ofRaw(it) - } - val allowShippingContactEditing = list[9] as Boolean? - val shippingMethods = list[10] as List? - val applicationData = list[11] as String? - val supportedCountries = list[12] as List? - val merchantCapability: ApplePayMerchantCapability? = (list[13] as Int?)?.let { - ApplePayMerchantCapability.ofRaw(it) - } + @Suppress("LocalVariableName") + fun fromList(__pigeon_list: List): ApplePayConfigurationDTO { + val merchantId = __pigeon_list[0] as String + val merchantName = __pigeon_list[1] as String + val allowOnboarding = __pigeon_list[2] as Boolean? + val summaryItems = __pigeon_list[3] as List? + val requiredBillingContactFields = __pigeon_list[4] as List? + val billingContact = __pigeon_list[5] as ApplePayContactDTO? + val requiredShippingContactFields = __pigeon_list[6] as List? + val shippingContact = __pigeon_list[7] as ApplePayContactDTO? + val applePayShippingType = __pigeon_list[8] as ApplePayShippingType? + val allowShippingContactEditing = __pigeon_list[9] as Boolean? + val shippingMethods = __pigeon_list[10] as List? + val applicationData = __pigeon_list[11] as String? + val supportedCountries = __pigeon_list[12] as List? + val merchantCapability = __pigeon_list[13] as ApplePayMerchantCapability? return ApplePayConfigurationDTO(merchantId, merchantName, allowOnboarding, summaryItems, requiredBillingContactFields, billingContact, requiredShippingContactFields, shippingContact, applePayShippingType, allowShippingContactEditing, shippingMethods, applicationData, supportedCountries, merchantCapability) } } fun toList(): List { - return listOf( + return listOf( merchantId, merchantName, allowOnboarding, summaryItems, requiredBillingContactFields, - billingContact?.toList(), + billingContact, requiredShippingContactFields, - shippingContact?.toList(), - applePayShippingType?.raw, + shippingContact, + applePayShippingType, allowShippingContactEditing, shippingMethods, applicationData, supportedCountries, - merchantCapability?.raw, + merchantCapability, ) } } @@ -538,27 +521,27 @@ data class ApplePayContactDTO ( ) { companion object { - @Suppress("UNCHECKED_CAST") - fun fromList(list: List): ApplePayContactDTO { - val phoneNumber = list[0] as String? - val emailAddress = list[1] as String? - val givenName = list[2] as String? - val familyName = list[3] as String? - val phoneticGivenName = list[4] as String? - val phoneticFamilyName = list[5] as String? - val addressLines = list[6] as List? - val subLocality = list[7] as String? - val city = list[8] as String? - val postalCode = list[9] as String? - val subAdministrativeArea = list[10] as String? - val administrativeArea = list[11] as String? - val country = list[12] as String? - val countryCode = list[13] as String? + @Suppress("LocalVariableName") + fun fromList(__pigeon_list: List): ApplePayContactDTO { + val phoneNumber = __pigeon_list[0] as String? + val emailAddress = __pigeon_list[1] as String? + val givenName = __pigeon_list[2] as String? + val familyName = __pigeon_list[3] as String? + val phoneticGivenName = __pigeon_list[4] as String? + val phoneticFamilyName = __pigeon_list[5] as String? + val addressLines = __pigeon_list[6] as List? + val subLocality = __pigeon_list[7] as String? + val city = __pigeon_list[8] as String? + val postalCode = __pigeon_list[9] as String? + val subAdministrativeArea = __pigeon_list[10] as String? + val administrativeArea = __pigeon_list[11] as String? + val country = __pigeon_list[12] as String? + val countryCode = __pigeon_list[13] as String? return ApplePayContactDTO(phoneNumber, emailAddress, givenName, familyName, phoneticGivenName, phoneticFamilyName, addressLines, subLocality, city, postalCode, subAdministrativeArea, administrativeArea, country, countryCode) } } fun toList(): List { - return listOf( + return listOf( phoneNumber, emailAddress, givenName, @@ -588,22 +571,22 @@ data class ApplePayShippingMethodDTO ( ) { companion object { - @Suppress("UNCHECKED_CAST") - fun fromList(list: List): ApplePayShippingMethodDTO { - val label = list[0] as String - val detail = list[1] as String - val amount = AmountDTO.fromList(list[2] as List) - val identifier = list[3] as String - val startDate = list[4] as String? - val endDate = list[5] as String? + @Suppress("LocalVariableName") + fun fromList(__pigeon_list: List): ApplePayShippingMethodDTO { + val label = __pigeon_list[0] as String + val detail = __pigeon_list[1] as String + val amount = __pigeon_list[2] as AmountDTO + val identifier = __pigeon_list[3] as String + val startDate = __pigeon_list[4] as String? + val endDate = __pigeon_list[5] as String? return ApplePayShippingMethodDTO(label, detail, amount, identifier, startDate, endDate) } } fun toList(): List { - return listOf( + return listOf( label, detail, - amount.toList(), + amount, identifier, startDate, endDate, @@ -619,19 +602,19 @@ data class ApplePaySummaryItemDTO ( ) { companion object { - @Suppress("UNCHECKED_CAST") - fun fromList(list: List): ApplePaySummaryItemDTO { - val label = list[0] as String - val amount = AmountDTO.fromList(list[1] as List) - val type = ApplePaySummaryItemType.ofRaw(list[2] as Int)!! + @Suppress("LocalVariableName") + fun fromList(__pigeon_list: List): ApplePaySummaryItemDTO { + val label = __pigeon_list[0] as String + val amount = __pigeon_list[1] as AmountDTO + val type = __pigeon_list[2] as ApplePaySummaryItemType return ApplePaySummaryItemDTO(label, amount, type) } } fun toList(): List { - return listOf( + return listOf( label, - amount.toList(), - type.raw, + amount, + type, ) } } @@ -656,40 +639,32 @@ data class GooglePayConfigurationDTO ( ) { companion object { - @Suppress("UNCHECKED_CAST") - fun fromList(list: List): GooglePayConfigurationDTO { - val googlePayEnvironment = GooglePayEnvironment.ofRaw(list[0] as Int)!! - val merchantAccount = list[1] as String? - val merchantInfoDTO: MerchantInfoDTO? = (list[2] as List?)?.let { - MerchantInfoDTO.fromList(it) - } - val totalPriceStatus: TotalPriceStatus? = (list[3] as Int?)?.let { - TotalPriceStatus.ofRaw(it) - } - val allowedCardNetworks = list[4] as List? - val allowedAuthMethods = list[5] as List? - val allowPrepaidCards = list[6] as Boolean? - val allowCreditCards = list[7] as Boolean? - val assuranceDetailsRequired = list[8] as Boolean? - val emailRequired = list[9] as Boolean? - val existingPaymentMethodRequired = list[10] as Boolean? - val shippingAddressRequired = list[11] as Boolean? - val shippingAddressParametersDTO: ShippingAddressParametersDTO? = (list[12] as List?)?.let { - ShippingAddressParametersDTO.fromList(it) - } - val billingAddressRequired = list[13] as Boolean? - val billingAddressParametersDTO: BillingAddressParametersDTO? = (list[14] as List?)?.let { - BillingAddressParametersDTO.fromList(it) - } + @Suppress("LocalVariableName") + fun fromList(__pigeon_list: List): GooglePayConfigurationDTO { + val googlePayEnvironment = __pigeon_list[0] as GooglePayEnvironment + val merchantAccount = __pigeon_list[1] as String? + val merchantInfoDTO = __pigeon_list[2] as MerchantInfoDTO? + val totalPriceStatus = __pigeon_list[3] as TotalPriceStatus? + val allowedCardNetworks = __pigeon_list[4] as List? + val allowedAuthMethods = __pigeon_list[5] as List? + val allowPrepaidCards = __pigeon_list[6] as Boolean? + val allowCreditCards = __pigeon_list[7] as Boolean? + val assuranceDetailsRequired = __pigeon_list[8] as Boolean? + val emailRequired = __pigeon_list[9] as Boolean? + val existingPaymentMethodRequired = __pigeon_list[10] as Boolean? + val shippingAddressRequired = __pigeon_list[11] as Boolean? + val shippingAddressParametersDTO = __pigeon_list[12] as ShippingAddressParametersDTO? + val billingAddressRequired = __pigeon_list[13] as Boolean? + val billingAddressParametersDTO = __pigeon_list[14] as BillingAddressParametersDTO? return GooglePayConfigurationDTO(googlePayEnvironment, merchantAccount, merchantInfoDTO, totalPriceStatus, allowedCardNetworks, allowedAuthMethods, allowPrepaidCards, allowCreditCards, assuranceDetailsRequired, emailRequired, existingPaymentMethodRequired, shippingAddressRequired, shippingAddressParametersDTO, billingAddressRequired, billingAddressParametersDTO) } } fun toList(): List { - return listOf( - googlePayEnvironment.raw, + return listOf( + googlePayEnvironment, merchantAccount, - merchantInfoDTO?.toList(), - totalPriceStatus?.raw, + merchantInfoDTO, + totalPriceStatus, allowedCardNetworks, allowedAuthMethods, allowPrepaidCards, @@ -698,9 +673,9 @@ data class GooglePayConfigurationDTO ( emailRequired, existingPaymentMethodRequired, shippingAddressRequired, - shippingAddressParametersDTO?.toList(), + shippingAddressParametersDTO, billingAddressRequired, - billingAddressParametersDTO?.toList(), + billingAddressParametersDTO, ) } } @@ -712,15 +687,15 @@ data class MerchantInfoDTO ( ) { companion object { - @Suppress("UNCHECKED_CAST") - fun fromList(list: List): MerchantInfoDTO { - val merchantName = list[0] as String? - val merchantId = list[1] as String? + @Suppress("LocalVariableName") + fun fromList(__pigeon_list: List): MerchantInfoDTO { + val merchantName = __pigeon_list[0] as String? + val merchantId = __pigeon_list[1] as String? return MerchantInfoDTO(merchantName, merchantId) } } fun toList(): List { - return listOf( + return listOf( merchantName, merchantId, ) @@ -734,15 +709,15 @@ data class ShippingAddressParametersDTO ( ) { companion object { - @Suppress("UNCHECKED_CAST") - fun fromList(list: List): ShippingAddressParametersDTO { - val allowedCountryCodes = list[0] as List? - val isPhoneNumberRequired = list[1] as Boolean? + @Suppress("LocalVariableName") + fun fromList(__pigeon_list: List): ShippingAddressParametersDTO { + val allowedCountryCodes = __pigeon_list[0] as List? + val isPhoneNumberRequired = __pigeon_list[1] as Boolean? return ShippingAddressParametersDTO(allowedCountryCodes, isPhoneNumberRequired) } } fun toList(): List { - return listOf( + return listOf( allowedCountryCodes, isPhoneNumberRequired, ) @@ -756,15 +731,15 @@ data class BillingAddressParametersDTO ( ) { companion object { - @Suppress("UNCHECKED_CAST") - fun fromList(list: List): BillingAddressParametersDTO { - val format = list[0] as String? - val isPhoneNumberRequired = list[1] as Boolean? + @Suppress("LocalVariableName") + fun fromList(__pigeon_list: List): BillingAddressParametersDTO { + val format = __pigeon_list[0] as String? + val isPhoneNumberRequired = __pigeon_list[1] as Boolean? return BillingAddressParametersDTO(format, isPhoneNumberRequired) } } fun toList(): List { - return listOf( + return listOf( format, isPhoneNumberRequired, ) @@ -778,16 +753,16 @@ data class CashAppPayConfigurationDTO ( ) { companion object { - @Suppress("UNCHECKED_CAST") - fun fromList(list: List): CashAppPayConfigurationDTO { - val cashAppPayEnvironment = CashAppPayEnvironment.ofRaw(list[0] as Int)!! - val returnUrl = list[1] as String + @Suppress("LocalVariableName") + fun fromList(__pigeon_list: List): CashAppPayConfigurationDTO { + val cashAppPayEnvironment = __pigeon_list[0] as CashAppPayEnvironment + val returnUrl = __pigeon_list[1] as String return CashAppPayConfigurationDTO(cashAppPayEnvironment, returnUrl) } } fun toList(): List { - return listOf( - cashAppPayEnvironment.raw, + return listOf( + cashAppPayEnvironment, returnUrl, ) } @@ -801,21 +776,19 @@ data class PaymentResultDTO ( ) { companion object { - @Suppress("UNCHECKED_CAST") - fun fromList(list: List): PaymentResultDTO { - val type = PaymentResultEnum.ofRaw(list[0] as Int)!! - val reason = list[1] as String? - val result: PaymentResultModelDTO? = (list[2] as List?)?.let { - PaymentResultModelDTO.fromList(it) - } + @Suppress("LocalVariableName") + fun fromList(__pigeon_list: List): PaymentResultDTO { + val type = __pigeon_list[0] as PaymentResultEnum + val reason = __pigeon_list[1] as String? + val result = __pigeon_list[2] as PaymentResultModelDTO? return PaymentResultDTO(type, reason, result) } } fun toList(): List { - return listOf( - type.raw, + return listOf( + type, reason, - result?.toList(), + result, ) } } @@ -830,25 +803,23 @@ data class PaymentResultModelDTO ( ) { companion object { - @Suppress("UNCHECKED_CAST") - fun fromList(list: List): PaymentResultModelDTO { - val sessionId = list[0] as String? - val sessionData = list[1] as String? - val sessionResult = list[2] as String? - val resultCode = list[3] as String? - val order: OrderResponseDTO? = (list[4] as List?)?.let { - OrderResponseDTO.fromList(it) - } + @Suppress("LocalVariableName") + fun fromList(__pigeon_list: List): PaymentResultModelDTO { + val sessionId = __pigeon_list[0] as String? + val sessionData = __pigeon_list[1] as String? + val sessionResult = __pigeon_list[2] as String? + val resultCode = __pigeon_list[3] as String? + val order = __pigeon_list[4] as OrderResponseDTO? return PaymentResultModelDTO(sessionId, sessionData, sessionResult, resultCode, order) } } fun toList(): List { - return listOf( + return listOf( sessionId, sessionData, sessionResult, resultCode, - order?.toList(), + order, ) } } @@ -862,25 +833,21 @@ data class OrderResponseDTO ( ) { companion object { - @Suppress("UNCHECKED_CAST") - fun fromList(list: List): OrderResponseDTO { - val pspReference = list[0] as String - val orderData = list[1] as String - val amount: AmountDTO? = (list[2] as List?)?.let { - AmountDTO.fromList(it) - } - val remainingAmount: AmountDTO? = (list[3] as List?)?.let { - AmountDTO.fromList(it) - } + @Suppress("LocalVariableName") + fun fromList(__pigeon_list: List): OrderResponseDTO { + val pspReference = __pigeon_list[0] as String + val orderData = __pigeon_list[1] as String + val amount = __pigeon_list[2] as AmountDTO? + val remainingAmount = __pigeon_list[3] as AmountDTO? return OrderResponseDTO(pspReference, orderData, amount, remainingAmount) } } fun toList(): List { - return listOf( + return listOf( pspReference, orderData, - amount?.toList(), - remainingAmount?.toList(), + amount, + remainingAmount, ) } } @@ -893,21 +860,19 @@ data class PlatformCommunicationModel ( ) { companion object { - @Suppress("UNCHECKED_CAST") - fun fromList(list: List): PlatformCommunicationModel { - val type = PlatformCommunicationType.ofRaw(list[0] as Int)!! - val data = list[1] as String? - val paymentResult: PaymentResultDTO? = (list[2] as List?)?.let { - PaymentResultDTO.fromList(it) - } + @Suppress("LocalVariableName") + fun fromList(__pigeon_list: List): PlatformCommunicationModel { + val type = __pigeon_list[0] as PlatformCommunicationType + val data = __pigeon_list[1] as String? + val paymentResult = __pigeon_list[2] as PaymentResultDTO? return PlatformCommunicationModel(type, data, paymentResult) } } fun toList(): List { - return listOf( - type.raw, + return listOf( + type, data, - paymentResult?.toList(), + paymentResult, ) } } @@ -921,23 +886,21 @@ data class ComponentCommunicationModel ( ) { companion object { - @Suppress("UNCHECKED_CAST") - fun fromList(list: List): ComponentCommunicationModel { - val type = ComponentCommunicationType.ofRaw(list[0] as Int)!! - val componentId = list[1] as String - val data = list[2] - val paymentResult: PaymentResultDTO? = (list[3] as List?)?.let { - PaymentResultDTO.fromList(it) - } + @Suppress("LocalVariableName") + fun fromList(__pigeon_list: List): ComponentCommunicationModel { + val type = __pigeon_list[0] as ComponentCommunicationType + val componentId = __pigeon_list[1] as String + val data = __pigeon_list[2] + val paymentResult = __pigeon_list[3] as PaymentResultDTO? return ComponentCommunicationModel(type, componentId, data, paymentResult) } } fun toList(): List { - return listOf( - type.raw, + return listOf( + type, componentId, data, - paymentResult?.toList(), + paymentResult, ) } } @@ -951,23 +914,21 @@ data class PaymentEventDTO ( ) { companion object { - @Suppress("UNCHECKED_CAST") - fun fromList(list: List): PaymentEventDTO { - val paymentEventType = PaymentEventType.ofRaw(list[0] as Int)!! - val result = list[1] as String? - val data = list[2] as Map? - val error: ErrorDTO? = (list[3] as List?)?.let { - ErrorDTO.fromList(it) - } + @Suppress("LocalVariableName") + fun fromList(__pigeon_list: List): PaymentEventDTO { + val paymentEventType = __pigeon_list[0] as PaymentEventType + val result = __pigeon_list[1] as String? + val data = __pigeon_list[2] as Map? + val error = __pigeon_list[3] as ErrorDTO? return PaymentEventDTO(paymentEventType, result, data, error) } } fun toList(): List { - return listOf( - paymentEventType.raw, + return listOf( + paymentEventType, result, data, - error?.toList(), + error, ) } } @@ -980,16 +941,16 @@ data class ErrorDTO ( ) { companion object { - @Suppress("UNCHECKED_CAST") - fun fromList(list: List): ErrorDTO { - val errorMessage = list[0] as String? - val reason = list[1] as String? - val dismissDropIn = list[2] as Boolean? + @Suppress("LocalVariableName") + fun fromList(__pigeon_list: List): ErrorDTO { + val errorMessage = __pigeon_list[0] as String? + val reason = __pigeon_list[1] as String? + val dismissDropIn = __pigeon_list[2] as Boolean? return ErrorDTO(errorMessage, reason, dismissDropIn) } } fun toList(): List { - return listOf( + return listOf( errorMessage, reason, dismissDropIn, @@ -1004,15 +965,15 @@ data class DeletedStoredPaymentMethodResultDTO ( ) { companion object { - @Suppress("UNCHECKED_CAST") - fun fromList(list: List): DeletedStoredPaymentMethodResultDTO { - val storedPaymentMethodId = list[0] as String - val isSuccessfullyRemoved = list[1] as Boolean + @Suppress("LocalVariableName") + fun fromList(__pigeon_list: List): DeletedStoredPaymentMethodResultDTO { + val storedPaymentMethodId = __pigeon_list[0] as String + val isSuccessfullyRemoved = __pigeon_list[1] as Boolean return DeletedStoredPaymentMethodResultDTO(storedPaymentMethodId, isSuccessfullyRemoved) } } fun toList(): List { - return listOf( + return listOf( storedPaymentMethodId, isSuccessfullyRemoved, ) @@ -1031,29 +992,27 @@ data class CardComponentConfigurationDTO ( ) { companion object { - @Suppress("UNCHECKED_CAST") - fun fromList(list: List): CardComponentConfigurationDTO { - val environment = Environment.ofRaw(list[0] as Int)!! - val clientKey = list[1] as String - val countryCode = list[2] as String - val amount: AmountDTO? = (list[3] as List?)?.let { - AmountDTO.fromList(it) - } - val shopperLocale = list[4] as String? - val cardConfiguration = CardConfigurationDTO.fromList(list[5] as List) - val analyticsOptionsDTO = AnalyticsOptionsDTO.fromList(list[6] as List) + @Suppress("LocalVariableName") + fun fromList(__pigeon_list: List): CardComponentConfigurationDTO { + val environment = __pigeon_list[0] as Environment + val clientKey = __pigeon_list[1] as String + val countryCode = __pigeon_list[2] as String + val amount = __pigeon_list[3] as AmountDTO? + val shopperLocale = __pigeon_list[4] as String? + val cardConfiguration = __pigeon_list[5] as CardConfigurationDTO + val analyticsOptionsDTO = __pigeon_list[6] as AnalyticsOptionsDTO return CardComponentConfigurationDTO(environment, clientKey, countryCode, amount, shopperLocale, cardConfiguration, analyticsOptionsDTO) } } fun toList(): List { - return listOf( - environment.raw, + return listOf( + environment, clientKey, countryCode, - amount?.toList(), + amount, shopperLocale, - cardConfiguration.toList(), - analyticsOptionsDTO.toList(), + cardConfiguration, + analyticsOptionsDTO, ) } } @@ -1072,37 +1031,31 @@ data class InstantPaymentConfigurationDTO ( ) { companion object { - @Suppress("UNCHECKED_CAST") - fun fromList(list: List): InstantPaymentConfigurationDTO { - val instantPaymentType = InstantPaymentType.ofRaw(list[0] as Int)!! - val environment = Environment.ofRaw(list[1] as Int)!! - val clientKey = list[2] as String - val countryCode = list[3] as String - val amount: AmountDTO? = (list[4] as List?)?.let { - AmountDTO.fromList(it) - } - val shopperLocale = list[5] as String? - val analyticsOptionsDTO = AnalyticsOptionsDTO.fromList(list[6] as List) - val googlePayConfigurationDTO: GooglePayConfigurationDTO? = (list[7] as List?)?.let { - GooglePayConfigurationDTO.fromList(it) - } - val applePayConfigurationDTO: ApplePayConfigurationDTO? = (list[8] as List?)?.let { - ApplePayConfigurationDTO.fromList(it) - } + @Suppress("LocalVariableName") + fun fromList(__pigeon_list: List): InstantPaymentConfigurationDTO { + val instantPaymentType = __pigeon_list[0] as InstantPaymentType + val environment = __pigeon_list[1] as Environment + val clientKey = __pigeon_list[2] as String + val countryCode = __pigeon_list[3] as String + val amount = __pigeon_list[4] as AmountDTO? + val shopperLocale = __pigeon_list[5] as String? + val analyticsOptionsDTO = __pigeon_list[6] as AnalyticsOptionsDTO + val googlePayConfigurationDTO = __pigeon_list[7] as GooglePayConfigurationDTO? + val applePayConfigurationDTO = __pigeon_list[8] as ApplePayConfigurationDTO? return InstantPaymentConfigurationDTO(instantPaymentType, environment, clientKey, countryCode, amount, shopperLocale, analyticsOptionsDTO, googlePayConfigurationDTO, applePayConfigurationDTO) } } fun toList(): List { - return listOf( - instantPaymentType.raw, - environment.raw, + return listOf( + instantPaymentType, + environment, clientKey, countryCode, - amount?.toList(), + amount, shopperLocale, - analyticsOptionsDTO.toList(), - googlePayConfigurationDTO?.toList(), - applePayConfigurationDTO?.toList(), + analyticsOptionsDTO, + googlePayConfigurationDTO, + applePayConfigurationDTO, ) } } @@ -1115,17 +1068,17 @@ data class InstantPaymentSetupResultDTO ( ) { companion object { - @Suppress("UNCHECKED_CAST") - fun fromList(list: List): InstantPaymentSetupResultDTO { - val instantPaymentType = InstantPaymentType.ofRaw(list[0] as Int)!! - val isSupported = list[1] as Boolean - val resultData = list[2] + @Suppress("LocalVariableName") + fun fromList(__pigeon_list: List): InstantPaymentSetupResultDTO { + val instantPaymentType = __pigeon_list[0] as InstantPaymentType + val isSupported = __pigeon_list[1] as Boolean + val resultData = __pigeon_list[2] return InstantPaymentSetupResultDTO(instantPaymentType, isSupported, resultData) } } fun toList(): List { - return listOf( - instantPaymentType.raw, + return listOf( + instantPaymentType, isSupported, resultData, ) @@ -1141,17 +1094,17 @@ data class UnencryptedCardDTO ( ) { companion object { - @Suppress("UNCHECKED_CAST") - fun fromList(list: List): UnencryptedCardDTO { - val cardNumber = list[0] as String? - val expiryMonth = list[1] as String? - val expiryYear = list[2] as String? - val cvc = list[3] as String? + @Suppress("LocalVariableName") + fun fromList(__pigeon_list: List): UnencryptedCardDTO { + val cardNumber = __pigeon_list[0] as String? + val expiryMonth = __pigeon_list[1] as String? + val expiryYear = __pigeon_list[2] as String? + val cvc = __pigeon_list[3] as String? return UnencryptedCardDTO(cardNumber, expiryMonth, expiryYear, cvc) } } fun toList(): List { - return listOf( + return listOf( cardNumber, expiryMonth, expiryYear, @@ -1169,17 +1122,17 @@ data class EncryptedCardDTO ( ) { companion object { - @Suppress("UNCHECKED_CAST") - fun fromList(list: List): EncryptedCardDTO { - val encryptedCardNumber = list[0] as String? - val encryptedExpiryMonth = list[1] as String? - val encryptedExpiryYear = list[2] as String? - val encryptedSecurityCode = list[3] as String? + @Suppress("LocalVariableName") + fun fromList(__pigeon_list: List): EncryptedCardDTO { + val encryptedCardNumber = __pigeon_list[0] as String? + val encryptedExpiryMonth = __pigeon_list[1] as String? + val encryptedExpiryYear = __pigeon_list[2] as String? + val encryptedSecurityCode = __pigeon_list[3] as String? return EncryptedCardDTO(encryptedCardNumber, encryptedExpiryMonth, encryptedExpiryYear, encryptedSecurityCode) } } fun toList(): List { - return listOf( + return listOf( encryptedCardNumber, encryptedExpiryMonth, encryptedExpiryYear, @@ -1198,25 +1151,23 @@ data class ActionComponentConfigurationDTO ( ) { companion object { - @Suppress("UNCHECKED_CAST") - fun fromList(list: List): ActionComponentConfigurationDTO { - val environment = Environment.ofRaw(list[0] as Int)!! - val clientKey = list[1] as String - val shopperLocale = list[2] as String? - val amount: AmountDTO? = (list[3] as List?)?.let { - AmountDTO.fromList(it) - } - val analyticsOptionsDTO = AnalyticsOptionsDTO.fromList(list[4] as List) + @Suppress("LocalVariableName") + fun fromList(__pigeon_list: List): ActionComponentConfigurationDTO { + val environment = __pigeon_list[0] as Environment + val clientKey = __pigeon_list[1] as String + val shopperLocale = __pigeon_list[2] as String? + val amount = __pigeon_list[3] as AmountDTO? + val analyticsOptionsDTO = __pigeon_list[4] as AnalyticsOptionsDTO return ActionComponentConfigurationDTO(environment, clientKey, shopperLocale, amount, analyticsOptionsDTO) } } fun toList(): List { - return listOf( - environment.raw, + return listOf( + environment, clientKey, shopperLocale, - amount?.toList(), - analyticsOptionsDTO.toList(), + amount, + analyticsOptionsDTO, ) } } @@ -1228,168 +1179,256 @@ data class OrderCancelResultDTO ( ) { companion object { - @Suppress("UNCHECKED_CAST") - fun fromList(list: List): OrderCancelResultDTO { - val orderCancelResponseBody = list[0] as Map - val updatedPaymentMethodsResponseBody = list[1] as Map? + @Suppress("LocalVariableName") + fun fromList(__pigeon_list: List): OrderCancelResultDTO { + val orderCancelResponseBody = __pigeon_list[0] as Map + val updatedPaymentMethodsResponseBody = __pigeon_list[1] as Map? return OrderCancelResultDTO(orderCancelResponseBody, updatedPaymentMethodsResponseBody) } } fun toList(): List { - return listOf( + return listOf( orderCancelResponseBody, updatedPaymentMethodsResponseBody, ) } } - -@Suppress("UNCHECKED_CAST") -private object CheckoutPlatformInterfaceCodec : StandardMessageCodec() { +private object PlatformApiPigeonCodec : StandardMessageCodec() { override fun readValueOfType(type: Byte, buffer: ByteBuffer): Any? { return when (type) { - 128.toByte() -> { - return (readValue(buffer) as? List)?.let { - ActionComponentConfigurationDTO.fromList(it) - } - } 129.toByte() -> { return (readValue(buffer) as? List)?.let { - AmountDTO.fromList(it) + SessionDTO.fromList(it) } } 130.toByte() -> { return (readValue(buffer) as? List)?.let { - AnalyticsOptionsDTO.fromList(it) + AmountDTO.fromList(it) } } 131.toByte() -> { return (readValue(buffer) as? List)?.let { - ApplePayConfigurationDTO.fromList(it) + AnalyticsOptionsDTO.fromList(it) } } 132.toByte() -> { return (readValue(buffer) as? List)?.let { - ApplePayContactDTO.fromList(it) + DropInConfigurationDTO.fromList(it) } } 133.toByte() -> { return (readValue(buffer) as? List)?.let { - ApplePayShippingMethodDTO.fromList(it) + CardConfigurationDTO.fromList(it) } } 134.toByte() -> { return (readValue(buffer) as? List)?.let { - ApplePaySummaryItemDTO.fromList(it) + ApplePayConfigurationDTO.fromList(it) } } 135.toByte() -> { return (readValue(buffer) as? List)?.let { - BillingAddressParametersDTO.fromList(it) + ApplePayContactDTO.fromList(it) } } 136.toByte() -> { return (readValue(buffer) as? List)?.let { - CardComponentConfigurationDTO.fromList(it) + ApplePayShippingMethodDTO.fromList(it) } } 137.toByte() -> { return (readValue(buffer) as? List)?.let { - CardConfigurationDTO.fromList(it) + ApplePaySummaryItemDTO.fromList(it) } } 138.toByte() -> { return (readValue(buffer) as? List)?.let { - CashAppPayConfigurationDTO.fromList(it) + GooglePayConfigurationDTO.fromList(it) } } 139.toByte() -> { return (readValue(buffer) as? List)?.let { - ComponentCommunicationModel.fromList(it) + MerchantInfoDTO.fromList(it) } } 140.toByte() -> { return (readValue(buffer) as? List)?.let { - DeletedStoredPaymentMethodResultDTO.fromList(it) + ShippingAddressParametersDTO.fromList(it) } } 141.toByte() -> { return (readValue(buffer) as? List)?.let { - DropInConfigurationDTO.fromList(it) + BillingAddressParametersDTO.fromList(it) } } 142.toByte() -> { return (readValue(buffer) as? List)?.let { - EncryptedCardDTO.fromList(it) + CashAppPayConfigurationDTO.fromList(it) } } 143.toByte() -> { return (readValue(buffer) as? List)?.let { - ErrorDTO.fromList(it) + PaymentResultDTO.fromList(it) } } 144.toByte() -> { return (readValue(buffer) as? List)?.let { - GooglePayConfigurationDTO.fromList(it) + PaymentResultModelDTO.fromList(it) } } 145.toByte() -> { return (readValue(buffer) as? List)?.let { - InstantPaymentConfigurationDTO.fromList(it) + OrderResponseDTO.fromList(it) } } 146.toByte() -> { return (readValue(buffer) as? List)?.let { - InstantPaymentSetupResultDTO.fromList(it) + PlatformCommunicationModel.fromList(it) } } 147.toByte() -> { return (readValue(buffer) as? List)?.let { - MerchantInfoDTO.fromList(it) + ComponentCommunicationModel.fromList(it) } } 148.toByte() -> { return (readValue(buffer) as? List)?.let { - OrderCancelResultDTO.fromList(it) + PaymentEventDTO.fromList(it) } } 149.toByte() -> { return (readValue(buffer) as? List)?.let { - OrderResponseDTO.fromList(it) + ErrorDTO.fromList(it) } } 150.toByte() -> { return (readValue(buffer) as? List)?.let { - PaymentEventDTO.fromList(it) + DeletedStoredPaymentMethodResultDTO.fromList(it) } } 151.toByte() -> { return (readValue(buffer) as? List)?.let { - PaymentResultDTO.fromList(it) + CardComponentConfigurationDTO.fromList(it) } } 152.toByte() -> { return (readValue(buffer) as? List)?.let { - PaymentResultModelDTO.fromList(it) + InstantPaymentConfigurationDTO.fromList(it) } } 153.toByte() -> { return (readValue(buffer) as? List)?.let { - PlatformCommunicationModel.fromList(it) + InstantPaymentSetupResultDTO.fromList(it) } } 154.toByte() -> { return (readValue(buffer) as? List)?.let { - SessionDTO.fromList(it) + UnencryptedCardDTO.fromList(it) } } 155.toByte() -> { return (readValue(buffer) as? List)?.let { - ShippingAddressParametersDTO.fromList(it) + EncryptedCardDTO.fromList(it) } } 156.toByte() -> { return (readValue(buffer) as? List)?.let { - UnencryptedCardDTO.fromList(it) + ActionComponentConfigurationDTO.fromList(it) + } + } + 157.toByte() -> { + return (readValue(buffer) as? List)?.let { + OrderCancelResultDTO.fromList(it) + } + } + 158.toByte() -> { + return (readValue(buffer) as Int?)?.let { + Environment.ofRaw(it) + } + } + 159.toByte() -> { + return (readValue(buffer) as Int?)?.let { + AddressMode.ofRaw(it) + } + } + 160.toByte() -> { + return (readValue(buffer) as Int?)?.let { + CardAuthMethod.ofRaw(it) + } + } + 161.toByte() -> { + return (readValue(buffer) as Int?)?.let { + TotalPriceStatus.ofRaw(it) + } + } + 162.toByte() -> { + return (readValue(buffer) as Int?)?.let { + GooglePayEnvironment.ofRaw(it) + } + } + 163.toByte() -> { + return (readValue(buffer) as Int?)?.let { + CashAppPayEnvironment.ofRaw(it) + } + } + 164.toByte() -> { + return (readValue(buffer) as Int?)?.let { + PaymentResultEnum.ofRaw(it) + } + } + 165.toByte() -> { + return (readValue(buffer) as Int?)?.let { + PlatformCommunicationType.ofRaw(it) + } + } + 166.toByte() -> { + return (readValue(buffer) as Int?)?.let { + ComponentCommunicationType.ofRaw(it) + } + } + 167.toByte() -> { + return (readValue(buffer) as Int?)?.let { + PaymentEventType.ofRaw(it) + } + } + 168.toByte() -> { + return (readValue(buffer) as Int?)?.let { + FieldVisibility.ofRaw(it) + } + } + 169.toByte() -> { + return (readValue(buffer) as Int?)?.let { + InstantPaymentType.ofRaw(it) + } + } + 170.toByte() -> { + return (readValue(buffer) as Int?)?.let { + ApplePayShippingType.ofRaw(it) + } + } + 171.toByte() -> { + return (readValue(buffer) as Int?)?.let { + ApplePayMerchantCapability.ofRaw(it) + } + } + 172.toByte() -> { + return (readValue(buffer) as Int?)?.let { + ApplePaySummaryItemType.ofRaw(it) + } + } + 173.toByte() -> { + return (readValue(buffer) as Int?)?.let { + CardNumberValidationResultDTO.ofRaw(it) + } + } + 174.toByte() -> { + return (readValue(buffer) as Int?)?.let { + CardExpiryDateValidationResultDTO.ofRaw(it) + } + } + 175.toByte() -> { + return (readValue(buffer) as Int?)?.let { + CardSecurityCodeValidationResultDTO.ofRaw(it) } } else -> super.readValueOfType(type, buffer) @@ -1397,127 +1436,200 @@ private object CheckoutPlatformInterfaceCodec : StandardMessageCodec() { } override fun writeValue(stream: ByteArrayOutputStream, value: Any?) { when (value) { - is ActionComponentConfigurationDTO -> { - stream.write(128) - writeValue(stream, value.toList()) - } - is AmountDTO -> { + is SessionDTO -> { stream.write(129) writeValue(stream, value.toList()) } - is AnalyticsOptionsDTO -> { + is AmountDTO -> { stream.write(130) writeValue(stream, value.toList()) } - is ApplePayConfigurationDTO -> { + is AnalyticsOptionsDTO -> { stream.write(131) writeValue(stream, value.toList()) } - is ApplePayContactDTO -> { + is DropInConfigurationDTO -> { stream.write(132) writeValue(stream, value.toList()) } - is ApplePayShippingMethodDTO -> { + is CardConfigurationDTO -> { stream.write(133) writeValue(stream, value.toList()) } - is ApplePaySummaryItemDTO -> { + is ApplePayConfigurationDTO -> { stream.write(134) writeValue(stream, value.toList()) } - is BillingAddressParametersDTO -> { + is ApplePayContactDTO -> { stream.write(135) writeValue(stream, value.toList()) } - is CardComponentConfigurationDTO -> { + is ApplePayShippingMethodDTO -> { stream.write(136) writeValue(stream, value.toList()) } - is CardConfigurationDTO -> { + is ApplePaySummaryItemDTO -> { stream.write(137) writeValue(stream, value.toList()) } - is CashAppPayConfigurationDTO -> { + is GooglePayConfigurationDTO -> { stream.write(138) writeValue(stream, value.toList()) } - is ComponentCommunicationModel -> { + is MerchantInfoDTO -> { stream.write(139) writeValue(stream, value.toList()) } - is DeletedStoredPaymentMethodResultDTO -> { + is ShippingAddressParametersDTO -> { stream.write(140) writeValue(stream, value.toList()) } - is DropInConfigurationDTO -> { + is BillingAddressParametersDTO -> { stream.write(141) writeValue(stream, value.toList()) } - is EncryptedCardDTO -> { + is CashAppPayConfigurationDTO -> { stream.write(142) writeValue(stream, value.toList()) } - is ErrorDTO -> { + is PaymentResultDTO -> { stream.write(143) writeValue(stream, value.toList()) } - is GooglePayConfigurationDTO -> { + is PaymentResultModelDTO -> { stream.write(144) writeValue(stream, value.toList()) } - is InstantPaymentConfigurationDTO -> { + is OrderResponseDTO -> { stream.write(145) writeValue(stream, value.toList()) } - is InstantPaymentSetupResultDTO -> { + is PlatformCommunicationModel -> { stream.write(146) writeValue(stream, value.toList()) } - is MerchantInfoDTO -> { + is ComponentCommunicationModel -> { stream.write(147) writeValue(stream, value.toList()) } - is OrderCancelResultDTO -> { + is PaymentEventDTO -> { stream.write(148) writeValue(stream, value.toList()) } - is OrderResponseDTO -> { + is ErrorDTO -> { stream.write(149) writeValue(stream, value.toList()) } - is PaymentEventDTO -> { + is DeletedStoredPaymentMethodResultDTO -> { stream.write(150) writeValue(stream, value.toList()) } - is PaymentResultDTO -> { + is CardComponentConfigurationDTO -> { stream.write(151) writeValue(stream, value.toList()) } - is PaymentResultModelDTO -> { + is InstantPaymentConfigurationDTO -> { stream.write(152) writeValue(stream, value.toList()) } - is PlatformCommunicationModel -> { + is InstantPaymentSetupResultDTO -> { stream.write(153) writeValue(stream, value.toList()) } - is SessionDTO -> { + is UnencryptedCardDTO -> { stream.write(154) writeValue(stream, value.toList()) } - is ShippingAddressParametersDTO -> { + is EncryptedCardDTO -> { stream.write(155) writeValue(stream, value.toList()) } - is UnencryptedCardDTO -> { + is ActionComponentConfigurationDTO -> { stream.write(156) writeValue(stream, value.toList()) } + is OrderCancelResultDTO -> { + stream.write(157) + writeValue(stream, value.toList()) + } + is Environment -> { + stream.write(158) + writeValue(stream, value.raw) + } + is AddressMode -> { + stream.write(159) + writeValue(stream, value.raw) + } + is CardAuthMethod -> { + stream.write(160) + writeValue(stream, value.raw) + } + is TotalPriceStatus -> { + stream.write(161) + writeValue(stream, value.raw) + } + is GooglePayEnvironment -> { + stream.write(162) + writeValue(stream, value.raw) + } + is CashAppPayEnvironment -> { + stream.write(163) + writeValue(stream, value.raw) + } + is PaymentResultEnum -> { + stream.write(164) + writeValue(stream, value.raw) + } + is PlatformCommunicationType -> { + stream.write(165) + writeValue(stream, value.raw) + } + is ComponentCommunicationType -> { + stream.write(166) + writeValue(stream, value.raw) + } + is PaymentEventType -> { + stream.write(167) + writeValue(stream, value.raw) + } + is FieldVisibility -> { + stream.write(168) + writeValue(stream, value.raw) + } + is InstantPaymentType -> { + stream.write(169) + writeValue(stream, value.raw) + } + is ApplePayShippingType -> { + stream.write(170) + writeValue(stream, value.raw) + } + is ApplePayMerchantCapability -> { + stream.write(171) + writeValue(stream, value.raw) + } + is ApplePaySummaryItemType -> { + stream.write(172) + writeValue(stream, value.raw) + } + is CardNumberValidationResultDTO -> { + stream.write(173) + writeValue(stream, value.raw) + } + is CardExpiryDateValidationResultDTO -> { + stream.write(174) + writeValue(stream, value.raw) + } + is CardSecurityCodeValidationResultDTO -> { + stream.write(175) + writeValue(stream, value.raw) + } else -> super.writeValue(stream, value) } } } + /** Generated interface from Pigeon that represents a handler of messages from Flutter. */ interface CheckoutPlatformInterface { fun getReturnUrl(callback: (Result) -> Unit) @@ -1533,16 +1645,17 @@ interface CheckoutPlatformInterface { companion object { /** The codec used by CheckoutPlatformInterface. */ val codec: MessageCodec by lazy { - CheckoutPlatformInterfaceCodec + PlatformApiPigeonCodec } /** Sets up an instance of `CheckoutPlatformInterface` to handle messages through the `binaryMessenger`. */ - @Suppress("UNCHECKED_CAST") - fun setUp(binaryMessenger: BinaryMessenger, api: CheckoutPlatformInterface?) { + @JvmOverloads + fun setUp(binaryMessenger: BinaryMessenger, api: CheckoutPlatformInterface?, messageChannelSuffix: String = "") { + val separatedMessageChannelSuffix = if (messageChannelSuffix.isNotEmpty()) ".$messageChannelSuffix" else "" run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.adyen_checkout.CheckoutPlatformInterface.getReturnUrl", codec) + val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.adyen_checkout.CheckoutPlatformInterface.getReturnUrl$separatedMessageChannelSuffix", codec) if (api != null) { channel.setMessageHandler { _, reply -> - api.getReturnUrl() { result: Result -> + api.getReturnUrl{ result: Result -> val error = result.exceptionOrNull() if (error != null) { reply.reply(wrapError(error)) @@ -1557,7 +1670,7 @@ interface CheckoutPlatformInterface { } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.adyen_checkout.CheckoutPlatformInterface.createSession", codec) + val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.adyen_checkout.CheckoutPlatformInterface.createSession$separatedMessageChannelSuffix", codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List @@ -1579,15 +1692,14 @@ interface CheckoutPlatformInterface { } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.adyen_checkout.CheckoutPlatformInterface.clearSession", codec) + val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.adyen_checkout.CheckoutPlatformInterface.clearSession$separatedMessageChannelSuffix", codec) if (api != null) { channel.setMessageHandler { _, reply -> - var wrapped: List - try { + val wrapped: List = try { api.clearSession() - wrapped = listOf(null) + listOf(null) } catch (exception: Throwable) { - wrapped = wrapError(exception) + wrapError(exception) } reply.reply(wrapped) } @@ -1596,7 +1708,7 @@ interface CheckoutPlatformInterface { } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.adyen_checkout.CheckoutPlatformInterface.encryptCard", codec) + val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.adyen_checkout.CheckoutPlatformInterface.encryptCard$separatedMessageChannelSuffix", codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List @@ -1617,7 +1729,7 @@ interface CheckoutPlatformInterface { } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.adyen_checkout.CheckoutPlatformInterface.encryptBin", codec) + val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.adyen_checkout.CheckoutPlatformInterface.encryptBin$separatedMessageChannelSuffix", codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List @@ -1638,17 +1750,16 @@ interface CheckoutPlatformInterface { } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.adyen_checkout.CheckoutPlatformInterface.validateCardNumber", codec) + val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.adyen_checkout.CheckoutPlatformInterface.validateCardNumber$separatedMessageChannelSuffix", codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List val cardNumberArg = args[0] as String val enableLuhnCheckArg = args[1] as Boolean - var wrapped: List - try { - wrapped = listOf(api.validateCardNumber(cardNumberArg, enableLuhnCheckArg).raw) + val wrapped: List = try { + listOf(api.validateCardNumber(cardNumberArg, enableLuhnCheckArg)) } catch (exception: Throwable) { - wrapped = wrapError(exception) + wrapError(exception) } reply.reply(wrapped) } @@ -1657,17 +1768,16 @@ interface CheckoutPlatformInterface { } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.adyen_checkout.CheckoutPlatformInterface.validateCardExpiryDate", codec) + val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.adyen_checkout.CheckoutPlatformInterface.validateCardExpiryDate$separatedMessageChannelSuffix", codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List val expiryMonthArg = args[0] as String val expiryYearArg = args[1] as String - var wrapped: List - try { - wrapped = listOf(api.validateCardExpiryDate(expiryMonthArg, expiryYearArg).raw) + val wrapped: List = try { + listOf(api.validateCardExpiryDate(expiryMonthArg, expiryYearArg)) } catch (exception: Throwable) { - wrapped = wrapError(exception) + wrapError(exception) } reply.reply(wrapped) } @@ -1676,17 +1786,16 @@ interface CheckoutPlatformInterface { } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.adyen_checkout.CheckoutPlatformInterface.validateCardSecurityCode", codec) + val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.adyen_checkout.CheckoutPlatformInterface.validateCardSecurityCode$separatedMessageChannelSuffix", codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List val securityCodeArg = args[0] as String val cardBrandArg = args[1] as String? - var wrapped: List - try { - wrapped = listOf(api.validateCardSecurityCode(securityCodeArg, cardBrandArg).raw) + val wrapped: List = try { + listOf(api.validateCardSecurityCode(securityCodeArg, cardBrandArg)) } catch (exception: Throwable) { - wrapped = wrapError(exception) + wrapError(exception) } reply.reply(wrapped) } @@ -1695,17 +1804,16 @@ interface CheckoutPlatformInterface { } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.adyen_checkout.CheckoutPlatformInterface.enableConsoleLogging", codec) + val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.adyen_checkout.CheckoutPlatformInterface.enableConsoleLogging$separatedMessageChannelSuffix", codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List val loggingEnabledArg = args[0] as Boolean - var wrapped: List - try { + val wrapped: List = try { api.enableConsoleLogging(loggingEnabledArg) - wrapped = listOf(null) + listOf(null) } catch (exception: Throwable) { - wrapped = wrapError(exception) + wrapError(exception) } reply.reply(wrapped) } @@ -1716,182 +1824,6 @@ interface CheckoutPlatformInterface { } } } -@Suppress("UNCHECKED_CAST") -private object DropInPlatformInterfaceCodec : StandardMessageCodec() { - override fun readValueOfType(type: Byte, buffer: ByteBuffer): Any? { - return when (type) { - 128.toByte() -> { - return (readValue(buffer) as? List)?.let { - AmountDTO.fromList(it) - } - } - 129.toByte() -> { - return (readValue(buffer) as? List)?.let { - AmountDTO.fromList(it) - } - } - 130.toByte() -> { - return (readValue(buffer) as? List)?.let { - AnalyticsOptionsDTO.fromList(it) - } - } - 131.toByte() -> { - return (readValue(buffer) as? List)?.let { - ApplePayConfigurationDTO.fromList(it) - } - } - 132.toByte() -> { - return (readValue(buffer) as? List)?.let { - ApplePayContactDTO.fromList(it) - } - } - 133.toByte() -> { - return (readValue(buffer) as? List)?.let { - ApplePayShippingMethodDTO.fromList(it) - } - } - 134.toByte() -> { - return (readValue(buffer) as? List)?.let { - ApplePaySummaryItemDTO.fromList(it) - } - } - 135.toByte() -> { - return (readValue(buffer) as? List)?.let { - BillingAddressParametersDTO.fromList(it) - } - } - 136.toByte() -> { - return (readValue(buffer) as? List)?.let { - CardConfigurationDTO.fromList(it) - } - } - 137.toByte() -> { - return (readValue(buffer) as? List)?.let { - CashAppPayConfigurationDTO.fromList(it) - } - } - 138.toByte() -> { - return (readValue(buffer) as? List)?.let { - DeletedStoredPaymentMethodResultDTO.fromList(it) - } - } - 139.toByte() -> { - return (readValue(buffer) as? List)?.let { - DropInConfigurationDTO.fromList(it) - } - } - 140.toByte() -> { - return (readValue(buffer) as? List)?.let { - ErrorDTO.fromList(it) - } - } - 141.toByte() -> { - return (readValue(buffer) as? List)?.let { - GooglePayConfigurationDTO.fromList(it) - } - } - 142.toByte() -> { - return (readValue(buffer) as? List)?.let { - MerchantInfoDTO.fromList(it) - } - } - 143.toByte() -> { - return (readValue(buffer) as? List)?.let { - OrderCancelResultDTO.fromList(it) - } - } - 144.toByte() -> { - return (readValue(buffer) as? List)?.let { - PaymentEventDTO.fromList(it) - } - } - 145.toByte() -> { - return (readValue(buffer) as? List)?.let { - ShippingAddressParametersDTO.fromList(it) - } - } - else -> super.readValueOfType(type, buffer) - } - } - override fun writeValue(stream: ByteArrayOutputStream, value: Any?) { - when (value) { - is AmountDTO -> { - stream.write(128) - writeValue(stream, value.toList()) - } - is AmountDTO -> { - stream.write(129) - writeValue(stream, value.toList()) - } - is AnalyticsOptionsDTO -> { - stream.write(130) - writeValue(stream, value.toList()) - } - is ApplePayConfigurationDTO -> { - stream.write(131) - writeValue(stream, value.toList()) - } - is ApplePayContactDTO -> { - stream.write(132) - writeValue(stream, value.toList()) - } - is ApplePayShippingMethodDTO -> { - stream.write(133) - writeValue(stream, value.toList()) - } - is ApplePaySummaryItemDTO -> { - stream.write(134) - writeValue(stream, value.toList()) - } - is BillingAddressParametersDTO -> { - stream.write(135) - writeValue(stream, value.toList()) - } - is CardConfigurationDTO -> { - stream.write(136) - writeValue(stream, value.toList()) - } - is CashAppPayConfigurationDTO -> { - stream.write(137) - writeValue(stream, value.toList()) - } - is DeletedStoredPaymentMethodResultDTO -> { - stream.write(138) - writeValue(stream, value.toList()) - } - is DropInConfigurationDTO -> { - stream.write(139) - writeValue(stream, value.toList()) - } - is ErrorDTO -> { - stream.write(140) - writeValue(stream, value.toList()) - } - is GooglePayConfigurationDTO -> { - stream.write(141) - writeValue(stream, value.toList()) - } - is MerchantInfoDTO -> { - stream.write(142) - writeValue(stream, value.toList()) - } - is OrderCancelResultDTO -> { - stream.write(143) - writeValue(stream, value.toList()) - } - is PaymentEventDTO -> { - stream.write(144) - writeValue(stream, value.toList()) - } - is ShippingAddressParametersDTO -> { - stream.write(145) - writeValue(stream, value.toList()) - } - else -> super.writeValue(stream, value) - } - } -} - /** Generated interface from Pigeon that represents a handler of messages from Flutter. */ interface DropInPlatformInterface { fun showDropInSession(dropInConfigurationDTO: DropInConfigurationDTO) @@ -1907,23 +1839,23 @@ interface DropInPlatformInterface { companion object { /** The codec used by DropInPlatformInterface. */ val codec: MessageCodec by lazy { - DropInPlatformInterfaceCodec + PlatformApiPigeonCodec } /** Sets up an instance of `DropInPlatformInterface` to handle messages through the `binaryMessenger`. */ - @Suppress("UNCHECKED_CAST") - fun setUp(binaryMessenger: BinaryMessenger, api: DropInPlatformInterface?) { + @JvmOverloads + fun setUp(binaryMessenger: BinaryMessenger, api: DropInPlatformInterface?, messageChannelSuffix: String = "") { + val separatedMessageChannelSuffix = if (messageChannelSuffix.isNotEmpty()) ".$messageChannelSuffix" else "" run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.adyen_checkout.DropInPlatformInterface.showDropInSession", codec) + val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.adyen_checkout.DropInPlatformInterface.showDropInSession$separatedMessageChannelSuffix", codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List val dropInConfigurationDTOArg = args[0] as DropInConfigurationDTO - var wrapped: List - try { + val wrapped: List = try { api.showDropInSession(dropInConfigurationDTOArg) - wrapped = listOf(null) + listOf(null) } catch (exception: Throwable) { - wrapped = wrapError(exception) + wrapError(exception) } reply.reply(wrapped) } @@ -1932,18 +1864,17 @@ interface DropInPlatformInterface { } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.adyen_checkout.DropInPlatformInterface.showDropInAdvanced", codec) + val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.adyen_checkout.DropInPlatformInterface.showDropInAdvanced$separatedMessageChannelSuffix", codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List val dropInConfigurationDTOArg = args[0] as DropInConfigurationDTO val paymentMethodsResponseArg = args[1] as String - var wrapped: List - try { + val wrapped: List = try { api.showDropInAdvanced(dropInConfigurationDTOArg, paymentMethodsResponseArg) - wrapped = listOf(null) + listOf(null) } catch (exception: Throwable) { - wrapped = wrapError(exception) + wrapError(exception) } reply.reply(wrapped) } @@ -1952,17 +1883,16 @@ interface DropInPlatformInterface { } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.adyen_checkout.DropInPlatformInterface.onPaymentsResult", codec) + val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.adyen_checkout.DropInPlatformInterface.onPaymentsResult$separatedMessageChannelSuffix", codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List val paymentsResultArg = args[0] as PaymentEventDTO - var wrapped: List - try { + val wrapped: List = try { api.onPaymentsResult(paymentsResultArg) - wrapped = listOf(null) + listOf(null) } catch (exception: Throwable) { - wrapped = wrapError(exception) + wrapError(exception) } reply.reply(wrapped) } @@ -1971,17 +1901,16 @@ interface DropInPlatformInterface { } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.adyen_checkout.DropInPlatformInterface.onPaymentsDetailsResult", codec) + val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.adyen_checkout.DropInPlatformInterface.onPaymentsDetailsResult$separatedMessageChannelSuffix", codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List val paymentsDetailsResultArg = args[0] as PaymentEventDTO - var wrapped: List - try { + val wrapped: List = try { api.onPaymentsDetailsResult(paymentsDetailsResultArg) - wrapped = listOf(null) + listOf(null) } catch (exception: Throwable) { - wrapped = wrapError(exception) + wrapError(exception) } reply.reply(wrapped) } @@ -1990,17 +1919,16 @@ interface DropInPlatformInterface { } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.adyen_checkout.DropInPlatformInterface.onDeleteStoredPaymentMethodResult", codec) + val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.adyen_checkout.DropInPlatformInterface.onDeleteStoredPaymentMethodResult$separatedMessageChannelSuffix", codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List val deleteStoredPaymentMethodResultDTOArg = args[0] as DeletedStoredPaymentMethodResultDTO - var wrapped: List - try { + val wrapped: List = try { api.onDeleteStoredPaymentMethodResult(deleteStoredPaymentMethodResultDTOArg) - wrapped = listOf(null) + listOf(null) } catch (exception: Throwable) { - wrapped = wrapError(exception) + wrapError(exception) } reply.reply(wrapped) } @@ -2009,17 +1937,16 @@ interface DropInPlatformInterface { } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.adyen_checkout.DropInPlatformInterface.onBalanceCheckResult", codec) + val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.adyen_checkout.DropInPlatformInterface.onBalanceCheckResult$separatedMessageChannelSuffix", codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List val balanceCheckResponseArg = args[0] as String - var wrapped: List - try { + val wrapped: List = try { api.onBalanceCheckResult(balanceCheckResponseArg) - wrapped = listOf(null) + listOf(null) } catch (exception: Throwable) { - wrapped = wrapError(exception) + wrapError(exception) } reply.reply(wrapped) } @@ -2028,17 +1955,16 @@ interface DropInPlatformInterface { } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.adyen_checkout.DropInPlatformInterface.onOrderRequestResult", codec) + val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.adyen_checkout.DropInPlatformInterface.onOrderRequestResult$separatedMessageChannelSuffix", codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List val orderRequestResponseArg = args[0] as String - var wrapped: List - try { + val wrapped: List = try { api.onOrderRequestResult(orderRequestResponseArg) - wrapped = listOf(null) + listOf(null) } catch (exception: Throwable) { - wrapped = wrapError(exception) + wrapError(exception) } reply.reply(wrapped) } @@ -2047,17 +1973,16 @@ interface DropInPlatformInterface { } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.adyen_checkout.DropInPlatformInterface.onOrderCancelResult", codec) + val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.adyen_checkout.DropInPlatformInterface.onOrderCancelResult$separatedMessageChannelSuffix", codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List val orderCancelResultArg = args[0] as OrderCancelResultDTO - var wrapped: List - try { + val wrapped: List = try { api.onOrderCancelResult(orderCancelResultArg) - wrapped = listOf(null) + listOf(null) } catch (exception: Throwable) { - wrapped = wrapError(exception) + wrapError(exception) } reply.reply(wrapped) } @@ -2066,15 +1991,14 @@ interface DropInPlatformInterface { } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.adyen_checkout.DropInPlatformInterface.cleanUpDropIn", codec) + val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.adyen_checkout.DropInPlatformInterface.cleanUpDropIn$separatedMessageChannelSuffix", codec) if (api != null) { channel.setMessageHandler { _, reply -> - var wrapped: List - try { + val wrapped: List = try { api.cleanUpDropIn() - wrapped = listOf(null) + listOf(null) } catch (exception: Throwable) { - wrapped = wrapError(exception) + wrapError(exception) } reply.reply(wrapped) } @@ -2085,77 +2009,18 @@ interface DropInPlatformInterface { } } } -@Suppress("UNCHECKED_CAST") -private object DropInFlutterInterfaceCodec : StandardMessageCodec() { - override fun readValueOfType(type: Byte, buffer: ByteBuffer): Any? { - return when (type) { - 128.toByte() -> { - return (readValue(buffer) as? List)?.let { - AmountDTO.fromList(it) - } - } - 129.toByte() -> { - return (readValue(buffer) as? List)?.let { - OrderResponseDTO.fromList(it) - } - } - 130.toByte() -> { - return (readValue(buffer) as? List)?.let { - PaymentResultDTO.fromList(it) - } - } - 131.toByte() -> { - return (readValue(buffer) as? List)?.let { - PaymentResultModelDTO.fromList(it) - } - } - 132.toByte() -> { - return (readValue(buffer) as? List)?.let { - PlatformCommunicationModel.fromList(it) - } - } - else -> super.readValueOfType(type, buffer) - } - } - override fun writeValue(stream: ByteArrayOutputStream, value: Any?) { - when (value) { - is AmountDTO -> { - stream.write(128) - writeValue(stream, value.toList()) - } - is OrderResponseDTO -> { - stream.write(129) - writeValue(stream, value.toList()) - } - is PaymentResultDTO -> { - stream.write(130) - writeValue(stream, value.toList()) - } - is PaymentResultModelDTO -> { - stream.write(131) - writeValue(stream, value.toList()) - } - is PlatformCommunicationModel -> { - stream.write(132) - writeValue(stream, value.toList()) - } - else -> super.writeValue(stream, value) - } - } -} - /** Generated class from Pigeon that represents Flutter messages that can be called from Kotlin. */ -@Suppress("UNCHECKED_CAST") -class DropInFlutterInterface(private val binaryMessenger: BinaryMessenger) { +class DropInFlutterInterface(private val binaryMessenger: BinaryMessenger, private val messageChannelSuffix: String = "") { companion object { /** The codec used by DropInFlutterInterface. */ val codec: MessageCodec by lazy { - DropInFlutterInterfaceCodec + PlatformApiPigeonCodec } } fun onDropInSessionPlatformCommunication(platformCommunicationModelArg: PlatformCommunicationModel, callback: (Result) -> Unit) { - val channelName = "dev.flutter.pigeon.adyen_checkout.DropInFlutterInterface.onDropInSessionPlatformCommunication" + val separatedMessageChannelSuffix = if (messageChannelSuffix.isNotEmpty()) ".$messageChannelSuffix" else "" + val channelName = "dev.flutter.pigeon.adyen_checkout.DropInFlutterInterface.onDropInSessionPlatformCommunication$separatedMessageChannelSuffix" val channel = BasicMessageChannel(binaryMessenger, channelName, codec) channel.send(listOf(platformCommunicationModelArg)) { if (it is List<*>) { @@ -2171,7 +2036,8 @@ class DropInFlutterInterface(private val binaryMessenger: BinaryMessenger) { } fun onDropInAdvancedPlatformCommunication(platformCommunicationModelArg: PlatformCommunicationModel, callback: (Result) -> Unit) { - val channelName = "dev.flutter.pigeon.adyen_checkout.DropInFlutterInterface.onDropInAdvancedPlatformCommunication" + val separatedMessageChannelSuffix = if (messageChannelSuffix.isNotEmpty()) ".$messageChannelSuffix" else "" + val channelName = "dev.flutter.pigeon.adyen_checkout.DropInFlutterInterface.onDropInAdvancedPlatformCommunication$separatedMessageChannelSuffix" val channel = BasicMessageChannel(binaryMessenger, channelName, codec) channel.send(listOf(platformCommunicationModelArg)) { if (it is List<*>) { @@ -2186,351 +2052,74 @@ class DropInFlutterInterface(private val binaryMessenger: BinaryMessenger) { } } } -@Suppress("UNCHECKED_CAST") -private object ComponentPlatformInterfaceCodec : StandardMessageCodec() { - override fun readValueOfType(type: Byte, buffer: ByteBuffer): Any? { - return when (type) { - 128.toByte() -> { - return (readValue(buffer) as? List)?.let { - ActionComponentConfigurationDTO.fromList(it) - } - } - 129.toByte() -> { - return (readValue(buffer) as? List)?.let { - AmountDTO.fromList(it) - } - } - 130.toByte() -> { - return (readValue(buffer) as? List)?.let { - AnalyticsOptionsDTO.fromList(it) - } - } - 131.toByte() -> { - return (readValue(buffer) as? List)?.let { - ApplePayConfigurationDTO.fromList(it) +/** Generated interface from Pigeon that represents a handler of messages from Flutter. */ +interface ComponentPlatformInterface { + fun updateViewHeight(viewId: Long) + fun onPaymentsResult(componentId: String, paymentsResult: PaymentEventDTO) + fun onPaymentsDetailsResult(componentId: String, paymentsDetailsResult: PaymentEventDTO) + fun isInstantPaymentSupportedByPlatform(instantPaymentConfigurationDTO: InstantPaymentConfigurationDTO, paymentMethodResponse: String, componentId: String, callback: (Result) -> Unit) + fun onInstantPaymentPressed(instantPaymentConfigurationDTO: InstantPaymentConfigurationDTO, encodedPaymentMethod: String, componentId: String) + fun handleAction(actionComponentConfiguration: ActionComponentConfigurationDTO, componentId: String, actionResponse: Map?) + fun onDispose(componentId: String) + + companion object { + /** The codec used by ComponentPlatformInterface. */ + val codec: MessageCodec by lazy { + PlatformApiPigeonCodec + } + /** Sets up an instance of `ComponentPlatformInterface` to handle messages through the `binaryMessenger`. */ + @JvmOverloads + fun setUp(binaryMessenger: BinaryMessenger, api: ComponentPlatformInterface?, messageChannelSuffix: String = "") { + val separatedMessageChannelSuffix = if (messageChannelSuffix.isNotEmpty()) ".$messageChannelSuffix" else "" + run { + val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.adyen_checkout.ComponentPlatformInterface.updateViewHeight$separatedMessageChannelSuffix", codec) + if (api != null) { + channel.setMessageHandler { message, reply -> + val args = message as List + val viewIdArg = args[0].let { num -> if (num is Int) num.toLong() else num as Long } + val wrapped: List = try { + api.updateViewHeight(viewIdArg) + listOf(null) + } catch (exception: Throwable) { + wrapError(exception) + } + reply.reply(wrapped) + } + } else { + channel.setMessageHandler(null) } } - 132.toByte() -> { - return (readValue(buffer) as? List)?.let { - ApplePayContactDTO.fromList(it) + run { + val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.adyen_checkout.ComponentPlatformInterface.onPaymentsResult$separatedMessageChannelSuffix", codec) + if (api != null) { + channel.setMessageHandler { message, reply -> + val args = message as List + val componentIdArg = args[0] as String + val paymentsResultArg = args[1] as PaymentEventDTO + val wrapped: List = try { + api.onPaymentsResult(componentIdArg, paymentsResultArg) + listOf(null) + } catch (exception: Throwable) { + wrapError(exception) + } + reply.reply(wrapped) + } + } else { + channel.setMessageHandler(null) } } - 133.toByte() -> { - return (readValue(buffer) as? List)?.let { - ApplePayShippingMethodDTO.fromList(it) - } - } - 134.toByte() -> { - return (readValue(buffer) as? List)?.let { - ApplePaySummaryItemDTO.fromList(it) - } - } - 135.toByte() -> { - return (readValue(buffer) as? List)?.let { - BillingAddressParametersDTO.fromList(it) - } - } - 136.toByte() -> { - return (readValue(buffer) as? List)?.let { - CardComponentConfigurationDTO.fromList(it) - } - } - 137.toByte() -> { - return (readValue(buffer) as? List)?.let { - CardConfigurationDTO.fromList(it) - } - } - 138.toByte() -> { - return (readValue(buffer) as? List)?.let { - CashAppPayConfigurationDTO.fromList(it) - } - } - 139.toByte() -> { - return (readValue(buffer) as? List)?.let { - ComponentCommunicationModel.fromList(it) - } - } - 140.toByte() -> { - return (readValue(buffer) as? List)?.let { - DeletedStoredPaymentMethodResultDTO.fromList(it) - } - } - 141.toByte() -> { - return (readValue(buffer) as? List)?.let { - DropInConfigurationDTO.fromList(it) - } - } - 142.toByte() -> { - return (readValue(buffer) as? List)?.let { - EncryptedCardDTO.fromList(it) - } - } - 143.toByte() -> { - return (readValue(buffer) as? List)?.let { - ErrorDTO.fromList(it) - } - } - 144.toByte() -> { - return (readValue(buffer) as? List)?.let { - GooglePayConfigurationDTO.fromList(it) - } - } - 145.toByte() -> { - return (readValue(buffer) as? List)?.let { - InstantPaymentConfigurationDTO.fromList(it) - } - } - 146.toByte() -> { - return (readValue(buffer) as? List)?.let { - InstantPaymentSetupResultDTO.fromList(it) - } - } - 147.toByte() -> { - return (readValue(buffer) as? List)?.let { - MerchantInfoDTO.fromList(it) - } - } - 148.toByte() -> { - return (readValue(buffer) as? List)?.let { - OrderCancelResultDTO.fromList(it) - } - } - 149.toByte() -> { - return (readValue(buffer) as? List)?.let { - OrderResponseDTO.fromList(it) - } - } - 150.toByte() -> { - return (readValue(buffer) as? List)?.let { - PaymentEventDTO.fromList(it) - } - } - 151.toByte() -> { - return (readValue(buffer) as? List)?.let { - PaymentResultDTO.fromList(it) - } - } - 152.toByte() -> { - return (readValue(buffer) as? List)?.let { - PaymentResultModelDTO.fromList(it) - } - } - 153.toByte() -> { - return (readValue(buffer) as? List)?.let { - PlatformCommunicationModel.fromList(it) - } - } - 154.toByte() -> { - return (readValue(buffer) as? List)?.let { - SessionDTO.fromList(it) - } - } - 155.toByte() -> { - return (readValue(buffer) as? List)?.let { - ShippingAddressParametersDTO.fromList(it) - } - } - 156.toByte() -> { - return (readValue(buffer) as? List)?.let { - UnencryptedCardDTO.fromList(it) - } - } - else -> super.readValueOfType(type, buffer) - } - } - override fun writeValue(stream: ByteArrayOutputStream, value: Any?) { - when (value) { - is ActionComponentConfigurationDTO -> { - stream.write(128) - writeValue(stream, value.toList()) - } - is AmountDTO -> { - stream.write(129) - writeValue(stream, value.toList()) - } - is AnalyticsOptionsDTO -> { - stream.write(130) - writeValue(stream, value.toList()) - } - is ApplePayConfigurationDTO -> { - stream.write(131) - writeValue(stream, value.toList()) - } - is ApplePayContactDTO -> { - stream.write(132) - writeValue(stream, value.toList()) - } - is ApplePayShippingMethodDTO -> { - stream.write(133) - writeValue(stream, value.toList()) - } - is ApplePaySummaryItemDTO -> { - stream.write(134) - writeValue(stream, value.toList()) - } - is BillingAddressParametersDTO -> { - stream.write(135) - writeValue(stream, value.toList()) - } - is CardComponentConfigurationDTO -> { - stream.write(136) - writeValue(stream, value.toList()) - } - is CardConfigurationDTO -> { - stream.write(137) - writeValue(stream, value.toList()) - } - is CashAppPayConfigurationDTO -> { - stream.write(138) - writeValue(stream, value.toList()) - } - is ComponentCommunicationModel -> { - stream.write(139) - writeValue(stream, value.toList()) - } - is DeletedStoredPaymentMethodResultDTO -> { - stream.write(140) - writeValue(stream, value.toList()) - } - is DropInConfigurationDTO -> { - stream.write(141) - writeValue(stream, value.toList()) - } - is EncryptedCardDTO -> { - stream.write(142) - writeValue(stream, value.toList()) - } - is ErrorDTO -> { - stream.write(143) - writeValue(stream, value.toList()) - } - is GooglePayConfigurationDTO -> { - stream.write(144) - writeValue(stream, value.toList()) - } - is InstantPaymentConfigurationDTO -> { - stream.write(145) - writeValue(stream, value.toList()) - } - is InstantPaymentSetupResultDTO -> { - stream.write(146) - writeValue(stream, value.toList()) - } - is MerchantInfoDTO -> { - stream.write(147) - writeValue(stream, value.toList()) - } - is OrderCancelResultDTO -> { - stream.write(148) - writeValue(stream, value.toList()) - } - is OrderResponseDTO -> { - stream.write(149) - writeValue(stream, value.toList()) - } - is PaymentEventDTO -> { - stream.write(150) - writeValue(stream, value.toList()) - } - is PaymentResultDTO -> { - stream.write(151) - writeValue(stream, value.toList()) - } - is PaymentResultModelDTO -> { - stream.write(152) - writeValue(stream, value.toList()) - } - is PlatformCommunicationModel -> { - stream.write(153) - writeValue(stream, value.toList()) - } - is SessionDTO -> { - stream.write(154) - writeValue(stream, value.toList()) - } - is ShippingAddressParametersDTO -> { - stream.write(155) - writeValue(stream, value.toList()) - } - is UnencryptedCardDTO -> { - stream.write(156) - writeValue(stream, value.toList()) - } - else -> super.writeValue(stream, value) - } - } -} - -/** Generated interface from Pigeon that represents a handler of messages from Flutter. */ -interface ComponentPlatformInterface { - fun updateViewHeight(viewId: Long) - fun onPaymentsResult(componentId: String, paymentsResult: PaymentEventDTO) - fun onPaymentsDetailsResult(componentId: String, paymentsDetailsResult: PaymentEventDTO) - fun isInstantPaymentSupportedByPlatform(instantPaymentConfigurationDTO: InstantPaymentConfigurationDTO, paymentMethodResponse: String, componentId: String, callback: (Result) -> Unit) - fun onInstantPaymentPressed(instantPaymentConfigurationDTO: InstantPaymentConfigurationDTO, encodedPaymentMethod: String, componentId: String) - fun handleAction(actionComponentConfiguration: ActionComponentConfigurationDTO, componentId: String, actionResponse: Map?) - fun onDispose(componentId: String) - - companion object { - /** The codec used by ComponentPlatformInterface. */ - val codec: MessageCodec by lazy { - ComponentPlatformInterfaceCodec - } - /** Sets up an instance of `ComponentPlatformInterface` to handle messages through the `binaryMessenger`. */ - @Suppress("UNCHECKED_CAST") - fun setUp(binaryMessenger: BinaryMessenger, api: ComponentPlatformInterface?) { run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.adyen_checkout.ComponentPlatformInterface.updateViewHeight", codec) - if (api != null) { - channel.setMessageHandler { message, reply -> - val args = message as List - val viewIdArg = args[0].let { if (it is Int) it.toLong() else it as Long } - var wrapped: List - try { - api.updateViewHeight(viewIdArg) - wrapped = listOf(null) - } catch (exception: Throwable) { - wrapped = wrapError(exception) - } - reply.reply(wrapped) - } - } else { - channel.setMessageHandler(null) - } - } - run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.adyen_checkout.ComponentPlatformInterface.onPaymentsResult", codec) - if (api != null) { - channel.setMessageHandler { message, reply -> - val args = message as List - val componentIdArg = args[0] as String - val paymentsResultArg = args[1] as PaymentEventDTO - var wrapped: List - try { - api.onPaymentsResult(componentIdArg, paymentsResultArg) - wrapped = listOf(null) - } catch (exception: Throwable) { - wrapped = wrapError(exception) - } - reply.reply(wrapped) - } - } else { - channel.setMessageHandler(null) - } - } - run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.adyen_checkout.ComponentPlatformInterface.onPaymentsDetailsResult", codec) + val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.adyen_checkout.ComponentPlatformInterface.onPaymentsDetailsResult$separatedMessageChannelSuffix", codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List val componentIdArg = args[0] as String val paymentsDetailsResultArg = args[1] as PaymentEventDTO - var wrapped: List - try { + val wrapped: List = try { api.onPaymentsDetailsResult(componentIdArg, paymentsDetailsResultArg) - wrapped = listOf(null) + listOf(null) } catch (exception: Throwable) { - wrapped = wrapError(exception) + wrapError(exception) } reply.reply(wrapped) } @@ -2539,7 +2128,7 @@ interface ComponentPlatformInterface { } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.adyen_checkout.ComponentPlatformInterface.isInstantPaymentSupportedByPlatform", codec) + val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.adyen_checkout.ComponentPlatformInterface.isInstantPaymentSupportedByPlatform$separatedMessageChannelSuffix", codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List @@ -2561,19 +2150,18 @@ interface ComponentPlatformInterface { } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.adyen_checkout.ComponentPlatformInterface.onInstantPaymentPressed", codec) + val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.adyen_checkout.ComponentPlatformInterface.onInstantPaymentPressed$separatedMessageChannelSuffix", codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List val instantPaymentConfigurationDTOArg = args[0] as InstantPaymentConfigurationDTO val encodedPaymentMethodArg = args[1] as String val componentIdArg = args[2] as String - var wrapped: List - try { + val wrapped: List = try { api.onInstantPaymentPressed(instantPaymentConfigurationDTOArg, encodedPaymentMethodArg, componentIdArg) - wrapped = listOf(null) + listOf(null) } catch (exception: Throwable) { - wrapped = wrapError(exception) + wrapError(exception) } reply.reply(wrapped) } @@ -2582,19 +2170,18 @@ interface ComponentPlatformInterface { } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.adyen_checkout.ComponentPlatformInterface.handleAction", codec) + val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.adyen_checkout.ComponentPlatformInterface.handleAction$separatedMessageChannelSuffix", codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List val actionComponentConfigurationArg = args[0] as ActionComponentConfigurationDTO val componentIdArg = args[1] as String val actionResponseArg = args[2] as Map? - var wrapped: List - try { + val wrapped: List = try { api.handleAction(actionComponentConfigurationArg, componentIdArg, actionResponseArg) - wrapped = listOf(null) + listOf(null) } catch (exception: Throwable) { - wrapped = wrapError(exception) + wrapError(exception) } reply.reply(wrapped) } @@ -2603,17 +2190,16 @@ interface ComponentPlatformInterface { } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.adyen_checkout.ComponentPlatformInterface.onDispose", codec) + val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.adyen_checkout.ComponentPlatformInterface.onDispose$separatedMessageChannelSuffix", codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List val componentIdArg = args[0] as String - var wrapped: List - try { + val wrapped: List = try { api.onDispose(componentIdArg) - wrapped = listOf(null) + listOf(null) } catch (exception: Throwable) { - wrapped = wrapError(exception) + wrapError(exception) } reply.reply(wrapped) } @@ -2624,113 +2210,18 @@ interface ComponentPlatformInterface { } } } -@Suppress("UNCHECKED_CAST") -private object ComponentFlutterInterfaceCodec : StandardMessageCodec() { - override fun readValueOfType(type: Byte, buffer: ByteBuffer): Any? { - return when (type) { - 128.toByte() -> { - return (readValue(buffer) as? List)?.let { - AmountDTO.fromList(it) - } - } - 129.toByte() -> { - return (readValue(buffer) as? List)?.let { - AnalyticsOptionsDTO.fromList(it) - } - } - 130.toByte() -> { - return (readValue(buffer) as? List)?.let { - CardComponentConfigurationDTO.fromList(it) - } - } - 131.toByte() -> { - return (readValue(buffer) as? List)?.let { - CardConfigurationDTO.fromList(it) - } - } - 132.toByte() -> { - return (readValue(buffer) as? List)?.let { - ComponentCommunicationModel.fromList(it) - } - } - 133.toByte() -> { - return (readValue(buffer) as? List)?.let { - OrderResponseDTO.fromList(it) - } - } - 134.toByte() -> { - return (readValue(buffer) as? List)?.let { - PaymentResultDTO.fromList(it) - } - } - 135.toByte() -> { - return (readValue(buffer) as? List)?.let { - PaymentResultModelDTO.fromList(it) - } - } - 136.toByte() -> { - return (readValue(buffer) as? List)?.let { - SessionDTO.fromList(it) - } - } - else -> super.readValueOfType(type, buffer) - } - } - override fun writeValue(stream: ByteArrayOutputStream, value: Any?) { - when (value) { - is AmountDTO -> { - stream.write(128) - writeValue(stream, value.toList()) - } - is AnalyticsOptionsDTO -> { - stream.write(129) - writeValue(stream, value.toList()) - } - is CardComponentConfigurationDTO -> { - stream.write(130) - writeValue(stream, value.toList()) - } - is CardConfigurationDTO -> { - stream.write(131) - writeValue(stream, value.toList()) - } - is ComponentCommunicationModel -> { - stream.write(132) - writeValue(stream, value.toList()) - } - is OrderResponseDTO -> { - stream.write(133) - writeValue(stream, value.toList()) - } - is PaymentResultDTO -> { - stream.write(134) - writeValue(stream, value.toList()) - } - is PaymentResultModelDTO -> { - stream.write(135) - writeValue(stream, value.toList()) - } - is SessionDTO -> { - stream.write(136) - writeValue(stream, value.toList()) - } - else -> super.writeValue(stream, value) - } - } -} - /** Generated class from Pigeon that represents Flutter messages that can be called from Kotlin. */ -@Suppress("UNCHECKED_CAST") -class ComponentFlutterInterface(private val binaryMessenger: BinaryMessenger) { +class ComponentFlutterInterface(private val binaryMessenger: BinaryMessenger, private val messageChannelSuffix: String = "") { companion object { /** The codec used by ComponentFlutterInterface. */ val codec: MessageCodec by lazy { - ComponentFlutterInterfaceCodec + PlatformApiPigeonCodec } } fun _generateCodecForDTOs(cardComponentConfigurationDTOArg: CardComponentConfigurationDTO, sessionDTOArg: SessionDTO, callback: (Result) -> Unit) { - val channelName = "dev.flutter.pigeon.adyen_checkout.ComponentFlutterInterface._generateCodecForDTOs" + val separatedMessageChannelSuffix = if (messageChannelSuffix.isNotEmpty()) ".$messageChannelSuffix" else "" + val channelName = "dev.flutter.pigeon.adyen_checkout.ComponentFlutterInterface._generateCodecForDTOs$separatedMessageChannelSuffix" val channel = BasicMessageChannel(binaryMessenger, channelName, codec) channel.send(listOf(cardComponentConfigurationDTOArg, sessionDTOArg)) { if (it is List<*>) { @@ -2746,7 +2237,8 @@ class ComponentFlutterInterface(private val binaryMessenger: BinaryMessenger) { } fun onComponentCommunication(componentCommunicationModelArg: ComponentCommunicationModel, callback: (Result) -> Unit) { - val channelName = "dev.flutter.pigeon.adyen_checkout.ComponentFlutterInterface.onComponentCommunication" + val separatedMessageChannelSuffix = if (messageChannelSuffix.isNotEmpty()) ".$messageChannelSuffix" else "" + val channelName = "dev.flutter.pigeon.adyen_checkout.ComponentFlutterInterface.onComponentCommunication$separatedMessageChannelSuffix" val channel = BasicMessageChannel(binaryMessenger, channelName, codec) channel.send(listOf(componentCommunicationModelArg)) { if (it is List<*>) { diff --git a/android/src/main/kotlin/com/adyen/checkout/flutter/apiOnly/CardValidation.kt b/android/src/main/kotlin/com/adyen/checkout/flutter/apiOnly/CardValidation.kt index da496403..70844bbd 100644 --- a/android/src/main/kotlin/com/adyen/checkout/flutter/apiOnly/CardValidation.kt +++ b/android/src/main/kotlin/com/adyen/checkout/flutter/apiOnly/CardValidation.kt @@ -21,12 +21,12 @@ internal object CardValidation { return when (validationResult) { is CardNumberValidationResult.Valid -> CardNumberValidationResultDTO.VALID is CardNumberValidationResult.Invalid.IllegalCharacters -> - CardNumberValidationResultDTO.INVALIDILLEGALCHARACTERS + CardNumberValidationResultDTO.INVALID_ILLEGAL_CHARACTERS - is CardNumberValidationResult.Invalid.TooLong -> CardNumberValidationResultDTO.INVALIDTOOLONG - is CardNumberValidationResult.Invalid.TooShort -> CardNumberValidationResultDTO.INVALIDTOOSHORT - is CardNumberValidationResult.Invalid.LuhnCheck -> CardNumberValidationResultDTO.INVALIDLUHNCHECK - else -> CardNumberValidationResultDTO.INVALIDOTHERREASON + is CardNumberValidationResult.Invalid.TooLong -> CardNumberValidationResultDTO.INVALID_TOO_LONG + is CardNumberValidationResult.Invalid.TooShort -> CardNumberValidationResultDTO.INVALID_TOO_SHORT + is CardNumberValidationResult.Invalid.LuhnCheck -> CardNumberValidationResultDTO.INVALID_LUHN_CHECK + else -> CardNumberValidationResultDTO.INVALID_OTHER_REASON } } @@ -34,18 +34,18 @@ internal object CardValidation { expiryMonth: String, expiryYear: String ): CardExpiryDateValidationResultDTO { - val expireMonth = expiryMonth.toIntOrNull() ?: return CardExpiryDateValidationResultDTO.NONPARSEABLEDATE - val expireYear = expiryYear.toIntOrNull() ?: return CardExpiryDateValidationResultDTO.NONPARSEABLEDATE + val expireMonth = expiryMonth.toIntOrNull() ?: return CardExpiryDateValidationResultDTO.NON_PARSEABLE_DATE + val expireYear = expiryYear.toIntOrNull() ?: return CardExpiryDateValidationResultDTO.NON_PARSEABLE_DATE val expiryDate = ExpiryDate(expireMonth, expireYear) val validationResult = CardExpiryDateValidator.validateExpiryDate(expiryDate) return when (validationResult) { is CardExpiryDateValidationResult.Valid -> CardExpiryDateValidationResultDTO.VALID is CardExpiryDateValidationResult.Invalid.TooFarInTheFuture -> - CardExpiryDateValidationResultDTO.INVALIDTOOFARINTHEFUTURE - is CardExpiryDateValidationResult.Invalid.TooOld -> CardExpiryDateValidationResultDTO.INVALIDTOOOLD + CardExpiryDateValidationResultDTO.INVALID_TOO_FAR_IN_THE_FUTURE + is CardExpiryDateValidationResult.Invalid.TooOld -> CardExpiryDateValidationResultDTO.INVALID_TOO_OLD is CardExpiryDateValidationResult.Invalid.NonParseableDate -> - CardExpiryDateValidationResultDTO.NONPARSEABLEDATE - else -> CardExpiryDateValidationResultDTO.INVALIDOTHERREASON + CardExpiryDateValidationResultDTO.NON_PARSEABLE_DATE + else -> CardExpiryDateValidationResultDTO.INVALID_OTHER_REASON } } diff --git a/android/src/main/kotlin/com/adyen/checkout/flutter/components/ComponentPlatformApi.kt b/android/src/main/kotlin/com/adyen/checkout/flutter/components/ComponentPlatformApi.kt index 5cfc5395..1aaa7b2b 100644 --- a/android/src/main/kotlin/com/adyen/checkout/flutter/components/ComponentPlatformApi.kt +++ b/android/src/main/kotlin/com/adyen/checkout/flutter/components/ComponentPlatformApi.kt @@ -81,7 +81,7 @@ class ComponentPlatformApi( val paymentMethodJson = JSONObject(paymentMethodResponse) val paymentMethod = PaymentMethod.SERIALIZER.deserialize(paymentMethodJson) when (instantPaymentConfigurationDTO.instantPaymentType) { - InstantPaymentType.GOOGLEPAY -> + InstantPaymentType.GOOGLE_PAY -> googlePayComponentManager.initialize( paymentMethod, componentId, @@ -89,7 +89,7 @@ class ComponentPlatformApi( callback ) - InstantPaymentType.INSTANT, InstantPaymentType.APPLEPAY -> return + InstantPaymentType.INSTANT, InstantPaymentType.APPLE_PAY -> return } } @@ -99,8 +99,8 @@ class ComponentPlatformApi( componentId: String, ) { when (instantPaymentConfigurationDTO.instantPaymentType) { - InstantPaymentType.GOOGLEPAY -> googlePayComponentManager.start() - InstantPaymentType.APPLEPAY -> return + InstantPaymentType.GOOGLE_PAY -> googlePayComponentManager.start() + InstantPaymentType.APPLE_PAY -> return InstantPaymentType.INSTANT -> instantComponentManager.start( instantPaymentConfigurationDTO, diff --git a/android/src/main/kotlin/com/adyen/checkout/flutter/components/action/ActionComponentCallback.kt b/android/src/main/kotlin/com/adyen/checkout/flutter/components/action/ActionComponentCallback.kt index 80685102..9c0b9ed0 100644 --- a/android/src/main/kotlin/com/adyen/checkout/flutter/components/action/ActionComponentCallback.kt +++ b/android/src/main/kotlin/com/adyen/checkout/flutter/components/action/ActionComponentCallback.kt @@ -20,7 +20,7 @@ internal class ActionComponentCallback( val data = ActionComponentData.SERIALIZER.serialize(actionComponentData).toString() val model = ComponentCommunicationModel( - type = ComponentCommunicationType.ADDITIONALDETAILS, + type = ComponentCommunicationType.ADDITIONAL_DETAILS, componentId = componentId, data = data, ) @@ -31,8 +31,8 @@ internal class ActionComponentCallback( ComponentLoadingBottomSheet.hide(activity.supportFragmentManager) val type: PaymentResultEnum = when (componentError.exception) { - is com.adyen.checkout.core.exception.CancellationException -> PaymentResultEnum.CANCELLEDBYUSER - is com.adyen.checkout.adyen3ds2.Cancelled3DS2Exception -> PaymentResultEnum.CANCELLEDBYUSER + is com.adyen.checkout.core.exception.CancellationException -> PaymentResultEnum.CANCELLED_BY_USER + is com.adyen.checkout.adyen3ds2.Cancelled3DS2Exception -> PaymentResultEnum.CANCELLED_BY_USER else -> PaymentResultEnum.ERROR } val model = diff --git a/android/src/main/kotlin/com/adyen/checkout/flutter/components/base/ComponentAdvancedCallback.kt b/android/src/main/kotlin/com/adyen/checkout/flutter/components/base/ComponentAdvancedCallback.kt index e52f1ebd..5a31d045 100644 --- a/android/src/main/kotlin/com/adyen/checkout/flutter/components/base/ComponentAdvancedCallback.kt +++ b/android/src/main/kotlin/com/adyen/checkout/flutter/components/base/ComponentAdvancedCallback.kt @@ -20,7 +20,7 @@ abstract class ComponentAdvancedCallback>( override fun onSubmit(state: T) { val model = ComponentCommunicationModel( - ComponentCommunicationType.ONSUBMIT, + ComponentCommunicationType.ON_SUBMIT, componentId = componentId, data = PaymentComponentData.SERIALIZER.serialize(state.data).toString(), ) @@ -30,7 +30,7 @@ abstract class ComponentAdvancedCallback>( override fun onAdditionalDetails(actionComponentData: ActionComponentData) { val model = ComponentCommunicationModel( - ComponentCommunicationType.ADDITIONALDETAILS, + ComponentCommunicationType.ADDITIONAL_DETAILS, componentId = componentId, data = ActionComponentData.SERIALIZER.serialize(actionComponentData).toString(), ) @@ -43,7 +43,7 @@ abstract class ComponentAdvancedCallback>( (componentError.exception is com.adyen.checkout.core.exception.CancellationException) || (componentError.exception is com.adyen.checkout.adyen3ds2.Cancelled3DS2Exception) ) - PaymentResultEnum.CANCELLEDBYUSER + PaymentResultEnum.CANCELLED_BY_USER else PaymentResultEnum.ERROR diff --git a/android/src/main/kotlin/com/adyen/checkout/flutter/components/base/ComponentSessionCallback.kt b/android/src/main/kotlin/com/adyen/checkout/flutter/components/base/ComponentSessionCallback.kt index 4ce6c615..5a048d9f 100644 --- a/android/src/main/kotlin/com/adyen/checkout/flutter/components/base/ComponentSessionCallback.kt +++ b/android/src/main/kotlin/com/adyen/checkout/flutter/components/base/ComponentSessionCallback.kt @@ -49,7 +49,7 @@ abstract class ComponentSessionCallback>( (componentError.exception is com.adyen.checkout.core.exception.CancellationException) || (componentError.exception is com.adyen.checkout.adyen3ds2.Cancelled3DS2Exception) ) - PaymentResultEnum.CANCELLEDBYUSER + PaymentResultEnum.CANCELLED_BY_USER else PaymentResultEnum.ERROR diff --git a/android/src/main/kotlin/com/adyen/checkout/flutter/components/googlepay/GooglePayAdvancedCallback.kt b/android/src/main/kotlin/com/adyen/checkout/flutter/components/googlepay/GooglePayAdvancedCallback.kt index 00a968d0..63bffcf4 100644 --- a/android/src/main/kotlin/com/adyen/checkout/flutter/components/googlepay/GooglePayAdvancedCallback.kt +++ b/android/src/main/kotlin/com/adyen/checkout/flutter/components/googlepay/GooglePayAdvancedCallback.kt @@ -27,7 +27,7 @@ class GooglePayAdvancedCallback( } val model = ComponentCommunicationModel( - ComponentCommunicationType.ONSUBMIT, + ComponentCommunicationType.ON_SUBMIT, componentId = componentId, data = submitData.toString(), ) diff --git a/android/src/main/kotlin/com/adyen/checkout/flutter/components/googlepay/GooglePayComponentManager.kt b/android/src/main/kotlin/com/adyen/checkout/flutter/components/googlepay/GooglePayComponentManager.kt index 32dcf1cd..4c6241c0 100644 --- a/android/src/main/kotlin/com/adyen/checkout/flutter/components/googlepay/GooglePayComponentManager.kt +++ b/android/src/main/kotlin/com/adyen/checkout/flutter/components/googlepay/GooglePayComponentManager.kt @@ -51,7 +51,7 @@ class GooglePayComponentManager( setupCallback?.invoke( Result.success( InstantPaymentSetupResultDTO( - InstantPaymentType.GOOGLEPAY, + InstantPaymentType.GOOGLE_PAY, true, allowedPaymentMethods ) diff --git a/android/src/main/kotlin/com/adyen/checkout/flutter/components/instant/advanced/IdealComponentAdvancedCallback.kt b/android/src/main/kotlin/com/adyen/checkout/flutter/components/instant/advanced/IdealComponentAdvancedCallback.kt index fa7cb9c2..5ba64db9 100644 --- a/android/src/main/kotlin/com/adyen/checkout/flutter/components/instant/advanced/IdealComponentAdvancedCallback.kt +++ b/android/src/main/kotlin/com/adyen/checkout/flutter/components/instant/advanced/IdealComponentAdvancedCallback.kt @@ -23,7 +23,7 @@ class IdealComponentAdvancedCallback( } val model = ComponentCommunicationModel( - ComponentCommunicationType.ONSUBMIT, + ComponentCommunicationType.ON_SUBMIT, componentId = componentId, data = submitData.toString(), ) diff --git a/android/src/main/kotlin/com/adyen/checkout/flutter/components/instant/advanced/InstantComponentAdvancedCallback.kt b/android/src/main/kotlin/com/adyen/checkout/flutter/components/instant/advanced/InstantComponentAdvancedCallback.kt index f69f625e..a4836b83 100644 --- a/android/src/main/kotlin/com/adyen/checkout/flutter/components/instant/advanced/InstantComponentAdvancedCallback.kt +++ b/android/src/main/kotlin/com/adyen/checkout/flutter/components/instant/advanced/InstantComponentAdvancedCallback.kt @@ -23,7 +23,7 @@ class InstantComponentAdvancedCallback( } val model = ComponentCommunicationModel( - ComponentCommunicationType.ONSUBMIT, + ComponentCommunicationType.ON_SUBMIT, componentId = componentId, data = submitData.toString(), ) diff --git a/android/src/main/kotlin/com/adyen/checkout/flutter/dropIn/DropInPlatformApi.kt b/android/src/main/kotlin/com/adyen/checkout/flutter/dropIn/DropInPlatformApi.kt index 86aadf53..edbb2cfb 100644 --- a/android/src/main/kotlin/com/adyen/checkout/flutter/dropIn/DropInPlatformApi.kt +++ b/android/src/main/kotlin/com/adyen/checkout/flutter/dropIn/DropInPlatformApi.kt @@ -156,7 +156,7 @@ class DropInPlatformApi( val model = PlatformCommunicationModel( - PlatformCommunicationType.PAYMENTCOMPONENT, + PlatformCommunicationType.PAYMENT_COMPONENT, data = message.contentIfNotHandled.toString(), ) dropInFlutterApi.onDropInAdvancedPlatformCommunication(model) {} @@ -173,7 +173,7 @@ class DropInPlatformApi( val dropInStoredPaymentMethodDeletionModel = message.contentIfNotHandled val platformCommunicationModel = PlatformCommunicationModel( - PlatformCommunicationType.DELETESTOREDPAYMENTMETHOD, + PlatformCommunicationType.DELETE_STORED_PAYMENT_METHOD, data = dropInStoredPaymentMethodDeletionModel?.storedPaymentMethodId, ) @@ -202,7 +202,7 @@ class DropInPlatformApi( val platformCommunicationModel = PlatformCommunicationModel( - PlatformCommunicationType.ADDITIONALDETAILS, + PlatformCommunicationType.ADDITIONAL_DETAILS, data = message.contentIfNotHandled.toString(), ) @@ -219,7 +219,7 @@ class DropInPlatformApi( val platformCommunicationModel = PlatformCommunicationModel( - PlatformCommunicationType.BALANCECHECK, + PlatformCommunicationType.BALANCE_CHECK, data = message.contentIfNotHandled.toString() ) dropInFlutterApi.onDropInAdvancedPlatformCommunication(platformCommunicationModel) {} @@ -235,7 +235,7 @@ class DropInPlatformApi( val platformCommunicationModel = PlatformCommunicationModel( - PlatformCommunicationType.REQUESTORDER, + PlatformCommunicationType.REQUEST_ORDER, data = message.contentIfNotHandled.toString() ) dropInFlutterApi.onDropInAdvancedPlatformCommunication(platformCommunicationModel) {} @@ -251,7 +251,7 @@ class DropInPlatformApi( val platformCommunicationModel = PlatformCommunicationModel( - PlatformCommunicationType.CANCELORDER, + PlatformCommunicationType.CANCEL_ORDER, data = message.contentIfNotHandled.toString() ) dropInFlutterApi.onDropInAdvancedPlatformCommunication(platformCommunicationModel) {} @@ -302,7 +302,7 @@ class DropInPlatformApi( when (sessionDropInResult) { is SessionDropInResult.CancelledByUser -> PaymentResultDTO( - PaymentResultEnum.CANCELLEDBYUSER + PaymentResultEnum.CANCELLED_BY_USER ) is SessionDropInResult.Error -> @@ -347,7 +347,7 @@ class DropInPlatformApi( when (dropInAdvancedFlowResult) { is DropInResult.CancelledByUser -> PaymentResultDTO( - PaymentResultEnum.CANCELLEDBYUSER + PaymentResultEnum.CANCELLED_BY_USER ) is DropInResult.Error -> diff --git a/android/src/main/kotlin/com/adyen/checkout/flutter/utils/ConfigurationMapper.kt b/android/src/main/kotlin/com/adyen/checkout/flutter/utils/ConfigurationMapper.kt index 2f67a616..ad200ea7 100644 --- a/android/src/main/kotlin/com/adyen/checkout/flutter/utils/ConfigurationMapper.kt +++ b/android/src/main/kotlin/com/adyen/checkout/flutter/utils/ConfigurationMapper.kt @@ -205,7 +205,7 @@ object ConfigurationMapper { private fun AddressMode.mapToAddressConfiguration(): AddressConfiguration { return when (this) { AddressMode.FULL -> AddressConfiguration.FullAddress() - AddressMode.POSTALCODE -> AddressConfiguration.PostalCode() + AddressMode.POSTAL_CODE -> AddressConfiguration.PostalCode() AddressMode.NONE -> AddressConfiguration.None } } @@ -240,7 +240,7 @@ object ConfigurationMapper { return when (this) { Environment.TEST -> SDKEnvironment.TEST Environment.EUROPE -> SDKEnvironment.EUROPE - Environment.UNITEDSTATES -> SDKEnvironment.UNITED_STATES + Environment.UNITED_STATES -> SDKEnvironment.UNITED_STATES Environment.AUSTRALIA -> SDKEnvironment.AUSTRALIA Environment.INDIA -> SDKEnvironment.INDIA Environment.APSE -> SDKEnvironment.APSE @@ -346,9 +346,9 @@ object ConfigurationMapper { private fun TotalPriceStatus.mapToTotalPriceStatus(): String { return when (this) { - TotalPriceStatus.NOTCURRENTLYKNOWN -> "NOT_CURRENTLY_KNOWN" + TotalPriceStatus.NOT_CURRENTLY_KNOWN -> "NOT_CURRENTLY_KNOWN" TotalPriceStatus.ESTIMATED -> "ESTIMATED" - TotalPriceStatus.FINALPRICE -> "FINAL" + TotalPriceStatus.FINAL_PRICE -> "FINAL" } } diff --git a/ios/Classes/PlatformApi.swift b/ios/Classes/PlatformApi.swift index 856683d9..529b13b9 100644 --- a/ios/Classes/PlatformApi.swift +++ b/ios/Classes/PlatformApi.swift @@ -1,2460 +1,2150 @@ -// Autogenerated from Pigeon (v16.0.5), do not edit directly. +// Autogenerated from Pigeon (v21.1.0), do not edit directly. // See also: https://pub.dev/packages/pigeon import Foundation #if os(iOS) - import Flutter + import Flutter #elseif os(macOS) - import FlutterMacOS + import FlutterMacOS #else - #error("Unsupported platform.") + #error("Unsupported platform.") #endif +/// Error class for passing custom error details to Dart side. +final class PigeonError: Error { + let code: String + let message: String? + let details: Any? + + init(code: String, message: String?, details: Any?) { + self.code = code + self.message = message + self.details = details + } + + var localizedDescription: String { + return + "PigeonError(code: \(code), message: \(message ?? ""), details: \(details ?? "")" + } +} + private func wrapResult(_ result: Any?) -> [Any?] { - [result] + return [result] } private func wrapError(_ error: Any) -> [Any?] { - if let flutterError = error as? FlutterError { - return [ - flutterError.code, - flutterError.message, - flutterError.details - ] - } + if let pigeonError = error as? PigeonError { return [ - "\(error)", - "\(type(of: error))", - "Stacktrace: \(Thread.callStackSymbols)" + pigeonError.code, + pigeonError.message, + pigeonError.details, ] + } + if let flutterError = error as? FlutterError { + return [ + flutterError.code, + flutterError.message, + flutterError.details, + ] + } + return [ + "\(error)", + "\(type(of: error))", + "Stacktrace: \(Thread.callStackSymbols)", + ] } -private func createConnectionError(withChannelName channelName: String) -> FlutterError { - FlutterError(code: "channel-error", message: "Unable to establish connection on channel: '\(channelName)'.", details: "") +private func createConnectionError(withChannelName channelName: String) -> PigeonError { + return PigeonError(code: "channel-error", message: "Unable to establish connection on channel: '\(channelName)'.", details: "") } private func isNullish(_ value: Any?) -> Bool { - value is NSNull || value == nil + return value is NSNull || value == nil } private func nilOrValue(_ value: Any?) -> T? { - if value is NSNull { return nil } - return value as! T? + if value is NSNull { return nil } + return value as! T? } enum Environment: Int { - case test = 0 - case europe = 1 - case unitedStates = 2 - case australia = 3 - case india = 4 - case apse = 5 + case test = 0 + case europe = 1 + case unitedStates = 2 + case australia = 3 + case india = 4 + case apse = 5 } enum AddressMode: Int { - case full = 0 - case postalCode = 1 - case none = 2 + case full = 0 + case postalCode = 1 + case none = 2 } enum CardAuthMethod: Int { - case panOnly = 0 - case cryptogram3DS = 1 + case panOnly = 0 + case cryptogram3DS = 1 } enum TotalPriceStatus: Int { - case notCurrentlyKnown = 0 - case estimated = 1 - case finalPrice = 2 + case notCurrentlyKnown = 0 + case estimated = 1 + case finalPrice = 2 } enum GooglePayEnvironment: Int { - case test = 0 - case production = 1 + case test = 0 + case production = 1 } enum CashAppPayEnvironment: Int { - case sandbox = 0 - case production = 1 + case sandbox = 0 + case production = 1 } enum PaymentResultEnum: Int { - case cancelledByUser = 0 - case error = 1 - case finished = 2 + case cancelledByUser = 0 + case error = 1 + case finished = 2 } enum PlatformCommunicationType: Int { - case paymentComponent = 0 - case additionalDetails = 1 - case result = 2 - case deleteStoredPaymentMethod = 3 - case balanceCheck = 4 - case requestOrder = 5 - case cancelOrder = 6 + case paymentComponent = 0 + case additionalDetails = 1 + case result = 2 + case deleteStoredPaymentMethod = 3 + case balanceCheck = 4 + case requestOrder = 5 + case cancelOrder = 6 } enum ComponentCommunicationType: Int { - case onSubmit = 0 - case additionalDetails = 1 - case loading = 2 - case result = 3 - case resize = 4 + case onSubmit = 0 + case additionalDetails = 1 + case loading = 2 + case result = 3 + case resize = 4 } enum PaymentEventType: Int { - case finished = 0 - case action = 1 - case error = 2 - case update = 3 + case finished = 0 + case action = 1 + case error = 2 + case update = 3 } enum FieldVisibility: Int { - case show = 0 - case hide = 1 + case show = 0 + case hide = 1 } enum InstantPaymentType: Int { - case googlePay = 0 - case applePay = 1 - case instant = 2 + case googlePay = 0 + case applePay = 1 + case instant = 2 } enum ApplePayShippingType: Int { - case shipping = 0 - case delivery = 1 - case storePickup = 2 - case servicePickup = 3 + case shipping = 0 + case delivery = 1 + case storePickup = 2 + case servicePickup = 3 } enum ApplePayMerchantCapability: Int { - case debit = 0 - case credit = 1 + case debit = 0 + case credit = 1 } enum ApplePaySummaryItemType: Int { - case pending = 0 - case definite = 1 + case pending = 0 + case definite = 1 } enum CardNumberValidationResultDTO: Int { - case valid = 0 - case invalidIllegalCharacters = 1 - case invalidLuhnCheck = 2 - case invalidTooShort = 3 - case invalidTooLong = 4 - case invalidOtherReason = 5 + case valid = 0 + case invalidIllegalCharacters = 1 + case invalidLuhnCheck = 2 + case invalidTooShort = 3 + case invalidTooLong = 4 + case invalidOtherReason = 5 } enum CardExpiryDateValidationResultDTO: Int { - case valid = 0 - case invalidTooFarInTheFuture = 1 - case invalidTooOld = 2 - case nonParseableDate = 3 - case invalidOtherReason = 4 + case valid = 0 + case invalidTooFarInTheFuture = 1 + case invalidTooOld = 2 + case nonParseableDate = 3 + case invalidOtherReason = 4 } enum CardSecurityCodeValidationResultDTO: Int { - case valid = 0 - case invalid = 1 + case valid = 0 + case invalid = 1 } /// Generated class from Pigeon that represents data sent in messages. struct SessionDTO { - var id: String - var sessionData: String - var paymentMethodsJson: String - - static func fromList(_ list: [Any?]) -> SessionDTO? { - let id = list[0] as! String - let sessionData = list[1] as! String - let paymentMethodsJson = list[2] as! String - - return SessionDTO( - id: id, - sessionData: sessionData, - paymentMethodsJson: paymentMethodsJson - ) - } - - func toList() -> [Any?] { - [ - id, - sessionData, - paymentMethodsJson - ] - } + var id: String + var sessionData: String + var paymentMethodsJson: String + + // swift-format-ignore: AlwaysUseLowerCamelCase + static func fromList(_ __pigeon_list: [Any?]) -> SessionDTO? { + let id = __pigeon_list[0] as! String + let sessionData = __pigeon_list[1] as! String + let paymentMethodsJson = __pigeon_list[2] as! String + + return SessionDTO( + id: id, + sessionData: sessionData, + paymentMethodsJson: paymentMethodsJson + ) + } + func toList() -> [Any?] { + return [ + id, + sessionData, + paymentMethodsJson, + ] + } } /// Generated class from Pigeon that represents data sent in messages. struct AmountDTO { - var currency: String - var value: Int64 - - static func fromList(_ list: [Any?]) -> AmountDTO? { - let currency = list[0] as! String - let value = list[1] is Int64 ? list[1] as! Int64 : Int64(list[1] as! Int32) - - return AmountDTO( - currency: currency, - value: value - ) - } - - func toList() -> [Any?] { - [ - currency, - value - ] - } + var currency: String + var value: Int64 + + // swift-format-ignore: AlwaysUseLowerCamelCase + static func fromList(_ __pigeon_list: [Any?]) -> AmountDTO? { + let currency = __pigeon_list[0] as! String + let value = __pigeon_list[1] is Int64 ? __pigeon_list[1] as! Int64 : Int64(__pigeon_list[1] as! Int32) + + return AmountDTO( + currency: currency, + value: value + ) + } + func toList() -> [Any?] { + return [ + currency, + value, + ] + } } /// Generated class from Pigeon that represents data sent in messages. struct AnalyticsOptionsDTO { - var enabled: Bool - var version: String - - static func fromList(_ list: [Any?]) -> AnalyticsOptionsDTO? { - let enabled = list[0] as! Bool - let version = list[1] as! String - - return AnalyticsOptionsDTO( - enabled: enabled, - version: version - ) - } - - func toList() -> [Any?] { - [ - enabled, - version - ] - } + var enabled: Bool + var version: String + + // swift-format-ignore: AlwaysUseLowerCamelCase + static func fromList(_ __pigeon_list: [Any?]) -> AnalyticsOptionsDTO? { + let enabled = __pigeon_list[0] as! Bool + let version = __pigeon_list[1] as! String + + return AnalyticsOptionsDTO( + enabled: enabled, + version: version + ) + } + func toList() -> [Any?] { + return [ + enabled, + version, + ] + } } /// Generated class from Pigeon that represents data sent in messages. struct DropInConfigurationDTO { - var environment: Environment - var clientKey: String - var countryCode: String - var amount: AmountDTO? - var shopperLocale: String? - var cardConfigurationDTO: CardConfigurationDTO? - var applePayConfigurationDTO: ApplePayConfigurationDTO? - var googlePayConfigurationDTO: GooglePayConfigurationDTO? - var cashAppPayConfigurationDTO: CashAppPayConfigurationDTO? - var analyticsOptionsDTO: AnalyticsOptionsDTO - var showPreselectedStoredPaymentMethod: Bool - var skipListWhenSinglePaymentMethod: Bool - var isRemoveStoredPaymentMethodEnabled: Bool - var preselectedPaymentMethodTitle: String? - var paymentMethodNames: [String?: String?]? - var isPartialPaymentSupported: Bool - - static func fromList(_ list: [Any?]) -> DropInConfigurationDTO? { - let environment = Environment(rawValue: list[0] as! Int)! - let clientKey = list[1] as! String - let countryCode = list[2] as! String - var amount: AmountDTO? - if let amountList: [Any?] = nilOrValue(list[3]) { - amount = AmountDTO.fromList(amountList) - } - let shopperLocale: String? = nilOrValue(list[4]) - var cardConfigurationDTO: CardConfigurationDTO? - if let cardConfigurationDTOList: [Any?] = nilOrValue(list[5]) { - cardConfigurationDTO = CardConfigurationDTO.fromList(cardConfigurationDTOList) - } - var applePayConfigurationDTO: ApplePayConfigurationDTO? - if let applePayConfigurationDTOList: [Any?] = nilOrValue(list[6]) { - applePayConfigurationDTO = ApplePayConfigurationDTO.fromList(applePayConfigurationDTOList) - } - var googlePayConfigurationDTO: GooglePayConfigurationDTO? - if let googlePayConfigurationDTOList: [Any?] = nilOrValue(list[7]) { - googlePayConfigurationDTO = GooglePayConfigurationDTO.fromList(googlePayConfigurationDTOList) - } - var cashAppPayConfigurationDTO: CashAppPayConfigurationDTO? - if let cashAppPayConfigurationDTOList: [Any?] = nilOrValue(list[8]) { - cashAppPayConfigurationDTO = CashAppPayConfigurationDTO.fromList(cashAppPayConfigurationDTOList) - } - let analyticsOptionsDTO = AnalyticsOptionsDTO.fromList(list[9] as! [Any?])! - let showPreselectedStoredPaymentMethod = list[10] as! Bool - let skipListWhenSinglePaymentMethod = list[11] as! Bool - let isRemoveStoredPaymentMethodEnabled = list[12] as! Bool - let preselectedPaymentMethodTitle: String? = nilOrValue(list[13]) - let paymentMethodNames: [String?: String?]? = nilOrValue(list[14]) - let isPartialPaymentSupported = list[15] as! Bool - - return DropInConfigurationDTO( - environment: environment, - clientKey: clientKey, - countryCode: countryCode, - amount: amount, - shopperLocale: shopperLocale, - cardConfigurationDTO: cardConfigurationDTO, - applePayConfigurationDTO: applePayConfigurationDTO, - googlePayConfigurationDTO: googlePayConfigurationDTO, - cashAppPayConfigurationDTO: cashAppPayConfigurationDTO, - analyticsOptionsDTO: analyticsOptionsDTO, - showPreselectedStoredPaymentMethod: showPreselectedStoredPaymentMethod, - skipListWhenSinglePaymentMethod: skipListWhenSinglePaymentMethod, - isRemoveStoredPaymentMethodEnabled: isRemoveStoredPaymentMethodEnabled, - preselectedPaymentMethodTitle: preselectedPaymentMethodTitle, - paymentMethodNames: paymentMethodNames, - isPartialPaymentSupported: isPartialPaymentSupported - ) - } - - func toList() -> [Any?] { - [ - environment.rawValue, - clientKey, - countryCode, - amount?.toList(), - shopperLocale, - cardConfigurationDTO?.toList(), - applePayConfigurationDTO?.toList(), - googlePayConfigurationDTO?.toList(), - cashAppPayConfigurationDTO?.toList(), - analyticsOptionsDTO.toList(), - showPreselectedStoredPaymentMethod, - skipListWhenSinglePaymentMethod, - isRemoveStoredPaymentMethodEnabled, - preselectedPaymentMethodTitle, - paymentMethodNames, - isPartialPaymentSupported - ] - } + var environment: Environment + var clientKey: String + var countryCode: String + var amount: AmountDTO? = nil + var shopperLocale: String? = nil + var cardConfigurationDTO: CardConfigurationDTO? = nil + var applePayConfigurationDTO: ApplePayConfigurationDTO? = nil + var googlePayConfigurationDTO: GooglePayConfigurationDTO? = nil + var cashAppPayConfigurationDTO: CashAppPayConfigurationDTO? = nil + var analyticsOptionsDTO: AnalyticsOptionsDTO + var showPreselectedStoredPaymentMethod: Bool + var skipListWhenSinglePaymentMethod: Bool + var isRemoveStoredPaymentMethodEnabled: Bool + var preselectedPaymentMethodTitle: String? = nil + var paymentMethodNames: [String?: String?]? = nil + var isPartialPaymentSupported: Bool + + // swift-format-ignore: AlwaysUseLowerCamelCase + static func fromList(_ __pigeon_list: [Any?]) -> DropInConfigurationDTO? { + let environment = __pigeon_list[0] as! Environment + let clientKey = __pigeon_list[1] as! String + let countryCode = __pigeon_list[2] as! String + let amount: AmountDTO? = nilOrValue(__pigeon_list[3]) + let shopperLocale: String? = nilOrValue(__pigeon_list[4]) + let cardConfigurationDTO: CardConfigurationDTO? = nilOrValue(__pigeon_list[5]) + let applePayConfigurationDTO: ApplePayConfigurationDTO? = nilOrValue(__pigeon_list[6]) + let googlePayConfigurationDTO: GooglePayConfigurationDTO? = nilOrValue(__pigeon_list[7]) + let cashAppPayConfigurationDTO: CashAppPayConfigurationDTO? = nilOrValue(__pigeon_list[8]) + let analyticsOptionsDTO = __pigeon_list[9] as! AnalyticsOptionsDTO + let showPreselectedStoredPaymentMethod = __pigeon_list[10] as! Bool + let skipListWhenSinglePaymentMethod = __pigeon_list[11] as! Bool + let isRemoveStoredPaymentMethodEnabled = __pigeon_list[12] as! Bool + let preselectedPaymentMethodTitle: String? = nilOrValue(__pigeon_list[13]) + let paymentMethodNames: [String?: String?]? = nilOrValue(__pigeon_list[14]) + let isPartialPaymentSupported = __pigeon_list[15] as! Bool + + return DropInConfigurationDTO( + environment: environment, + clientKey: clientKey, + countryCode: countryCode, + amount: amount, + shopperLocale: shopperLocale, + cardConfigurationDTO: cardConfigurationDTO, + applePayConfigurationDTO: applePayConfigurationDTO, + googlePayConfigurationDTO: googlePayConfigurationDTO, + cashAppPayConfigurationDTO: cashAppPayConfigurationDTO, + analyticsOptionsDTO: analyticsOptionsDTO, + showPreselectedStoredPaymentMethod: showPreselectedStoredPaymentMethod, + skipListWhenSinglePaymentMethod: skipListWhenSinglePaymentMethod, + isRemoveStoredPaymentMethodEnabled: isRemoveStoredPaymentMethodEnabled, + preselectedPaymentMethodTitle: preselectedPaymentMethodTitle, + paymentMethodNames: paymentMethodNames, + isPartialPaymentSupported: isPartialPaymentSupported + ) + } + func toList() -> [Any?] { + return [ + environment, + clientKey, + countryCode, + amount, + shopperLocale, + cardConfigurationDTO, + applePayConfigurationDTO, + googlePayConfigurationDTO, + cashAppPayConfigurationDTO, + analyticsOptionsDTO, + showPreselectedStoredPaymentMethod, + skipListWhenSinglePaymentMethod, + isRemoveStoredPaymentMethodEnabled, + preselectedPaymentMethodTitle, + paymentMethodNames, + isPartialPaymentSupported, + ] + } } /// Generated class from Pigeon that represents data sent in messages. struct CardConfigurationDTO { - var holderNameRequired: Bool - var addressMode: AddressMode - var showStorePaymentField: Bool - var showCvcForStoredCard: Bool - var showCvc: Bool - var kcpFieldVisibility: FieldVisibility - var socialSecurityNumberFieldVisibility: FieldVisibility - var supportedCardTypes: [String?] - - static func fromList(_ list: [Any?]) -> CardConfigurationDTO? { - let holderNameRequired = list[0] as! Bool - let addressMode = AddressMode(rawValue: list[1] as! Int)! - let showStorePaymentField = list[2] as! Bool - let showCvcForStoredCard = list[3] as! Bool - let showCvc = list[4] as! Bool - let kcpFieldVisibility = FieldVisibility(rawValue: list[5] as! Int)! - let socialSecurityNumberFieldVisibility = FieldVisibility(rawValue: list[6] as! Int)! - let supportedCardTypes = list[7] as! [String?] - - return CardConfigurationDTO( - holderNameRequired: holderNameRequired, - addressMode: addressMode, - showStorePaymentField: showStorePaymentField, - showCvcForStoredCard: showCvcForStoredCard, - showCvc: showCvc, - kcpFieldVisibility: kcpFieldVisibility, - socialSecurityNumberFieldVisibility: socialSecurityNumberFieldVisibility, - supportedCardTypes: supportedCardTypes - ) - } - - func toList() -> [Any?] { - [ - holderNameRequired, - addressMode.rawValue, - showStorePaymentField, - showCvcForStoredCard, - showCvc, - kcpFieldVisibility.rawValue, - socialSecurityNumberFieldVisibility.rawValue, - supportedCardTypes - ] - } + var holderNameRequired: Bool + var addressMode: AddressMode + var showStorePaymentField: Bool + var showCvcForStoredCard: Bool + var showCvc: Bool + var kcpFieldVisibility: FieldVisibility + var socialSecurityNumberFieldVisibility: FieldVisibility + var supportedCardTypes: [String?] + + // swift-format-ignore: AlwaysUseLowerCamelCase + static func fromList(_ __pigeon_list: [Any?]) -> CardConfigurationDTO? { + let holderNameRequired = __pigeon_list[0] as! Bool + let addressMode = __pigeon_list[1] as! AddressMode + let showStorePaymentField = __pigeon_list[2] as! Bool + let showCvcForStoredCard = __pigeon_list[3] as! Bool + let showCvc = __pigeon_list[4] as! Bool + let kcpFieldVisibility = __pigeon_list[5] as! FieldVisibility + let socialSecurityNumberFieldVisibility = __pigeon_list[6] as! FieldVisibility + let supportedCardTypes = __pigeon_list[7] as! [String?] + + return CardConfigurationDTO( + holderNameRequired: holderNameRequired, + addressMode: addressMode, + showStorePaymentField: showStorePaymentField, + showCvcForStoredCard: showCvcForStoredCard, + showCvc: showCvc, + kcpFieldVisibility: kcpFieldVisibility, + socialSecurityNumberFieldVisibility: socialSecurityNumberFieldVisibility, + supportedCardTypes: supportedCardTypes + ) + } + func toList() -> [Any?] { + return [ + holderNameRequired, + addressMode, + showStorePaymentField, + showCvcForStoredCard, + showCvc, + kcpFieldVisibility, + socialSecurityNumberFieldVisibility, + supportedCardTypes, + ] + } } /// Generated class from Pigeon that represents data sent in messages. struct ApplePayConfigurationDTO { - var merchantId: String - var merchantName: String - var allowOnboarding: Bool? - var summaryItems: [ApplePaySummaryItemDTO?]? - var requiredBillingContactFields: [String?]? - var billingContact: ApplePayContactDTO? - var requiredShippingContactFields: [String?]? - var shippingContact: ApplePayContactDTO? - var applePayShippingType: ApplePayShippingType? - var allowShippingContactEditing: Bool? - var shippingMethods: [ApplePayShippingMethodDTO?]? - var applicationData: String? - var supportedCountries: [String?]? - var merchantCapability: ApplePayMerchantCapability? - - static func fromList(_ list: [Any?]) -> ApplePayConfigurationDTO? { - let merchantId = list[0] as! String - let merchantName = list[1] as! String - let allowOnboarding: Bool? = nilOrValue(list[2]) - let summaryItems: [ApplePaySummaryItemDTO?]? = nilOrValue(list[3]) - let requiredBillingContactFields: [String?]? = nilOrValue(list[4]) - var billingContact: ApplePayContactDTO? - if let billingContactList: [Any?] = nilOrValue(list[5]) { - billingContact = ApplePayContactDTO.fromList(billingContactList) - } - let requiredShippingContactFields: [String?]? = nilOrValue(list[6]) - var shippingContact: ApplePayContactDTO? - if let shippingContactList: [Any?] = nilOrValue(list[7]) { - shippingContact = ApplePayContactDTO.fromList(shippingContactList) - } - var applePayShippingType: ApplePayShippingType? - let applePayShippingTypeEnumVal: Int? = nilOrValue(list[8]) - if let applePayShippingTypeRawValue = applePayShippingTypeEnumVal { - applePayShippingType = ApplePayShippingType(rawValue: applePayShippingTypeRawValue)! - } - let allowShippingContactEditing: Bool? = nilOrValue(list[9]) - let shippingMethods: [ApplePayShippingMethodDTO?]? = nilOrValue(list[10]) - let applicationData: String? = nilOrValue(list[11]) - let supportedCountries: [String?]? = nilOrValue(list[12]) - var merchantCapability: ApplePayMerchantCapability? - let merchantCapabilityEnumVal: Int? = nilOrValue(list[13]) - if let merchantCapabilityRawValue = merchantCapabilityEnumVal { - merchantCapability = ApplePayMerchantCapability(rawValue: merchantCapabilityRawValue)! - } - - return ApplePayConfigurationDTO( - merchantId: merchantId, - merchantName: merchantName, - allowOnboarding: allowOnboarding, - summaryItems: summaryItems, - requiredBillingContactFields: requiredBillingContactFields, - billingContact: billingContact, - requiredShippingContactFields: requiredShippingContactFields, - shippingContact: shippingContact, - applePayShippingType: applePayShippingType, - allowShippingContactEditing: allowShippingContactEditing, - shippingMethods: shippingMethods, - applicationData: applicationData, - supportedCountries: supportedCountries, - merchantCapability: merchantCapability - ) - } - - func toList() -> [Any?] { - [ - merchantId, - merchantName, - allowOnboarding, - summaryItems, - requiredBillingContactFields, - billingContact?.toList(), - requiredShippingContactFields, - shippingContact?.toList(), - applePayShippingType?.rawValue, - allowShippingContactEditing, - shippingMethods, - applicationData, - supportedCountries, - merchantCapability?.rawValue - ] - } + var merchantId: String + var merchantName: String + var allowOnboarding: Bool? = nil + var summaryItems: [ApplePaySummaryItemDTO?]? = nil + var requiredBillingContactFields: [String?]? = nil + var billingContact: ApplePayContactDTO? = nil + var requiredShippingContactFields: [String?]? = nil + var shippingContact: ApplePayContactDTO? = nil + var applePayShippingType: ApplePayShippingType? = nil + var allowShippingContactEditing: Bool? = nil + var shippingMethods: [ApplePayShippingMethodDTO?]? = nil + var applicationData: String? = nil + var supportedCountries: [String?]? = nil + var merchantCapability: ApplePayMerchantCapability? = nil + + // swift-format-ignore: AlwaysUseLowerCamelCase + static func fromList(_ __pigeon_list: [Any?]) -> ApplePayConfigurationDTO? { + let merchantId = __pigeon_list[0] as! String + let merchantName = __pigeon_list[1] as! String + let allowOnboarding: Bool? = nilOrValue(__pigeon_list[2]) + let summaryItems: [ApplePaySummaryItemDTO?]? = nilOrValue(__pigeon_list[3]) + let requiredBillingContactFields: [String?]? = nilOrValue(__pigeon_list[4]) + let billingContact: ApplePayContactDTO? = nilOrValue(__pigeon_list[5]) + let requiredShippingContactFields: [String?]? = nilOrValue(__pigeon_list[6]) + let shippingContact: ApplePayContactDTO? = nilOrValue(__pigeon_list[7]) + let applePayShippingType: ApplePayShippingType? = nilOrValue(__pigeon_list[8]) + let allowShippingContactEditing: Bool? = nilOrValue(__pigeon_list[9]) + let shippingMethods: [ApplePayShippingMethodDTO?]? = nilOrValue(__pigeon_list[10]) + let applicationData: String? = nilOrValue(__pigeon_list[11]) + let supportedCountries: [String?]? = nilOrValue(__pigeon_list[12]) + let merchantCapability: ApplePayMerchantCapability? = nilOrValue(__pigeon_list[13]) + + return ApplePayConfigurationDTO( + merchantId: merchantId, + merchantName: merchantName, + allowOnboarding: allowOnboarding, + summaryItems: summaryItems, + requiredBillingContactFields: requiredBillingContactFields, + billingContact: billingContact, + requiredShippingContactFields: requiredShippingContactFields, + shippingContact: shippingContact, + applePayShippingType: applePayShippingType, + allowShippingContactEditing: allowShippingContactEditing, + shippingMethods: shippingMethods, + applicationData: applicationData, + supportedCountries: supportedCountries, + merchantCapability: merchantCapability + ) + } + func toList() -> [Any?] { + return [ + merchantId, + merchantName, + allowOnboarding, + summaryItems, + requiredBillingContactFields, + billingContact, + requiredShippingContactFields, + shippingContact, + applePayShippingType, + allowShippingContactEditing, + shippingMethods, + applicationData, + supportedCountries, + merchantCapability, + ] + } } /// Generated class from Pigeon that represents data sent in messages. struct ApplePayContactDTO { - var phoneNumber: String? - var emailAddress: String? - var givenName: String? - var familyName: String? - var phoneticGivenName: String? - var phoneticFamilyName: String? - var addressLines: [String?]? - var subLocality: String? - var city: String? - var postalCode: String? - var subAdministrativeArea: String? - var administrativeArea: String? - var country: String? - var countryCode: String? - - static func fromList(_ list: [Any?]) -> ApplePayContactDTO? { - let phoneNumber: String? = nilOrValue(list[0]) - let emailAddress: String? = nilOrValue(list[1]) - let givenName: String? = nilOrValue(list[2]) - let familyName: String? = nilOrValue(list[3]) - let phoneticGivenName: String? = nilOrValue(list[4]) - let phoneticFamilyName: String? = nilOrValue(list[5]) - let addressLines: [String?]? = nilOrValue(list[6]) - let subLocality: String? = nilOrValue(list[7]) - let city: String? = nilOrValue(list[8]) - let postalCode: String? = nilOrValue(list[9]) - let subAdministrativeArea: String? = nilOrValue(list[10]) - let administrativeArea: String? = nilOrValue(list[11]) - let country: String? = nilOrValue(list[12]) - let countryCode: String? = nilOrValue(list[13]) - - return ApplePayContactDTO( - phoneNumber: phoneNumber, - emailAddress: emailAddress, - givenName: givenName, - familyName: familyName, - phoneticGivenName: phoneticGivenName, - phoneticFamilyName: phoneticFamilyName, - addressLines: addressLines, - subLocality: subLocality, - city: city, - postalCode: postalCode, - subAdministrativeArea: subAdministrativeArea, - administrativeArea: administrativeArea, - country: country, - countryCode: countryCode - ) - } - - func toList() -> [Any?] { - [ - phoneNumber, - emailAddress, - givenName, - familyName, - phoneticGivenName, - phoneticFamilyName, - addressLines, - subLocality, - city, - postalCode, - subAdministrativeArea, - administrativeArea, - country, - countryCode - ] - } + var phoneNumber: String? = nil + var emailAddress: String? = nil + var givenName: String? = nil + var familyName: String? = nil + var phoneticGivenName: String? = nil + var phoneticFamilyName: String? = nil + var addressLines: [String?]? = nil + var subLocality: String? = nil + var city: String? = nil + var postalCode: String? = nil + var subAdministrativeArea: String? = nil + var administrativeArea: String? = nil + var country: String? = nil + var countryCode: String? = nil + + // swift-format-ignore: AlwaysUseLowerCamelCase + static func fromList(_ __pigeon_list: [Any?]) -> ApplePayContactDTO? { + let phoneNumber: String? = nilOrValue(__pigeon_list[0]) + let emailAddress: String? = nilOrValue(__pigeon_list[1]) + let givenName: String? = nilOrValue(__pigeon_list[2]) + let familyName: String? = nilOrValue(__pigeon_list[3]) + let phoneticGivenName: String? = nilOrValue(__pigeon_list[4]) + let phoneticFamilyName: String? = nilOrValue(__pigeon_list[5]) + let addressLines: [String?]? = nilOrValue(__pigeon_list[6]) + let subLocality: String? = nilOrValue(__pigeon_list[7]) + let city: String? = nilOrValue(__pigeon_list[8]) + let postalCode: String? = nilOrValue(__pigeon_list[9]) + let subAdministrativeArea: String? = nilOrValue(__pigeon_list[10]) + let administrativeArea: String? = nilOrValue(__pigeon_list[11]) + let country: String? = nilOrValue(__pigeon_list[12]) + let countryCode: String? = nilOrValue(__pigeon_list[13]) + + return ApplePayContactDTO( + phoneNumber: phoneNumber, + emailAddress: emailAddress, + givenName: givenName, + familyName: familyName, + phoneticGivenName: phoneticGivenName, + phoneticFamilyName: phoneticFamilyName, + addressLines: addressLines, + subLocality: subLocality, + city: city, + postalCode: postalCode, + subAdministrativeArea: subAdministrativeArea, + administrativeArea: administrativeArea, + country: country, + countryCode: countryCode + ) + } + func toList() -> [Any?] { + return [ + phoneNumber, + emailAddress, + givenName, + familyName, + phoneticGivenName, + phoneticFamilyName, + addressLines, + subLocality, + city, + postalCode, + subAdministrativeArea, + administrativeArea, + country, + countryCode, + ] + } } /// Generated class from Pigeon that represents data sent in messages. struct ApplePayShippingMethodDTO { - var label: String - var detail: String - var amount: AmountDTO - var identifier: String - var startDate: String? - var endDate: String? - - static func fromList(_ list: [Any?]) -> ApplePayShippingMethodDTO? { - let label = list[0] as! String - let detail = list[1] as! String - let amount = AmountDTO.fromList(list[2] as! [Any?])! - let identifier = list[3] as! String - let startDate: String? = nilOrValue(list[4]) - let endDate: String? = nilOrValue(list[5]) - - return ApplePayShippingMethodDTO( - label: label, - detail: detail, - amount: amount, - identifier: identifier, - startDate: startDate, - endDate: endDate - ) - } - - func toList() -> [Any?] { - [ - label, - detail, - amount.toList(), - identifier, - startDate, - endDate - ] - } + var label: String + var detail: String + var amount: AmountDTO + var identifier: String + var startDate: String? = nil + var endDate: String? = nil + + // swift-format-ignore: AlwaysUseLowerCamelCase + static func fromList(_ __pigeon_list: [Any?]) -> ApplePayShippingMethodDTO? { + let label = __pigeon_list[0] as! String + let detail = __pigeon_list[1] as! String + let amount = __pigeon_list[2] as! AmountDTO + let identifier = __pigeon_list[3] as! String + let startDate: String? = nilOrValue(__pigeon_list[4]) + let endDate: String? = nilOrValue(__pigeon_list[5]) + + return ApplePayShippingMethodDTO( + label: label, + detail: detail, + amount: amount, + identifier: identifier, + startDate: startDate, + endDate: endDate + ) + } + func toList() -> [Any?] { + return [ + label, + detail, + amount, + identifier, + startDate, + endDate, + ] + } } /// Generated class from Pigeon that represents data sent in messages. struct ApplePaySummaryItemDTO { - var label: String - var amount: AmountDTO - var type: ApplePaySummaryItemType - - static func fromList(_ list: [Any?]) -> ApplePaySummaryItemDTO? { - let label = list[0] as! String - let amount = AmountDTO.fromList(list[1] as! [Any?])! - let type = ApplePaySummaryItemType(rawValue: list[2] as! Int)! - - return ApplePaySummaryItemDTO( - label: label, - amount: amount, - type: type - ) - } - - func toList() -> [Any?] { - [ - label, - amount.toList(), - type.rawValue - ] - } + var label: String + var amount: AmountDTO + var type: ApplePaySummaryItemType + + // swift-format-ignore: AlwaysUseLowerCamelCase + static func fromList(_ __pigeon_list: [Any?]) -> ApplePaySummaryItemDTO? { + let label = __pigeon_list[0] as! String + let amount = __pigeon_list[1] as! AmountDTO + let type = __pigeon_list[2] as! ApplePaySummaryItemType + + return ApplePaySummaryItemDTO( + label: label, + amount: amount, + type: type + ) + } + func toList() -> [Any?] { + return [ + label, + amount, + type, + ] + } } /// Generated class from Pigeon that represents data sent in messages. struct GooglePayConfigurationDTO { - var googlePayEnvironment: GooglePayEnvironment - var merchantAccount: String? - var merchantInfoDTO: MerchantInfoDTO? - var totalPriceStatus: TotalPriceStatus? - var allowedCardNetworks: [String?]? - var allowedAuthMethods: [String?]? - var allowPrepaidCards: Bool? - var allowCreditCards: Bool? - var assuranceDetailsRequired: Bool? - var emailRequired: Bool? - var existingPaymentMethodRequired: Bool? - var shippingAddressRequired: Bool? - var shippingAddressParametersDTO: ShippingAddressParametersDTO? - var billingAddressRequired: Bool? - var billingAddressParametersDTO: BillingAddressParametersDTO? - - static func fromList(_ list: [Any?]) -> GooglePayConfigurationDTO? { - let googlePayEnvironment = GooglePayEnvironment(rawValue: list[0] as! Int)! - let merchantAccount: String? = nilOrValue(list[1]) - var merchantInfoDTO: MerchantInfoDTO? - if let merchantInfoDTOList: [Any?] = nilOrValue(list[2]) { - merchantInfoDTO = MerchantInfoDTO.fromList(merchantInfoDTOList) - } - var totalPriceStatus: TotalPriceStatus? - let totalPriceStatusEnumVal: Int? = nilOrValue(list[3]) - if let totalPriceStatusRawValue = totalPriceStatusEnumVal { - totalPriceStatus = TotalPriceStatus(rawValue: totalPriceStatusRawValue)! - } - let allowedCardNetworks: [String?]? = nilOrValue(list[4]) - let allowedAuthMethods: [String?]? = nilOrValue(list[5]) - let allowPrepaidCards: Bool? = nilOrValue(list[6]) - let allowCreditCards: Bool? = nilOrValue(list[7]) - let assuranceDetailsRequired: Bool? = nilOrValue(list[8]) - let emailRequired: Bool? = nilOrValue(list[9]) - let existingPaymentMethodRequired: Bool? = nilOrValue(list[10]) - let shippingAddressRequired: Bool? = nilOrValue(list[11]) - var shippingAddressParametersDTO: ShippingAddressParametersDTO? - if let shippingAddressParametersDTOList: [Any?] = nilOrValue(list[12]) { - shippingAddressParametersDTO = ShippingAddressParametersDTO.fromList(shippingAddressParametersDTOList) - } - let billingAddressRequired: Bool? = nilOrValue(list[13]) - var billingAddressParametersDTO: BillingAddressParametersDTO? - if let billingAddressParametersDTOList: [Any?] = nilOrValue(list[14]) { - billingAddressParametersDTO = BillingAddressParametersDTO.fromList(billingAddressParametersDTOList) - } - - return GooglePayConfigurationDTO( - googlePayEnvironment: googlePayEnvironment, - merchantAccount: merchantAccount, - merchantInfoDTO: merchantInfoDTO, - totalPriceStatus: totalPriceStatus, - allowedCardNetworks: allowedCardNetworks, - allowedAuthMethods: allowedAuthMethods, - allowPrepaidCards: allowPrepaidCards, - allowCreditCards: allowCreditCards, - assuranceDetailsRequired: assuranceDetailsRequired, - emailRequired: emailRequired, - existingPaymentMethodRequired: existingPaymentMethodRequired, - shippingAddressRequired: shippingAddressRequired, - shippingAddressParametersDTO: shippingAddressParametersDTO, - billingAddressRequired: billingAddressRequired, - billingAddressParametersDTO: billingAddressParametersDTO - ) - } - - func toList() -> [Any?] { - [ - googlePayEnvironment.rawValue, - merchantAccount, - merchantInfoDTO?.toList(), - totalPriceStatus?.rawValue, - allowedCardNetworks, - allowedAuthMethods, - allowPrepaidCards, - allowCreditCards, - assuranceDetailsRequired, - emailRequired, - existingPaymentMethodRequired, - shippingAddressRequired, - shippingAddressParametersDTO?.toList(), - billingAddressRequired, - billingAddressParametersDTO?.toList() - ] - } + var googlePayEnvironment: GooglePayEnvironment + var merchantAccount: String? = nil + var merchantInfoDTO: MerchantInfoDTO? = nil + var totalPriceStatus: TotalPriceStatus? = nil + var allowedCardNetworks: [String?]? = nil + var allowedAuthMethods: [String?]? = nil + var allowPrepaidCards: Bool? = nil + var allowCreditCards: Bool? = nil + var assuranceDetailsRequired: Bool? = nil + var emailRequired: Bool? = nil + var existingPaymentMethodRequired: Bool? = nil + var shippingAddressRequired: Bool? = nil + var shippingAddressParametersDTO: ShippingAddressParametersDTO? = nil + var billingAddressRequired: Bool? = nil + var billingAddressParametersDTO: BillingAddressParametersDTO? = nil + + // swift-format-ignore: AlwaysUseLowerCamelCase + static func fromList(_ __pigeon_list: [Any?]) -> GooglePayConfigurationDTO? { + let googlePayEnvironment = __pigeon_list[0] as! GooglePayEnvironment + let merchantAccount: String? = nilOrValue(__pigeon_list[1]) + let merchantInfoDTO: MerchantInfoDTO? = nilOrValue(__pigeon_list[2]) + let totalPriceStatus: TotalPriceStatus? = nilOrValue(__pigeon_list[3]) + let allowedCardNetworks: [String?]? = nilOrValue(__pigeon_list[4]) + let allowedAuthMethods: [String?]? = nilOrValue(__pigeon_list[5]) + let allowPrepaidCards: Bool? = nilOrValue(__pigeon_list[6]) + let allowCreditCards: Bool? = nilOrValue(__pigeon_list[7]) + let assuranceDetailsRequired: Bool? = nilOrValue(__pigeon_list[8]) + let emailRequired: Bool? = nilOrValue(__pigeon_list[9]) + let existingPaymentMethodRequired: Bool? = nilOrValue(__pigeon_list[10]) + let shippingAddressRequired: Bool? = nilOrValue(__pigeon_list[11]) + let shippingAddressParametersDTO: ShippingAddressParametersDTO? = nilOrValue(__pigeon_list[12]) + let billingAddressRequired: Bool? = nilOrValue(__pigeon_list[13]) + let billingAddressParametersDTO: BillingAddressParametersDTO? = nilOrValue(__pigeon_list[14]) + + return GooglePayConfigurationDTO( + googlePayEnvironment: googlePayEnvironment, + merchantAccount: merchantAccount, + merchantInfoDTO: merchantInfoDTO, + totalPriceStatus: totalPriceStatus, + allowedCardNetworks: allowedCardNetworks, + allowedAuthMethods: allowedAuthMethods, + allowPrepaidCards: allowPrepaidCards, + allowCreditCards: allowCreditCards, + assuranceDetailsRequired: assuranceDetailsRequired, + emailRequired: emailRequired, + existingPaymentMethodRequired: existingPaymentMethodRequired, + shippingAddressRequired: shippingAddressRequired, + shippingAddressParametersDTO: shippingAddressParametersDTO, + billingAddressRequired: billingAddressRequired, + billingAddressParametersDTO: billingAddressParametersDTO + ) + } + func toList() -> [Any?] { + return [ + googlePayEnvironment, + merchantAccount, + merchantInfoDTO, + totalPriceStatus, + allowedCardNetworks, + allowedAuthMethods, + allowPrepaidCards, + allowCreditCards, + assuranceDetailsRequired, + emailRequired, + existingPaymentMethodRequired, + shippingAddressRequired, + shippingAddressParametersDTO, + billingAddressRequired, + billingAddressParametersDTO, + ] + } } /// Generated class from Pigeon that represents data sent in messages. struct MerchantInfoDTO { - var merchantName: String? - var merchantId: String? - - static func fromList(_ list: [Any?]) -> MerchantInfoDTO? { - let merchantName: String? = nilOrValue(list[0]) - let merchantId: String? = nilOrValue(list[1]) - - return MerchantInfoDTO( - merchantName: merchantName, - merchantId: merchantId - ) - } - - func toList() -> [Any?] { - [ - merchantName, - merchantId - ] - } + var merchantName: String? = nil + var merchantId: String? = nil + + // swift-format-ignore: AlwaysUseLowerCamelCase + static func fromList(_ __pigeon_list: [Any?]) -> MerchantInfoDTO? { + let merchantName: String? = nilOrValue(__pigeon_list[0]) + let merchantId: String? = nilOrValue(__pigeon_list[1]) + + return MerchantInfoDTO( + merchantName: merchantName, + merchantId: merchantId + ) + } + func toList() -> [Any?] { + return [ + merchantName, + merchantId, + ] + } } /// Generated class from Pigeon that represents data sent in messages. struct ShippingAddressParametersDTO { - var allowedCountryCodes: [String?]? - var isPhoneNumberRequired: Bool? - - static func fromList(_ list: [Any?]) -> ShippingAddressParametersDTO? { - let allowedCountryCodes: [String?]? = nilOrValue(list[0]) - let isPhoneNumberRequired: Bool? = nilOrValue(list[1]) - - return ShippingAddressParametersDTO( - allowedCountryCodes: allowedCountryCodes, - isPhoneNumberRequired: isPhoneNumberRequired - ) - } - - func toList() -> [Any?] { - [ - allowedCountryCodes, - isPhoneNumberRequired - ] - } + var allowedCountryCodes: [String?]? = nil + var isPhoneNumberRequired: Bool? = nil + + // swift-format-ignore: AlwaysUseLowerCamelCase + static func fromList(_ __pigeon_list: [Any?]) -> ShippingAddressParametersDTO? { + let allowedCountryCodes: [String?]? = nilOrValue(__pigeon_list[0]) + let isPhoneNumberRequired: Bool? = nilOrValue(__pigeon_list[1]) + + return ShippingAddressParametersDTO( + allowedCountryCodes: allowedCountryCodes, + isPhoneNumberRequired: isPhoneNumberRequired + ) + } + func toList() -> [Any?] { + return [ + allowedCountryCodes, + isPhoneNumberRequired, + ] + } } /// Generated class from Pigeon that represents data sent in messages. struct BillingAddressParametersDTO { - var format: String? - var isPhoneNumberRequired: Bool? - - static func fromList(_ list: [Any?]) -> BillingAddressParametersDTO? { - let format: String? = nilOrValue(list[0]) - let isPhoneNumberRequired: Bool? = nilOrValue(list[1]) - - return BillingAddressParametersDTO( - format: format, - isPhoneNumberRequired: isPhoneNumberRequired - ) - } - - func toList() -> [Any?] { - [ - format, - isPhoneNumberRequired - ] - } + var format: String? = nil + var isPhoneNumberRequired: Bool? = nil + + // swift-format-ignore: AlwaysUseLowerCamelCase + static func fromList(_ __pigeon_list: [Any?]) -> BillingAddressParametersDTO? { + let format: String? = nilOrValue(__pigeon_list[0]) + let isPhoneNumberRequired: Bool? = nilOrValue(__pigeon_list[1]) + + return BillingAddressParametersDTO( + format: format, + isPhoneNumberRequired: isPhoneNumberRequired + ) + } + func toList() -> [Any?] { + return [ + format, + isPhoneNumberRequired, + ] + } } /// Generated class from Pigeon that represents data sent in messages. struct CashAppPayConfigurationDTO { - var cashAppPayEnvironment: CashAppPayEnvironment - var returnUrl: String - - static func fromList(_ list: [Any?]) -> CashAppPayConfigurationDTO? { - let cashAppPayEnvironment = CashAppPayEnvironment(rawValue: list[0] as! Int)! - let returnUrl = list[1] as! String - - return CashAppPayConfigurationDTO( - cashAppPayEnvironment: cashAppPayEnvironment, - returnUrl: returnUrl - ) - } - - func toList() -> [Any?] { - [ - cashAppPayEnvironment.rawValue, - returnUrl - ] - } + var cashAppPayEnvironment: CashAppPayEnvironment + var returnUrl: String + + // swift-format-ignore: AlwaysUseLowerCamelCase + static func fromList(_ __pigeon_list: [Any?]) -> CashAppPayConfigurationDTO? { + let cashAppPayEnvironment = __pigeon_list[0] as! CashAppPayEnvironment + let returnUrl = __pigeon_list[1] as! String + + return CashAppPayConfigurationDTO( + cashAppPayEnvironment: cashAppPayEnvironment, + returnUrl: returnUrl + ) + } + func toList() -> [Any?] { + return [ + cashAppPayEnvironment, + returnUrl, + ] + } } /// Generated class from Pigeon that represents data sent in messages. struct PaymentResultDTO { - var type: PaymentResultEnum - var reason: String? - var result: PaymentResultModelDTO? - - static func fromList(_ list: [Any?]) -> PaymentResultDTO? { - let type = PaymentResultEnum(rawValue: list[0] as! Int)! - let reason: String? = nilOrValue(list[1]) - var result: PaymentResultModelDTO? - if let resultList: [Any?] = nilOrValue(list[2]) { - result = PaymentResultModelDTO.fromList(resultList) - } - - return PaymentResultDTO( - type: type, - reason: reason, - result: result - ) - } - - func toList() -> [Any?] { - [ - type.rawValue, - reason, - result?.toList() - ] - } + var type: PaymentResultEnum + var reason: String? = nil + var result: PaymentResultModelDTO? = nil + + // swift-format-ignore: AlwaysUseLowerCamelCase + static func fromList(_ __pigeon_list: [Any?]) -> PaymentResultDTO? { + let type = __pigeon_list[0] as! PaymentResultEnum + let reason: String? = nilOrValue(__pigeon_list[1]) + let result: PaymentResultModelDTO? = nilOrValue(__pigeon_list[2]) + + return PaymentResultDTO( + type: type, + reason: reason, + result: result + ) + } + func toList() -> [Any?] { + return [ + type, + reason, + result, + ] + } } /// Generated class from Pigeon that represents data sent in messages. struct PaymentResultModelDTO { - var sessionId: String? - var sessionData: String? - var sessionResult: String? - var resultCode: String? - var order: OrderResponseDTO? - - static func fromList(_ list: [Any?]) -> PaymentResultModelDTO? { - let sessionId: String? = nilOrValue(list[0]) - let sessionData: String? = nilOrValue(list[1]) - let sessionResult: String? = nilOrValue(list[2]) - let resultCode: String? = nilOrValue(list[3]) - var order: OrderResponseDTO? - if let orderList: [Any?] = nilOrValue(list[4]) { - order = OrderResponseDTO.fromList(orderList) - } - - return PaymentResultModelDTO( - sessionId: sessionId, - sessionData: sessionData, - sessionResult: sessionResult, - resultCode: resultCode, - order: order - ) - } - - func toList() -> [Any?] { - [ - sessionId, - sessionData, - sessionResult, - resultCode, - order?.toList() - ] - } + var sessionId: String? = nil + var sessionData: String? = nil + var sessionResult: String? = nil + var resultCode: String? = nil + var order: OrderResponseDTO? = nil + + // swift-format-ignore: AlwaysUseLowerCamelCase + static func fromList(_ __pigeon_list: [Any?]) -> PaymentResultModelDTO? { + let sessionId: String? = nilOrValue(__pigeon_list[0]) + let sessionData: String? = nilOrValue(__pigeon_list[1]) + let sessionResult: String? = nilOrValue(__pigeon_list[2]) + let resultCode: String? = nilOrValue(__pigeon_list[3]) + let order: OrderResponseDTO? = nilOrValue(__pigeon_list[4]) + + return PaymentResultModelDTO( + sessionId: sessionId, + sessionData: sessionData, + sessionResult: sessionResult, + resultCode: resultCode, + order: order + ) + } + func toList() -> [Any?] { + return [ + sessionId, + sessionData, + sessionResult, + resultCode, + order, + ] + } } /// Generated class from Pigeon that represents data sent in messages. struct OrderResponseDTO { - var pspReference: String - var orderData: String - var amount: AmountDTO? - var remainingAmount: AmountDTO? - - static func fromList(_ list: [Any?]) -> OrderResponseDTO? { - let pspReference = list[0] as! String - let orderData = list[1] as! String - var amount: AmountDTO? - if let amountList: [Any?] = nilOrValue(list[2]) { - amount = AmountDTO.fromList(amountList) - } - var remainingAmount: AmountDTO? - if let remainingAmountList: [Any?] = nilOrValue(list[3]) { - remainingAmount = AmountDTO.fromList(remainingAmountList) - } - - return OrderResponseDTO( - pspReference: pspReference, - orderData: orderData, - amount: amount, - remainingAmount: remainingAmount - ) - } - - func toList() -> [Any?] { - [ - pspReference, - orderData, - amount?.toList(), - remainingAmount?.toList() - ] - } + var pspReference: String + var orderData: String + var amount: AmountDTO? = nil + var remainingAmount: AmountDTO? = nil + + // swift-format-ignore: AlwaysUseLowerCamelCase + static func fromList(_ __pigeon_list: [Any?]) -> OrderResponseDTO? { + let pspReference = __pigeon_list[0] as! String + let orderData = __pigeon_list[1] as! String + let amount: AmountDTO? = nilOrValue(__pigeon_list[2]) + let remainingAmount: AmountDTO? = nilOrValue(__pigeon_list[3]) + + return OrderResponseDTO( + pspReference: pspReference, + orderData: orderData, + amount: amount, + remainingAmount: remainingAmount + ) + } + func toList() -> [Any?] { + return [ + pspReference, + orderData, + amount, + remainingAmount, + ] + } } /// Generated class from Pigeon that represents data sent in messages. struct PlatformCommunicationModel { - var type: PlatformCommunicationType - var data: String? - var paymentResult: PaymentResultDTO? - - static func fromList(_ list: [Any?]) -> PlatformCommunicationModel? { - let type = PlatformCommunicationType(rawValue: list[0] as! Int)! - let data: String? = nilOrValue(list[1]) - var paymentResult: PaymentResultDTO? - if let paymentResultList: [Any?] = nilOrValue(list[2]) { - paymentResult = PaymentResultDTO.fromList(paymentResultList) - } - - return PlatformCommunicationModel( - type: type, - data: data, - paymentResult: paymentResult - ) - } - - func toList() -> [Any?] { - [ - type.rawValue, - data, - paymentResult?.toList() - ] - } + var type: PlatformCommunicationType + var data: String? = nil + var paymentResult: PaymentResultDTO? = nil + + // swift-format-ignore: AlwaysUseLowerCamelCase + static func fromList(_ __pigeon_list: [Any?]) -> PlatformCommunicationModel? { + let type = __pigeon_list[0] as! PlatformCommunicationType + let data: String? = nilOrValue(__pigeon_list[1]) + let paymentResult: PaymentResultDTO? = nilOrValue(__pigeon_list[2]) + + return PlatformCommunicationModel( + type: type, + data: data, + paymentResult: paymentResult + ) + } + func toList() -> [Any?] { + return [ + type, + data, + paymentResult, + ] + } } /// Generated class from Pigeon that represents data sent in messages. struct ComponentCommunicationModel { - var type: ComponentCommunicationType - var componentId: String - var data: Any? - var paymentResult: PaymentResultDTO? - - static func fromList(_ list: [Any?]) -> ComponentCommunicationModel? { - let type = ComponentCommunicationType(rawValue: list[0] as! Int)! - let componentId = list[1] as! String - let data: Any? = list[2] - var paymentResult: PaymentResultDTO? - if let paymentResultList: [Any?] = nilOrValue(list[3]) { - paymentResult = PaymentResultDTO.fromList(paymentResultList) - } - - return ComponentCommunicationModel( - type: type, - componentId: componentId, - data: data, - paymentResult: paymentResult - ) - } - - func toList() -> [Any?] { - [ - type.rawValue, - componentId, - data, - paymentResult?.toList() - ] - } + var type: ComponentCommunicationType + var componentId: String + var data: Any? = nil + var paymentResult: PaymentResultDTO? = nil + + // swift-format-ignore: AlwaysUseLowerCamelCase + static func fromList(_ __pigeon_list: [Any?]) -> ComponentCommunicationModel? { + let type = __pigeon_list[0] as! ComponentCommunicationType + let componentId = __pigeon_list[1] as! String + let data: Any? = __pigeon_list[2] + let paymentResult: PaymentResultDTO? = nilOrValue(__pigeon_list[3]) + + return ComponentCommunicationModel( + type: type, + componentId: componentId, + data: data, + paymentResult: paymentResult + ) + } + func toList() -> [Any?] { + return [ + type, + componentId, + data, + paymentResult, + ] + } } /// Generated class from Pigeon that represents data sent in messages. struct PaymentEventDTO { - var paymentEventType: PaymentEventType - var result: String? - var data: [String?: Any?]? - var error: ErrorDTO? - - static func fromList(_ list: [Any?]) -> PaymentEventDTO? { - let paymentEventType = PaymentEventType(rawValue: list[0] as! Int)! - let result: String? = nilOrValue(list[1]) - let data: [String?: Any?]? = nilOrValue(list[2]) - var error: ErrorDTO? - if let errorList: [Any?] = nilOrValue(list[3]) { - error = ErrorDTO.fromList(errorList) - } - - return PaymentEventDTO( - paymentEventType: paymentEventType, - result: result, - data: data, - error: error - ) - } - - func toList() -> [Any?] { - [ - paymentEventType.rawValue, - result, - data, - error?.toList() - ] - } + var paymentEventType: PaymentEventType + var result: String? = nil + var data: [String?: Any?]? = nil + var error: ErrorDTO? = nil + + // swift-format-ignore: AlwaysUseLowerCamelCase + static func fromList(_ __pigeon_list: [Any?]) -> PaymentEventDTO? { + let paymentEventType = __pigeon_list[0] as! PaymentEventType + let result: String? = nilOrValue(__pigeon_list[1]) + let data: [String?: Any?]? = nilOrValue(__pigeon_list[2]) + let error: ErrorDTO? = nilOrValue(__pigeon_list[3]) + + return PaymentEventDTO( + paymentEventType: paymentEventType, + result: result, + data: data, + error: error + ) + } + func toList() -> [Any?] { + return [ + paymentEventType, + result, + data, + error, + ] + } } /// Generated class from Pigeon that represents data sent in messages. struct ErrorDTO { - var errorMessage: String? - var reason: String? - var dismissDropIn: Bool? - - static func fromList(_ list: [Any?]) -> ErrorDTO? { - let errorMessage: String? = nilOrValue(list[0]) - let reason: String? = nilOrValue(list[1]) - let dismissDropIn: Bool? = nilOrValue(list[2]) - - return ErrorDTO( - errorMessage: errorMessage, - reason: reason, - dismissDropIn: dismissDropIn - ) - } - - func toList() -> [Any?] { - [ - errorMessage, - reason, - dismissDropIn - ] - } + var errorMessage: String? = nil + var reason: String? = nil + var dismissDropIn: Bool? = nil + + // swift-format-ignore: AlwaysUseLowerCamelCase + static func fromList(_ __pigeon_list: [Any?]) -> ErrorDTO? { + let errorMessage: String? = nilOrValue(__pigeon_list[0]) + let reason: String? = nilOrValue(__pigeon_list[1]) + let dismissDropIn: Bool? = nilOrValue(__pigeon_list[2]) + + return ErrorDTO( + errorMessage: errorMessage, + reason: reason, + dismissDropIn: dismissDropIn + ) + } + func toList() -> [Any?] { + return [ + errorMessage, + reason, + dismissDropIn, + ] + } } /// Generated class from Pigeon that represents data sent in messages. struct DeletedStoredPaymentMethodResultDTO { - var storedPaymentMethodId: String - var isSuccessfullyRemoved: Bool - - static func fromList(_ list: [Any?]) -> DeletedStoredPaymentMethodResultDTO? { - let storedPaymentMethodId = list[0] as! String - let isSuccessfullyRemoved = list[1] as! Bool - - return DeletedStoredPaymentMethodResultDTO( - storedPaymentMethodId: storedPaymentMethodId, - isSuccessfullyRemoved: isSuccessfullyRemoved - ) - } - - func toList() -> [Any?] { - [ - storedPaymentMethodId, - isSuccessfullyRemoved - ] - } + var storedPaymentMethodId: String + var isSuccessfullyRemoved: Bool + + // swift-format-ignore: AlwaysUseLowerCamelCase + static func fromList(_ __pigeon_list: [Any?]) -> DeletedStoredPaymentMethodResultDTO? { + let storedPaymentMethodId = __pigeon_list[0] as! String + let isSuccessfullyRemoved = __pigeon_list[1] as! Bool + + return DeletedStoredPaymentMethodResultDTO( + storedPaymentMethodId: storedPaymentMethodId, + isSuccessfullyRemoved: isSuccessfullyRemoved + ) + } + func toList() -> [Any?] { + return [ + storedPaymentMethodId, + isSuccessfullyRemoved, + ] + } } /// Generated class from Pigeon that represents data sent in messages. struct CardComponentConfigurationDTO { - var environment: Environment - var clientKey: String - var countryCode: String - var amount: AmountDTO? - var shopperLocale: String? - var cardConfiguration: CardConfigurationDTO - var analyticsOptionsDTO: AnalyticsOptionsDTO - - static func fromList(_ list: [Any?]) -> CardComponentConfigurationDTO? { - let environment = Environment(rawValue: list[0] as! Int)! - let clientKey = list[1] as! String - let countryCode = list[2] as! String - var amount: AmountDTO? - if let amountList: [Any?] = nilOrValue(list[3]) { - amount = AmountDTO.fromList(amountList) - } - let shopperLocale: String? = nilOrValue(list[4]) - let cardConfiguration = CardConfigurationDTO.fromList(list[5] as! [Any?])! - let analyticsOptionsDTO = AnalyticsOptionsDTO.fromList(list[6] as! [Any?])! - - return CardComponentConfigurationDTO( - environment: environment, - clientKey: clientKey, - countryCode: countryCode, - amount: amount, - shopperLocale: shopperLocale, - cardConfiguration: cardConfiguration, - analyticsOptionsDTO: analyticsOptionsDTO - ) - } - - func toList() -> [Any?] { - [ - environment.rawValue, - clientKey, - countryCode, - amount?.toList(), - shopperLocale, - cardConfiguration.toList(), - analyticsOptionsDTO.toList() - ] - } + var environment: Environment + var clientKey: String + var countryCode: String + var amount: AmountDTO? = nil + var shopperLocale: String? = nil + var cardConfiguration: CardConfigurationDTO + var analyticsOptionsDTO: AnalyticsOptionsDTO + + // swift-format-ignore: AlwaysUseLowerCamelCase + static func fromList(_ __pigeon_list: [Any?]) -> CardComponentConfigurationDTO? { + let environment = __pigeon_list[0] as! Environment + let clientKey = __pigeon_list[1] as! String + let countryCode = __pigeon_list[2] as! String + let amount: AmountDTO? = nilOrValue(__pigeon_list[3]) + let shopperLocale: String? = nilOrValue(__pigeon_list[4]) + let cardConfiguration = __pigeon_list[5] as! CardConfigurationDTO + let analyticsOptionsDTO = __pigeon_list[6] as! AnalyticsOptionsDTO + + return CardComponentConfigurationDTO( + environment: environment, + clientKey: clientKey, + countryCode: countryCode, + amount: amount, + shopperLocale: shopperLocale, + cardConfiguration: cardConfiguration, + analyticsOptionsDTO: analyticsOptionsDTO + ) + } + func toList() -> [Any?] { + return [ + environment, + clientKey, + countryCode, + amount, + shopperLocale, + cardConfiguration, + analyticsOptionsDTO, + ] + } } /// Generated class from Pigeon that represents data sent in messages. struct InstantPaymentConfigurationDTO { - var instantPaymentType: InstantPaymentType - var environment: Environment - var clientKey: String - var countryCode: String - var amount: AmountDTO? - var shopperLocale: String? - var analyticsOptionsDTO: AnalyticsOptionsDTO - var googlePayConfigurationDTO: GooglePayConfigurationDTO? - var applePayConfigurationDTO: ApplePayConfigurationDTO? - - static func fromList(_ list: [Any?]) -> InstantPaymentConfigurationDTO? { - let instantPaymentType = InstantPaymentType(rawValue: list[0] as! Int)! - let environment = Environment(rawValue: list[1] as! Int)! - let clientKey = list[2] as! String - let countryCode = list[3] as! String - var amount: AmountDTO? - if let amountList: [Any?] = nilOrValue(list[4]) { - amount = AmountDTO.fromList(amountList) - } - let shopperLocale: String? = nilOrValue(list[5]) - let analyticsOptionsDTO = AnalyticsOptionsDTO.fromList(list[6] as! [Any?])! - var googlePayConfigurationDTO: GooglePayConfigurationDTO? - if let googlePayConfigurationDTOList: [Any?] = nilOrValue(list[7]) { - googlePayConfigurationDTO = GooglePayConfigurationDTO.fromList(googlePayConfigurationDTOList) - } - var applePayConfigurationDTO: ApplePayConfigurationDTO? - if let applePayConfigurationDTOList: [Any?] = nilOrValue(list[8]) { - applePayConfigurationDTO = ApplePayConfigurationDTO.fromList(applePayConfigurationDTOList) - } - - return InstantPaymentConfigurationDTO( - instantPaymentType: instantPaymentType, - environment: environment, - clientKey: clientKey, - countryCode: countryCode, - amount: amount, - shopperLocale: shopperLocale, - analyticsOptionsDTO: analyticsOptionsDTO, - googlePayConfigurationDTO: googlePayConfigurationDTO, - applePayConfigurationDTO: applePayConfigurationDTO - ) - } - - func toList() -> [Any?] { - [ - instantPaymentType.rawValue, - environment.rawValue, - clientKey, - countryCode, - amount?.toList(), - shopperLocale, - analyticsOptionsDTO.toList(), - googlePayConfigurationDTO?.toList(), - applePayConfigurationDTO?.toList() - ] - } + var instantPaymentType: InstantPaymentType + var environment: Environment + var clientKey: String + var countryCode: String + var amount: AmountDTO? = nil + var shopperLocale: String? = nil + var analyticsOptionsDTO: AnalyticsOptionsDTO + var googlePayConfigurationDTO: GooglePayConfigurationDTO? = nil + var applePayConfigurationDTO: ApplePayConfigurationDTO? = nil + + // swift-format-ignore: AlwaysUseLowerCamelCase + static func fromList(_ __pigeon_list: [Any?]) -> InstantPaymentConfigurationDTO? { + let instantPaymentType = __pigeon_list[0] as! InstantPaymentType + let environment = __pigeon_list[1] as! Environment + let clientKey = __pigeon_list[2] as! String + let countryCode = __pigeon_list[3] as! String + let amount: AmountDTO? = nilOrValue(__pigeon_list[4]) + let shopperLocale: String? = nilOrValue(__pigeon_list[5]) + let analyticsOptionsDTO = __pigeon_list[6] as! AnalyticsOptionsDTO + let googlePayConfigurationDTO: GooglePayConfigurationDTO? = nilOrValue(__pigeon_list[7]) + let applePayConfigurationDTO: ApplePayConfigurationDTO? = nilOrValue(__pigeon_list[8]) + + return InstantPaymentConfigurationDTO( + instantPaymentType: instantPaymentType, + environment: environment, + clientKey: clientKey, + countryCode: countryCode, + amount: amount, + shopperLocale: shopperLocale, + analyticsOptionsDTO: analyticsOptionsDTO, + googlePayConfigurationDTO: googlePayConfigurationDTO, + applePayConfigurationDTO: applePayConfigurationDTO + ) + } + func toList() -> [Any?] { + return [ + instantPaymentType, + environment, + clientKey, + countryCode, + amount, + shopperLocale, + analyticsOptionsDTO, + googlePayConfigurationDTO, + applePayConfigurationDTO, + ] + } } /// Generated class from Pigeon that represents data sent in messages. struct InstantPaymentSetupResultDTO { - var instantPaymentType: InstantPaymentType - var isSupported: Bool - var resultData: Any? - - static func fromList(_ list: [Any?]) -> InstantPaymentSetupResultDTO? { - let instantPaymentType = InstantPaymentType(rawValue: list[0] as! Int)! - let isSupported = list[1] as! Bool - let resultData: Any? = list[2] - - return InstantPaymentSetupResultDTO( - instantPaymentType: instantPaymentType, - isSupported: isSupported, - resultData: resultData - ) - } - - func toList() -> [Any?] { - [ - instantPaymentType.rawValue, - isSupported, - resultData - ] - } + var instantPaymentType: InstantPaymentType + var isSupported: Bool + var resultData: Any? = nil + + // swift-format-ignore: AlwaysUseLowerCamelCase + static func fromList(_ __pigeon_list: [Any?]) -> InstantPaymentSetupResultDTO? { + let instantPaymentType = __pigeon_list[0] as! InstantPaymentType + let isSupported = __pigeon_list[1] as! Bool + let resultData: Any? = __pigeon_list[2] + + return InstantPaymentSetupResultDTO( + instantPaymentType: instantPaymentType, + isSupported: isSupported, + resultData: resultData + ) + } + func toList() -> [Any?] { + return [ + instantPaymentType, + isSupported, + resultData, + ] + } } /// Generated class from Pigeon that represents data sent in messages. struct UnencryptedCardDTO { - var cardNumber: String? - var expiryMonth: String? - var expiryYear: String? - var cvc: String? - - static func fromList(_ list: [Any?]) -> UnencryptedCardDTO? { - let cardNumber: String? = nilOrValue(list[0]) - let expiryMonth: String? = nilOrValue(list[1]) - let expiryYear: String? = nilOrValue(list[2]) - let cvc: String? = nilOrValue(list[3]) - - return UnencryptedCardDTO( - cardNumber: cardNumber, - expiryMonth: expiryMonth, - expiryYear: expiryYear, - cvc: cvc - ) - } - - func toList() -> [Any?] { - [ - cardNumber, - expiryMonth, - expiryYear, - cvc - ] - } + var cardNumber: String? = nil + var expiryMonth: String? = nil + var expiryYear: String? = nil + var cvc: String? = nil + + // swift-format-ignore: AlwaysUseLowerCamelCase + static func fromList(_ __pigeon_list: [Any?]) -> UnencryptedCardDTO? { + let cardNumber: String? = nilOrValue(__pigeon_list[0]) + let expiryMonth: String? = nilOrValue(__pigeon_list[1]) + let expiryYear: String? = nilOrValue(__pigeon_list[2]) + let cvc: String? = nilOrValue(__pigeon_list[3]) + + return UnencryptedCardDTO( + cardNumber: cardNumber, + expiryMonth: expiryMonth, + expiryYear: expiryYear, + cvc: cvc + ) + } + func toList() -> [Any?] { + return [ + cardNumber, + expiryMonth, + expiryYear, + cvc, + ] + } } /// Generated class from Pigeon that represents data sent in messages. struct EncryptedCardDTO { - var encryptedCardNumber: String? - var encryptedExpiryMonth: String? - var encryptedExpiryYear: String? - var encryptedSecurityCode: String? - - static func fromList(_ list: [Any?]) -> EncryptedCardDTO? { - let encryptedCardNumber: String? = nilOrValue(list[0]) - let encryptedExpiryMonth: String? = nilOrValue(list[1]) - let encryptedExpiryYear: String? = nilOrValue(list[2]) - let encryptedSecurityCode: String? = nilOrValue(list[3]) - - return EncryptedCardDTO( - encryptedCardNumber: encryptedCardNumber, - encryptedExpiryMonth: encryptedExpiryMonth, - encryptedExpiryYear: encryptedExpiryYear, - encryptedSecurityCode: encryptedSecurityCode - ) - } - - func toList() -> [Any?] { - [ - encryptedCardNumber, - encryptedExpiryMonth, - encryptedExpiryYear, - encryptedSecurityCode - ] - } + var encryptedCardNumber: String? = nil + var encryptedExpiryMonth: String? = nil + var encryptedExpiryYear: String? = nil + var encryptedSecurityCode: String? = nil + + // swift-format-ignore: AlwaysUseLowerCamelCase + static func fromList(_ __pigeon_list: [Any?]) -> EncryptedCardDTO? { + let encryptedCardNumber: String? = nilOrValue(__pigeon_list[0]) + let encryptedExpiryMonth: String? = nilOrValue(__pigeon_list[1]) + let encryptedExpiryYear: String? = nilOrValue(__pigeon_list[2]) + let encryptedSecurityCode: String? = nilOrValue(__pigeon_list[3]) + + return EncryptedCardDTO( + encryptedCardNumber: encryptedCardNumber, + encryptedExpiryMonth: encryptedExpiryMonth, + encryptedExpiryYear: encryptedExpiryYear, + encryptedSecurityCode: encryptedSecurityCode + ) + } + func toList() -> [Any?] { + return [ + encryptedCardNumber, + encryptedExpiryMonth, + encryptedExpiryYear, + encryptedSecurityCode, + ] + } } /// Generated class from Pigeon that represents data sent in messages. struct ActionComponentConfigurationDTO { - var environment: Environment - var clientKey: String - var shopperLocale: String? - var amount: AmountDTO? - var analyticsOptionsDTO: AnalyticsOptionsDTO - - static func fromList(_ list: [Any?]) -> ActionComponentConfigurationDTO? { - let environment = Environment(rawValue: list[0] as! Int)! - let clientKey = list[1] as! String - let shopperLocale: String? = nilOrValue(list[2]) - var amount: AmountDTO? - if let amountList: [Any?] = nilOrValue(list[3]) { - amount = AmountDTO.fromList(amountList) - } - let analyticsOptionsDTO = AnalyticsOptionsDTO.fromList(list[4] as! [Any?])! - - return ActionComponentConfigurationDTO( - environment: environment, - clientKey: clientKey, - shopperLocale: shopperLocale, - amount: amount, - analyticsOptionsDTO: analyticsOptionsDTO - ) - } - - func toList() -> [Any?] { - [ - environment.rawValue, - clientKey, - shopperLocale, - amount?.toList(), - analyticsOptionsDTO.toList() - ] - } + var environment: Environment + var clientKey: String + var shopperLocale: String? = nil + var amount: AmountDTO? = nil + var analyticsOptionsDTO: AnalyticsOptionsDTO + + // swift-format-ignore: AlwaysUseLowerCamelCase + static func fromList(_ __pigeon_list: [Any?]) -> ActionComponentConfigurationDTO? { + let environment = __pigeon_list[0] as! Environment + let clientKey = __pigeon_list[1] as! String + let shopperLocale: String? = nilOrValue(__pigeon_list[2]) + let amount: AmountDTO? = nilOrValue(__pigeon_list[3]) + let analyticsOptionsDTO = __pigeon_list[4] as! AnalyticsOptionsDTO + + return ActionComponentConfigurationDTO( + environment: environment, + clientKey: clientKey, + shopperLocale: shopperLocale, + amount: amount, + analyticsOptionsDTO: analyticsOptionsDTO + ) + } + func toList() -> [Any?] { + return [ + environment, + clientKey, + shopperLocale, + amount, + analyticsOptionsDTO, + ] + } } /// Generated class from Pigeon that represents data sent in messages. struct OrderCancelResultDTO { - var orderCancelResponseBody: [String?: Any?] - var updatedPaymentMethodsResponseBody: [String?: Any?]? - - static func fromList(_ list: [Any?]) -> OrderCancelResultDTO? { - let orderCancelResponseBody = list[0] as! [String?: Any?] - let updatedPaymentMethodsResponseBody: [String?: Any?]? = nilOrValue(list[1]) - - return OrderCancelResultDTO( - orderCancelResponseBody: orderCancelResponseBody, - updatedPaymentMethodsResponseBody: updatedPaymentMethodsResponseBody - ) - } - - func toList() -> [Any?] { - [ - orderCancelResponseBody, - updatedPaymentMethodsResponseBody - ] - } -} - -private class CheckoutPlatformInterfaceCodecReader: FlutterStandardReader { - override func readValue(ofType type: UInt8) -> Any? { - switch type { - case 128: - return ActionComponentConfigurationDTO.fromList(self.readValue() as! [Any?]) - case 129: - return AmountDTO.fromList(self.readValue() as! [Any?]) - case 130: - return AnalyticsOptionsDTO.fromList(self.readValue() as! [Any?]) - case 131: - return ApplePayConfigurationDTO.fromList(self.readValue() as! [Any?]) - case 132: - return ApplePayContactDTO.fromList(self.readValue() as! [Any?]) - case 133: - return ApplePayShippingMethodDTO.fromList(self.readValue() as! [Any?]) - case 134: - return ApplePaySummaryItemDTO.fromList(self.readValue() as! [Any?]) - case 135: - return BillingAddressParametersDTO.fromList(self.readValue() as! [Any?]) - case 136: - return CardComponentConfigurationDTO.fromList(self.readValue() as! [Any?]) - case 137: - return CardConfigurationDTO.fromList(self.readValue() as! [Any?]) - case 138: - return CashAppPayConfigurationDTO.fromList(self.readValue() as! [Any?]) - case 139: - return ComponentCommunicationModel.fromList(self.readValue() as! [Any?]) - case 140: - return DeletedStoredPaymentMethodResultDTO.fromList(self.readValue() as! [Any?]) - case 141: - return DropInConfigurationDTO.fromList(self.readValue() as! [Any?]) - case 142: - return EncryptedCardDTO.fromList(self.readValue() as! [Any?]) - case 143: - return ErrorDTO.fromList(self.readValue() as! [Any?]) - case 144: - return GooglePayConfigurationDTO.fromList(self.readValue() as! [Any?]) - case 145: - return InstantPaymentConfigurationDTO.fromList(self.readValue() as! [Any?]) - case 146: - return InstantPaymentSetupResultDTO.fromList(self.readValue() as! [Any?]) - case 147: - return MerchantInfoDTO.fromList(self.readValue() as! [Any?]) - case 148: - return OrderCancelResultDTO.fromList(self.readValue() as! [Any?]) - case 149: - return OrderResponseDTO.fromList(self.readValue() as! [Any?]) - case 150: - return PaymentEventDTO.fromList(self.readValue() as! [Any?]) - case 151: - return PaymentResultDTO.fromList(self.readValue() as! [Any?]) - case 152: - return PaymentResultModelDTO.fromList(self.readValue() as! [Any?]) - case 153: - return PlatformCommunicationModel.fromList(self.readValue() as! [Any?]) - case 154: - return SessionDTO.fromList(self.readValue() as! [Any?]) - case 155: - return ShippingAddressParametersDTO.fromList(self.readValue() as! [Any?]) - case 156: - return UnencryptedCardDTO.fromList(self.readValue() as! [Any?]) - default: - return super.readValue(ofType: type) - } - } -} - -private class CheckoutPlatformInterfaceCodecWriter: FlutterStandardWriter { - override func writeValue(_ value: Any) { - if let value = value as? ActionComponentConfigurationDTO { - super.writeByte(128) - super.writeValue(value.toList()) - } else if let value = value as? AmountDTO { - super.writeByte(129) - super.writeValue(value.toList()) - } else if let value = value as? AnalyticsOptionsDTO { - super.writeByte(130) - super.writeValue(value.toList()) - } else if let value = value as? ApplePayConfigurationDTO { - super.writeByte(131) - super.writeValue(value.toList()) - } else if let value = value as? ApplePayContactDTO { - super.writeByte(132) - super.writeValue(value.toList()) - } else if let value = value as? ApplePayShippingMethodDTO { - super.writeByte(133) - super.writeValue(value.toList()) - } else if let value = value as? ApplePaySummaryItemDTO { - super.writeByte(134) - super.writeValue(value.toList()) - } else if let value = value as? BillingAddressParametersDTO { - super.writeByte(135) - super.writeValue(value.toList()) - } else if let value = value as? CardComponentConfigurationDTO { - super.writeByte(136) - super.writeValue(value.toList()) - } else if let value = value as? CardConfigurationDTO { - super.writeByte(137) - super.writeValue(value.toList()) - } else if let value = value as? CashAppPayConfigurationDTO { - super.writeByte(138) - super.writeValue(value.toList()) - } else if let value = value as? ComponentCommunicationModel { - super.writeByte(139) - super.writeValue(value.toList()) - } else if let value = value as? DeletedStoredPaymentMethodResultDTO { - super.writeByte(140) - super.writeValue(value.toList()) - } else if let value = value as? DropInConfigurationDTO { - super.writeByte(141) - super.writeValue(value.toList()) - } else if let value = value as? EncryptedCardDTO { - super.writeByte(142) - super.writeValue(value.toList()) - } else if let value = value as? ErrorDTO { - super.writeByte(143) - super.writeValue(value.toList()) - } else if let value = value as? GooglePayConfigurationDTO { - super.writeByte(144) - super.writeValue(value.toList()) - } else if let value = value as? InstantPaymentConfigurationDTO { - super.writeByte(145) - super.writeValue(value.toList()) - } else if let value = value as? InstantPaymentSetupResultDTO { - super.writeByte(146) - super.writeValue(value.toList()) - } else if let value = value as? MerchantInfoDTO { - super.writeByte(147) - super.writeValue(value.toList()) - } else if let value = value as? OrderCancelResultDTO { - super.writeByte(148) - super.writeValue(value.toList()) - } else if let value = value as? OrderResponseDTO { - super.writeByte(149) - super.writeValue(value.toList()) - } else if let value = value as? PaymentEventDTO { - super.writeByte(150) - super.writeValue(value.toList()) - } else if let value = value as? PaymentResultDTO { - super.writeByte(151) - super.writeValue(value.toList()) - } else if let value = value as? PaymentResultModelDTO { - super.writeByte(152) - super.writeValue(value.toList()) - } else if let value = value as? PlatformCommunicationModel { - super.writeByte(153) - super.writeValue(value.toList()) - } else if let value = value as? SessionDTO { - super.writeByte(154) - super.writeValue(value.toList()) - } else if let value = value as? ShippingAddressParametersDTO { - super.writeByte(155) - super.writeValue(value.toList()) - } else if let value = value as? UnencryptedCardDTO { - super.writeByte(156) - super.writeValue(value.toList()) - } else { - super.writeValue(value) - } - } -} - -private class CheckoutPlatformInterfaceCodecReaderWriter: FlutterStandardReaderWriter { - override func reader(with data: Data) -> FlutterStandardReader { - CheckoutPlatformInterfaceCodecReader(data: data) - } - - override func writer(with data: NSMutableData) -> FlutterStandardWriter { - CheckoutPlatformInterfaceCodecWriter(data: data) - } + var orderCancelResponseBody: [String?: Any?] + var updatedPaymentMethodsResponseBody: [String?: Any?]? = nil + + // swift-format-ignore: AlwaysUseLowerCamelCase + static func fromList(_ __pigeon_list: [Any?]) -> OrderCancelResultDTO? { + let orderCancelResponseBody = __pigeon_list[0] as! [String?: Any?] + let updatedPaymentMethodsResponseBody: [String?: Any?]? = nilOrValue(__pigeon_list[1]) + + return OrderCancelResultDTO( + orderCancelResponseBody: orderCancelResponseBody, + updatedPaymentMethodsResponseBody: updatedPaymentMethodsResponseBody + ) + } + func toList() -> [Any?] { + return [ + orderCancelResponseBody, + updatedPaymentMethodsResponseBody, + ] + } +} +private class PlatformApiPigeonCodecReader: FlutterStandardReader { + override func readValue(ofType type: UInt8) -> Any? { + switch type { + case 129: + return SessionDTO.fromList(self.readValue() as! [Any?]) + case 130: + return AmountDTO.fromList(self.readValue() as! [Any?]) + case 131: + return AnalyticsOptionsDTO.fromList(self.readValue() as! [Any?]) + case 132: + return DropInConfigurationDTO.fromList(self.readValue() as! [Any?]) + case 133: + return CardConfigurationDTO.fromList(self.readValue() as! [Any?]) + case 134: + return ApplePayConfigurationDTO.fromList(self.readValue() as! [Any?]) + case 135: + return ApplePayContactDTO.fromList(self.readValue() as! [Any?]) + case 136: + return ApplePayShippingMethodDTO.fromList(self.readValue() as! [Any?]) + case 137: + return ApplePaySummaryItemDTO.fromList(self.readValue() as! [Any?]) + case 138: + return GooglePayConfigurationDTO.fromList(self.readValue() as! [Any?]) + case 139: + return MerchantInfoDTO.fromList(self.readValue() as! [Any?]) + case 140: + return ShippingAddressParametersDTO.fromList(self.readValue() as! [Any?]) + case 141: + return BillingAddressParametersDTO.fromList(self.readValue() as! [Any?]) + case 142: + return CashAppPayConfigurationDTO.fromList(self.readValue() as! [Any?]) + case 143: + return PaymentResultDTO.fromList(self.readValue() as! [Any?]) + case 144: + return PaymentResultModelDTO.fromList(self.readValue() as! [Any?]) + case 145: + return OrderResponseDTO.fromList(self.readValue() as! [Any?]) + case 146: + return PlatformCommunicationModel.fromList(self.readValue() as! [Any?]) + case 147: + return ComponentCommunicationModel.fromList(self.readValue() as! [Any?]) + case 148: + return PaymentEventDTO.fromList(self.readValue() as! [Any?]) + case 149: + return ErrorDTO.fromList(self.readValue() as! [Any?]) + case 150: + return DeletedStoredPaymentMethodResultDTO.fromList(self.readValue() as! [Any?]) + case 151: + return CardComponentConfigurationDTO.fromList(self.readValue() as! [Any?]) + case 152: + return InstantPaymentConfigurationDTO.fromList(self.readValue() as! [Any?]) + case 153: + return InstantPaymentSetupResultDTO.fromList(self.readValue() as! [Any?]) + case 154: + return UnencryptedCardDTO.fromList(self.readValue() as! [Any?]) + case 155: + return EncryptedCardDTO.fromList(self.readValue() as! [Any?]) + case 156: + return ActionComponentConfigurationDTO.fromList(self.readValue() as! [Any?]) + case 157: + return OrderCancelResultDTO.fromList(self.readValue() as! [Any?]) + case 158: + var enumResult: Environment? = nil + let enumResultAsInt: Int? = nilOrValue(self.readValue() as? Int) + if let enumResultAsInt = enumResultAsInt { + enumResult = Environment(rawValue: enumResultAsInt) + } + return enumResult + case 159: + var enumResult: AddressMode? = nil + let enumResultAsInt: Int? = nilOrValue(self.readValue() as? Int) + if let enumResultAsInt = enumResultAsInt { + enumResult = AddressMode(rawValue: enumResultAsInt) + } + return enumResult + case 160: + var enumResult: CardAuthMethod? = nil + let enumResultAsInt: Int? = nilOrValue(self.readValue() as? Int) + if let enumResultAsInt = enumResultAsInt { + enumResult = CardAuthMethod(rawValue: enumResultAsInt) + } + return enumResult + case 161: + var enumResult: TotalPriceStatus? = nil + let enumResultAsInt: Int? = nilOrValue(self.readValue() as? Int) + if let enumResultAsInt = enumResultAsInt { + enumResult = TotalPriceStatus(rawValue: enumResultAsInt) + } + return enumResult + case 162: + var enumResult: GooglePayEnvironment? = nil + let enumResultAsInt: Int? = nilOrValue(self.readValue() as? Int) + if let enumResultAsInt = enumResultAsInt { + enumResult = GooglePayEnvironment(rawValue: enumResultAsInt) + } + return enumResult + case 163: + var enumResult: CashAppPayEnvironment? = nil + let enumResultAsInt: Int? = nilOrValue(self.readValue() as? Int) + if let enumResultAsInt = enumResultAsInt { + enumResult = CashAppPayEnvironment(rawValue: enumResultAsInt) + } + return enumResult + case 164: + var enumResult: PaymentResultEnum? = nil + let enumResultAsInt: Int? = nilOrValue(self.readValue() as? Int) + if let enumResultAsInt = enumResultAsInt { + enumResult = PaymentResultEnum(rawValue: enumResultAsInt) + } + return enumResult + case 165: + var enumResult: PlatformCommunicationType? = nil + let enumResultAsInt: Int? = nilOrValue(self.readValue() as? Int) + if let enumResultAsInt = enumResultAsInt { + enumResult = PlatformCommunicationType(rawValue: enumResultAsInt) + } + return enumResult + case 166: + var enumResult: ComponentCommunicationType? = nil + let enumResultAsInt: Int? = nilOrValue(self.readValue() as? Int) + if let enumResultAsInt = enumResultAsInt { + enumResult = ComponentCommunicationType(rawValue: enumResultAsInt) + } + return enumResult + case 167: + var enumResult: PaymentEventType? = nil + let enumResultAsInt: Int? = nilOrValue(self.readValue() as? Int) + if let enumResultAsInt = enumResultAsInt { + enumResult = PaymentEventType(rawValue: enumResultAsInt) + } + return enumResult + case 168: + var enumResult: FieldVisibility? = nil + let enumResultAsInt: Int? = nilOrValue(self.readValue() as? Int) + if let enumResultAsInt = enumResultAsInt { + enumResult = FieldVisibility(rawValue: enumResultAsInt) + } + return enumResult + case 169: + var enumResult: InstantPaymentType? = nil + let enumResultAsInt: Int? = nilOrValue(self.readValue() as? Int) + if let enumResultAsInt = enumResultAsInt { + enumResult = InstantPaymentType(rawValue: enumResultAsInt) + } + return enumResult + case 170: + var enumResult: ApplePayShippingType? = nil + let enumResultAsInt: Int? = nilOrValue(self.readValue() as? Int) + if let enumResultAsInt = enumResultAsInt { + enumResult = ApplePayShippingType(rawValue: enumResultAsInt) + } + return enumResult + case 171: + var enumResult: ApplePayMerchantCapability? = nil + let enumResultAsInt: Int? = nilOrValue(self.readValue() as? Int) + if let enumResultAsInt = enumResultAsInt { + enumResult = ApplePayMerchantCapability(rawValue: enumResultAsInt) + } + return enumResult + case 172: + var enumResult: ApplePaySummaryItemType? = nil + let enumResultAsInt: Int? = nilOrValue(self.readValue() as? Int) + if let enumResultAsInt = enumResultAsInt { + enumResult = ApplePaySummaryItemType(rawValue: enumResultAsInt) + } + return enumResult + case 173: + var enumResult: CardNumberValidationResultDTO? = nil + let enumResultAsInt: Int? = nilOrValue(self.readValue() as? Int) + if let enumResultAsInt = enumResultAsInt { + enumResult = CardNumberValidationResultDTO(rawValue: enumResultAsInt) + } + return enumResult + case 174: + var enumResult: CardExpiryDateValidationResultDTO? = nil + let enumResultAsInt: Int? = nilOrValue(self.readValue() as? Int) + if let enumResultAsInt = enumResultAsInt { + enumResult = CardExpiryDateValidationResultDTO(rawValue: enumResultAsInt) + } + return enumResult + case 175: + var enumResult: CardSecurityCodeValidationResultDTO? = nil + let enumResultAsInt: Int? = nilOrValue(self.readValue() as? Int) + if let enumResultAsInt = enumResultAsInt { + enumResult = CardSecurityCodeValidationResultDTO(rawValue: enumResultAsInt) + } + return enumResult + default: + return super.readValue(ofType: type) + } + } +} + +private class PlatformApiPigeonCodecWriter: FlutterStandardWriter { + override func writeValue(_ value: Any) { + if let value = value as? SessionDTO { + super.writeByte(129) + super.writeValue(value.toList()) + } else if let value = value as? AmountDTO { + super.writeByte(130) + super.writeValue(value.toList()) + } else if let value = value as? AnalyticsOptionsDTO { + super.writeByte(131) + super.writeValue(value.toList()) + } else if let value = value as? DropInConfigurationDTO { + super.writeByte(132) + super.writeValue(value.toList()) + } else if let value = value as? CardConfigurationDTO { + super.writeByte(133) + super.writeValue(value.toList()) + } else if let value = value as? ApplePayConfigurationDTO { + super.writeByte(134) + super.writeValue(value.toList()) + } else if let value = value as? ApplePayContactDTO { + super.writeByte(135) + super.writeValue(value.toList()) + } else if let value = value as? ApplePayShippingMethodDTO { + super.writeByte(136) + super.writeValue(value.toList()) + } else if let value = value as? ApplePaySummaryItemDTO { + super.writeByte(137) + super.writeValue(value.toList()) + } else if let value = value as? GooglePayConfigurationDTO { + super.writeByte(138) + super.writeValue(value.toList()) + } else if let value = value as? MerchantInfoDTO { + super.writeByte(139) + super.writeValue(value.toList()) + } else if let value = value as? ShippingAddressParametersDTO { + super.writeByte(140) + super.writeValue(value.toList()) + } else if let value = value as? BillingAddressParametersDTO { + super.writeByte(141) + super.writeValue(value.toList()) + } else if let value = value as? CashAppPayConfigurationDTO { + super.writeByte(142) + super.writeValue(value.toList()) + } else if let value = value as? PaymentResultDTO { + super.writeByte(143) + super.writeValue(value.toList()) + } else if let value = value as? PaymentResultModelDTO { + super.writeByte(144) + super.writeValue(value.toList()) + } else if let value = value as? OrderResponseDTO { + super.writeByte(145) + super.writeValue(value.toList()) + } else if let value = value as? PlatformCommunicationModel { + super.writeByte(146) + super.writeValue(value.toList()) + } else if let value = value as? ComponentCommunicationModel { + super.writeByte(147) + super.writeValue(value.toList()) + } else if let value = value as? PaymentEventDTO { + super.writeByte(148) + super.writeValue(value.toList()) + } else if let value = value as? ErrorDTO { + super.writeByte(149) + super.writeValue(value.toList()) + } else if let value = value as? DeletedStoredPaymentMethodResultDTO { + super.writeByte(150) + super.writeValue(value.toList()) + } else if let value = value as? CardComponentConfigurationDTO { + super.writeByte(151) + super.writeValue(value.toList()) + } else if let value = value as? InstantPaymentConfigurationDTO { + super.writeByte(152) + super.writeValue(value.toList()) + } else if let value = value as? InstantPaymentSetupResultDTO { + super.writeByte(153) + super.writeValue(value.toList()) + } else if let value = value as? UnencryptedCardDTO { + super.writeByte(154) + super.writeValue(value.toList()) + } else if let value = value as? EncryptedCardDTO { + super.writeByte(155) + super.writeValue(value.toList()) + } else if let value = value as? ActionComponentConfigurationDTO { + super.writeByte(156) + super.writeValue(value.toList()) + } else if let value = value as? OrderCancelResultDTO { + super.writeByte(157) + super.writeValue(value.toList()) + } else if let value = value as? Environment { + super.writeByte(158) + super.writeValue(value.rawValue) + } else if let value = value as? AddressMode { + super.writeByte(159) + super.writeValue(value.rawValue) + } else if let value = value as? CardAuthMethod { + super.writeByte(160) + super.writeValue(value.rawValue) + } else if let value = value as? TotalPriceStatus { + super.writeByte(161) + super.writeValue(value.rawValue) + } else if let value = value as? GooglePayEnvironment { + super.writeByte(162) + super.writeValue(value.rawValue) + } else if let value = value as? CashAppPayEnvironment { + super.writeByte(163) + super.writeValue(value.rawValue) + } else if let value = value as? PaymentResultEnum { + super.writeByte(164) + super.writeValue(value.rawValue) + } else if let value = value as? PlatformCommunicationType { + super.writeByte(165) + super.writeValue(value.rawValue) + } else if let value = value as? ComponentCommunicationType { + super.writeByte(166) + super.writeValue(value.rawValue) + } else if let value = value as? PaymentEventType { + super.writeByte(167) + super.writeValue(value.rawValue) + } else if let value = value as? FieldVisibility { + super.writeByte(168) + super.writeValue(value.rawValue) + } else if let value = value as? InstantPaymentType { + super.writeByte(169) + super.writeValue(value.rawValue) + } else if let value = value as? ApplePayShippingType { + super.writeByte(170) + super.writeValue(value.rawValue) + } else if let value = value as? ApplePayMerchantCapability { + super.writeByte(171) + super.writeValue(value.rawValue) + } else if let value = value as? ApplePaySummaryItemType { + super.writeByte(172) + super.writeValue(value.rawValue) + } else if let value = value as? CardNumberValidationResultDTO { + super.writeByte(173) + super.writeValue(value.rawValue) + } else if let value = value as? CardExpiryDateValidationResultDTO { + super.writeByte(174) + super.writeValue(value.rawValue) + } else if let value = value as? CardSecurityCodeValidationResultDTO { + super.writeByte(175) + super.writeValue(value.rawValue) + } else { + super.writeValue(value) + } + } +} + +private class PlatformApiPigeonCodecReaderWriter: FlutterStandardReaderWriter { + override func reader(with data: Data) -> FlutterStandardReader { + return PlatformApiPigeonCodecReader(data: data) + } + + override func writer(with data: NSMutableData) -> FlutterStandardWriter { + return PlatformApiPigeonCodecWriter(data: data) + } +} + +class PlatformApiPigeonCodec: FlutterStandardMessageCodec, @unchecked Sendable { + static let shared = PlatformApiPigeonCodec(readerWriter: PlatformApiPigeonCodecReaderWriter()) } -class CheckoutPlatformInterfaceCodec: FlutterStandardMessageCodec { - static let shared = CheckoutPlatformInterfaceCodec(readerWriter: CheckoutPlatformInterfaceCodecReaderWriter()) -} /// Generated protocol from Pigeon that represents a handler of messages from Flutter. protocol CheckoutPlatformInterface { - func getReturnUrl(completion: @escaping (Result) -> Void) - func createSession(sessionId: String, sessionData: String, configuration: Any?, completion: @escaping (Result) -> Void) - func clearSession() throws - func encryptCard(unencryptedCardDTO: UnencryptedCardDTO, publicKey: String, completion: @escaping (Result) -> Void) - func encryptBin(bin: String, publicKey: String, completion: @escaping (Result) -> Void) - func validateCardNumber(cardNumber: String, enableLuhnCheck: Bool) throws -> CardNumberValidationResultDTO - func validateCardExpiryDate(expiryMonth: String, expiryYear: String) throws -> CardExpiryDateValidationResultDTO - func validateCardSecurityCode(securityCode: String, cardBrand: String?) throws -> CardSecurityCodeValidationResultDTO - func enableConsoleLogging(loggingEnabled: Bool) throws + func getReturnUrl(completion: @escaping (Result) -> Void) + func createSession(sessionId: String, sessionData: String, configuration: Any?, completion: @escaping (Result) -> Void) + func clearSession() throws + func encryptCard(unencryptedCardDTO: UnencryptedCardDTO, publicKey: String, completion: @escaping (Result) -> Void) + func encryptBin(bin: String, publicKey: String, completion: @escaping (Result) -> Void) + func validateCardNumber(cardNumber: String, enableLuhnCheck: Bool) throws -> CardNumberValidationResultDTO + func validateCardExpiryDate(expiryMonth: String, expiryYear: String) throws -> CardExpiryDateValidationResultDTO + func validateCardSecurityCode(securityCode: String, cardBrand: String?) throws -> CardSecurityCodeValidationResultDTO + func enableConsoleLogging(loggingEnabled: Bool) throws } /// Generated setup class from Pigeon to handle messages through the `binaryMessenger`. class CheckoutPlatformInterfaceSetup { - /// The codec used by CheckoutPlatformInterface. - static var codec: FlutterStandardMessageCodec { CheckoutPlatformInterfaceCodec.shared } - /// Sets up an instance of `CheckoutPlatformInterface` to handle messages through the `binaryMessenger`. - static func setUp(binaryMessenger: FlutterBinaryMessenger, api: CheckoutPlatformInterface?) { - let getReturnUrlChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.adyen_checkout.CheckoutPlatformInterface.getReturnUrl", binaryMessenger: binaryMessenger, codec: codec) - if let api { - getReturnUrlChannel.setMessageHandler { _, reply in - api.getReturnUrl { result in - switch result { - case let .success(res): - reply(wrapResult(res)) - case let .failure(error): - reply(wrapError(error)) - } - } - } - } else { - getReturnUrlChannel.setMessageHandler(nil) - } - let createSessionChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.adyen_checkout.CheckoutPlatformInterface.createSession", binaryMessenger: binaryMessenger, codec: codec) - if let api { - createSessionChannel.setMessageHandler { message, reply in - let args = message as! [Any?] - let sessionIdArg = args[0] as! String - let sessionDataArg = args[1] as! String - let configurationArg: Any? = args[2] - api.createSession(sessionId: sessionIdArg, sessionData: sessionDataArg, configuration: configurationArg) { result in - switch result { - case let .success(res): - reply(wrapResult(res)) - case let .failure(error): - reply(wrapError(error)) - } - } - } - } else { - createSessionChannel.setMessageHandler(nil) - } - let clearSessionChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.adyen_checkout.CheckoutPlatformInterface.clearSession", binaryMessenger: binaryMessenger, codec: codec) - if let api { - clearSessionChannel.setMessageHandler { _, reply in - do { - try api.clearSession() - reply(wrapResult(nil)) - } catch { - reply(wrapError(error)) - } - } - } else { - clearSessionChannel.setMessageHandler(nil) - } - let encryptCardChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.adyen_checkout.CheckoutPlatformInterface.encryptCard", binaryMessenger: binaryMessenger, codec: codec) - if let api { - encryptCardChannel.setMessageHandler { message, reply in - let args = message as! [Any?] - let unencryptedCardDTOArg = args[0] as! UnencryptedCardDTO - let publicKeyArg = args[1] as! String - api.encryptCard(unencryptedCardDTO: unencryptedCardDTOArg, publicKey: publicKeyArg) { result in - switch result { - case let .success(res): - reply(wrapResult(res)) - case let .failure(error): - reply(wrapError(error)) - } - } - } - } else { - encryptCardChannel.setMessageHandler(nil) - } - let encryptBinChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.adyen_checkout.CheckoutPlatformInterface.encryptBin", binaryMessenger: binaryMessenger, codec: codec) - if let api { - encryptBinChannel.setMessageHandler { message, reply in - let args = message as! [Any?] - let binArg = args[0] as! String - let publicKeyArg = args[1] as! String - api.encryptBin(bin: binArg, publicKey: publicKeyArg) { result in - switch result { - case let .success(res): - reply(wrapResult(res)) - case let .failure(error): - reply(wrapError(error)) - } - } - } - } else { - encryptBinChannel.setMessageHandler(nil) - } - let validateCardNumberChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.adyen_checkout.CheckoutPlatformInterface.validateCardNumber", binaryMessenger: binaryMessenger, codec: codec) - if let api { - validateCardNumberChannel.setMessageHandler { message, reply in - let args = message as! [Any?] - let cardNumberArg = args[0] as! String - let enableLuhnCheckArg = args[1] as! Bool - do { - let result = try api.validateCardNumber(cardNumber: cardNumberArg, enableLuhnCheck: enableLuhnCheckArg) - reply(wrapResult(result.rawValue)) - } catch { - reply(wrapError(error)) - } - } - } else { - validateCardNumberChannel.setMessageHandler(nil) - } - let validateCardExpiryDateChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.adyen_checkout.CheckoutPlatformInterface.validateCardExpiryDate", binaryMessenger: binaryMessenger, codec: codec) - if let api { - validateCardExpiryDateChannel.setMessageHandler { message, reply in - let args = message as! [Any?] - let expiryMonthArg = args[0] as! String - let expiryYearArg = args[1] as! String - do { - let result = try api.validateCardExpiryDate(expiryMonth: expiryMonthArg, expiryYear: expiryYearArg) - reply(wrapResult(result.rawValue)) - } catch { - reply(wrapError(error)) - } - } - } else { - validateCardExpiryDateChannel.setMessageHandler(nil) - } - let validateCardSecurityCodeChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.adyen_checkout.CheckoutPlatformInterface.validateCardSecurityCode", binaryMessenger: binaryMessenger, codec: codec) - if let api { - validateCardSecurityCodeChannel.setMessageHandler { message, reply in - let args = message as! [Any?] - let securityCodeArg = args[0] as! String - let cardBrandArg: String? = nilOrValue(args[1]) - do { - let result = try api.validateCardSecurityCode(securityCode: securityCodeArg, cardBrand: cardBrandArg) - reply(wrapResult(result.rawValue)) - } catch { - reply(wrapError(error)) - } - } - } else { - validateCardSecurityCodeChannel.setMessageHandler(nil) - } - let enableConsoleLoggingChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.adyen_checkout.CheckoutPlatformInterface.enableConsoleLogging", binaryMessenger: binaryMessenger, codec: codec) - if let api { - enableConsoleLoggingChannel.setMessageHandler { message, reply in - let args = message as! [Any?] - let loggingEnabledArg = args[0] as! Bool - do { - try api.enableConsoleLogging(loggingEnabled: loggingEnabledArg) - reply(wrapResult(nil)) - } catch { - reply(wrapError(error)) - } - } - } else { - enableConsoleLoggingChannel.setMessageHandler(nil) - } - } + static var codec: FlutterStandardMessageCodec { PlatformApiPigeonCodec.shared } + /// Sets up an instance of `CheckoutPlatformInterface` to handle messages through the `binaryMessenger`. + static func setUp(binaryMessenger: FlutterBinaryMessenger, api: CheckoutPlatformInterface?, messageChannelSuffix: String = "") { + let channelSuffix = messageChannelSuffix.count > 0 ? ".\(messageChannelSuffix)" : "" + let getReturnUrlChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.adyen_checkout.CheckoutPlatformInterface.getReturnUrl\(channelSuffix)", binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + getReturnUrlChannel.setMessageHandler { _, reply in + api.getReturnUrl { result in + switch result { + case .success(let res): + reply(wrapResult(res)) + case .failure(let error): + reply(wrapError(error)) + } + } + } + } else { + getReturnUrlChannel.setMessageHandler(nil) + } + let createSessionChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.adyen_checkout.CheckoutPlatformInterface.createSession\(channelSuffix)", binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + createSessionChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let sessionIdArg = args[0] as! String + let sessionDataArg = args[1] as! String + let configurationArg: Any? = args[2] + api.createSession(sessionId: sessionIdArg, sessionData: sessionDataArg, configuration: configurationArg) { result in + switch result { + case .success(let res): + reply(wrapResult(res)) + case .failure(let error): + reply(wrapError(error)) + } + } + } + } else { + createSessionChannel.setMessageHandler(nil) + } + let clearSessionChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.adyen_checkout.CheckoutPlatformInterface.clearSession\(channelSuffix)", binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + clearSessionChannel.setMessageHandler { _, reply in + do { + try api.clearSession() + reply(wrapResult(nil)) + } catch { + reply(wrapError(error)) + } + } + } else { + clearSessionChannel.setMessageHandler(nil) + } + let encryptCardChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.adyen_checkout.CheckoutPlatformInterface.encryptCard\(channelSuffix)", binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + encryptCardChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let unencryptedCardDTOArg = args[0] as! UnencryptedCardDTO + let publicKeyArg = args[1] as! String + api.encryptCard(unencryptedCardDTO: unencryptedCardDTOArg, publicKey: publicKeyArg) { result in + switch result { + case .success(let res): + reply(wrapResult(res)) + case .failure(let error): + reply(wrapError(error)) + } + } + } + } else { + encryptCardChannel.setMessageHandler(nil) + } + let encryptBinChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.adyen_checkout.CheckoutPlatformInterface.encryptBin\(channelSuffix)", binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + encryptBinChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let binArg = args[0] as! String + let publicKeyArg = args[1] as! String + api.encryptBin(bin: binArg, publicKey: publicKeyArg) { result in + switch result { + case .success(let res): + reply(wrapResult(res)) + case .failure(let error): + reply(wrapError(error)) + } + } + } + } else { + encryptBinChannel.setMessageHandler(nil) + } + let validateCardNumberChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.adyen_checkout.CheckoutPlatformInterface.validateCardNumber\(channelSuffix)", binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + validateCardNumberChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let cardNumberArg = args[0] as! String + let enableLuhnCheckArg = args[1] as! Bool + do { + let result = try api.validateCardNumber(cardNumber: cardNumberArg, enableLuhnCheck: enableLuhnCheckArg) + reply(wrapResult(result)) + } catch { + reply(wrapError(error)) + } + } + } else { + validateCardNumberChannel.setMessageHandler(nil) + } + let validateCardExpiryDateChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.adyen_checkout.CheckoutPlatformInterface.validateCardExpiryDate\(channelSuffix)", binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + validateCardExpiryDateChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let expiryMonthArg = args[0] as! String + let expiryYearArg = args[1] as! String + do { + let result = try api.validateCardExpiryDate(expiryMonth: expiryMonthArg, expiryYear: expiryYearArg) + reply(wrapResult(result)) + } catch { + reply(wrapError(error)) + } + } + } else { + validateCardExpiryDateChannel.setMessageHandler(nil) + } + let validateCardSecurityCodeChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.adyen_checkout.CheckoutPlatformInterface.validateCardSecurityCode\(channelSuffix)", binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + validateCardSecurityCodeChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let securityCodeArg = args[0] as! String + let cardBrandArg: String? = nilOrValue(args[1]) + do { + let result = try api.validateCardSecurityCode(securityCode: securityCodeArg, cardBrand: cardBrandArg) + reply(wrapResult(result)) + } catch { + reply(wrapError(error)) + } + } + } else { + validateCardSecurityCodeChannel.setMessageHandler(nil) + } + let enableConsoleLoggingChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.adyen_checkout.CheckoutPlatformInterface.enableConsoleLogging\(channelSuffix)", binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + enableConsoleLoggingChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let loggingEnabledArg = args[0] as! Bool + do { + try api.enableConsoleLogging(loggingEnabled: loggingEnabledArg) + reply(wrapResult(nil)) + } catch { + reply(wrapError(error)) + } + } + } else { + enableConsoleLoggingChannel.setMessageHandler(nil) + } + } } - -private class DropInPlatformInterfaceCodecReader: FlutterStandardReader { - override func readValue(ofType type: UInt8) -> Any? { - switch type { - case 128: - return AmountDTO.fromList(self.readValue() as! [Any?]) - case 129: - return AmountDTO.fromList(self.readValue() as! [Any?]) - case 130: - return AnalyticsOptionsDTO.fromList(self.readValue() as! [Any?]) - case 131: - return ApplePayConfigurationDTO.fromList(self.readValue() as! [Any?]) - case 132: - return ApplePayContactDTO.fromList(self.readValue() as! [Any?]) - case 133: - return ApplePayShippingMethodDTO.fromList(self.readValue() as! [Any?]) - case 134: - return ApplePaySummaryItemDTO.fromList(self.readValue() as! [Any?]) - case 135: - return BillingAddressParametersDTO.fromList(self.readValue() as! [Any?]) - case 136: - return CardConfigurationDTO.fromList(self.readValue() as! [Any?]) - case 137: - return CashAppPayConfigurationDTO.fromList(self.readValue() as! [Any?]) - case 138: - return DeletedStoredPaymentMethodResultDTO.fromList(self.readValue() as! [Any?]) - case 139: - return DropInConfigurationDTO.fromList(self.readValue() as! [Any?]) - case 140: - return ErrorDTO.fromList(self.readValue() as! [Any?]) - case 141: - return GooglePayConfigurationDTO.fromList(self.readValue() as! [Any?]) - case 142: - return MerchantInfoDTO.fromList(self.readValue() as! [Any?]) - case 143: - return OrderCancelResultDTO.fromList(self.readValue() as! [Any?]) - case 144: - return PaymentEventDTO.fromList(self.readValue() as! [Any?]) - case 145: - return ShippingAddressParametersDTO.fromList(self.readValue() as! [Any?]) - default: - return super.readValue(ofType: type) - } - } -} - -private class DropInPlatformInterfaceCodecWriter: FlutterStandardWriter { - override func writeValue(_ value: Any) { - if let value = value as? AmountDTO { - super.writeByte(128) - super.writeValue(value.toList()) - } else if let value = value as? AmountDTO { - super.writeByte(129) - super.writeValue(value.toList()) - } else if let value = value as? AnalyticsOptionsDTO { - super.writeByte(130) - super.writeValue(value.toList()) - } else if let value = value as? ApplePayConfigurationDTO { - super.writeByte(131) - super.writeValue(value.toList()) - } else if let value = value as? ApplePayContactDTO { - super.writeByte(132) - super.writeValue(value.toList()) - } else if let value = value as? ApplePayShippingMethodDTO { - super.writeByte(133) - super.writeValue(value.toList()) - } else if let value = value as? ApplePaySummaryItemDTO { - super.writeByte(134) - super.writeValue(value.toList()) - } else if let value = value as? BillingAddressParametersDTO { - super.writeByte(135) - super.writeValue(value.toList()) - } else if let value = value as? CardConfigurationDTO { - super.writeByte(136) - super.writeValue(value.toList()) - } else if let value = value as? CashAppPayConfigurationDTO { - super.writeByte(137) - super.writeValue(value.toList()) - } else if let value = value as? DeletedStoredPaymentMethodResultDTO { - super.writeByte(138) - super.writeValue(value.toList()) - } else if let value = value as? DropInConfigurationDTO { - super.writeByte(139) - super.writeValue(value.toList()) - } else if let value = value as? ErrorDTO { - super.writeByte(140) - super.writeValue(value.toList()) - } else if let value = value as? GooglePayConfigurationDTO { - super.writeByte(141) - super.writeValue(value.toList()) - } else if let value = value as? MerchantInfoDTO { - super.writeByte(142) - super.writeValue(value.toList()) - } else if let value = value as? OrderCancelResultDTO { - super.writeByte(143) - super.writeValue(value.toList()) - } else if let value = value as? PaymentEventDTO { - super.writeByte(144) - super.writeValue(value.toList()) - } else if let value = value as? ShippingAddressParametersDTO { - super.writeByte(145) - super.writeValue(value.toList()) - } else { - super.writeValue(value) - } - } -} - -private class DropInPlatformInterfaceCodecReaderWriter: FlutterStandardReaderWriter { - override func reader(with data: Data) -> FlutterStandardReader { - DropInPlatformInterfaceCodecReader(data: data) - } - - override func writer(with data: NSMutableData) -> FlutterStandardWriter { - DropInPlatformInterfaceCodecWriter(data: data) - } -} - -class DropInPlatformInterfaceCodec: FlutterStandardMessageCodec { - static let shared = DropInPlatformInterfaceCodec(readerWriter: DropInPlatformInterfaceCodecReaderWriter()) -} - /// Generated protocol from Pigeon that represents a handler of messages from Flutter. protocol DropInPlatformInterface { - func showDropInSession(dropInConfigurationDTO: DropInConfigurationDTO) throws - func showDropInAdvanced(dropInConfigurationDTO: DropInConfigurationDTO, paymentMethodsResponse: String) throws - func onPaymentsResult(paymentsResult: PaymentEventDTO) throws - func onPaymentsDetailsResult(paymentsDetailsResult: PaymentEventDTO) throws - func onDeleteStoredPaymentMethodResult(deleteStoredPaymentMethodResultDTO: DeletedStoredPaymentMethodResultDTO) throws - func onBalanceCheckResult(balanceCheckResponse: String) throws - func onOrderRequestResult(orderRequestResponse: String) throws - func onOrderCancelResult(orderCancelResult: OrderCancelResultDTO) throws - func cleanUpDropIn() throws + func showDropInSession(dropInConfigurationDTO: DropInConfigurationDTO) throws + func showDropInAdvanced(dropInConfigurationDTO: DropInConfigurationDTO, paymentMethodsResponse: String) throws + func onPaymentsResult(paymentsResult: PaymentEventDTO) throws + func onPaymentsDetailsResult(paymentsDetailsResult: PaymentEventDTO) throws + func onDeleteStoredPaymentMethodResult(deleteStoredPaymentMethodResultDTO: DeletedStoredPaymentMethodResultDTO) throws + func onBalanceCheckResult(balanceCheckResponse: String) throws + func onOrderRequestResult(orderRequestResponse: String) throws + func onOrderCancelResult(orderCancelResult: OrderCancelResultDTO) throws + func cleanUpDropIn() throws } /// Generated setup class from Pigeon to handle messages through the `binaryMessenger`. class DropInPlatformInterfaceSetup { - /// The codec used by DropInPlatformInterface. - static var codec: FlutterStandardMessageCodec { DropInPlatformInterfaceCodec.shared } - /// Sets up an instance of `DropInPlatformInterface` to handle messages through the `binaryMessenger`. - static func setUp(binaryMessenger: FlutterBinaryMessenger, api: DropInPlatformInterface?) { - let showDropInSessionChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.adyen_checkout.DropInPlatformInterface.showDropInSession", binaryMessenger: binaryMessenger, codec: codec) - if let api { - showDropInSessionChannel.setMessageHandler { message, reply in - let args = message as! [Any?] - let dropInConfigurationDTOArg = args[0] as! DropInConfigurationDTO - do { - try api.showDropInSession(dropInConfigurationDTO: dropInConfigurationDTOArg) - reply(wrapResult(nil)) - } catch { - reply(wrapError(error)) - } - } - } else { - showDropInSessionChannel.setMessageHandler(nil) - } - let showDropInAdvancedChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.adyen_checkout.DropInPlatformInterface.showDropInAdvanced", binaryMessenger: binaryMessenger, codec: codec) - if let api { - showDropInAdvancedChannel.setMessageHandler { message, reply in - let args = message as! [Any?] - let dropInConfigurationDTOArg = args[0] as! DropInConfigurationDTO - let paymentMethodsResponseArg = args[1] as! String - do { - try api.showDropInAdvanced(dropInConfigurationDTO: dropInConfigurationDTOArg, paymentMethodsResponse: paymentMethodsResponseArg) - reply(wrapResult(nil)) - } catch { - reply(wrapError(error)) - } - } - } else { - showDropInAdvancedChannel.setMessageHandler(nil) - } - let onPaymentsResultChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.adyen_checkout.DropInPlatformInterface.onPaymentsResult", binaryMessenger: binaryMessenger, codec: codec) - if let api { - onPaymentsResultChannel.setMessageHandler { message, reply in - let args = message as! [Any?] - let paymentsResultArg = args[0] as! PaymentEventDTO - do { - try api.onPaymentsResult(paymentsResult: paymentsResultArg) - reply(wrapResult(nil)) - } catch { - reply(wrapError(error)) - } - } - } else { - onPaymentsResultChannel.setMessageHandler(nil) - } - let onPaymentsDetailsResultChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.adyen_checkout.DropInPlatformInterface.onPaymentsDetailsResult", binaryMessenger: binaryMessenger, codec: codec) - if let api { - onPaymentsDetailsResultChannel.setMessageHandler { message, reply in - let args = message as! [Any?] - let paymentsDetailsResultArg = args[0] as! PaymentEventDTO - do { - try api.onPaymentsDetailsResult(paymentsDetailsResult: paymentsDetailsResultArg) - reply(wrapResult(nil)) - } catch { - reply(wrapError(error)) - } - } - } else { - onPaymentsDetailsResultChannel.setMessageHandler(nil) - } - let onDeleteStoredPaymentMethodResultChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.adyen_checkout.DropInPlatformInterface.onDeleteStoredPaymentMethodResult", binaryMessenger: binaryMessenger, codec: codec) - if let api { - onDeleteStoredPaymentMethodResultChannel.setMessageHandler { message, reply in - let args = message as! [Any?] - let deleteStoredPaymentMethodResultDTOArg = args[0] as! DeletedStoredPaymentMethodResultDTO - do { - try api.onDeleteStoredPaymentMethodResult(deleteStoredPaymentMethodResultDTO: deleteStoredPaymentMethodResultDTOArg) - reply(wrapResult(nil)) - } catch { - reply(wrapError(error)) - } - } - } else { - onDeleteStoredPaymentMethodResultChannel.setMessageHandler(nil) - } - let onBalanceCheckResultChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.adyen_checkout.DropInPlatformInterface.onBalanceCheckResult", binaryMessenger: binaryMessenger, codec: codec) - if let api { - onBalanceCheckResultChannel.setMessageHandler { message, reply in - let args = message as! [Any?] - let balanceCheckResponseArg = args[0] as! String - do { - try api.onBalanceCheckResult(balanceCheckResponse: balanceCheckResponseArg) - reply(wrapResult(nil)) - } catch { - reply(wrapError(error)) - } - } - } else { - onBalanceCheckResultChannel.setMessageHandler(nil) - } - let onOrderRequestResultChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.adyen_checkout.DropInPlatformInterface.onOrderRequestResult", binaryMessenger: binaryMessenger, codec: codec) - if let api { - onOrderRequestResultChannel.setMessageHandler { message, reply in - let args = message as! [Any?] - let orderRequestResponseArg = args[0] as! String - do { - try api.onOrderRequestResult(orderRequestResponse: orderRequestResponseArg) - reply(wrapResult(nil)) - } catch { - reply(wrapError(error)) - } - } - } else { - onOrderRequestResultChannel.setMessageHandler(nil) - } - let onOrderCancelResultChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.adyen_checkout.DropInPlatformInterface.onOrderCancelResult", binaryMessenger: binaryMessenger, codec: codec) - if let api { - onOrderCancelResultChannel.setMessageHandler { message, reply in - let args = message as! [Any?] - let orderCancelResultArg = args[0] as! OrderCancelResultDTO - do { - try api.onOrderCancelResult(orderCancelResult: orderCancelResultArg) - reply(wrapResult(nil)) - } catch { - reply(wrapError(error)) - } - } - } else { - onOrderCancelResultChannel.setMessageHandler(nil) - } - let cleanUpDropInChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.adyen_checkout.DropInPlatformInterface.cleanUpDropIn", binaryMessenger: binaryMessenger, codec: codec) - if let api { - cleanUpDropInChannel.setMessageHandler { _, reply in - do { - try api.cleanUpDropIn() - reply(wrapResult(nil)) - } catch { - reply(wrapError(error)) - } - } - } else { - cleanUpDropInChannel.setMessageHandler(nil) - } - } -} - -private class DropInFlutterInterfaceCodecReader: FlutterStandardReader { - override func readValue(ofType type: UInt8) -> Any? { - switch type { - case 128: - return AmountDTO.fromList(self.readValue() as! [Any?]) - case 129: - return OrderResponseDTO.fromList(self.readValue() as! [Any?]) - case 130: - return PaymentResultDTO.fromList(self.readValue() as! [Any?]) - case 131: - return PaymentResultModelDTO.fromList(self.readValue() as! [Any?]) - case 132: - return PlatformCommunicationModel.fromList(self.readValue() as! [Any?]) - default: - return super.readValue(ofType: type) - } - } -} - -private class DropInFlutterInterfaceCodecWriter: FlutterStandardWriter { - override func writeValue(_ value: Any) { - if let value = value as? AmountDTO { - super.writeByte(128) - super.writeValue(value.toList()) - } else if let value = value as? OrderResponseDTO { - super.writeByte(129) - super.writeValue(value.toList()) - } else if let value = value as? PaymentResultDTO { - super.writeByte(130) - super.writeValue(value.toList()) - } else if let value = value as? PaymentResultModelDTO { - super.writeByte(131) - super.writeValue(value.toList()) - } else if let value = value as? PlatformCommunicationModel { - super.writeByte(132) - super.writeValue(value.toList()) - } else { - super.writeValue(value) - } - } -} - -private class DropInFlutterInterfaceCodecReaderWriter: FlutterStandardReaderWriter { - override func reader(with data: Data) -> FlutterStandardReader { - DropInFlutterInterfaceCodecReader(data: data) - } - - override func writer(with data: NSMutableData) -> FlutterStandardWriter { - DropInFlutterInterfaceCodecWriter(data: data) - } -} - -class DropInFlutterInterfaceCodec: FlutterStandardMessageCodec { - static let shared = DropInFlutterInterfaceCodec(readerWriter: DropInFlutterInterfaceCodecReaderWriter()) + static var codec: FlutterStandardMessageCodec { PlatformApiPigeonCodec.shared } + /// Sets up an instance of `DropInPlatformInterface` to handle messages through the `binaryMessenger`. + static func setUp(binaryMessenger: FlutterBinaryMessenger, api: DropInPlatformInterface?, messageChannelSuffix: String = "") { + let channelSuffix = messageChannelSuffix.count > 0 ? ".\(messageChannelSuffix)" : "" + let showDropInSessionChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.adyen_checkout.DropInPlatformInterface.showDropInSession\(channelSuffix)", binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + showDropInSessionChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let dropInConfigurationDTOArg = args[0] as! DropInConfigurationDTO + do { + try api.showDropInSession(dropInConfigurationDTO: dropInConfigurationDTOArg) + reply(wrapResult(nil)) + } catch { + reply(wrapError(error)) + } + } + } else { + showDropInSessionChannel.setMessageHandler(nil) + } + let showDropInAdvancedChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.adyen_checkout.DropInPlatformInterface.showDropInAdvanced\(channelSuffix)", binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + showDropInAdvancedChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let dropInConfigurationDTOArg = args[0] as! DropInConfigurationDTO + let paymentMethodsResponseArg = args[1] as! String + do { + try api.showDropInAdvanced(dropInConfigurationDTO: dropInConfigurationDTOArg, paymentMethodsResponse: paymentMethodsResponseArg) + reply(wrapResult(nil)) + } catch { + reply(wrapError(error)) + } + } + } else { + showDropInAdvancedChannel.setMessageHandler(nil) + } + let onPaymentsResultChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.adyen_checkout.DropInPlatformInterface.onPaymentsResult\(channelSuffix)", binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + onPaymentsResultChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let paymentsResultArg = args[0] as! PaymentEventDTO + do { + try api.onPaymentsResult(paymentsResult: paymentsResultArg) + reply(wrapResult(nil)) + } catch { + reply(wrapError(error)) + } + } + } else { + onPaymentsResultChannel.setMessageHandler(nil) + } + let onPaymentsDetailsResultChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.adyen_checkout.DropInPlatformInterface.onPaymentsDetailsResult\(channelSuffix)", binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + onPaymentsDetailsResultChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let paymentsDetailsResultArg = args[0] as! PaymentEventDTO + do { + try api.onPaymentsDetailsResult(paymentsDetailsResult: paymentsDetailsResultArg) + reply(wrapResult(nil)) + } catch { + reply(wrapError(error)) + } + } + } else { + onPaymentsDetailsResultChannel.setMessageHandler(nil) + } + let onDeleteStoredPaymentMethodResultChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.adyen_checkout.DropInPlatformInterface.onDeleteStoredPaymentMethodResult\(channelSuffix)", binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + onDeleteStoredPaymentMethodResultChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let deleteStoredPaymentMethodResultDTOArg = args[0] as! DeletedStoredPaymentMethodResultDTO + do { + try api.onDeleteStoredPaymentMethodResult(deleteStoredPaymentMethodResultDTO: deleteStoredPaymentMethodResultDTOArg) + reply(wrapResult(nil)) + } catch { + reply(wrapError(error)) + } + } + } else { + onDeleteStoredPaymentMethodResultChannel.setMessageHandler(nil) + } + let onBalanceCheckResultChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.adyen_checkout.DropInPlatformInterface.onBalanceCheckResult\(channelSuffix)", binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + onBalanceCheckResultChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let balanceCheckResponseArg = args[0] as! String + do { + try api.onBalanceCheckResult(balanceCheckResponse: balanceCheckResponseArg) + reply(wrapResult(nil)) + } catch { + reply(wrapError(error)) + } + } + } else { + onBalanceCheckResultChannel.setMessageHandler(nil) + } + let onOrderRequestResultChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.adyen_checkout.DropInPlatformInterface.onOrderRequestResult\(channelSuffix)", binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + onOrderRequestResultChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let orderRequestResponseArg = args[0] as! String + do { + try api.onOrderRequestResult(orderRequestResponse: orderRequestResponseArg) + reply(wrapResult(nil)) + } catch { + reply(wrapError(error)) + } + } + } else { + onOrderRequestResultChannel.setMessageHandler(nil) + } + let onOrderCancelResultChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.adyen_checkout.DropInPlatformInterface.onOrderCancelResult\(channelSuffix)", binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + onOrderCancelResultChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let orderCancelResultArg = args[0] as! OrderCancelResultDTO + do { + try api.onOrderCancelResult(orderCancelResult: orderCancelResultArg) + reply(wrapResult(nil)) + } catch { + reply(wrapError(error)) + } + } + } else { + onOrderCancelResultChannel.setMessageHandler(nil) + } + let cleanUpDropInChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.adyen_checkout.DropInPlatformInterface.cleanUpDropIn\(channelSuffix)", binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + cleanUpDropInChannel.setMessageHandler { _, reply in + do { + try api.cleanUpDropIn() + reply(wrapResult(nil)) + } catch { + reply(wrapError(error)) + } + } + } else { + cleanUpDropInChannel.setMessageHandler(nil) + } + } } - /// Generated protocol from Pigeon that represents Flutter messages that can be called from Swift. protocol DropInFlutterInterfaceProtocol { - func onDropInSessionPlatformCommunication(platformCommunicationModel platformCommunicationModelArg: PlatformCommunicationModel, completion: @escaping (Result) -> Void) - func onDropInAdvancedPlatformCommunication(platformCommunicationModel platformCommunicationModelArg: PlatformCommunicationModel, completion: @escaping (Result) -> Void) + func onDropInSessionPlatformCommunication(platformCommunicationModel platformCommunicationModelArg: PlatformCommunicationModel, completion: @escaping (Result) -> Void) + func onDropInAdvancedPlatformCommunication(platformCommunicationModel platformCommunicationModelArg: PlatformCommunicationModel, completion: @escaping (Result) -> Void) } - class DropInFlutterInterface: DropInFlutterInterfaceProtocol { - private let binaryMessenger: FlutterBinaryMessenger - init(binaryMessenger: FlutterBinaryMessenger) { - self.binaryMessenger = binaryMessenger - } - - var codec: FlutterStandardMessageCodec { - DropInFlutterInterfaceCodec.shared - } - - func onDropInSessionPlatformCommunication(platformCommunicationModel platformCommunicationModelArg: PlatformCommunicationModel, completion: @escaping (Result) -> Void) { - let channelName = "dev.flutter.pigeon.adyen_checkout.DropInFlutterInterface.onDropInSessionPlatformCommunication" - let channel = FlutterBasicMessageChannel(name: channelName, binaryMessenger: binaryMessenger, codec: codec) - channel.sendMessage([platformCommunicationModelArg] as [Any?]) { response in - guard let listResponse = response as? [Any?] else { - completion(.failure(createConnectionError(withChannelName: channelName))) - return - } - if listResponse.count > 1 { - let code: String = listResponse[0] as! String - let message: String? = nilOrValue(listResponse[1]) - let details: String? = nilOrValue(listResponse[2]) - completion(.failure(FlutterError(code: code, message: message, details: details))) - } else { - completion(.success(())) - } - } - } - - func onDropInAdvancedPlatformCommunication(platformCommunicationModel platformCommunicationModelArg: PlatformCommunicationModel, completion: @escaping (Result) -> Void) { - let channelName = "dev.flutter.pigeon.adyen_checkout.DropInFlutterInterface.onDropInAdvancedPlatformCommunication" - let channel = FlutterBasicMessageChannel(name: channelName, binaryMessenger: binaryMessenger, codec: codec) - channel.sendMessage([platformCommunicationModelArg] as [Any?]) { response in - guard let listResponse = response as? [Any?] else { - completion(.failure(createConnectionError(withChannelName: channelName))) - return - } - if listResponse.count > 1 { - let code: String = listResponse[0] as! String - let message: String? = nilOrValue(listResponse[1]) - let details: String? = nilOrValue(listResponse[2]) - completion(.failure(FlutterError(code: code, message: message, details: details))) - } else { - completion(.success(())) - } - } - } -} - -private class ComponentPlatformInterfaceCodecReader: FlutterStandardReader { - override func readValue(ofType type: UInt8) -> Any? { - switch type { - case 128: - return ActionComponentConfigurationDTO.fromList(self.readValue() as! [Any?]) - case 129: - return AmountDTO.fromList(self.readValue() as! [Any?]) - case 130: - return AnalyticsOptionsDTO.fromList(self.readValue() as! [Any?]) - case 131: - return ApplePayConfigurationDTO.fromList(self.readValue() as! [Any?]) - case 132: - return ApplePayContactDTO.fromList(self.readValue() as! [Any?]) - case 133: - return ApplePayShippingMethodDTO.fromList(self.readValue() as! [Any?]) - case 134: - return ApplePaySummaryItemDTO.fromList(self.readValue() as! [Any?]) - case 135: - return BillingAddressParametersDTO.fromList(self.readValue() as! [Any?]) - case 136: - return CardComponentConfigurationDTO.fromList(self.readValue() as! [Any?]) - case 137: - return CardConfigurationDTO.fromList(self.readValue() as! [Any?]) - case 138: - return CashAppPayConfigurationDTO.fromList(self.readValue() as! [Any?]) - case 139: - return ComponentCommunicationModel.fromList(self.readValue() as! [Any?]) - case 140: - return DeletedStoredPaymentMethodResultDTO.fromList(self.readValue() as! [Any?]) - case 141: - return DropInConfigurationDTO.fromList(self.readValue() as! [Any?]) - case 142: - return EncryptedCardDTO.fromList(self.readValue() as! [Any?]) - case 143: - return ErrorDTO.fromList(self.readValue() as! [Any?]) - case 144: - return GooglePayConfigurationDTO.fromList(self.readValue() as! [Any?]) - case 145: - return InstantPaymentConfigurationDTO.fromList(self.readValue() as! [Any?]) - case 146: - return InstantPaymentSetupResultDTO.fromList(self.readValue() as! [Any?]) - case 147: - return MerchantInfoDTO.fromList(self.readValue() as! [Any?]) - case 148: - return OrderCancelResultDTO.fromList(self.readValue() as! [Any?]) - case 149: - return OrderResponseDTO.fromList(self.readValue() as! [Any?]) - case 150: - return PaymentEventDTO.fromList(self.readValue() as! [Any?]) - case 151: - return PaymentResultDTO.fromList(self.readValue() as! [Any?]) - case 152: - return PaymentResultModelDTO.fromList(self.readValue() as! [Any?]) - case 153: - return PlatformCommunicationModel.fromList(self.readValue() as! [Any?]) - case 154: - return SessionDTO.fromList(self.readValue() as! [Any?]) - case 155: - return ShippingAddressParametersDTO.fromList(self.readValue() as! [Any?]) - case 156: - return UnencryptedCardDTO.fromList(self.readValue() as! [Any?]) - default: - return super.readValue(ofType: type) - } - } -} - -private class ComponentPlatformInterfaceCodecWriter: FlutterStandardWriter { - override func writeValue(_ value: Any) { - if let value = value as? ActionComponentConfigurationDTO { - super.writeByte(128) - super.writeValue(value.toList()) - } else if let value = value as? AmountDTO { - super.writeByte(129) - super.writeValue(value.toList()) - } else if let value = value as? AnalyticsOptionsDTO { - super.writeByte(130) - super.writeValue(value.toList()) - } else if let value = value as? ApplePayConfigurationDTO { - super.writeByte(131) - super.writeValue(value.toList()) - } else if let value = value as? ApplePayContactDTO { - super.writeByte(132) - super.writeValue(value.toList()) - } else if let value = value as? ApplePayShippingMethodDTO { - super.writeByte(133) - super.writeValue(value.toList()) - } else if let value = value as? ApplePaySummaryItemDTO { - super.writeByte(134) - super.writeValue(value.toList()) - } else if let value = value as? BillingAddressParametersDTO { - super.writeByte(135) - super.writeValue(value.toList()) - } else if let value = value as? CardComponentConfigurationDTO { - super.writeByte(136) - super.writeValue(value.toList()) - } else if let value = value as? CardConfigurationDTO { - super.writeByte(137) - super.writeValue(value.toList()) - } else if let value = value as? CashAppPayConfigurationDTO { - super.writeByte(138) - super.writeValue(value.toList()) - } else if let value = value as? ComponentCommunicationModel { - super.writeByte(139) - super.writeValue(value.toList()) - } else if let value = value as? DeletedStoredPaymentMethodResultDTO { - super.writeByte(140) - super.writeValue(value.toList()) - } else if let value = value as? DropInConfigurationDTO { - super.writeByte(141) - super.writeValue(value.toList()) - } else if let value = value as? EncryptedCardDTO { - super.writeByte(142) - super.writeValue(value.toList()) - } else if let value = value as? ErrorDTO { - super.writeByte(143) - super.writeValue(value.toList()) - } else if let value = value as? GooglePayConfigurationDTO { - super.writeByte(144) - super.writeValue(value.toList()) - } else if let value = value as? InstantPaymentConfigurationDTO { - super.writeByte(145) - super.writeValue(value.toList()) - } else if let value = value as? InstantPaymentSetupResultDTO { - super.writeByte(146) - super.writeValue(value.toList()) - } else if let value = value as? MerchantInfoDTO { - super.writeByte(147) - super.writeValue(value.toList()) - } else if let value = value as? OrderCancelResultDTO { - super.writeByte(148) - super.writeValue(value.toList()) - } else if let value = value as? OrderResponseDTO { - super.writeByte(149) - super.writeValue(value.toList()) - } else if let value = value as? PaymentEventDTO { - super.writeByte(150) - super.writeValue(value.toList()) - } else if let value = value as? PaymentResultDTO { - super.writeByte(151) - super.writeValue(value.toList()) - } else if let value = value as? PaymentResultModelDTO { - super.writeByte(152) - super.writeValue(value.toList()) - } else if let value = value as? PlatformCommunicationModel { - super.writeByte(153) - super.writeValue(value.toList()) - } else if let value = value as? SessionDTO { - super.writeByte(154) - super.writeValue(value.toList()) - } else if let value = value as? ShippingAddressParametersDTO { - super.writeByte(155) - super.writeValue(value.toList()) - } else if let value = value as? UnencryptedCardDTO { - super.writeByte(156) - super.writeValue(value.toList()) - } else { - super.writeValue(value) - } - } -} - -private class ComponentPlatformInterfaceCodecReaderWriter: FlutterStandardReaderWriter { - override func reader(with data: Data) -> FlutterStandardReader { - ComponentPlatformInterfaceCodecReader(data: data) - } - - override func writer(with data: NSMutableData) -> FlutterStandardWriter { - ComponentPlatformInterfaceCodecWriter(data: data) - } -} - -class ComponentPlatformInterfaceCodec: FlutterStandardMessageCodec { - static let shared = ComponentPlatformInterfaceCodec(readerWriter: ComponentPlatformInterfaceCodecReaderWriter()) + private let binaryMessenger: FlutterBinaryMessenger + private let messageChannelSuffix: String + init(binaryMessenger: FlutterBinaryMessenger, messageChannelSuffix: String = "") { + self.binaryMessenger = binaryMessenger + self.messageChannelSuffix = messageChannelSuffix.count > 0 ? ".\(messageChannelSuffix)" : "" + } + var codec: PlatformApiPigeonCodec { + return PlatformApiPigeonCodec.shared + } + func onDropInSessionPlatformCommunication(platformCommunicationModel platformCommunicationModelArg: PlatformCommunicationModel, completion: @escaping (Result) -> Void) { + let channelName: String = "dev.flutter.pigeon.adyen_checkout.DropInFlutterInterface.onDropInSessionPlatformCommunication\(messageChannelSuffix)" + let channel = FlutterBasicMessageChannel(name: channelName, binaryMessenger: binaryMessenger, codec: codec) + channel.sendMessage([platformCommunicationModelArg] as [Any?]) { response in + guard let listResponse = response as? [Any?] else { + completion(.failure(createConnectionError(withChannelName: channelName))) + return + } + if listResponse.count > 1 { + let code: String = listResponse[0] as! String + let message: String? = nilOrValue(listResponse[1]) + let details: String? = nilOrValue(listResponse[2]) + completion(.failure(PigeonError(code: code, message: message, details: details))) + } else { + completion(.success(Void())) + } + } + } + func onDropInAdvancedPlatformCommunication(platformCommunicationModel platformCommunicationModelArg: PlatformCommunicationModel, completion: @escaping (Result) -> Void) { + let channelName: String = "dev.flutter.pigeon.adyen_checkout.DropInFlutterInterface.onDropInAdvancedPlatformCommunication\(messageChannelSuffix)" + let channel = FlutterBasicMessageChannel(name: channelName, binaryMessenger: binaryMessenger, codec: codec) + channel.sendMessage([platformCommunicationModelArg] as [Any?]) { response in + guard let listResponse = response as? [Any?] else { + completion(.failure(createConnectionError(withChannelName: channelName))) + return + } + if listResponse.count > 1 { + let code: String = listResponse[0] as! String + let message: String? = nilOrValue(listResponse[1]) + let details: String? = nilOrValue(listResponse[2]) + completion(.failure(PigeonError(code: code, message: message, details: details))) + } else { + completion(.success(Void())) + } + } + } } - /// Generated protocol from Pigeon that represents a handler of messages from Flutter. protocol ComponentPlatformInterface { - func updateViewHeight(viewId: Int64) throws - func onPaymentsResult(componentId: String, paymentsResult: PaymentEventDTO) throws - func onPaymentsDetailsResult(componentId: String, paymentsDetailsResult: PaymentEventDTO) throws - func isInstantPaymentSupportedByPlatform(instantPaymentConfigurationDTO: InstantPaymentConfigurationDTO, paymentMethodResponse: String, componentId: String, completion: @escaping (Result) -> Void) - func onInstantPaymentPressed(instantPaymentConfigurationDTO: InstantPaymentConfigurationDTO, encodedPaymentMethod: String, componentId: String) throws - func handleAction(actionComponentConfiguration: ActionComponentConfigurationDTO, componentId: String, actionResponse: [String?: Any?]?) throws - func onDispose(componentId: String) throws + func updateViewHeight(viewId: Int64) throws + func onPaymentsResult(componentId: String, paymentsResult: PaymentEventDTO) throws + func onPaymentsDetailsResult(componentId: String, paymentsDetailsResult: PaymentEventDTO) throws + func isInstantPaymentSupportedByPlatform(instantPaymentConfigurationDTO: InstantPaymentConfigurationDTO, paymentMethodResponse: String, componentId: String, completion: @escaping (Result) -> Void) + func onInstantPaymentPressed(instantPaymentConfigurationDTO: InstantPaymentConfigurationDTO, encodedPaymentMethod: String, componentId: String) throws + func handleAction(actionComponentConfiguration: ActionComponentConfigurationDTO, componentId: String, actionResponse: [String?: Any?]?) throws + func onDispose(componentId: String) throws } /// Generated setup class from Pigeon to handle messages through the `binaryMessenger`. class ComponentPlatformInterfaceSetup { - /// The codec used by ComponentPlatformInterface. - static var codec: FlutterStandardMessageCodec { ComponentPlatformInterfaceCodec.shared } - /// Sets up an instance of `ComponentPlatformInterface` to handle messages through the `binaryMessenger`. - static func setUp(binaryMessenger: FlutterBinaryMessenger, api: ComponentPlatformInterface?) { - let updateViewHeightChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.adyen_checkout.ComponentPlatformInterface.updateViewHeight", binaryMessenger: binaryMessenger, codec: codec) - if let api { - updateViewHeightChannel.setMessageHandler { message, reply in - let args = message as! [Any?] - let viewIdArg = args[0] is Int64 ? args[0] as! Int64 : Int64(args[0] as! Int32) - do { - try api.updateViewHeight(viewId: viewIdArg) - reply(wrapResult(nil)) - } catch { - reply(wrapError(error)) - } - } - } else { - updateViewHeightChannel.setMessageHandler(nil) - } - let onPaymentsResultChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.adyen_checkout.ComponentPlatformInterface.onPaymentsResult", binaryMessenger: binaryMessenger, codec: codec) - if let api { - onPaymentsResultChannel.setMessageHandler { message, reply in - let args = message as! [Any?] - let componentIdArg = args[0] as! String - let paymentsResultArg = args[1] as! PaymentEventDTO - do { - try api.onPaymentsResult(componentId: componentIdArg, paymentsResult: paymentsResultArg) - reply(wrapResult(nil)) - } catch { - reply(wrapError(error)) - } - } - } else { - onPaymentsResultChannel.setMessageHandler(nil) - } - let onPaymentsDetailsResultChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.adyen_checkout.ComponentPlatformInterface.onPaymentsDetailsResult", binaryMessenger: binaryMessenger, codec: codec) - if let api { - onPaymentsDetailsResultChannel.setMessageHandler { message, reply in - let args = message as! [Any?] - let componentIdArg = args[0] as! String - let paymentsDetailsResultArg = args[1] as! PaymentEventDTO - do { - try api.onPaymentsDetailsResult(componentId: componentIdArg, paymentsDetailsResult: paymentsDetailsResultArg) - reply(wrapResult(nil)) - } catch { - reply(wrapError(error)) - } - } - } else { - onPaymentsDetailsResultChannel.setMessageHandler(nil) - } - let isInstantPaymentSupportedByPlatformChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.adyen_checkout.ComponentPlatformInterface.isInstantPaymentSupportedByPlatform", binaryMessenger: binaryMessenger, codec: codec) - if let api { - isInstantPaymentSupportedByPlatformChannel.setMessageHandler { message, reply in - let args = message as! [Any?] - let instantPaymentConfigurationDTOArg = args[0] as! InstantPaymentConfigurationDTO - let paymentMethodResponseArg = args[1] as! String - let componentIdArg = args[2] as! String - api.isInstantPaymentSupportedByPlatform(instantPaymentConfigurationDTO: instantPaymentConfigurationDTOArg, paymentMethodResponse: paymentMethodResponseArg, componentId: componentIdArg) { result in - switch result { - case let .success(res): - reply(wrapResult(res)) - case let .failure(error): - reply(wrapError(error)) - } - } - } - } else { - isInstantPaymentSupportedByPlatformChannel.setMessageHandler(nil) - } - let onInstantPaymentPressedChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.adyen_checkout.ComponentPlatformInterface.onInstantPaymentPressed", binaryMessenger: binaryMessenger, codec: codec) - if let api { - onInstantPaymentPressedChannel.setMessageHandler { message, reply in - let args = message as! [Any?] - let instantPaymentConfigurationDTOArg = args[0] as! InstantPaymentConfigurationDTO - let encodedPaymentMethodArg = args[1] as! String - let componentIdArg = args[2] as! String - do { - try api.onInstantPaymentPressed(instantPaymentConfigurationDTO: instantPaymentConfigurationDTOArg, encodedPaymentMethod: encodedPaymentMethodArg, componentId: componentIdArg) - reply(wrapResult(nil)) - } catch { - reply(wrapError(error)) - } - } - } else { - onInstantPaymentPressedChannel.setMessageHandler(nil) - } - let handleActionChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.adyen_checkout.ComponentPlatformInterface.handleAction", binaryMessenger: binaryMessenger, codec: codec) - if let api { - handleActionChannel.setMessageHandler { message, reply in - let args = message as! [Any?] - let actionComponentConfigurationArg = args[0] as! ActionComponentConfigurationDTO - let componentIdArg = args[1] as! String - let actionResponseArg: [String?: Any?]? = nilOrValue(args[2]) - do { - try api.handleAction(actionComponentConfiguration: actionComponentConfigurationArg, componentId: componentIdArg, actionResponse: actionResponseArg) - reply(wrapResult(nil)) - } catch { - reply(wrapError(error)) - } - } - } else { - handleActionChannel.setMessageHandler(nil) - } - let onDisposeChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.adyen_checkout.ComponentPlatformInterface.onDispose", binaryMessenger: binaryMessenger, codec: codec) - if let api { - onDisposeChannel.setMessageHandler { message, reply in - let args = message as! [Any?] - let componentIdArg = args[0] as! String - do { - try api.onDispose(componentId: componentIdArg) - reply(wrapResult(nil)) - } catch { - reply(wrapError(error)) - } - } - } else { - onDisposeChannel.setMessageHandler(nil) - } - } -} - -private class ComponentFlutterInterfaceCodecReader: FlutterStandardReader { - override func readValue(ofType type: UInt8) -> Any? { - switch type { - case 128: - return AmountDTO.fromList(self.readValue() as! [Any?]) - case 129: - return AnalyticsOptionsDTO.fromList(self.readValue() as! [Any?]) - case 130: - return CardComponentConfigurationDTO.fromList(self.readValue() as! [Any?]) - case 131: - return CardConfigurationDTO.fromList(self.readValue() as! [Any?]) - case 132: - return ComponentCommunicationModel.fromList(self.readValue() as! [Any?]) - case 133: - return OrderResponseDTO.fromList(self.readValue() as! [Any?]) - case 134: - return PaymentResultDTO.fromList(self.readValue() as! [Any?]) - case 135: - return PaymentResultModelDTO.fromList(self.readValue() as! [Any?]) - case 136: - return SessionDTO.fromList(self.readValue() as! [Any?]) - default: - return super.readValue(ofType: type) - } - } + static var codec: FlutterStandardMessageCodec { PlatformApiPigeonCodec.shared } + /// Sets up an instance of `ComponentPlatformInterface` to handle messages through the `binaryMessenger`. + static func setUp(binaryMessenger: FlutterBinaryMessenger, api: ComponentPlatformInterface?, messageChannelSuffix: String = "") { + let channelSuffix = messageChannelSuffix.count > 0 ? ".\(messageChannelSuffix)" : "" + let updateViewHeightChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.adyen_checkout.ComponentPlatformInterface.updateViewHeight\(channelSuffix)", binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + updateViewHeightChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let viewIdArg = args[0] is Int64 ? args[0] as! Int64 : Int64(args[0] as! Int32) + do { + try api.updateViewHeight(viewId: viewIdArg) + reply(wrapResult(nil)) + } catch { + reply(wrapError(error)) + } + } + } else { + updateViewHeightChannel.setMessageHandler(nil) + } + let onPaymentsResultChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.adyen_checkout.ComponentPlatformInterface.onPaymentsResult\(channelSuffix)", binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + onPaymentsResultChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let componentIdArg = args[0] as! String + let paymentsResultArg = args[1] as! PaymentEventDTO + do { + try api.onPaymentsResult(componentId: componentIdArg, paymentsResult: paymentsResultArg) + reply(wrapResult(nil)) + } catch { + reply(wrapError(error)) + } + } + } else { + onPaymentsResultChannel.setMessageHandler(nil) + } + let onPaymentsDetailsResultChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.adyen_checkout.ComponentPlatformInterface.onPaymentsDetailsResult\(channelSuffix)", binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + onPaymentsDetailsResultChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let componentIdArg = args[0] as! String + let paymentsDetailsResultArg = args[1] as! PaymentEventDTO + do { + try api.onPaymentsDetailsResult(componentId: componentIdArg, paymentsDetailsResult: paymentsDetailsResultArg) + reply(wrapResult(nil)) + } catch { + reply(wrapError(error)) + } + } + } else { + onPaymentsDetailsResultChannel.setMessageHandler(nil) + } + let isInstantPaymentSupportedByPlatformChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.adyen_checkout.ComponentPlatformInterface.isInstantPaymentSupportedByPlatform\(channelSuffix)", binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + isInstantPaymentSupportedByPlatformChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let instantPaymentConfigurationDTOArg = args[0] as! InstantPaymentConfigurationDTO + let paymentMethodResponseArg = args[1] as! String + let componentIdArg = args[2] as! String + api.isInstantPaymentSupportedByPlatform(instantPaymentConfigurationDTO: instantPaymentConfigurationDTOArg, paymentMethodResponse: paymentMethodResponseArg, componentId: componentIdArg) { result in + switch result { + case .success(let res): + reply(wrapResult(res)) + case .failure(let error): + reply(wrapError(error)) + } + } + } + } else { + isInstantPaymentSupportedByPlatformChannel.setMessageHandler(nil) + } + let onInstantPaymentPressedChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.adyen_checkout.ComponentPlatformInterface.onInstantPaymentPressed\(channelSuffix)", binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + onInstantPaymentPressedChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let instantPaymentConfigurationDTOArg = args[0] as! InstantPaymentConfigurationDTO + let encodedPaymentMethodArg = args[1] as! String + let componentIdArg = args[2] as! String + do { + try api.onInstantPaymentPressed(instantPaymentConfigurationDTO: instantPaymentConfigurationDTOArg, encodedPaymentMethod: encodedPaymentMethodArg, componentId: componentIdArg) + reply(wrapResult(nil)) + } catch { + reply(wrapError(error)) + } + } + } else { + onInstantPaymentPressedChannel.setMessageHandler(nil) + } + let handleActionChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.adyen_checkout.ComponentPlatformInterface.handleAction\(channelSuffix)", binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + handleActionChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let actionComponentConfigurationArg = args[0] as! ActionComponentConfigurationDTO + let componentIdArg = args[1] as! String + let actionResponseArg: [String?: Any?]? = nilOrValue(args[2]) + do { + try api.handleAction(actionComponentConfiguration: actionComponentConfigurationArg, componentId: componentIdArg, actionResponse: actionResponseArg) + reply(wrapResult(nil)) + } catch { + reply(wrapError(error)) + } + } + } else { + handleActionChannel.setMessageHandler(nil) + } + let onDisposeChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.adyen_checkout.ComponentPlatformInterface.onDispose\(channelSuffix)", binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + onDisposeChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let componentIdArg = args[0] as! String + do { + try api.onDispose(componentId: componentIdArg) + reply(wrapResult(nil)) + } catch { + reply(wrapError(error)) + } + } + } else { + onDisposeChannel.setMessageHandler(nil) + } + } } - -private class ComponentFlutterInterfaceCodecWriter: FlutterStandardWriter { - override func writeValue(_ value: Any) { - if let value = value as? AmountDTO { - super.writeByte(128) - super.writeValue(value.toList()) - } else if let value = value as? AnalyticsOptionsDTO { - super.writeByte(129) - super.writeValue(value.toList()) - } else if let value = value as? CardComponentConfigurationDTO { - super.writeByte(130) - super.writeValue(value.toList()) - } else if let value = value as? CardConfigurationDTO { - super.writeByte(131) - super.writeValue(value.toList()) - } else if let value = value as? ComponentCommunicationModel { - super.writeByte(132) - super.writeValue(value.toList()) - } else if let value = value as? OrderResponseDTO { - super.writeByte(133) - super.writeValue(value.toList()) - } else if let value = value as? PaymentResultDTO { - super.writeByte(134) - super.writeValue(value.toList()) - } else if let value = value as? PaymentResultModelDTO { - super.writeByte(135) - super.writeValue(value.toList()) - } else if let value = value as? SessionDTO { - super.writeByte(136) - super.writeValue(value.toList()) - } else { - super.writeValue(value) - } - } -} - -private class ComponentFlutterInterfaceCodecReaderWriter: FlutterStandardReaderWriter { - override func reader(with data: Data) -> FlutterStandardReader { - ComponentFlutterInterfaceCodecReader(data: data) - } - - override func writer(with data: NSMutableData) -> FlutterStandardWriter { - ComponentFlutterInterfaceCodecWriter(data: data) - } -} - -class ComponentFlutterInterfaceCodec: FlutterStandardMessageCodec { - static let shared = ComponentFlutterInterfaceCodec(readerWriter: ComponentFlutterInterfaceCodecReaderWriter()) -} - /// Generated protocol from Pigeon that represents Flutter messages that can be called from Swift. protocol ComponentFlutterInterfaceProtocol { - func _generateCodecForDTOs(cardComponentConfigurationDTO cardComponentConfigurationDTOArg: CardComponentConfigurationDTO, sessionDTO sessionDTOArg: SessionDTO, completion: @escaping (Result) -> Void) - func onComponentCommunication(componentCommunicationModel componentCommunicationModelArg: ComponentCommunicationModel, completion: @escaping (Result) -> Void) + func _generateCodecForDTOs(cardComponentConfigurationDTO cardComponentConfigurationDTOArg: CardComponentConfigurationDTO, sessionDTO sessionDTOArg: SessionDTO, completion: @escaping (Result) -> Void) + func onComponentCommunication(componentCommunicationModel componentCommunicationModelArg: ComponentCommunicationModel, completion: @escaping (Result) -> Void) } - class ComponentFlutterInterface: ComponentFlutterInterfaceProtocol { - private let binaryMessenger: FlutterBinaryMessenger - init(binaryMessenger: FlutterBinaryMessenger) { - self.binaryMessenger = binaryMessenger - } - - var codec: FlutterStandardMessageCodec { - ComponentFlutterInterfaceCodec.shared - } - - func _generateCodecForDTOs(cardComponentConfigurationDTO cardComponentConfigurationDTOArg: CardComponentConfigurationDTO, sessionDTO sessionDTOArg: SessionDTO, completion: @escaping (Result) -> Void) { - let channelName = "dev.flutter.pigeon.adyen_checkout.ComponentFlutterInterface._generateCodecForDTOs" - let channel = FlutterBasicMessageChannel(name: channelName, binaryMessenger: binaryMessenger, codec: codec) - channel.sendMessage([cardComponentConfigurationDTOArg, sessionDTOArg] as [Any?]) { response in - guard let listResponse = response as? [Any?] else { - completion(.failure(createConnectionError(withChannelName: channelName))) - return - } - if listResponse.count > 1 { - let code: String = listResponse[0] as! String - let message: String? = nilOrValue(listResponse[1]) - let details: String? = nilOrValue(listResponse[2]) - completion(.failure(FlutterError(code: code, message: message, details: details))) - } else { - completion(.success(())) - } - } - } - - func onComponentCommunication(componentCommunicationModel componentCommunicationModelArg: ComponentCommunicationModel, completion: @escaping (Result) -> Void) { - let channelName = "dev.flutter.pigeon.adyen_checkout.ComponentFlutterInterface.onComponentCommunication" - let channel = FlutterBasicMessageChannel(name: channelName, binaryMessenger: binaryMessenger, codec: codec) - channel.sendMessage([componentCommunicationModelArg] as [Any?]) { response in - guard let listResponse = response as? [Any?] else { - completion(.failure(createConnectionError(withChannelName: channelName))) - return - } - if listResponse.count > 1 { - let code: String = listResponse[0] as! String - let message: String? = nilOrValue(listResponse[1]) - let details: String? = nilOrValue(listResponse[2]) - completion(.failure(FlutterError(code: code, message: message, details: details))) - } else { - completion(.success(())) - } - } - } + private let binaryMessenger: FlutterBinaryMessenger + private let messageChannelSuffix: String + init(binaryMessenger: FlutterBinaryMessenger, messageChannelSuffix: String = "") { + self.binaryMessenger = binaryMessenger + self.messageChannelSuffix = messageChannelSuffix.count > 0 ? ".\(messageChannelSuffix)" : "" + } + var codec: PlatformApiPigeonCodec { + return PlatformApiPigeonCodec.shared + } + func _generateCodecForDTOs(cardComponentConfigurationDTO cardComponentConfigurationDTOArg: CardComponentConfigurationDTO, sessionDTO sessionDTOArg: SessionDTO, completion: @escaping (Result) -> Void) { + let channelName: String = "dev.flutter.pigeon.adyen_checkout.ComponentFlutterInterface._generateCodecForDTOs\(messageChannelSuffix)" + let channel = FlutterBasicMessageChannel(name: channelName, binaryMessenger: binaryMessenger, codec: codec) + channel.sendMessage([cardComponentConfigurationDTOArg, sessionDTOArg] as [Any?]) { response in + guard let listResponse = response as? [Any?] else { + completion(.failure(createConnectionError(withChannelName: channelName))) + return + } + if listResponse.count > 1 { + let code: String = listResponse[0] as! String + let message: String? = nilOrValue(listResponse[1]) + let details: String? = nilOrValue(listResponse[2]) + completion(.failure(PigeonError(code: code, message: message, details: details))) + } else { + completion(.success(Void())) + } + } + } + func onComponentCommunication(componentCommunicationModel componentCommunicationModelArg: ComponentCommunicationModel, completion: @escaping (Result) -> Void) { + let channelName: String = "dev.flutter.pigeon.adyen_checkout.ComponentFlutterInterface.onComponentCommunication\(messageChannelSuffix)" + let channel = FlutterBasicMessageChannel(name: channelName, binaryMessenger: binaryMessenger, codec: codec) + channel.sendMessage([componentCommunicationModelArg] as [Any?]) { response in + guard let listResponse = response as? [Any?] else { + completion(.failure(createConnectionError(withChannelName: channelName))) + return + } + if listResponse.count > 1 { + let code: String = listResponse[0] as! String + let message: String? = nilOrValue(listResponse[1]) + let details: String? = nilOrValue(listResponse[2]) + completion(.failure(PigeonError(code: code, message: message, details: details))) + } else { + completion(.success(Void())) + } + } + } } diff --git a/lib/src/components/component_flutter_api.dart b/lib/src/components/component_flutter_api.dart index 5bfcde8d..a216aec2 100644 --- a/lib/src/components/component_flutter_api.dart +++ b/lib/src/components/component_flutter_api.dart @@ -12,7 +12,7 @@ class ComponentFlutterApi implements ComponentFlutterInterface { static ComponentFlutterApi _initComponentFlutterApi() { ComponentFlutterApi componentFlutterApi = ComponentFlutterApi._init(); - ComponentFlutterInterface.setup(componentFlutterApi); + ComponentFlutterInterface.setUp(componentFlutterApi); _componentCommunicationStream = StreamController.broadcast(); return componentFlutterApi; @@ -34,7 +34,7 @@ class ComponentFlutterApi implements ComponentFlutterInterface { if (componentCommunicationStream.hasListener == false) { _instance = null; _componentCommunicationStream.close(); - ComponentFlutterInterface.setup(null); + ComponentFlutterInterface.setUp(null); } } } diff --git a/lib/src/drop_in/drop_in.dart b/lib/src/drop_in/drop_in.dart index 93e0303e..c404ad4e 100644 --- a/lib/src/drop_in/drop_in.dart +++ b/lib/src/drop_in/drop_in.dart @@ -17,7 +17,7 @@ class DropIn { this.dropInFlutterApi, this.dropInPlatformApi, ) { - DropInFlutterInterface.setup(dropInFlutterApi); + DropInFlutterInterface.setUp(dropInFlutterApi); } final PaymentEventHandler _paymentEventHandler = PaymentEventHandler(); diff --git a/lib/src/generated/platform_api.g.dart b/lib/src/generated/platform_api.g.dart index f878f916..db4335b0 100644 --- a/lib/src/generated/platform_api.g.dart +++ b/lib/src/generated/platform_api.g.dart @@ -1,4 +1,4 @@ -// Autogenerated from Pigeon (v16.0.5), do not edit directly. +// Autogenerated from Pigeon (v21.1.0), do not edit directly. // See also: https://pub.dev/packages/pigeon // ignore_for_file: public_member_api_docs, non_constant_identifier_names, avoid_as, unused_import, unnecessary_parenthesis, prefer_null_aware_operators, omit_local_variable_types, unused_shown_name, unnecessary_import, no_leading_underscores_for_local_identifiers @@ -15,8 +15,7 @@ PlatformException _createConnectionError(String channelName) { ); } -List wrapResponse( - {Object? result, PlatformException? error, bool empty = false}) { +List wrapResponse({Object? result, PlatformException? error, bool empty = false}) { if (empty) { return []; } @@ -280,16 +279,16 @@ class DropInConfigurationDTO { Object encode() { return [ - environment.index, + environment, clientKey, countryCode, - amount?.encode(), + amount, shopperLocale, - cardConfigurationDTO?.encode(), - applePayConfigurationDTO?.encode(), - googlePayConfigurationDTO?.encode(), - cashAppPayConfigurationDTO?.encode(), - analyticsOptionsDTO.encode(), + cardConfigurationDTO, + applePayConfigurationDTO, + googlePayConfigurationDTO, + cashAppPayConfigurationDTO, + analyticsOptionsDTO, showPreselectedStoredPaymentMethod, skipListWhenSinglePaymentMethod, isRemoveStoredPaymentMethodEnabled, @@ -302,33 +301,21 @@ class DropInConfigurationDTO { static DropInConfigurationDTO decode(Object result) { result as List; return DropInConfigurationDTO( - environment: Environment.values[result[0]! as int], + environment: result[0]! as Environment, clientKey: result[1]! as String, countryCode: result[2]! as String, - amount: result[3] != null - ? AmountDTO.decode(result[3]! as List) - : null, + amount: result[3] as AmountDTO?, shopperLocale: result[4] as String?, - cardConfigurationDTO: result[5] != null - ? CardConfigurationDTO.decode(result[5]! as List) - : null, - applePayConfigurationDTO: result[6] != null - ? ApplePayConfigurationDTO.decode(result[6]! as List) - : null, - googlePayConfigurationDTO: result[7] != null - ? GooglePayConfigurationDTO.decode(result[7]! as List) - : null, - cashAppPayConfigurationDTO: result[8] != null - ? CashAppPayConfigurationDTO.decode(result[8]! as List) - : null, - analyticsOptionsDTO: - AnalyticsOptionsDTO.decode(result[9]! as List), + cardConfigurationDTO: result[5] as CardConfigurationDTO?, + applePayConfigurationDTO: result[6] as ApplePayConfigurationDTO?, + googlePayConfigurationDTO: result[7] as GooglePayConfigurationDTO?, + cashAppPayConfigurationDTO: result[8] as CashAppPayConfigurationDTO?, + analyticsOptionsDTO: result[9]! as AnalyticsOptionsDTO, showPreselectedStoredPaymentMethod: result[10]! as bool, skipListWhenSinglePaymentMethod: result[11]! as bool, isRemoveStoredPaymentMethodEnabled: result[12]! as bool, preselectedPaymentMethodTitle: result[13] as String?, - paymentMethodNames: - (result[14] as Map?)?.cast(), + paymentMethodNames: (result[14] as Map?)?.cast(), isPartialPaymentSupported: result[15]! as bool, ); } @@ -365,12 +352,12 @@ class CardConfigurationDTO { Object encode() { return [ holderNameRequired, - addressMode.index, + addressMode, showStorePaymentField, showCvcForStoredCard, showCvc, - kcpFieldVisibility.index, - socialSecurityNumberFieldVisibility.index, + kcpFieldVisibility, + socialSecurityNumberFieldVisibility, supportedCardTypes, ]; } @@ -379,13 +366,12 @@ class CardConfigurationDTO { result as List; return CardConfigurationDTO( holderNameRequired: result[0]! as bool, - addressMode: AddressMode.values[result[1]! as int], + addressMode: result[1]! as AddressMode, showStorePaymentField: result[2]! as bool, showCvcForStoredCard: result[3]! as bool, showCvc: result[4]! as bool, - kcpFieldVisibility: FieldVisibility.values[result[5]! as int], - socialSecurityNumberFieldVisibility: - FieldVisibility.values[result[6]! as int], + kcpFieldVisibility: result[5]! as FieldVisibility, + socialSecurityNumberFieldVisibility: result[6]! as FieldVisibility, supportedCardTypes: (result[7] as List?)!.cast(), ); } @@ -444,15 +430,15 @@ class ApplePayConfigurationDTO { allowOnboarding, summaryItems, requiredBillingContactFields, - billingContact?.encode(), + billingContact, requiredShippingContactFields, - shippingContact?.encode(), - applePayShippingType?.index, + shippingContact, + applePayShippingType, allowShippingContactEditing, shippingMethods, applicationData, supportedCountries, - merchantCapability?.index, + merchantCapability, ]; } @@ -462,29 +448,17 @@ class ApplePayConfigurationDTO { merchantId: result[0]! as String, merchantName: result[1]! as String, allowOnboarding: result[2] as bool?, - summaryItems: - (result[3] as List?)?.cast(), - requiredBillingContactFields: - (result[4] as List?)?.cast(), - billingContact: result[5] != null - ? ApplePayContactDTO.decode(result[5]! as List) - : null, - requiredShippingContactFields: - (result[6] as List?)?.cast(), - shippingContact: result[7] != null - ? ApplePayContactDTO.decode(result[7]! as List) - : null, - applePayShippingType: result[8] != null - ? ApplePayShippingType.values[result[8]! as int] - : null, + summaryItems: (result[3] as List?)?.cast(), + requiredBillingContactFields: (result[4] as List?)?.cast(), + billingContact: result[5] as ApplePayContactDTO?, + requiredShippingContactFields: (result[6] as List?)?.cast(), + shippingContact: result[7] as ApplePayContactDTO?, + applePayShippingType: result[8] as ApplePayShippingType?, allowShippingContactEditing: result[9] as bool?, - shippingMethods: - (result[10] as List?)?.cast(), + shippingMethods: (result[10] as List?)?.cast(), applicationData: result[11] as String?, supportedCountries: (result[12] as List?)?.cast(), - merchantCapability: result[13] != null - ? ApplePayMerchantCapability.values[result[13]! as int] - : null, + merchantCapability: result[13] as ApplePayMerchantCapability?, ); } } @@ -601,7 +575,7 @@ class ApplePayShippingMethodDTO { return [ label, detail, - amount.encode(), + amount, identifier, startDate, endDate, @@ -613,7 +587,7 @@ class ApplePayShippingMethodDTO { return ApplePayShippingMethodDTO( label: result[0]! as String, detail: result[1]! as String, - amount: AmountDTO.decode(result[2]! as List), + amount: result[2]! as AmountDTO, identifier: result[3]! as String, startDate: result[4] as String?, endDate: result[5] as String?, @@ -637,8 +611,8 @@ class ApplePaySummaryItemDTO { Object encode() { return [ label, - amount.encode(), - type.index, + amount, + type, ]; } @@ -646,8 +620,8 @@ class ApplePaySummaryItemDTO { result as List; return ApplePaySummaryItemDTO( label: result[0]! as String, - amount: AmountDTO.decode(result[1]! as List), - type: ApplePaySummaryItemType.values[result[2]! as int], + amount: result[1]! as AmountDTO, + type: result[2]! as ApplePaySummaryItemType, ); } } @@ -703,10 +677,10 @@ class GooglePayConfigurationDTO { Object encode() { return [ - googlePayEnvironment.index, + googlePayEnvironment, merchantAccount, - merchantInfoDTO?.encode(), - totalPriceStatus?.index, + merchantInfoDTO, + totalPriceStatus, allowedCardNetworks, allowedAuthMethods, allowPrepaidCards, @@ -715,22 +689,19 @@ class GooglePayConfigurationDTO { emailRequired, existingPaymentMethodRequired, shippingAddressRequired, - shippingAddressParametersDTO?.encode(), + shippingAddressParametersDTO, billingAddressRequired, - billingAddressParametersDTO?.encode(), + billingAddressParametersDTO, ]; } static GooglePayConfigurationDTO decode(Object result) { result as List; return GooglePayConfigurationDTO( - googlePayEnvironment: GooglePayEnvironment.values[result[0]! as int], + googlePayEnvironment: result[0]! as GooglePayEnvironment, merchantAccount: result[1] as String?, - merchantInfoDTO: result[2] != null - ? MerchantInfoDTO.decode(result[2]! as List) - : null, - totalPriceStatus: - result[3] != null ? TotalPriceStatus.values[result[3]! as int] : null, + merchantInfoDTO: result[2] as MerchantInfoDTO?, + totalPriceStatus: result[3] as TotalPriceStatus?, allowedCardNetworks: (result[4] as List?)?.cast(), allowedAuthMethods: (result[5] as List?)?.cast(), allowPrepaidCards: result[6] as bool?, @@ -739,13 +710,9 @@ class GooglePayConfigurationDTO { emailRequired: result[9] as bool?, existingPaymentMethodRequired: result[10] as bool?, shippingAddressRequired: result[11] as bool?, - shippingAddressParametersDTO: result[12] != null - ? ShippingAddressParametersDTO.decode(result[12]! as List) - : null, + shippingAddressParametersDTO: result[12] as ShippingAddressParametersDTO?, billingAddressRequired: result[13] as bool?, - billingAddressParametersDTO: result[14] != null - ? BillingAddressParametersDTO.decode(result[14]! as List) - : null, + billingAddressParametersDTO: result[14] as BillingAddressParametersDTO?, ); } } @@ -840,7 +807,7 @@ class CashAppPayConfigurationDTO { Object encode() { return [ - cashAppPayEnvironment.index, + cashAppPayEnvironment, returnUrl, ]; } @@ -848,7 +815,7 @@ class CashAppPayConfigurationDTO { static CashAppPayConfigurationDTO decode(Object result) { result as List; return CashAppPayConfigurationDTO( - cashAppPayEnvironment: CashAppPayEnvironment.values[result[0]! as int], + cashAppPayEnvironment: result[0]! as CashAppPayEnvironment, returnUrl: result[1]! as String, ); } @@ -869,20 +836,18 @@ class PaymentResultDTO { Object encode() { return [ - type.index, + type, reason, - result?.encode(), + result, ]; } static PaymentResultDTO decode(Object result) { result as List; return PaymentResultDTO( - type: PaymentResultEnum.values[result[0]! as int], + type: result[0]! as PaymentResultEnum, reason: result[1] as String?, - result: result[2] != null - ? PaymentResultModelDTO.decode(result[2]! as List) - : null, + result: result[2] as PaymentResultModelDTO?, ); } } @@ -912,7 +877,7 @@ class PaymentResultModelDTO { sessionData, sessionResult, resultCode, - order?.encode(), + order, ]; } @@ -923,9 +888,7 @@ class PaymentResultModelDTO { sessionData: result[1] as String?, sessionResult: result[2] as String?, resultCode: result[3] as String?, - order: result[4] != null - ? OrderResponseDTO.decode(result[4]! as List) - : null, + order: result[4] as OrderResponseDTO?, ); } } @@ -950,8 +913,8 @@ class OrderResponseDTO { return [ pspReference, orderData, - amount?.encode(), - remainingAmount?.encode(), + amount, + remainingAmount, ]; } @@ -960,12 +923,8 @@ class OrderResponseDTO { return OrderResponseDTO( pspReference: result[0]! as String, orderData: result[1]! as String, - amount: result[2] != null - ? AmountDTO.decode(result[2]! as List) - : null, - remainingAmount: result[3] != null - ? AmountDTO.decode(result[3]! as List) - : null, + amount: result[2] as AmountDTO?, + remainingAmount: result[3] as AmountDTO?, ); } } @@ -985,20 +944,18 @@ class PlatformCommunicationModel { Object encode() { return [ - type.index, + type, data, - paymentResult?.encode(), + paymentResult, ]; } static PlatformCommunicationModel decode(Object result) { result as List; return PlatformCommunicationModel( - type: PlatformCommunicationType.values[result[0]! as int], + type: result[0]! as PlatformCommunicationType, data: result[1] as String?, - paymentResult: result[2] != null - ? PaymentResultDTO.decode(result[2]! as List) - : null, + paymentResult: result[2] as PaymentResultDTO?, ); } } @@ -1021,22 +978,20 @@ class ComponentCommunicationModel { Object encode() { return [ - type.index, + type, componentId, data, - paymentResult?.encode(), + paymentResult, ]; } static ComponentCommunicationModel decode(Object result) { result as List; return ComponentCommunicationModel( - type: ComponentCommunicationType.values[result[0]! as int], + type: result[0]! as ComponentCommunicationType, componentId: result[1]! as String, data: result[2], - paymentResult: result[3] != null - ? PaymentResultDTO.decode(result[3]! as List) - : null, + paymentResult: result[3] as PaymentResultDTO?, ); } } @@ -1059,22 +1014,20 @@ class PaymentEventDTO { Object encode() { return [ - paymentEventType.index, + paymentEventType, result, data, - error?.encode(), + error, ]; } static PaymentEventDTO decode(Object result) { result as List; return PaymentEventDTO( - paymentEventType: PaymentEventType.values[result[0]! as int], + paymentEventType: result[0]! as PaymentEventType, result: result[1] as String?, data: (result[2] as Map?)?.cast(), - error: result[3] != null - ? ErrorDTO.decode(result[3]! as List) - : null, + error: result[3] as ErrorDTO?, ); } } @@ -1163,30 +1116,26 @@ class CardComponentConfigurationDTO { Object encode() { return [ - environment.index, + environment, clientKey, countryCode, - amount?.encode(), + amount, shopperLocale, - cardConfiguration.encode(), - analyticsOptionsDTO.encode(), + cardConfiguration, + analyticsOptionsDTO, ]; } static CardComponentConfigurationDTO decode(Object result) { result as List; return CardComponentConfigurationDTO( - environment: Environment.values[result[0]! as int], + environment: result[0]! as Environment, clientKey: result[1]! as String, countryCode: result[2]! as String, - amount: result[3] != null - ? AmountDTO.decode(result[3]! as List) - : null, + amount: result[3] as AmountDTO?, shopperLocale: result[4] as String?, - cardConfiguration: - CardConfigurationDTO.decode(result[5]! as List), - analyticsOptionsDTO: - AnalyticsOptionsDTO.decode(result[6]! as List), + cardConfiguration: result[5]! as CardConfigurationDTO, + analyticsOptionsDTO: result[6]! as AnalyticsOptionsDTO, ); } } @@ -1224,37 +1173,30 @@ class InstantPaymentConfigurationDTO { Object encode() { return [ - instantPaymentType.index, - environment.index, + instantPaymentType, + environment, clientKey, countryCode, - amount?.encode(), + amount, shopperLocale, - analyticsOptionsDTO.encode(), - googlePayConfigurationDTO?.encode(), - applePayConfigurationDTO?.encode(), + analyticsOptionsDTO, + googlePayConfigurationDTO, + applePayConfigurationDTO, ]; } static InstantPaymentConfigurationDTO decode(Object result) { result as List; return InstantPaymentConfigurationDTO( - instantPaymentType: InstantPaymentType.values[result[0]! as int], - environment: Environment.values[result[1]! as int], + instantPaymentType: result[0]! as InstantPaymentType, + environment: result[1]! as Environment, clientKey: result[2]! as String, countryCode: result[3]! as String, - amount: result[4] != null - ? AmountDTO.decode(result[4]! as List) - : null, + amount: result[4] as AmountDTO?, shopperLocale: result[5] as String?, - analyticsOptionsDTO: - AnalyticsOptionsDTO.decode(result[6]! as List), - googlePayConfigurationDTO: result[7] != null - ? GooglePayConfigurationDTO.decode(result[7]! as List) - : null, - applePayConfigurationDTO: result[8] != null - ? ApplePayConfigurationDTO.decode(result[8]! as List) - : null, + analyticsOptionsDTO: result[6]! as AnalyticsOptionsDTO, + googlePayConfigurationDTO: result[7] as GooglePayConfigurationDTO?, + applePayConfigurationDTO: result[8] as ApplePayConfigurationDTO?, ); } } @@ -1274,7 +1216,7 @@ class InstantPaymentSetupResultDTO { Object encode() { return [ - instantPaymentType.index, + instantPaymentType, isSupported, resultData, ]; @@ -1283,7 +1225,7 @@ class InstantPaymentSetupResultDTO { static InstantPaymentSetupResultDTO decode(Object result) { result as List; return InstantPaymentSetupResultDTO( - instantPaymentType: InstantPaymentType.values[result[0]! as int], + instantPaymentType: result[0]! as InstantPaymentType, isSupported: result[1]! as bool, resultData: result[2], ); @@ -1383,25 +1325,22 @@ class ActionComponentConfigurationDTO { Object encode() { return [ - environment.index, + environment, clientKey, shopperLocale, - amount?.encode(), - analyticsOptionsDTO.encode(), + amount, + analyticsOptionsDTO, ]; } static ActionComponentConfigurationDTO decode(Object result) { result as List; return ActionComponentConfigurationDTO( - environment: Environment.values[result[0]! as int], + environment: result[0]! as Environment, clientKey: result[1]! as String, shopperLocale: result[2] as String?, - amount: result[3] != null - ? AmountDTO.decode(result[3]! as List) - : null, - analyticsOptionsDTO: - AnalyticsOptionsDTO.decode(result[4]! as List), + amount: result[3] as AmountDTO?, + analyticsOptionsDTO: result[4]! as AnalyticsOptionsDTO, ); } } @@ -1426,105 +1365,158 @@ class OrderCancelResultDTO { static OrderCancelResultDTO decode(Object result) { result as List; return OrderCancelResultDTO( - orderCancelResponseBody: - (result[0] as Map?)!.cast(), - updatedPaymentMethodsResponseBody: - (result[1] as Map?)?.cast(), + orderCancelResponseBody: (result[0] as Map?)!.cast(), + updatedPaymentMethodsResponseBody: (result[1] as Map?)?.cast(), ); } } -class _CheckoutPlatformInterfaceCodec extends StandardMessageCodec { - const _CheckoutPlatformInterfaceCodec(); + +class _PigeonCodec extends StandardMessageCodec { + const _PigeonCodec(); @override void writeValue(WriteBuffer buffer, Object? value) { - if (value is ActionComponentConfigurationDTO) { - buffer.putUint8(128); - writeValue(buffer, value.encode()); - } else if (value is AmountDTO) { + if (value is SessionDTO) { buffer.putUint8(129); writeValue(buffer, value.encode()); - } else if (value is AnalyticsOptionsDTO) { + } else if (value is AmountDTO) { buffer.putUint8(130); writeValue(buffer, value.encode()); - } else if (value is ApplePayConfigurationDTO) { + } else if (value is AnalyticsOptionsDTO) { buffer.putUint8(131); writeValue(buffer, value.encode()); - } else if (value is ApplePayContactDTO) { + } else if (value is DropInConfigurationDTO) { buffer.putUint8(132); writeValue(buffer, value.encode()); - } else if (value is ApplePayShippingMethodDTO) { + } else if (value is CardConfigurationDTO) { buffer.putUint8(133); writeValue(buffer, value.encode()); - } else if (value is ApplePaySummaryItemDTO) { + } else if (value is ApplePayConfigurationDTO) { buffer.putUint8(134); writeValue(buffer, value.encode()); - } else if (value is BillingAddressParametersDTO) { + } else if (value is ApplePayContactDTO) { buffer.putUint8(135); writeValue(buffer, value.encode()); - } else if (value is CardComponentConfigurationDTO) { + } else if (value is ApplePayShippingMethodDTO) { buffer.putUint8(136); writeValue(buffer, value.encode()); - } else if (value is CardConfigurationDTO) { + } else if (value is ApplePaySummaryItemDTO) { buffer.putUint8(137); writeValue(buffer, value.encode()); - } else if (value is CashAppPayConfigurationDTO) { + } else if (value is GooglePayConfigurationDTO) { buffer.putUint8(138); writeValue(buffer, value.encode()); - } else if (value is ComponentCommunicationModel) { + } else if (value is MerchantInfoDTO) { buffer.putUint8(139); writeValue(buffer, value.encode()); - } else if (value is DeletedStoredPaymentMethodResultDTO) { + } else if (value is ShippingAddressParametersDTO) { buffer.putUint8(140); writeValue(buffer, value.encode()); - } else if (value is DropInConfigurationDTO) { + } else if (value is BillingAddressParametersDTO) { buffer.putUint8(141); writeValue(buffer, value.encode()); - } else if (value is EncryptedCardDTO) { + } else if (value is CashAppPayConfigurationDTO) { buffer.putUint8(142); writeValue(buffer, value.encode()); - } else if (value is ErrorDTO) { + } else if (value is PaymentResultDTO) { buffer.putUint8(143); writeValue(buffer, value.encode()); - } else if (value is GooglePayConfigurationDTO) { + } else if (value is PaymentResultModelDTO) { buffer.putUint8(144); writeValue(buffer, value.encode()); - } else if (value is InstantPaymentConfigurationDTO) { + } else if (value is OrderResponseDTO) { buffer.putUint8(145); writeValue(buffer, value.encode()); - } else if (value is InstantPaymentSetupResultDTO) { + } else if (value is PlatformCommunicationModel) { buffer.putUint8(146); writeValue(buffer, value.encode()); - } else if (value is MerchantInfoDTO) { + } else if (value is ComponentCommunicationModel) { buffer.putUint8(147); writeValue(buffer, value.encode()); - } else if (value is OrderCancelResultDTO) { + } else if (value is PaymentEventDTO) { buffer.putUint8(148); writeValue(buffer, value.encode()); - } else if (value is OrderResponseDTO) { + } else if (value is ErrorDTO) { buffer.putUint8(149); writeValue(buffer, value.encode()); - } else if (value is PaymentEventDTO) { + } else if (value is DeletedStoredPaymentMethodResultDTO) { buffer.putUint8(150); writeValue(buffer, value.encode()); - } else if (value is PaymentResultDTO) { + } else if (value is CardComponentConfigurationDTO) { buffer.putUint8(151); writeValue(buffer, value.encode()); - } else if (value is PaymentResultModelDTO) { + } else if (value is InstantPaymentConfigurationDTO) { buffer.putUint8(152); writeValue(buffer, value.encode()); - } else if (value is PlatformCommunicationModel) { + } else if (value is InstantPaymentSetupResultDTO) { buffer.putUint8(153); writeValue(buffer, value.encode()); - } else if (value is SessionDTO) { + } else if (value is UnencryptedCardDTO) { buffer.putUint8(154); writeValue(buffer, value.encode()); - } else if (value is ShippingAddressParametersDTO) { + } else if (value is EncryptedCardDTO) { buffer.putUint8(155); writeValue(buffer, value.encode()); - } else if (value is UnencryptedCardDTO) { + } else if (value is ActionComponentConfigurationDTO) { buffer.putUint8(156); writeValue(buffer, value.encode()); + } else if (value is OrderCancelResultDTO) { + buffer.putUint8(157); + writeValue(buffer, value.encode()); + } else if (value is Environment) { + buffer.putUint8(158); + writeValue(buffer, value.index); + } else if (value is AddressMode) { + buffer.putUint8(159); + writeValue(buffer, value.index); + } else if (value is CardAuthMethod) { + buffer.putUint8(160); + writeValue(buffer, value.index); + } else if (value is TotalPriceStatus) { + buffer.putUint8(161); + writeValue(buffer, value.index); + } else if (value is GooglePayEnvironment) { + buffer.putUint8(162); + writeValue(buffer, value.index); + } else if (value is CashAppPayEnvironment) { + buffer.putUint8(163); + writeValue(buffer, value.index); + } else if (value is PaymentResultEnum) { + buffer.putUint8(164); + writeValue(buffer, value.index); + } else if (value is PlatformCommunicationType) { + buffer.putUint8(165); + writeValue(buffer, value.index); + } else if (value is ComponentCommunicationType) { + buffer.putUint8(166); + writeValue(buffer, value.index); + } else if (value is PaymentEventType) { + buffer.putUint8(167); + writeValue(buffer, value.index); + } else if (value is FieldVisibility) { + buffer.putUint8(168); + writeValue(buffer, value.index); + } else if (value is InstantPaymentType) { + buffer.putUint8(169); + writeValue(buffer, value.index); + } else if (value is ApplePayShippingType) { + buffer.putUint8(170); + writeValue(buffer, value.index); + } else if (value is ApplePayMerchantCapability) { + buffer.putUint8(171); + writeValue(buffer, value.index); + } else if (value is ApplePaySummaryItemType) { + buffer.putUint8(172); + writeValue(buffer, value.index); + } else if (value is CardNumberValidationResultDTO) { + buffer.putUint8(173); + writeValue(buffer, value.index); + } else if (value is CardExpiryDateValidationResultDTO) { + buffer.putUint8(174); + writeValue(buffer, value.index); + } else if (value is CardSecurityCodeValidationResultDTO) { + buffer.putUint8(175); + writeValue(buffer, value.index); } else { super.writeValue(buffer, value); } @@ -1533,64 +1525,118 @@ class _CheckoutPlatformInterfaceCodec extends StandardMessageCodec { @override Object? readValueOfType(int type, ReadBuffer buffer) { switch (type) { - case 128: - return ActionComponentConfigurationDTO.decode(readValue(buffer)!); - case 129: + case 129: + return SessionDTO.decode(readValue(buffer)!); + case 130: return AmountDTO.decode(readValue(buffer)!); - case 130: + case 131: return AnalyticsOptionsDTO.decode(readValue(buffer)!); - case 131: + case 132: + return DropInConfigurationDTO.decode(readValue(buffer)!); + case 133: + return CardConfigurationDTO.decode(readValue(buffer)!); + case 134: return ApplePayConfigurationDTO.decode(readValue(buffer)!); - case 132: + case 135: return ApplePayContactDTO.decode(readValue(buffer)!); - case 133: + case 136: return ApplePayShippingMethodDTO.decode(readValue(buffer)!); - case 134: + case 137: return ApplePaySummaryItemDTO.decode(readValue(buffer)!); - case 135: + case 138: + return GooglePayConfigurationDTO.decode(readValue(buffer)!); + case 139: + return MerchantInfoDTO.decode(readValue(buffer)!); + case 140: + return ShippingAddressParametersDTO.decode(readValue(buffer)!); + case 141: return BillingAddressParametersDTO.decode(readValue(buffer)!); - case 136: - return CardComponentConfigurationDTO.decode(readValue(buffer)!); - case 137: - return CardConfigurationDTO.decode(readValue(buffer)!); - case 138: + case 142: return CashAppPayConfigurationDTO.decode(readValue(buffer)!); - case 139: + case 143: + return PaymentResultDTO.decode(readValue(buffer)!); + case 144: + return PaymentResultModelDTO.decode(readValue(buffer)!); + case 145: + return OrderResponseDTO.decode(readValue(buffer)!); + case 146: + return PlatformCommunicationModel.decode(readValue(buffer)!); + case 147: return ComponentCommunicationModel.decode(readValue(buffer)!); - case 140: - return DeletedStoredPaymentMethodResultDTO.decode(readValue(buffer)!); - case 141: - return DropInConfigurationDTO.decode(readValue(buffer)!); - case 142: - return EncryptedCardDTO.decode(readValue(buffer)!); - case 143: + case 148: + return PaymentEventDTO.decode(readValue(buffer)!); + case 149: return ErrorDTO.decode(readValue(buffer)!); - case 144: - return GooglePayConfigurationDTO.decode(readValue(buffer)!); - case 145: + case 150: + return DeletedStoredPaymentMethodResultDTO.decode(readValue(buffer)!); + case 151: + return CardComponentConfigurationDTO.decode(readValue(buffer)!); + case 152: return InstantPaymentConfigurationDTO.decode(readValue(buffer)!); - case 146: + case 153: return InstantPaymentSetupResultDTO.decode(readValue(buffer)!); - case 147: - return MerchantInfoDTO.decode(readValue(buffer)!); - case 148: - return OrderCancelResultDTO.decode(readValue(buffer)!); - case 149: - return OrderResponseDTO.decode(readValue(buffer)!); - case 150: - return PaymentEventDTO.decode(readValue(buffer)!); - case 151: - return PaymentResultDTO.decode(readValue(buffer)!); - case 152: - return PaymentResultModelDTO.decode(readValue(buffer)!); - case 153: - return PlatformCommunicationModel.decode(readValue(buffer)!); - case 154: - return SessionDTO.decode(readValue(buffer)!); - case 155: - return ShippingAddressParametersDTO.decode(readValue(buffer)!); - case 156: + case 154: return UnencryptedCardDTO.decode(readValue(buffer)!); + case 155: + return EncryptedCardDTO.decode(readValue(buffer)!); + case 156: + return ActionComponentConfigurationDTO.decode(readValue(buffer)!); + case 157: + return OrderCancelResultDTO.decode(readValue(buffer)!); + case 158: + final int? value = readValue(buffer) as int?; + return value == null ? null : Environment.values[value]; + case 159: + final int? value = readValue(buffer) as int?; + return value == null ? null : AddressMode.values[value]; + case 160: + final int? value = readValue(buffer) as int?; + return value == null ? null : CardAuthMethod.values[value]; + case 161: + final int? value = readValue(buffer) as int?; + return value == null ? null : TotalPriceStatus.values[value]; + case 162: + final int? value = readValue(buffer) as int?; + return value == null ? null : GooglePayEnvironment.values[value]; + case 163: + final int? value = readValue(buffer) as int?; + return value == null ? null : CashAppPayEnvironment.values[value]; + case 164: + final int? value = readValue(buffer) as int?; + return value == null ? null : PaymentResultEnum.values[value]; + case 165: + final int? value = readValue(buffer) as int?; + return value == null ? null : PlatformCommunicationType.values[value]; + case 166: + final int? value = readValue(buffer) as int?; + return value == null ? null : ComponentCommunicationType.values[value]; + case 167: + final int? value = readValue(buffer) as int?; + return value == null ? null : PaymentEventType.values[value]; + case 168: + final int? value = readValue(buffer) as int?; + return value == null ? null : FieldVisibility.values[value]; + case 169: + final int? value = readValue(buffer) as int?; + return value == null ? null : InstantPaymentType.values[value]; + case 170: + final int? value = readValue(buffer) as int?; + return value == null ? null : ApplePayShippingType.values[value]; + case 171: + final int? value = readValue(buffer) as int?; + return value == null ? null : ApplePayMerchantCapability.values[value]; + case 172: + final int? value = readValue(buffer) as int?; + return value == null ? null : ApplePaySummaryItemType.values[value]; + case 173: + final int? value = readValue(buffer) as int?; + return value == null ? null : CardNumberValidationResultDTO.values[value]; + case 174: + final int? value = readValue(buffer) as int?; + return value == null ? null : CardExpiryDateValidationResultDTO.values[value]; + case 175: + final int? value = readValue(buffer) as int?; + return value == null ? null : CardSecurityCodeValidationResultDTO.values[value]; default: return super.readValueOfType(type, buffer); } @@ -1601,18 +1647,18 @@ class CheckoutPlatformInterface { /// Constructor for [CheckoutPlatformInterface]. The [binaryMessenger] named argument is /// available for dependency injection. If it is left null, the default /// BinaryMessenger will be used which routes to the host platform. - CheckoutPlatformInterface({BinaryMessenger? binaryMessenger}) - : __pigeon_binaryMessenger = binaryMessenger; + CheckoutPlatformInterface({BinaryMessenger? binaryMessenger, String messageChannelSuffix = ''}) + : __pigeon_binaryMessenger = binaryMessenger, + __pigeon_messageChannelSuffix = messageChannelSuffix.isNotEmpty ? '.$messageChannelSuffix' : ''; final BinaryMessenger? __pigeon_binaryMessenger; - static const MessageCodec pigeonChannelCodec = - _CheckoutPlatformInterfaceCodec(); + static const MessageCodec pigeonChannelCodec = _PigeonCodec(); + + final String __pigeon_messageChannelSuffix; Future getReturnUrl() async { - const String __pigeon_channelName = - 'dev.flutter.pigeon.adyen_checkout.CheckoutPlatformInterface.getReturnUrl'; - final BasicMessageChannel __pigeon_channel = - BasicMessageChannel( + final String __pigeon_channelName = 'dev.flutter.pigeon.adyen_checkout.CheckoutPlatformInterface.getReturnUrl$__pigeon_messageChannelSuffix'; + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, @@ -1637,19 +1683,15 @@ class CheckoutPlatformInterface { } } - Future createSession( - String sessionId, String sessionData, Object? configuration) async { - const String __pigeon_channelName = - 'dev.flutter.pigeon.adyen_checkout.CheckoutPlatformInterface.createSession'; - final BasicMessageChannel __pigeon_channel = - BasicMessageChannel( + Future createSession(String sessionId, String sessionData, Object? configuration) async { + final String __pigeon_channelName = 'dev.flutter.pigeon.adyen_checkout.CheckoutPlatformInterface.createSession$__pigeon_messageChannelSuffix'; + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, ); - final List? __pigeon_replyList = await __pigeon_channel - .send([sessionId, sessionData, configuration]) - as List?; + final List? __pigeon_replyList = + await __pigeon_channel.send([sessionId, sessionData, configuration]) as List?; if (__pigeon_replyList == null) { throw _createConnectionError(__pigeon_channelName); } else if (__pigeon_replyList.length > 1) { @@ -1669,10 +1711,8 @@ class CheckoutPlatformInterface { } Future clearSession() async { - const String __pigeon_channelName = - 'dev.flutter.pigeon.adyen_checkout.CheckoutPlatformInterface.clearSession'; - final BasicMessageChannel __pigeon_channel = - BasicMessageChannel( + final String __pigeon_channelName = 'dev.flutter.pigeon.adyen_checkout.CheckoutPlatformInterface.clearSession$__pigeon_messageChannelSuffix'; + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, @@ -1692,18 +1732,15 @@ class CheckoutPlatformInterface { } } - Future encryptCard( - UnencryptedCardDTO unencryptedCardDTO, String publicKey) async { - const String __pigeon_channelName = - 'dev.flutter.pigeon.adyen_checkout.CheckoutPlatformInterface.encryptCard'; - final BasicMessageChannel __pigeon_channel = - BasicMessageChannel( + Future encryptCard(UnencryptedCardDTO unencryptedCardDTO, String publicKey) async { + final String __pigeon_channelName = 'dev.flutter.pigeon.adyen_checkout.CheckoutPlatformInterface.encryptCard$__pigeon_messageChannelSuffix'; + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, ); - final List? __pigeon_replyList = await __pigeon_channel - .send([unencryptedCardDTO, publicKey]) as List?; + final List? __pigeon_replyList = + await __pigeon_channel.send([unencryptedCardDTO, publicKey]) as List?; if (__pigeon_replyList == null) { throw _createConnectionError(__pigeon_channelName); } else if (__pigeon_replyList.length > 1) { @@ -1723,16 +1760,14 @@ class CheckoutPlatformInterface { } Future encryptBin(String bin, String publicKey) async { - const String __pigeon_channelName = - 'dev.flutter.pigeon.adyen_checkout.CheckoutPlatformInterface.encryptBin'; - final BasicMessageChannel __pigeon_channel = - BasicMessageChannel( + final String __pigeon_channelName = 'dev.flutter.pigeon.adyen_checkout.CheckoutPlatformInterface.encryptBin$__pigeon_messageChannelSuffix'; + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, ); - final List? __pigeon_replyList = await __pigeon_channel - .send([bin, publicKey]) as List?; + final List? __pigeon_replyList = + await __pigeon_channel.send([bin, publicKey]) as List?; if (__pigeon_replyList == null) { throw _createConnectionError(__pigeon_channelName); } else if (__pigeon_replyList.length > 1) { @@ -1751,18 +1786,15 @@ class CheckoutPlatformInterface { } } - Future validateCardNumber( - String cardNumber, bool enableLuhnCheck) async { - const String __pigeon_channelName = - 'dev.flutter.pigeon.adyen_checkout.CheckoutPlatformInterface.validateCardNumber'; - final BasicMessageChannel __pigeon_channel = - BasicMessageChannel( + Future validateCardNumber(String cardNumber, bool enableLuhnCheck) async { + final String __pigeon_channelName = 'dev.flutter.pigeon.adyen_checkout.CheckoutPlatformInterface.validateCardNumber$__pigeon_messageChannelSuffix'; + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, ); - final List? __pigeon_replyList = await __pigeon_channel - .send([cardNumber, enableLuhnCheck]) as List?; + final List? __pigeon_replyList = + await __pigeon_channel.send([cardNumber, enableLuhnCheck]) as List?; if (__pigeon_replyList == null) { throw _createConnectionError(__pigeon_channelName); } else if (__pigeon_replyList.length > 1) { @@ -1777,23 +1809,19 @@ class CheckoutPlatformInterface { message: 'Host platform returned null value for non-null return value.', ); } else { - return CardNumberValidationResultDTO - .values[__pigeon_replyList[0]! as int]; + return (__pigeon_replyList[0] as CardNumberValidationResultDTO?)!; } } - Future validateCardExpiryDate( - String expiryMonth, String expiryYear) async { - const String __pigeon_channelName = - 'dev.flutter.pigeon.adyen_checkout.CheckoutPlatformInterface.validateCardExpiryDate'; - final BasicMessageChannel __pigeon_channel = - BasicMessageChannel( + Future validateCardExpiryDate(String expiryMonth, String expiryYear) async { + final String __pigeon_channelName = 'dev.flutter.pigeon.adyen_checkout.CheckoutPlatformInterface.validateCardExpiryDate$__pigeon_messageChannelSuffix'; + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, ); - final List? __pigeon_replyList = await __pigeon_channel - .send([expiryMonth, expiryYear]) as List?; + final List? __pigeon_replyList = + await __pigeon_channel.send([expiryMonth, expiryYear]) as List?; if (__pigeon_replyList == null) { throw _createConnectionError(__pigeon_channelName); } else if (__pigeon_replyList.length > 1) { @@ -1808,23 +1836,19 @@ class CheckoutPlatformInterface { message: 'Host platform returned null value for non-null return value.', ); } else { - return CardExpiryDateValidationResultDTO - .values[__pigeon_replyList[0]! as int]; + return (__pigeon_replyList[0] as CardExpiryDateValidationResultDTO?)!; } } - Future validateCardSecurityCode( - String securityCode, String? cardBrand) async { - const String __pigeon_channelName = - 'dev.flutter.pigeon.adyen_checkout.CheckoutPlatformInterface.validateCardSecurityCode'; - final BasicMessageChannel __pigeon_channel = - BasicMessageChannel( + Future validateCardSecurityCode(String securityCode, String? cardBrand) async { + final String __pigeon_channelName = 'dev.flutter.pigeon.adyen_checkout.CheckoutPlatformInterface.validateCardSecurityCode$__pigeon_messageChannelSuffix'; + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, ); - final List? __pigeon_replyList = await __pigeon_channel - .send([securityCode, cardBrand]) as List?; + final List? __pigeon_replyList = + await __pigeon_channel.send([securityCode, cardBrand]) as List?; if (__pigeon_replyList == null) { throw _createConnectionError(__pigeon_channelName); } else if (__pigeon_replyList.length > 1) { @@ -1839,22 +1863,19 @@ class CheckoutPlatformInterface { message: 'Host platform returned null value for non-null return value.', ); } else { - return CardSecurityCodeValidationResultDTO - .values[__pigeon_replyList[0]! as int]; + return (__pigeon_replyList[0] as CardSecurityCodeValidationResultDTO?)!; } } Future enableConsoleLogging(bool loggingEnabled) async { - const String __pigeon_channelName = - 'dev.flutter.pigeon.adyen_checkout.CheckoutPlatformInterface.enableConsoleLogging'; - final BasicMessageChannel __pigeon_channel = - BasicMessageChannel( + final String __pigeon_channelName = 'dev.flutter.pigeon.adyen_checkout.CheckoutPlatformInterface.enableConsoleLogging$__pigeon_messageChannelSuffix'; + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, ); - final List? __pigeon_replyList = await __pigeon_channel - .send([loggingEnabled]) as List?; + final List? __pigeon_replyList = + await __pigeon_channel.send([loggingEnabled]) as List?; if (__pigeon_replyList == null) { throw _createConnectionError(__pigeon_channelName); } else if (__pigeon_replyList.length > 1) { @@ -1869,137 +1890,28 @@ class CheckoutPlatformInterface { } } -class _DropInPlatformInterfaceCodec extends StandardMessageCodec { - const _DropInPlatformInterfaceCodec(); - @override - void writeValue(WriteBuffer buffer, Object? value) { - if (value is AmountDTO) { - buffer.putUint8(128); - writeValue(buffer, value.encode()); - } else if (value is AmountDTO) { - buffer.putUint8(129); - writeValue(buffer, value.encode()); - } else if (value is AnalyticsOptionsDTO) { - buffer.putUint8(130); - writeValue(buffer, value.encode()); - } else if (value is ApplePayConfigurationDTO) { - buffer.putUint8(131); - writeValue(buffer, value.encode()); - } else if (value is ApplePayContactDTO) { - buffer.putUint8(132); - writeValue(buffer, value.encode()); - } else if (value is ApplePayShippingMethodDTO) { - buffer.putUint8(133); - writeValue(buffer, value.encode()); - } else if (value is ApplePaySummaryItemDTO) { - buffer.putUint8(134); - writeValue(buffer, value.encode()); - } else if (value is BillingAddressParametersDTO) { - buffer.putUint8(135); - writeValue(buffer, value.encode()); - } else if (value is CardConfigurationDTO) { - buffer.putUint8(136); - writeValue(buffer, value.encode()); - } else if (value is CashAppPayConfigurationDTO) { - buffer.putUint8(137); - writeValue(buffer, value.encode()); - } else if (value is DeletedStoredPaymentMethodResultDTO) { - buffer.putUint8(138); - writeValue(buffer, value.encode()); - } else if (value is DropInConfigurationDTO) { - buffer.putUint8(139); - writeValue(buffer, value.encode()); - } else if (value is ErrorDTO) { - buffer.putUint8(140); - writeValue(buffer, value.encode()); - } else if (value is GooglePayConfigurationDTO) { - buffer.putUint8(141); - writeValue(buffer, value.encode()); - } else if (value is MerchantInfoDTO) { - buffer.putUint8(142); - writeValue(buffer, value.encode()); - } else if (value is OrderCancelResultDTO) { - buffer.putUint8(143); - writeValue(buffer, value.encode()); - } else if (value is PaymentEventDTO) { - buffer.putUint8(144); - writeValue(buffer, value.encode()); - } else if (value is ShippingAddressParametersDTO) { - buffer.putUint8(145); - writeValue(buffer, value.encode()); - } else { - super.writeValue(buffer, value); - } - } - - @override - Object? readValueOfType(int type, ReadBuffer buffer) { - switch (type) { - case 128: - return AmountDTO.decode(readValue(buffer)!); - case 129: - return AmountDTO.decode(readValue(buffer)!); - case 130: - return AnalyticsOptionsDTO.decode(readValue(buffer)!); - case 131: - return ApplePayConfigurationDTO.decode(readValue(buffer)!); - case 132: - return ApplePayContactDTO.decode(readValue(buffer)!); - case 133: - return ApplePayShippingMethodDTO.decode(readValue(buffer)!); - case 134: - return ApplePaySummaryItemDTO.decode(readValue(buffer)!); - case 135: - return BillingAddressParametersDTO.decode(readValue(buffer)!); - case 136: - return CardConfigurationDTO.decode(readValue(buffer)!); - case 137: - return CashAppPayConfigurationDTO.decode(readValue(buffer)!); - case 138: - return DeletedStoredPaymentMethodResultDTO.decode(readValue(buffer)!); - case 139: - return DropInConfigurationDTO.decode(readValue(buffer)!); - case 140: - return ErrorDTO.decode(readValue(buffer)!); - case 141: - return GooglePayConfigurationDTO.decode(readValue(buffer)!); - case 142: - return MerchantInfoDTO.decode(readValue(buffer)!); - case 143: - return OrderCancelResultDTO.decode(readValue(buffer)!); - case 144: - return PaymentEventDTO.decode(readValue(buffer)!); - case 145: - return ShippingAddressParametersDTO.decode(readValue(buffer)!); - default: - return super.readValueOfType(type, buffer); - } - } -} - class DropInPlatformInterface { /// Constructor for [DropInPlatformInterface]. The [binaryMessenger] named argument is /// available for dependency injection. If it is left null, the default /// BinaryMessenger will be used which routes to the host platform. - DropInPlatformInterface({BinaryMessenger? binaryMessenger}) - : __pigeon_binaryMessenger = binaryMessenger; + DropInPlatformInterface({BinaryMessenger? binaryMessenger, String messageChannelSuffix = ''}) + : __pigeon_binaryMessenger = binaryMessenger, + __pigeon_messageChannelSuffix = messageChannelSuffix.isNotEmpty ? '.$messageChannelSuffix' : ''; final BinaryMessenger? __pigeon_binaryMessenger; - static const MessageCodec pigeonChannelCodec = - _DropInPlatformInterfaceCodec(); + static const MessageCodec pigeonChannelCodec = _PigeonCodec(); - Future showDropInSession( - DropInConfigurationDTO dropInConfigurationDTO) async { - const String __pigeon_channelName = - 'dev.flutter.pigeon.adyen_checkout.DropInPlatformInterface.showDropInSession'; - final BasicMessageChannel __pigeon_channel = - BasicMessageChannel( + final String __pigeon_messageChannelSuffix; + + Future showDropInSession(DropInConfigurationDTO dropInConfigurationDTO) async { + final String __pigeon_channelName = 'dev.flutter.pigeon.adyen_checkout.DropInPlatformInterface.showDropInSession$__pigeon_messageChannelSuffix'; + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, ); - final List? __pigeon_replyList = await __pigeon_channel - .send([dropInConfigurationDTO]) as List?; + final List? __pigeon_replyList = + await __pigeon_channel.send([dropInConfigurationDTO]) as List?; if (__pigeon_replyList == null) { throw _createConnectionError(__pigeon_channelName); } else if (__pigeon_replyList.length > 1) { @@ -2013,19 +1925,15 @@ class DropInPlatformInterface { } } - Future showDropInAdvanced(DropInConfigurationDTO dropInConfigurationDTO, - String paymentMethodsResponse) async { - const String __pigeon_channelName = - 'dev.flutter.pigeon.adyen_checkout.DropInPlatformInterface.showDropInAdvanced'; - final BasicMessageChannel __pigeon_channel = - BasicMessageChannel( + Future showDropInAdvanced(DropInConfigurationDTO dropInConfigurationDTO, String paymentMethodsResponse) async { + final String __pigeon_channelName = 'dev.flutter.pigeon.adyen_checkout.DropInPlatformInterface.showDropInAdvanced$__pigeon_messageChannelSuffix'; + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, ); - final List? __pigeon_replyList = await __pigeon_channel - .send([dropInConfigurationDTO, paymentMethodsResponse]) - as List?; + final List? __pigeon_replyList = + await __pigeon_channel.send([dropInConfigurationDTO, paymentMethodsResponse]) as List?; if (__pigeon_replyList == null) { throw _createConnectionError(__pigeon_channelName); } else if (__pigeon_replyList.length > 1) { @@ -2040,16 +1948,14 @@ class DropInPlatformInterface { } Future onPaymentsResult(PaymentEventDTO paymentsResult) async { - const String __pigeon_channelName = - 'dev.flutter.pigeon.adyen_checkout.DropInPlatformInterface.onPaymentsResult'; - final BasicMessageChannel __pigeon_channel = - BasicMessageChannel( + final String __pigeon_channelName = 'dev.flutter.pigeon.adyen_checkout.DropInPlatformInterface.onPaymentsResult$__pigeon_messageChannelSuffix'; + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, ); - final List? __pigeon_replyList = await __pigeon_channel - .send([paymentsResult]) as List?; + final List? __pigeon_replyList = + await __pigeon_channel.send([paymentsResult]) as List?; if (__pigeon_replyList == null) { throw _createConnectionError(__pigeon_channelName); } else if (__pigeon_replyList.length > 1) { @@ -2063,18 +1969,15 @@ class DropInPlatformInterface { } } - Future onPaymentsDetailsResult( - PaymentEventDTO paymentsDetailsResult) async { - const String __pigeon_channelName = - 'dev.flutter.pigeon.adyen_checkout.DropInPlatformInterface.onPaymentsDetailsResult'; - final BasicMessageChannel __pigeon_channel = - BasicMessageChannel( + Future onPaymentsDetailsResult(PaymentEventDTO paymentsDetailsResult) async { + final String __pigeon_channelName = 'dev.flutter.pigeon.adyen_checkout.DropInPlatformInterface.onPaymentsDetailsResult$__pigeon_messageChannelSuffix'; + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, ); - final List? __pigeon_replyList = await __pigeon_channel - .send([paymentsDetailsResult]) as List?; + final List? __pigeon_replyList = + await __pigeon_channel.send([paymentsDetailsResult]) as List?; if (__pigeon_replyList == null) { throw _createConnectionError(__pigeon_channelName); } else if (__pigeon_replyList.length > 1) { @@ -2088,19 +1991,15 @@ class DropInPlatformInterface { } } - Future onDeleteStoredPaymentMethodResult( - DeletedStoredPaymentMethodResultDTO - deleteStoredPaymentMethodResultDTO) async { - const String __pigeon_channelName = - 'dev.flutter.pigeon.adyen_checkout.DropInPlatformInterface.onDeleteStoredPaymentMethodResult'; - final BasicMessageChannel __pigeon_channel = - BasicMessageChannel( + Future onDeleteStoredPaymentMethodResult(DeletedStoredPaymentMethodResultDTO deleteStoredPaymentMethodResultDTO) async { + final String __pigeon_channelName = 'dev.flutter.pigeon.adyen_checkout.DropInPlatformInterface.onDeleteStoredPaymentMethodResult$__pigeon_messageChannelSuffix'; + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, ); - final List? __pigeon_replyList = await __pigeon_channel - .send([deleteStoredPaymentMethodResultDTO]) as List?; + final List? __pigeon_replyList = + await __pigeon_channel.send([deleteStoredPaymentMethodResultDTO]) as List?; if (__pigeon_replyList == null) { throw _createConnectionError(__pigeon_channelName); } else if (__pigeon_replyList.length > 1) { @@ -2115,16 +2014,14 @@ class DropInPlatformInterface { } Future onBalanceCheckResult(String balanceCheckResponse) async { - const String __pigeon_channelName = - 'dev.flutter.pigeon.adyen_checkout.DropInPlatformInterface.onBalanceCheckResult'; - final BasicMessageChannel __pigeon_channel = - BasicMessageChannel( + final String __pigeon_channelName = 'dev.flutter.pigeon.adyen_checkout.DropInPlatformInterface.onBalanceCheckResult$__pigeon_messageChannelSuffix'; + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, ); - final List? __pigeon_replyList = await __pigeon_channel - .send([balanceCheckResponse]) as List?; + final List? __pigeon_replyList = + await __pigeon_channel.send([balanceCheckResponse]) as List?; if (__pigeon_replyList == null) { throw _createConnectionError(__pigeon_channelName); } else if (__pigeon_replyList.length > 1) { @@ -2139,16 +2036,14 @@ class DropInPlatformInterface { } Future onOrderRequestResult(String orderRequestResponse) async { - const String __pigeon_channelName = - 'dev.flutter.pigeon.adyen_checkout.DropInPlatformInterface.onOrderRequestResult'; - final BasicMessageChannel __pigeon_channel = - BasicMessageChannel( + final String __pigeon_channelName = 'dev.flutter.pigeon.adyen_checkout.DropInPlatformInterface.onOrderRequestResult$__pigeon_messageChannelSuffix'; + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, ); - final List? __pigeon_replyList = await __pigeon_channel - .send([orderRequestResponse]) as List?; + final List? __pigeon_replyList = + await __pigeon_channel.send([orderRequestResponse]) as List?; if (__pigeon_replyList == null) { throw _createConnectionError(__pigeon_channelName); } else if (__pigeon_replyList.length > 1) { @@ -2162,18 +2057,15 @@ class DropInPlatformInterface { } } - Future onOrderCancelResult( - OrderCancelResultDTO orderCancelResult) async { - const String __pigeon_channelName = - 'dev.flutter.pigeon.adyen_checkout.DropInPlatformInterface.onOrderCancelResult'; - final BasicMessageChannel __pigeon_channel = - BasicMessageChannel( + Future onOrderCancelResult(OrderCancelResultDTO orderCancelResult) async { + final String __pigeon_channelName = 'dev.flutter.pigeon.adyen_checkout.DropInPlatformInterface.onOrderCancelResult$__pigeon_messageChannelSuffix'; + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, ); - final List? __pigeon_replyList = await __pigeon_channel - .send([orderCancelResult]) as List?; + final List? __pigeon_replyList = + await __pigeon_channel.send([orderCancelResult]) as List?; if (__pigeon_replyList == null) { throw _createConnectionError(__pigeon_channelName); } else if (__pigeon_replyList.length > 1) { @@ -2188,10 +2080,8 @@ class DropInPlatformInterface { } Future cleanUpDropIn() async { - const String __pigeon_channelName = - 'dev.flutter.pigeon.adyen_checkout.DropInPlatformInterface.cleanUpDropIn'; - final BasicMessageChannel __pigeon_channel = - BasicMessageChannel( + final String __pigeon_channelName = 'dev.flutter.pigeon.adyen_checkout.DropInPlatformInterface.cleanUpDropIn$__pigeon_messageChannelSuffix'; + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, @@ -2212,117 +2102,61 @@ class DropInPlatformInterface { } } -class _DropInFlutterInterfaceCodec extends StandardMessageCodec { - const _DropInFlutterInterfaceCodec(); - @override - void writeValue(WriteBuffer buffer, Object? value) { - if (value is AmountDTO) { - buffer.putUint8(128); - writeValue(buffer, value.encode()); - } else if (value is OrderResponseDTO) { - buffer.putUint8(129); - writeValue(buffer, value.encode()); - } else if (value is PaymentResultDTO) { - buffer.putUint8(130); - writeValue(buffer, value.encode()); - } else if (value is PaymentResultModelDTO) { - buffer.putUint8(131); - writeValue(buffer, value.encode()); - } else if (value is PlatformCommunicationModel) { - buffer.putUint8(132); - writeValue(buffer, value.encode()); - } else { - super.writeValue(buffer, value); - } - } - - @override - Object? readValueOfType(int type, ReadBuffer buffer) { - switch (type) { - case 128: - return AmountDTO.decode(readValue(buffer)!); - case 129: - return OrderResponseDTO.decode(readValue(buffer)!); - case 130: - return PaymentResultDTO.decode(readValue(buffer)!); - case 131: - return PaymentResultModelDTO.decode(readValue(buffer)!); - case 132: - return PlatformCommunicationModel.decode(readValue(buffer)!); - default: - return super.readValueOfType(type, buffer); - } - } -} - abstract class DropInFlutterInterface { - static const MessageCodec pigeonChannelCodec = - _DropInFlutterInterfaceCodec(); + static const MessageCodec pigeonChannelCodec = _PigeonCodec(); - void onDropInSessionPlatformCommunication( - PlatformCommunicationModel platformCommunicationModel); + void onDropInSessionPlatformCommunication(PlatformCommunicationModel platformCommunicationModel); - void onDropInAdvancedPlatformCommunication( - PlatformCommunicationModel platformCommunicationModel); + void onDropInAdvancedPlatformCommunication(PlatformCommunicationModel platformCommunicationModel); - static void setup(DropInFlutterInterface? api, - {BinaryMessenger? binaryMessenger}) { + static void setUp(DropInFlutterInterface? api, {BinaryMessenger? binaryMessenger, String messageChannelSuffix = '',}) { + messageChannelSuffix = messageChannelSuffix.isNotEmpty ? '.$messageChannelSuffix' : ''; { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel< - Object?>( - 'dev.flutter.pigeon.adyen_checkout.DropInFlutterInterface.onDropInSessionPlatformCommunication', - pigeonChannelCodec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + 'dev.flutter.pigeon.adyen_checkout.DropInFlutterInterface.onDropInSessionPlatformCommunication$messageChannelSuffix', pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { __pigeon_channel.setMessageHandler(null); } else { __pigeon_channel.setMessageHandler((Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.adyen_checkout.DropInFlutterInterface.onDropInSessionPlatformCommunication was null.'); + 'Argument for dev.flutter.pigeon.adyen_checkout.DropInFlutterInterface.onDropInSessionPlatformCommunication was null.'); final List args = (message as List?)!; - final PlatformCommunicationModel? arg_platformCommunicationModel = - (args[0] as PlatformCommunicationModel?); + final PlatformCommunicationModel? arg_platformCommunicationModel = (args[0] as PlatformCommunicationModel?); assert(arg_platformCommunicationModel != null, 'Argument for dev.flutter.pigeon.adyen_checkout.DropInFlutterInterface.onDropInSessionPlatformCommunication was null, expected non-null PlatformCommunicationModel.'); try { - api.onDropInSessionPlatformCommunication( - arg_platformCommunicationModel!); + api.onDropInSessionPlatformCommunication(arg_platformCommunicationModel!); return wrapResponse(empty: true); } on PlatformException catch (e) { return wrapResponse(error: e); - } catch (e) { - return wrapResponse( - error: PlatformException(code: 'error', message: e.toString())); + } catch (e) { + return wrapResponse(error: PlatformException(code: 'error', message: e.toString())); } }); } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel< - Object?>( - 'dev.flutter.pigeon.adyen_checkout.DropInFlutterInterface.onDropInAdvancedPlatformCommunication', - pigeonChannelCodec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + 'dev.flutter.pigeon.adyen_checkout.DropInFlutterInterface.onDropInAdvancedPlatformCommunication$messageChannelSuffix', pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { __pigeon_channel.setMessageHandler(null); } else { __pigeon_channel.setMessageHandler((Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.adyen_checkout.DropInFlutterInterface.onDropInAdvancedPlatformCommunication was null.'); + 'Argument for dev.flutter.pigeon.adyen_checkout.DropInFlutterInterface.onDropInAdvancedPlatformCommunication was null.'); final List args = (message as List?)!; - final PlatformCommunicationModel? arg_platformCommunicationModel = - (args[0] as PlatformCommunicationModel?); + final PlatformCommunicationModel? arg_platformCommunicationModel = (args[0] as PlatformCommunicationModel?); assert(arg_platformCommunicationModel != null, 'Argument for dev.flutter.pigeon.adyen_checkout.DropInFlutterInterface.onDropInAdvancedPlatformCommunication was null, expected non-null PlatformCommunicationModel.'); try { - api.onDropInAdvancedPlatformCommunication( - arg_platformCommunicationModel!); + api.onDropInAdvancedPlatformCommunication(arg_platformCommunicationModel!); return wrapResponse(empty: true); } on PlatformException catch (e) { return wrapResponse(error: e); - } catch (e) { - return wrapResponse( - error: PlatformException(code: 'error', message: e.toString())); + } catch (e) { + return wrapResponse(error: PlatformException(code: 'error', message: e.toString())); } }); } @@ -2330,185 +2164,22 @@ abstract class DropInFlutterInterface { } } -class _ComponentPlatformInterfaceCodec extends StandardMessageCodec { - const _ComponentPlatformInterfaceCodec(); - @override - void writeValue(WriteBuffer buffer, Object? value) { - if (value is ActionComponentConfigurationDTO) { - buffer.putUint8(128); - writeValue(buffer, value.encode()); - } else if (value is AmountDTO) { - buffer.putUint8(129); - writeValue(buffer, value.encode()); - } else if (value is AnalyticsOptionsDTO) { - buffer.putUint8(130); - writeValue(buffer, value.encode()); - } else if (value is ApplePayConfigurationDTO) { - buffer.putUint8(131); - writeValue(buffer, value.encode()); - } else if (value is ApplePayContactDTO) { - buffer.putUint8(132); - writeValue(buffer, value.encode()); - } else if (value is ApplePayShippingMethodDTO) { - buffer.putUint8(133); - writeValue(buffer, value.encode()); - } else if (value is ApplePaySummaryItemDTO) { - buffer.putUint8(134); - writeValue(buffer, value.encode()); - } else if (value is BillingAddressParametersDTO) { - buffer.putUint8(135); - writeValue(buffer, value.encode()); - } else if (value is CardComponentConfigurationDTO) { - buffer.putUint8(136); - writeValue(buffer, value.encode()); - } else if (value is CardConfigurationDTO) { - buffer.putUint8(137); - writeValue(buffer, value.encode()); - } else if (value is CashAppPayConfigurationDTO) { - buffer.putUint8(138); - writeValue(buffer, value.encode()); - } else if (value is ComponentCommunicationModel) { - buffer.putUint8(139); - writeValue(buffer, value.encode()); - } else if (value is DeletedStoredPaymentMethodResultDTO) { - buffer.putUint8(140); - writeValue(buffer, value.encode()); - } else if (value is DropInConfigurationDTO) { - buffer.putUint8(141); - writeValue(buffer, value.encode()); - } else if (value is EncryptedCardDTO) { - buffer.putUint8(142); - writeValue(buffer, value.encode()); - } else if (value is ErrorDTO) { - buffer.putUint8(143); - writeValue(buffer, value.encode()); - } else if (value is GooglePayConfigurationDTO) { - buffer.putUint8(144); - writeValue(buffer, value.encode()); - } else if (value is InstantPaymentConfigurationDTO) { - buffer.putUint8(145); - writeValue(buffer, value.encode()); - } else if (value is InstantPaymentSetupResultDTO) { - buffer.putUint8(146); - writeValue(buffer, value.encode()); - } else if (value is MerchantInfoDTO) { - buffer.putUint8(147); - writeValue(buffer, value.encode()); - } else if (value is OrderCancelResultDTO) { - buffer.putUint8(148); - writeValue(buffer, value.encode()); - } else if (value is OrderResponseDTO) { - buffer.putUint8(149); - writeValue(buffer, value.encode()); - } else if (value is PaymentEventDTO) { - buffer.putUint8(150); - writeValue(buffer, value.encode()); - } else if (value is PaymentResultDTO) { - buffer.putUint8(151); - writeValue(buffer, value.encode()); - } else if (value is PaymentResultModelDTO) { - buffer.putUint8(152); - writeValue(buffer, value.encode()); - } else if (value is PlatformCommunicationModel) { - buffer.putUint8(153); - writeValue(buffer, value.encode()); - } else if (value is SessionDTO) { - buffer.putUint8(154); - writeValue(buffer, value.encode()); - } else if (value is ShippingAddressParametersDTO) { - buffer.putUint8(155); - writeValue(buffer, value.encode()); - } else if (value is UnencryptedCardDTO) { - buffer.putUint8(156); - writeValue(buffer, value.encode()); - } else { - super.writeValue(buffer, value); - } - } - - @override - Object? readValueOfType(int type, ReadBuffer buffer) { - switch (type) { - case 128: - return ActionComponentConfigurationDTO.decode(readValue(buffer)!); - case 129: - return AmountDTO.decode(readValue(buffer)!); - case 130: - return AnalyticsOptionsDTO.decode(readValue(buffer)!); - case 131: - return ApplePayConfigurationDTO.decode(readValue(buffer)!); - case 132: - return ApplePayContactDTO.decode(readValue(buffer)!); - case 133: - return ApplePayShippingMethodDTO.decode(readValue(buffer)!); - case 134: - return ApplePaySummaryItemDTO.decode(readValue(buffer)!); - case 135: - return BillingAddressParametersDTO.decode(readValue(buffer)!); - case 136: - return CardComponentConfigurationDTO.decode(readValue(buffer)!); - case 137: - return CardConfigurationDTO.decode(readValue(buffer)!); - case 138: - return CashAppPayConfigurationDTO.decode(readValue(buffer)!); - case 139: - return ComponentCommunicationModel.decode(readValue(buffer)!); - case 140: - return DeletedStoredPaymentMethodResultDTO.decode(readValue(buffer)!); - case 141: - return DropInConfigurationDTO.decode(readValue(buffer)!); - case 142: - return EncryptedCardDTO.decode(readValue(buffer)!); - case 143: - return ErrorDTO.decode(readValue(buffer)!); - case 144: - return GooglePayConfigurationDTO.decode(readValue(buffer)!); - case 145: - return InstantPaymentConfigurationDTO.decode(readValue(buffer)!); - case 146: - return InstantPaymentSetupResultDTO.decode(readValue(buffer)!); - case 147: - return MerchantInfoDTO.decode(readValue(buffer)!); - case 148: - return OrderCancelResultDTO.decode(readValue(buffer)!); - case 149: - return OrderResponseDTO.decode(readValue(buffer)!); - case 150: - return PaymentEventDTO.decode(readValue(buffer)!); - case 151: - return PaymentResultDTO.decode(readValue(buffer)!); - case 152: - return PaymentResultModelDTO.decode(readValue(buffer)!); - case 153: - return PlatformCommunicationModel.decode(readValue(buffer)!); - case 154: - return SessionDTO.decode(readValue(buffer)!); - case 155: - return ShippingAddressParametersDTO.decode(readValue(buffer)!); - case 156: - return UnencryptedCardDTO.decode(readValue(buffer)!); - default: - return super.readValueOfType(type, buffer); - } - } -} - class ComponentPlatformInterface { /// Constructor for [ComponentPlatformInterface]. The [binaryMessenger] named argument is /// available for dependency injection. If it is left null, the default /// BinaryMessenger will be used which routes to the host platform. - ComponentPlatformInterface({BinaryMessenger? binaryMessenger}) - : __pigeon_binaryMessenger = binaryMessenger; + ComponentPlatformInterface({BinaryMessenger? binaryMessenger, String messageChannelSuffix = ''}) + : __pigeon_binaryMessenger = binaryMessenger, + __pigeon_messageChannelSuffix = messageChannelSuffix.isNotEmpty ? '.$messageChannelSuffix' : ''; final BinaryMessenger? __pigeon_binaryMessenger; - static const MessageCodec pigeonChannelCodec = - _ComponentPlatformInterfaceCodec(); + static const MessageCodec pigeonChannelCodec = _PigeonCodec(); + + final String __pigeon_messageChannelSuffix; Future updateViewHeight(int viewId) async { - const String __pigeon_channelName = - 'dev.flutter.pigeon.adyen_checkout.ComponentPlatformInterface.updateViewHeight'; - final BasicMessageChannel __pigeon_channel = - BasicMessageChannel( + final String __pigeon_channelName = 'dev.flutter.pigeon.adyen_checkout.ComponentPlatformInterface.updateViewHeight$__pigeon_messageChannelSuffix'; + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, @@ -2528,18 +2199,15 @@ class ComponentPlatformInterface { } } - Future onPaymentsResult( - String componentId, PaymentEventDTO paymentsResult) async { - const String __pigeon_channelName = - 'dev.flutter.pigeon.adyen_checkout.ComponentPlatformInterface.onPaymentsResult'; - final BasicMessageChannel __pigeon_channel = - BasicMessageChannel( + Future onPaymentsResult(String componentId, PaymentEventDTO paymentsResult) async { + final String __pigeon_channelName = 'dev.flutter.pigeon.adyen_checkout.ComponentPlatformInterface.onPaymentsResult$__pigeon_messageChannelSuffix'; + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, ); - final List? __pigeon_replyList = await __pigeon_channel - .send([componentId, paymentsResult]) as List?; + final List? __pigeon_replyList = + await __pigeon_channel.send([componentId, paymentsResult]) as List?; if (__pigeon_replyList == null) { throw _createConnectionError(__pigeon_channelName); } else if (__pigeon_replyList.length > 1) { @@ -2553,18 +2221,15 @@ class ComponentPlatformInterface { } } - Future onPaymentsDetailsResult( - String componentId, PaymentEventDTO paymentsDetailsResult) async { - const String __pigeon_channelName = - 'dev.flutter.pigeon.adyen_checkout.ComponentPlatformInterface.onPaymentsDetailsResult'; - final BasicMessageChannel __pigeon_channel = - BasicMessageChannel( + Future onPaymentsDetailsResult(String componentId, PaymentEventDTO paymentsDetailsResult) async { + final String __pigeon_channelName = 'dev.flutter.pigeon.adyen_checkout.ComponentPlatformInterface.onPaymentsDetailsResult$__pigeon_messageChannelSuffix'; + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, ); - final List? __pigeon_replyList = await __pigeon_channel - .send([componentId, paymentsDetailsResult]) as List?; + final List? __pigeon_replyList = + await __pigeon_channel.send([componentId, paymentsDetailsResult]) as List?; if (__pigeon_replyList == null) { throw _createConnectionError(__pigeon_channelName); } else if (__pigeon_replyList.length > 1) { @@ -2578,24 +2243,15 @@ class ComponentPlatformInterface { } } - Future isInstantPaymentSupportedByPlatform( - InstantPaymentConfigurationDTO instantPaymentConfigurationDTO, - String paymentMethodResponse, - String componentId) async { - const String __pigeon_channelName = - 'dev.flutter.pigeon.adyen_checkout.ComponentPlatformInterface.isInstantPaymentSupportedByPlatform'; - final BasicMessageChannel __pigeon_channel = - BasicMessageChannel( + Future isInstantPaymentSupportedByPlatform(InstantPaymentConfigurationDTO instantPaymentConfigurationDTO, String paymentMethodResponse, String componentId) async { + final String __pigeon_channelName = 'dev.flutter.pigeon.adyen_checkout.ComponentPlatformInterface.isInstantPaymentSupportedByPlatform$__pigeon_messageChannelSuffix'; + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, ); - final List? __pigeon_replyList = await __pigeon_channel - .send([ - instantPaymentConfigurationDTO, - paymentMethodResponse, - componentId - ]) as List?; + final List? __pigeon_replyList = + await __pigeon_channel.send([instantPaymentConfigurationDTO, paymentMethodResponse, componentId]) as List?; if (__pigeon_replyList == null) { throw _createConnectionError(__pigeon_channelName); } else if (__pigeon_replyList.length > 1) { @@ -2614,24 +2270,15 @@ class ComponentPlatformInterface { } } - Future onInstantPaymentPressed( - InstantPaymentConfigurationDTO instantPaymentConfigurationDTO, - String encodedPaymentMethod, - String componentId) async { - const String __pigeon_channelName = - 'dev.flutter.pigeon.adyen_checkout.ComponentPlatformInterface.onInstantPaymentPressed'; - final BasicMessageChannel __pigeon_channel = - BasicMessageChannel( + Future onInstantPaymentPressed(InstantPaymentConfigurationDTO instantPaymentConfigurationDTO, String encodedPaymentMethod, String componentId) async { + final String __pigeon_channelName = 'dev.flutter.pigeon.adyen_checkout.ComponentPlatformInterface.onInstantPaymentPressed$__pigeon_messageChannelSuffix'; + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, ); - final List? __pigeon_replyList = await __pigeon_channel - .send([ - instantPaymentConfigurationDTO, - encodedPaymentMethod, - componentId - ]) as List?; + final List? __pigeon_replyList = + await __pigeon_channel.send([instantPaymentConfigurationDTO, encodedPaymentMethod, componentId]) as List?; if (__pigeon_replyList == null) { throw _createConnectionError(__pigeon_channelName); } else if (__pigeon_replyList.length > 1) { @@ -2645,24 +2292,15 @@ class ComponentPlatformInterface { } } - Future handleAction( - ActionComponentConfigurationDTO actionComponentConfiguration, - String componentId, - Map? actionResponse) async { - const String __pigeon_channelName = - 'dev.flutter.pigeon.adyen_checkout.ComponentPlatformInterface.handleAction'; - final BasicMessageChannel __pigeon_channel = - BasicMessageChannel( + Future handleAction(ActionComponentConfigurationDTO actionComponentConfiguration, String componentId, Map? actionResponse) async { + final String __pigeon_channelName = 'dev.flutter.pigeon.adyen_checkout.ComponentPlatformInterface.handleAction$__pigeon_messageChannelSuffix'; + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, ); - final List? __pigeon_replyList = await __pigeon_channel - .send([ - actionComponentConfiguration, - componentId, - actionResponse - ]) as List?; + final List? __pigeon_replyList = + await __pigeon_channel.send([actionComponentConfiguration, componentId, actionResponse]) as List?; if (__pigeon_replyList == null) { throw _createConnectionError(__pigeon_channelName); } else if (__pigeon_replyList.length > 1) { @@ -2677,10 +2315,8 @@ class ComponentPlatformInterface { } Future onDispose(String componentId) async { - const String __pigeon_channelName = - 'dev.flutter.pigeon.adyen_checkout.ComponentPlatformInterface.onDispose'; - final BasicMessageChannel __pigeon_channel = - BasicMessageChannel( + final String __pigeon_channelName = 'dev.flutter.pigeon.adyen_checkout.ComponentPlatformInterface.onDispose$__pigeon_messageChannelSuffix'; + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, @@ -2701,131 +2337,55 @@ class ComponentPlatformInterface { } } -class _ComponentFlutterInterfaceCodec extends StandardMessageCodec { - const _ComponentFlutterInterfaceCodec(); - @override - void writeValue(WriteBuffer buffer, Object? value) { - if (value is AmountDTO) { - buffer.putUint8(128); - writeValue(buffer, value.encode()); - } else if (value is AnalyticsOptionsDTO) { - buffer.putUint8(129); - writeValue(buffer, value.encode()); - } else if (value is CardComponentConfigurationDTO) { - buffer.putUint8(130); - writeValue(buffer, value.encode()); - } else if (value is CardConfigurationDTO) { - buffer.putUint8(131); - writeValue(buffer, value.encode()); - } else if (value is ComponentCommunicationModel) { - buffer.putUint8(132); - writeValue(buffer, value.encode()); - } else if (value is OrderResponseDTO) { - buffer.putUint8(133); - writeValue(buffer, value.encode()); - } else if (value is PaymentResultDTO) { - buffer.putUint8(134); - writeValue(buffer, value.encode()); - } else if (value is PaymentResultModelDTO) { - buffer.putUint8(135); - writeValue(buffer, value.encode()); - } else if (value is SessionDTO) { - buffer.putUint8(136); - writeValue(buffer, value.encode()); - } else { - super.writeValue(buffer, value); - } - } - - @override - Object? readValueOfType(int type, ReadBuffer buffer) { - switch (type) { - case 128: - return AmountDTO.decode(readValue(buffer)!); - case 129: - return AnalyticsOptionsDTO.decode(readValue(buffer)!); - case 130: - return CardComponentConfigurationDTO.decode(readValue(buffer)!); - case 131: - return CardConfigurationDTO.decode(readValue(buffer)!); - case 132: - return ComponentCommunicationModel.decode(readValue(buffer)!); - case 133: - return OrderResponseDTO.decode(readValue(buffer)!); - case 134: - return PaymentResultDTO.decode(readValue(buffer)!); - case 135: - return PaymentResultModelDTO.decode(readValue(buffer)!); - case 136: - return SessionDTO.decode(readValue(buffer)!); - default: - return super.readValueOfType(type, buffer); - } - } -} - abstract class ComponentFlutterInterface { - static const MessageCodec pigeonChannelCodec = - _ComponentFlutterInterfaceCodec(); + static const MessageCodec pigeonChannelCodec = _PigeonCodec(); - void _generateCodecForDTOs( - CardComponentConfigurationDTO cardComponentConfigurationDTO, - SessionDTO sessionDTO); + void _generateCodecForDTOs(CardComponentConfigurationDTO cardComponentConfigurationDTO, SessionDTO sessionDTO); - void onComponentCommunication( - ComponentCommunicationModel componentCommunicationModel); + void onComponentCommunication(ComponentCommunicationModel componentCommunicationModel); - static void setup(ComponentFlutterInterface? api, - {BinaryMessenger? binaryMessenger}) { + static void setUp(ComponentFlutterInterface? api, {BinaryMessenger? binaryMessenger, String messageChannelSuffix = '',}) { + messageChannelSuffix = messageChannelSuffix.isNotEmpty ? '.$messageChannelSuffix' : ''; { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel< - Object?>( - 'dev.flutter.pigeon.adyen_checkout.ComponentFlutterInterface._generateCodecForDTOs', - pigeonChannelCodec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + 'dev.flutter.pigeon.adyen_checkout.ComponentFlutterInterface._generateCodecForDTOs$messageChannelSuffix', pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { __pigeon_channel.setMessageHandler(null); } else { __pigeon_channel.setMessageHandler((Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.adyen_checkout.ComponentFlutterInterface._generateCodecForDTOs was null.'); + 'Argument for dev.flutter.pigeon.adyen_checkout.ComponentFlutterInterface._generateCodecForDTOs was null.'); final List args = (message as List?)!; - final CardComponentConfigurationDTO? - arg_cardComponentConfigurationDTO = - (args[0] as CardComponentConfigurationDTO?); + final CardComponentConfigurationDTO? arg_cardComponentConfigurationDTO = (args[0] as CardComponentConfigurationDTO?); assert(arg_cardComponentConfigurationDTO != null, 'Argument for dev.flutter.pigeon.adyen_checkout.ComponentFlutterInterface._generateCodecForDTOs was null, expected non-null CardComponentConfigurationDTO.'); final SessionDTO? arg_sessionDTO = (args[1] as SessionDTO?); assert(arg_sessionDTO != null, 'Argument for dev.flutter.pigeon.adyen_checkout.ComponentFlutterInterface._generateCodecForDTOs was null, expected non-null SessionDTO.'); try { - api._generateCodecForDTOs( - arg_cardComponentConfigurationDTO!, arg_sessionDTO!); + api._generateCodecForDTOs(arg_cardComponentConfigurationDTO!, arg_sessionDTO!); return wrapResponse(empty: true); } on PlatformException catch (e) { return wrapResponse(error: e); - } catch (e) { - return wrapResponse( - error: PlatformException(code: 'error', message: e.toString())); + } catch (e) { + return wrapResponse(error: PlatformException(code: 'error', message: e.toString())); } }); } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel< - Object?>( - 'dev.flutter.pigeon.adyen_checkout.ComponentFlutterInterface.onComponentCommunication', - pigeonChannelCodec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + 'dev.flutter.pigeon.adyen_checkout.ComponentFlutterInterface.onComponentCommunication$messageChannelSuffix', pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { __pigeon_channel.setMessageHandler(null); } else { __pigeon_channel.setMessageHandler((Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.adyen_checkout.ComponentFlutterInterface.onComponentCommunication was null.'); + 'Argument for dev.flutter.pigeon.adyen_checkout.ComponentFlutterInterface.onComponentCommunication was null.'); final List args = (message as List?)!; - final ComponentCommunicationModel? arg_componentCommunicationModel = - (args[0] as ComponentCommunicationModel?); + final ComponentCommunicationModel? arg_componentCommunicationModel = (args[0] as ComponentCommunicationModel?); assert(arg_componentCommunicationModel != null, 'Argument for dev.flutter.pigeon.adyen_checkout.ComponentFlutterInterface.onComponentCommunication was null, expected non-null ComponentCommunicationModel.'); try { @@ -2833,9 +2393,8 @@ abstract class ComponentFlutterInterface { return wrapResponse(empty: true); } on PlatformException catch (e) { return wrapResponse(error: e); - } catch (e) { - return wrapResponse( - error: PlatformException(code: 'error', message: e.toString())); + } catch (e) { + return wrapResponse(error: PlatformException(code: 'error', message: e.toString())); } }); } diff --git a/pubspec.yaml b/pubspec.yaml index bd30ffb7..b81ffe9c 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -13,21 +13,20 @@ topics: - online-payments environment: - sdk: ^3.0.6 - flutter: ">=3.10.6" + sdk: ^3.2.0 + flutter: ">=3.16.0" dependencies: flutter: sdk: flutter - plugin_platform_interface: ^2.1.7 - stream_transform: ^2.1.0 + plugin_platform_interface: ^2.1.8 pay: ^2.0.0 dev_dependencies: flutter_test: sdk: flutter flutter_lints: 3.0.1 - pigeon: 16.0.5 + pigeon: 21.1.0 flutter: assets: