-
Notifications
You must be signed in to change notification settings - Fork 69
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #392 from Adyen/feature/availability-provider
Improve component availability checks
- Loading branch information
Showing
15 changed files
with
124 additions
and
115 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
25 changes: 25 additions & 0 deletions
25
components-core/src/main/java/com/adyen/checkout/components/AlwaysAvailablePaymentMethod.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
/* | ||
* Copyright (c) 2021 Adyen N.V. | ||
* | ||
* This file is open source and available under the MIT license. See the LICENSE file for more info. | ||
* | ||
* Created by josephj on 18/5/2021. | ||
*/ | ||
|
||
package com.adyen.checkout.components | ||
|
||
import android.app.Application | ||
import com.adyen.checkout.components.base.Configuration | ||
import com.adyen.checkout.components.model.paymentmethods.PaymentMethod | ||
|
||
class AlwaysAvailablePaymentMethod : PaymentMethodAvailabilityCheck<Configuration> { | ||
|
||
override fun isAvailable( | ||
applicationContext: Application, | ||
paymentMethod: PaymentMethod, | ||
configuration: Configuration?, | ||
callback: ComponentAvailableCallback<Configuration> | ||
) { | ||
callback.onAvailabilityResult(true, paymentMethod, configuration) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
26 changes: 26 additions & 0 deletions
26
...onents-core/src/main/java/com/adyen/checkout/components/PaymentMethodAvailabilityCheck.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
/* | ||
* Copyright (c) 2021 Adyen N.V. | ||
* | ||
* This file is open source and available under the MIT license. See the LICENSE file for more info. | ||
* | ||
* Created by josephj on 17/5/2021. | ||
*/ | ||
package com.adyen.checkout.components | ||
|
||
import android.app.Application | ||
import com.adyen.checkout.components.base.Configuration | ||
import com.adyen.checkout.components.model.paymentmethods.PaymentMethod | ||
|
||
/** | ||
* Specifies whether a certain payment method is available for use with the provided parameters. | ||
* | ||
* @param ConfigurationT The Configuration for the Component corresponding to this payment method. Simply use [Configuration] if not applicable. | ||
*/ | ||
interface PaymentMethodAvailabilityCheck<ConfigurationT : Configuration> { | ||
fun isAvailable( | ||
applicationContext: Application, | ||
paymentMethod: PaymentMethod, | ||
configuration: ConfigurationT?, | ||
callback: ComponentAvailableCallback<ConfigurationT> | ||
) | ||
} |
12 changes: 0 additions & 12 deletions
12
components-core/src/main/java/com/adyen/checkout/components/base/EmptyInputData.java
This file was deleted.
Oops, something went wrong.
16 changes: 0 additions & 16 deletions
16
components-core/src/main/java/com/adyen/checkout/components/base/EmptyOutputData.java
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.