Skip to content

Commit

Permalink
Moved generated pigeon code for Android into a dedicated folder
Browse files Browse the repository at this point in the history
  • Loading branch information
Robert-SD committed Feb 5, 2025
1 parent a55dc9d commit 43bb806
Show file tree
Hide file tree
Showing 32 changed files with 153 additions and 138 deletions.
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
package com.adyen.checkout.flutter

import CheckoutPlatformInterface
import ComponentFlutterInterface
import ComponentPlatformInterface
import DropInFlutterInterface
import DropInPlatformInterface
import android.content.Intent
import androidx.fragment.app.FragmentActivity
import androidx.lifecycle.Lifecycle
import androidx.lifecycle.LifecycleEventObserver
import com.adyen.checkout.dropin.DropIn
import com.adyen.checkout.flutter.components.ComponentPlatformApi
import com.adyen.checkout.flutter.dropIn.DropInPlatformApi
import com.adyen.checkout.flutter.generated.CheckoutPlatformInterface
import com.adyen.checkout.flutter.generated.ComponentFlutterInterface
import com.adyen.checkout.flutter.generated.ComponentPlatformInterface
import com.adyen.checkout.flutter.generated.DropInFlutterInterface
import com.adyen.checkout.flutter.generated.DropInPlatformInterface
import com.adyen.checkout.flutter.session.SessionHolder
import com.adyen.checkout.flutter.utils.Constants.Companion.WRONG_FLUTTER_ACTIVITY_USAGE_ERROR_MESSAGE
import io.flutter.embedding.engine.plugins.FlutterPlugin
Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,5 @@
package com.adyen.checkout.flutter

import CardComponentConfigurationDTO
import CardExpiryDateValidationResultDTO
import CardNumberValidationResultDTO
import CardSecurityCodeValidationResultDTO
import CheckoutPlatformInterface
import DropInConfigurationDTO
import EncryptedCardDTO
import InstantPaymentConfigurationDTO
import SessionDTO
import UnencryptedCardDTO
import android.annotation.SuppressLint
import android.util.Log
import androidx.fragment.app.FragmentActivity
Expand All @@ -21,12 +11,23 @@ import com.adyen.checkout.core.AdyenLogger
import com.adyen.checkout.core.internal.util.Logger.NONE
import com.adyen.checkout.flutter.apiOnly.AdyenCSE
import com.adyen.checkout.flutter.apiOnly.CardValidation
import com.adyen.checkout.flutter.generated.CardComponentConfigurationDTO
import com.adyen.checkout.flutter.generated.CardExpiryDateValidationResultDTO
import com.adyen.checkout.flutter.generated.CardNumberValidationResultDTO
import com.adyen.checkout.flutter.generated.CardSecurityCodeValidationResultDTO
import com.adyen.checkout.flutter.generated.CheckoutPlatformInterface
import com.adyen.checkout.flutter.generated.DropInConfigurationDTO
import com.adyen.checkout.flutter.generated.EncryptedCardDTO
import com.adyen.checkout.flutter.generated.InstantPaymentConfigurationDTO
import com.adyen.checkout.flutter.generated.InstantPaymentType
import com.adyen.checkout.flutter.generated.SessionDTO
import com.adyen.checkout.flutter.generated.UnencryptedCardDTO
import com.adyen.checkout.flutter.session.SessionHolder
import com.adyen.checkout.flutter.utils.ConfigurationMapper.mapToAmount
import com.adyen.checkout.flutter.utils.ConfigurationMapper.mapToAnalyticsConfiguration
import com.adyen.checkout.flutter.utils.ConfigurationMapper.mapToDropInConfiguration
import com.adyen.checkout.flutter.utils.ConfigurationMapper.mapToCardConfiguration
import com.adyen.checkout.flutter.utils.ConfigurationMapper.mapToCheckoutConfiguration
import com.adyen.checkout.flutter.utils.ConfigurationMapper.mapToAmount
import com.adyen.checkout.flutter.utils.ConfigurationMapper.mapToDropInConfiguration
import com.adyen.checkout.flutter.utils.ConfigurationMapper.mapToEnvironment
import com.adyen.checkout.redirect.RedirectComponent
import com.adyen.checkout.sessions.core.CheckoutSessionProvider
Expand Down Expand Up @@ -122,7 +123,9 @@ class CheckoutPlatformApi(

is InstantPaymentConfigurationDTO -> {
return when (configuration.instantPaymentType) {
InstantPaymentType.APPLE_PAY -> throw IllegalStateException("Apple Pay is not supported on Android.")
InstantPaymentType.APPLE_PAY -> throw IllegalStateException(
"Apple Pay is not supported on Android."
)
InstantPaymentType.GOOGLE_PAY -> configuration.mapToCheckoutConfiguration()
InstantPaymentType.INSTANT -> configuration.mapToCheckoutConfiguration()
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
package com.adyen.checkout.flutter.apiOnly

import EncryptedCardDTO
import UnencryptedCardDTO
import com.adyen.checkout.cse.CardEncrypter
import com.adyen.checkout.flutter.generated.EncryptedCardDTO
import com.adyen.checkout.flutter.generated.UnencryptedCardDTO
import com.adyen.checkout.flutter.utils.ConfigurationMapper.fromDTO
import com.adyen.checkout.flutter.utils.ConfigurationMapper.mapToEncryptedCardDTO
import java.lang.Exception

internal object AdyenCSE {
fun encryptCard(
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
package com.adyen.checkout.flutter.apiOnly

import CardExpiryDateValidationResultDTO
import CardNumberValidationResultDTO
import CardSecurityCodeValidationResultDTO
import com.adyen.checkout.core.CardBrand
import com.adyen.checkout.core.ui.model.ExpiryDate
import com.adyen.checkout.core.ui.validation.CardExpiryDateValidationResult
Expand All @@ -11,6 +8,9 @@ import com.adyen.checkout.core.ui.validation.CardNumberValidationResult
import com.adyen.checkout.core.ui.validation.CardNumberValidator
import com.adyen.checkout.core.ui.validation.CardSecurityCodeValidationResult
import com.adyen.checkout.core.ui.validation.CardSecurityCodeValidator
import com.adyen.checkout.flutter.generated.CardExpiryDateValidationResultDTO
import com.adyen.checkout.flutter.generated.CardNumberValidationResultDTO
import com.adyen.checkout.flutter.generated.CardSecurityCodeValidationResultDTO

internal object CardValidation {
fun validateCardNumber(
Expand Down
Original file line number Diff line number Diff line change
@@ -1,17 +1,5 @@
package com.adyen.checkout.flutter.components

import ActionComponentConfigurationDTO
import ComponentCommunicationModel
import ComponentFlutterInterface
import ComponentPlatformInterface
import ErrorDTO
import InstantPaymentConfigurationDTO
import InstantPaymentSetupResultDTO
import InstantPaymentType
import PaymentEventDTO
import PaymentEventType
import PaymentResultDTO
import PaymentResultModelDTO
import android.content.Intent
import androidx.core.util.Consumer
import androidx.fragment.app.FragmentActivity
Expand All @@ -23,6 +11,20 @@ import com.adyen.checkout.flutter.components.card.CardComponentManager
import com.adyen.checkout.flutter.components.googlepay.GooglePayComponentManager
import com.adyen.checkout.flutter.components.instant.InstantComponentManager
import com.adyen.checkout.flutter.components.view.ComponentLoadingBottomSheet
import com.adyen.checkout.flutter.generated.ActionComponentConfigurationDTO
import com.adyen.checkout.flutter.generated.ComponentCommunicationModel
import com.adyen.checkout.flutter.generated.ComponentCommunicationType
import com.adyen.checkout.flutter.generated.ComponentFlutterInterface
import com.adyen.checkout.flutter.generated.ComponentPlatformInterface
import com.adyen.checkout.flutter.generated.ErrorDTO
import com.adyen.checkout.flutter.generated.InstantPaymentConfigurationDTO
import com.adyen.checkout.flutter.generated.InstantPaymentSetupResultDTO
import com.adyen.checkout.flutter.generated.InstantPaymentType
import com.adyen.checkout.flutter.generated.PaymentEventDTO
import com.adyen.checkout.flutter.generated.PaymentEventType
import com.adyen.checkout.flutter.generated.PaymentResultDTO
import com.adyen.checkout.flutter.generated.PaymentResultEnum
import com.adyen.checkout.flutter.generated.PaymentResultModelDTO
import com.adyen.checkout.flutter.session.SessionHolder
import com.adyen.checkout.flutter.utils.Constants
import com.adyen.checkout.googlepay.GooglePayComponent
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
package com.adyen.checkout.flutter.components.action

import ComponentCommunicationModel
import ComponentFlutterInterface
import PaymentResultDTO
import PaymentResultEnum
import androidx.fragment.app.FragmentActivity
import com.adyen.checkout.components.core.ActionComponentCallback
import com.adyen.checkout.components.core.ActionComponentData
import com.adyen.checkout.components.core.ComponentError
import com.adyen.checkout.flutter.components.view.ComponentLoadingBottomSheet
import com.adyen.checkout.flutter.generated.ComponentCommunicationModel
import com.adyen.checkout.flutter.generated.ComponentCommunicationType
import com.adyen.checkout.flutter.generated.ComponentFlutterInterface
import com.adyen.checkout.flutter.generated.PaymentResultDTO
import com.adyen.checkout.flutter.generated.PaymentResultEnum

internal class ActionComponentCallback(
private val activity: FragmentActivity,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,17 @@
package com.adyen.checkout.flutter.components.action

import ActionComponentConfigurationDTO
import ComponentCommunicationModel
import ComponentFlutterInterface
import PaymentResultDTO
import androidx.fragment.app.FragmentActivity
import com.adyen.checkout.action.core.GenericActionComponent
import com.adyen.checkout.action.core.internal.ActionHandlingComponent
import com.adyen.checkout.components.core.CheckoutConfiguration
import com.adyen.checkout.components.core.action.Action
import com.adyen.checkout.flutter.components.view.ComponentLoadingBottomSheet
import com.adyen.checkout.flutter.generated.ActionComponentConfigurationDTO
import com.adyen.checkout.flutter.generated.ComponentCommunicationModel
import com.adyen.checkout.flutter.generated.ComponentCommunicationType
import com.adyen.checkout.flutter.generated.ComponentFlutterInterface
import com.adyen.checkout.flutter.generated.PaymentResultDTO
import com.adyen.checkout.flutter.generated.PaymentResultEnum
import com.adyen.checkout.flutter.utils.ConfigurationMapper.mapToCheckoutConfiguration
import org.json.JSONObject
import java.util.UUID
Expand Down
Original file line number Diff line number Diff line change
@@ -1,17 +1,16 @@
package com.adyen.checkout.flutter.components.base

import ComponentCommunicationModel
import ComponentCommunicationType
import ComponentFlutterInterface
import PaymentResultDTO
import PaymentResultEnum
import com.adyen.checkout.components.core.ActionComponentData
import com.adyen.checkout.components.core.ComponentCallback
import com.adyen.checkout.components.core.ComponentError
import com.adyen.checkout.components.core.PaymentComponentData
import com.adyen.checkout.components.core.PaymentComponentState
import com.adyen.checkout.flutter.generated.ComponentCommunicationModel
import com.adyen.checkout.flutter.generated.ComponentCommunicationType
import com.adyen.checkout.flutter.generated.ComponentFlutterInterface
import com.adyen.checkout.flutter.generated.PaymentResultDTO
import com.adyen.checkout.flutter.generated.PaymentResultEnum
import com.adyen.checkout.flutter.utils.Constants
import java.util.concurrent.CancellationException

abstract class ComponentAdvancedCallback<T : PaymentComponentState<*>>(
private val componentFlutterApi: ComponentFlutterInterface,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
package com.adyen.checkout.flutter.components.base

import ComponentCommunicationModel
import ComponentCommunicationType
import ComponentFlutterInterface
import PaymentResultDTO
import PaymentResultEnum
import PaymentResultModelDTO
import com.adyen.checkout.components.core.ComponentError
import com.adyen.checkout.components.core.PaymentComponentState
import com.adyen.checkout.components.core.action.Action
import com.adyen.checkout.flutter.generated.ComponentCommunicationModel
import com.adyen.checkout.flutter.generated.ComponentCommunicationType
import com.adyen.checkout.flutter.generated.ComponentFlutterInterface
import com.adyen.checkout.flutter.generated.PaymentResultDTO
import com.adyen.checkout.flutter.generated.PaymentResultEnum
import com.adyen.checkout.flutter.generated.PaymentResultModelDTO
import com.adyen.checkout.flutter.utils.ConfigurationMapper.mapToOrderResponseModel
import com.adyen.checkout.flutter.utils.Constants
import com.adyen.checkout.sessions.core.SessionComponentCallback
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
package com.adyen.checkout.flutter.components.card

import CardComponentConfigurationDTO
import ComponentFlutterInterface
import android.content.Context
import android.view.View
import androidx.activity.ComponentActivity
import com.adyen.checkout.card.CardComponent
import com.adyen.checkout.flutter.components.view.DynamicComponentView
import com.adyen.checkout.flutter.generated.CardComponentConfigurationDTO
import com.adyen.checkout.flutter.generated.ComponentFlutterInterface
import com.adyen.checkout.flutter.utils.ConfigurationMapper.mapToAmount
import com.adyen.checkout.flutter.utils.ConfigurationMapper.mapToAnalyticsConfiguration
import com.adyen.checkout.flutter.utils.ConfigurationMapper.mapToCardConfiguration
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
package com.adyen.checkout.flutter.components.card

import ComponentFlutterInterface
import android.content.Context
import androidx.fragment.app.FragmentActivity
import com.adyen.checkout.flutter.components.card.advanced.CardAdvancedComponent
import com.adyen.checkout.flutter.components.card.session.CardSessionComponent
import com.adyen.checkout.flutter.generated.ComponentFlutterInterface
import com.adyen.checkout.flutter.session.SessionHolder
import io.flutter.plugin.platform.PlatformView
import io.flutter.plugin.platform.PlatformViewFactory
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package com.adyen.checkout.flutter.components.card

import ComponentFlutterInterface
import androidx.fragment.app.FragmentActivity
import com.adyen.checkout.action.core.internal.ActionHandlingComponent
import com.adyen.checkout.flutter.generated.ComponentFlutterInterface
import com.adyen.checkout.flutter.session.SessionHolder
import io.flutter.embedding.engine.plugins.FlutterPlugin

Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package com.adyen.checkout.flutter.components.card.advanced

import ComponentFlutterInterface
import com.adyen.checkout.card.CardComponentState
import com.adyen.checkout.flutter.components.base.ComponentAdvancedCallback
import com.adyen.checkout.flutter.generated.ComponentFlutterInterface

internal class CardAdvancedCallback(
private val componentFlutterApi: ComponentFlutterInterface,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
package com.adyen.checkout.flutter.components.card.advanced

import ComponentFlutterInterface
import android.content.Context
import androidx.fragment.app.FragmentActivity
import com.adyen.checkout.card.CardComponent
import com.adyen.checkout.components.core.PaymentMethod
import com.adyen.checkout.components.core.StoredPaymentMethod
import com.adyen.checkout.flutter.components.card.BaseCardComponent
import com.adyen.checkout.flutter.generated.ComponentFlutterInterface
import org.json.JSONObject
import java.util.UUID

Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
package com.adyen.checkout.flutter.components.card.session

import ComponentFlutterInterface
import com.adyen.checkout.card.CardComponentState
import com.adyen.checkout.components.core.action.Action
import com.adyen.checkout.flutter.components.base.ComponentSessionCallback
import com.adyen.checkout.flutter.generated.ComponentFlutterInterface

internal class CardSessionCallback(
private val componentFlutterApi: ComponentFlutterInterface,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package com.adyen.checkout.flutter.components.card.session

import ComponentFlutterInterface
import android.content.Context
import androidx.fragment.app.FragmentActivity
import com.adyen.checkout.card.CardComponent
Expand All @@ -9,6 +8,7 @@ import com.adyen.checkout.components.core.PaymentMethod
import com.adyen.checkout.components.core.StoredPaymentMethod
import com.adyen.checkout.components.core.action.Action
import com.adyen.checkout.flutter.components.card.BaseCardComponent
import com.adyen.checkout.flutter.generated.ComponentFlutterInterface
import com.adyen.checkout.flutter.session.SessionHolder
import com.adyen.checkout.sessions.core.CheckoutSession
import com.adyen.checkout.sessions.core.SessionSetupResponse
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
package com.adyen.checkout.flutter.components.googlepay

import ComponentCommunicationModel
import ComponentFlutterInterface
import com.adyen.checkout.components.core.ComponentError
import com.adyen.checkout.components.core.PaymentComponentData
import com.adyen.checkout.flutter.components.base.ComponentAdvancedCallback
import com.adyen.checkout.flutter.generated.ComponentCommunicationModel
import com.adyen.checkout.flutter.generated.ComponentCommunicationType
import com.adyen.checkout.flutter.generated.ComponentFlutterInterface
import com.adyen.checkout.flutter.utils.Constants
import com.adyen.checkout.googlepay.GooglePayComponentState
import org.json.JSONObject
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
package com.adyen.checkout.flutter.components.googlepay

import ComponentFlutterInterface
import InstantPaymentConfigurationDTO
import InstantPaymentSetupResultDTO
import android.content.Intent
import androidx.fragment.app.FragmentActivity
import com.adyen.checkout.action.core.internal.ActionHandlingComponent
Expand All @@ -11,14 +8,17 @@ import com.adyen.checkout.components.core.ComponentAvailableCallback
import com.adyen.checkout.components.core.Order
import com.adyen.checkout.components.core.PaymentMethod
import com.adyen.checkout.components.core.action.Action
import com.adyen.checkout.flutter.components.view.ComponentLoadingBottomSheet
import com.adyen.checkout.flutter.generated.ComponentFlutterInterface
import com.adyen.checkout.flutter.generated.InstantPaymentConfigurationDTO
import com.adyen.checkout.flutter.generated.InstantPaymentSetupResultDTO
import com.adyen.checkout.flutter.generated.InstantPaymentType
import com.adyen.checkout.flutter.session.SessionHolder
import com.adyen.checkout.flutter.utils.ConfigurationMapper.mapToGooglePayCheckoutConfiguration
import com.adyen.checkout.flutter.utils.Constants
import com.adyen.checkout.googlepay.GooglePayComponent
import com.adyen.checkout.flutter.components.view.ComponentLoadingBottomSheet
import com.adyen.checkout.flutter.utils.ConfigurationMapper.mapToGooglePayCheckoutConfiguration
import com.adyen.checkout.sessions.core.CheckoutSession
import com.adyen.checkout.sessions.core.SessionSetupResponse
import java.lang.Exception
import java.util.UUID

class GooglePayComponentManager(
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
package com.adyen.checkout.flutter.components.googlepay

import ComponentCommunicationModel
import ComponentFlutterInterface
import com.adyen.checkout.components.core.ComponentError
import com.adyen.checkout.components.core.action.Action
import com.adyen.checkout.flutter.components.base.ComponentSessionCallback
import com.adyen.checkout.flutter.generated.ComponentCommunicationModel
import com.adyen.checkout.flutter.generated.ComponentCommunicationType
import com.adyen.checkout.flutter.generated.ComponentFlutterInterface
import com.adyen.checkout.googlepay.GooglePayComponentState
import com.adyen.checkout.sessions.core.SessionPaymentResult

Expand Down
Loading

0 comments on commit 43bb806

Please sign in to comment.