diff --git a/.github/workflows/generate_dependency_graph.yml b/.github/workflows/generate_dependency_graph.yml
index a58817f3e8..724419dc54 100644
--- a/.github/workflows/generate_dependency_graph.yml
+++ b/.github/workflows/generate_dependency_graph.yml
@@ -9,9 +9,15 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v4
+
+ # Setup Java 17
+ # https://github.com/marketplace/actions/setup-java-jdk
+ - name: Set up JDK
+ uses: actions/setup-java@v4
with:
- ref: ${{ github.head_ref }}
- fetch-depth: 0
+ distribution: 'zulu'
+ java-version: 17
+ cache: 'gradle'
- name: Setup Graphviz
uses: ts-graphviz/setup-graphviz@v1
@@ -30,4 +36,4 @@ jobs:
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
- branch: ${{ github.head_ref }}
+ branch: ${{ github.ref }}
diff --git a/3ds2/build.gradle b/3ds2/build.gradle
index fd202313f6..a034923583 100644
--- a/3ds2/build.gradle
+++ b/3ds2/build.gradle
@@ -21,13 +21,11 @@ apply from: "${rootDir}/config/gradle/sharedTasks.gradle"
android {
namespace 'com.adyen.checkout.adyen3ds2'
- compileSdkVersion compile_sdk_version
+ compileSdk compile_sdk_version
defaultConfig {
- minSdkVersion min_sdk_version
- targetSdkVersion target_sdk_version
- versionCode version_code
- versionName version_name
+ minSdk min_sdk_version
+ targetSdk target_sdk_version
testInstrumentationRunner 'androidx.test.runner.AndroidJUnitRunner'
consumerProguardFiles "consumer-rules.pro"
diff --git a/3ds2/src/main/java/com/adyen/checkout/adyen3ds2/Adyen3DS2Configuration.kt b/3ds2/src/main/java/com/adyen/checkout/adyen3ds2/Adyen3DS2Configuration.kt
index ab4fcfbf18..2b34309019 100644
--- a/3ds2/src/main/java/com/adyen/checkout/adyen3ds2/Adyen3DS2Configuration.kt
+++ b/3ds2/src/main/java/com/adyen/checkout/adyen3ds2/Adyen3DS2Configuration.kt
@@ -141,7 +141,7 @@ fun CheckoutConfiguration.adyen3DS2(
return this
}
-fun CheckoutConfiguration.getAdyen3DS2Configuration(): Adyen3DS2Configuration? {
+internal fun CheckoutConfiguration.getAdyen3DS2Configuration(): Adyen3DS2Configuration? {
return getActionConfiguration(Adyen3DS2Configuration::class.java)
}
diff --git a/README.md b/README.md
index 6a55482726..875e809922 100644
--- a/README.md
+++ b/README.md
@@ -31,23 +31,23 @@ Import the corresponding module in your `build.gradle` file.
For Drop-in:
```groovy
-implementation "com.adyen.checkout:drop-in-compose:5.3.0"
+implementation "com.adyen.checkout:drop-in-compose:5.3.1"
```
For the Credit Card component:
```groovy
-implementation "com.adyen.checkout:card:5.3.0"
-implementation "com.adyen.checkout:components-compose:5.3.0"
+implementation "com.adyen.checkout:card:5.3.1"
+implementation "com.adyen.checkout:components-compose:5.3.1"
```
### Without Jetpack Compose
For Drop-in:
```groovy
-implementation "com.adyen.checkout:drop-in:5.3.0"
+implementation "com.adyen.checkout:drop-in:5.3.1"
```
For the Credit Card component:
```groovy
-implementation "com.adyen.checkout:card:5.3.0"
+implementation "com.adyen.checkout:card:5.3.1"
```
The library is available on [Maven Central][mavenRepo].
diff --git a/RELEASE_NOTES.md b/RELEASE_NOTES.md
index eb45949724..3574118366 100644
--- a/RELEASE_NOTES.md
+++ b/RELEASE_NOTES.md
@@ -8,71 +8,18 @@
[//]: # (## Deprecated)
[//]: # ( - Configurations public constructor are deprecated, please use each Configuration's builder to make a Configuration object)
-## New
-- A new way to create a configuration using DSL to be more declarative and concise:
-```Kotlin
-CheckoutConfiguration(
- environment = environment,
- clientKey = clientKey,
- shopperLocale = shopperLocale,
- amount = amount,
-) {
- dropIn {
- setEnableRemovingStoredPaymentMethods(true)
- }
-
- card {
- setHolderNameRequired(true)
- setShopperReference("...")
- }
-
- adyen3DS2 {
- setThreeDSRequestorAppURL("...")
- }
-}
-```
-
-- For the Card Component, you can use the new [Address Lookup functionality](docs/ADDRESS_LOOKUP.md).
-- For voucher actions: when the `url` or `downloadUrl` is not included, the shopper has the option to select **Save as image** and save the voucher to the device's `Downloads` folder.
-- You can now set your own `AdyenLogger` instance with `AdyenLogger.setLogger`. This gives the ability to intercept logs and handle them in your own way.
-- [Instructions](example-app/README.md) to use the testing app in the repository. You can follow `How to migrate` section [here](https://github.com/Adyen/adyen-android/pull/1505).
-- Payment methods:
- - Multibanco. Payment method type: **multibanco**.
- - Pay Easy. Payment method type: **econtext_atm**.
- - Convenience Stores Japan. Payment method type: **econtext_stores**
- - Online Banking Japan. Payment method type: **econtext_online**.
- - Seven-Eleven: Payment method type: **econtext_seven_eleven**
-
## Fixed
-- When building `minifyEnabled` without the `kotlin-parcelize` plugin in your project, the build should no longer crash.
-- When handling actions, you no longer get the `IllegalArgumentException: Unsupported delegate type` error that causes a crash.
+- For Drop-in and Components, when `?android:attr/textColor` is not defined in your own theme, the Card Component no longer crashes.
+- The `onAdditionalDetails` event is now triggered only once. Previously, the event was triggered multiple times in some edge cases.
+- The build output no longer contains warnings about multiple substitutions specified in non-positional format in string resources.
+- For the Card Component, we fixed localization issues that occurred when using the Address Lookup functionality.
+- Overriding some of the XML styles without specifying a parent style no longer causes a build error.
-## Deprecated
-- When creating a configuration, the `Builder` constructors with a `Context` is deprecated. You can now omit the `context` parameter.
-- `PermissionException`. Handle permissions through `ActionComponentCallback`, `SessionComponentCallback`, or `ComponentCallback` callbacks instead.
-- The styles for vouchers have been changed:
- - | Previous (v5.2.0 or earlier) | Now (v5.3.0) |
- |---------------------------------------------|-----------------------------------------------|
- | `AdyenCheckout.Voucher.Description.Bacs` | `AdyenCheckout.Voucher.Simple.Description` |
- | `AdyenCheckout.Voucher.Description.Boleto` | `AdyenCheckout.Voucher.Full.Description` |
- | `AdyenCheckout.Voucher.ExpirationDateLabel` | `AdyenCheckout.Voucher.InformationFieldLabel` |
- | `AdyenCheckout.Voucher.ExpirationDate` | `AdyenCheckout.Voucher.InformationFieldValue` |
- | `AdyenCheckout.Voucher.ButtonCopyCode` | `AdyenCheckout.Voucher.Button.CopyCode` |
- | `AdyenCheckout.Voucher.ButtonDownloadPdf` | `AdyenCheckout.Voucher.Button.DownloadPdf` |
-- Logger.LogLevel has been deprecated.
- - | Previous (v5.2.0 or earlier) | Now (v5.3.0) |
- |------------------------------------------|-------------------------------------------------|
- | `Logger.LogLevel` | `AdyenLogLevel` |
- | `AdyenLogger.setLogLevel(logLevel: Int)` | `AdyenLogger.setLogLevel(level: AdyenLogLevel)` |
+## Removed
+- You can no longer use functions like `CheckoutConfiguration.getCardConfiguration()` or `CheckoutConfiguration.getDropInConfiguration()` to get configurations from the `CheckoutConfiguration` object. When starting Drop-in or Components, pass the full `CheckoutConfiguration` object.
## Changed
-- When creating a configuration, the `shopperLocale` parameter is now optional.
- - Sessions flow: when you don't set it, the shopper locale is set to the value included in the `/sessions` request.
- - Advanced flow: when you don't set it, the shopper local is set to the primary user locale on the device.
-- For Drop-in, all actions now start in expanded mode.
-- For the Google Pay Component, you no longer need to manually import the `3ds2` module to handle transactions that require Native 3D Secure 2 challenge.
-- If you use `DropInServiceResult.Error` without specifying an error message, the default has changed from `Error sending payment. Please try again.` to `An unknown error occurred`.
-- For the Sessions flow:
- - When starting Drop-in (with `DropIn.startPayment`) or creating a Component (with `YourComponent.PROVIDER.get`), the `configuration` parameter is now optional.
- - When using `CheckoutSessionProvider.createSession` to create a `CheckoutSession`, you can pass only `environment` and `clientKey` instead of the whole configuration.
- - Removing stored payment methods is now handled internally. You no longer need to override the `onRemoveStoredPaymentMethod` function.
+- Dependency versions:
+ | Name | Version |
+ |--------------------------------------------------------------------------------------------------------|-------------------------------|
+ | [Android Gradle plugin](https://developer.android.com/build/releases/gradle-plugin) | **8.3.1** |
diff --git a/SECURITY.md b/SECURITY.md
index e843ff246f..6bff304ad7 100644
--- a/SECURITY.md
+++ b/SECURITY.md
@@ -1,3 +1,4 @@
# Disclosing security issues
-We welcome reports of possible vulnerabilities or issues as part of our [responsible disclosure policy](https://www.adyen.com/policies-and-disclaimer/responsible-disclosure). For more information check out this page on [how to disclose a security issue](https://help.adyen.com/en_US/knowledge/security/product-security/how-do-i-disclose-a-security-issue).
+We welcome reports of possible vulnerabilities or issues as part of our [responsible disclosure policy](https://www.adyen.com/policies-and-disclaimer/responsible-disclosure). For more information go to
+[this page](https://www.adyen.com/policies-and-disclaimer/responsible-disclosure).
diff --git a/ach/build.gradle b/ach/build.gradle
index 68059afd78..953cb6ff44 100644
--- a/ach/build.gradle
+++ b/ach/build.gradle
@@ -12,13 +12,11 @@ apply from: "${rootDir}/config/gradle/sharedTasks.gradle"
android {
namespace 'com.adyen.checkout.ach'
- compileSdkVersion compile_sdk_version
+ compileSdk compile_sdk_version
defaultConfig {
- minSdkVersion min_sdk_version
- targetSdkVersion target_sdk_version
- versionCode version_code
- versionName version_name
+ minSdk min_sdk_version
+ targetSdk target_sdk_version
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
consumerProguardFiles "consumer-rules.pro"
diff --git a/ach/src/main/java/com/adyen/checkout/ach/ACHDirectDebitConfiguration.kt b/ach/src/main/java/com/adyen/checkout/ach/ACHDirectDebitConfiguration.kt
index 5562fb7af1..fd709c4714 100644
--- a/ach/src/main/java/com/adyen/checkout/ach/ACHDirectDebitConfiguration.kt
+++ b/ach/src/main/java/com/adyen/checkout/ach/ACHDirectDebitConfiguration.kt
@@ -167,7 +167,7 @@ fun CheckoutConfiguration.achDirectDebit(
return this
}
-fun CheckoutConfiguration.getACHDirectDebitConfiguration(): ACHDirectDebitConfiguration? {
+internal fun CheckoutConfiguration.getACHDirectDebitConfiguration(): ACHDirectDebitConfiguration? {
return getConfiguration(PaymentMethodTypes.ACH)
}
diff --git a/action-core/build.gradle b/action-core/build.gradle
index a5368082be..b2c6de067c 100644
--- a/action-core/build.gradle
+++ b/action-core/build.gradle
@@ -20,13 +20,11 @@ apply from: "${rootDir}/config/gradle/sharedTasks.gradle"
android {
namespace 'com.adyen.checkout.action.core'
- compileSdkVersion compile_sdk_version
+ compileSdk compile_sdk_version
defaultConfig {
- minSdkVersion min_sdk_version
- targetSdkVersion target_sdk_version
- versionCode version_code
- versionName version_name
+ minSdk min_sdk_version
+ targetSdk target_sdk_version
testInstrumentationRunner 'androidx.test.runner.AndroidJUnitRunner'
consumerProguardFiles "consumer-rules.pro"
diff --git a/action/build.gradle b/action/build.gradle
index 6f5e7bfc93..51d9376945 100644
--- a/action/build.gradle
+++ b/action/build.gradle
@@ -20,13 +20,11 @@ apply from: "${rootDir}/config/gradle/sharedTasks.gradle"
android {
namespace 'com.adyen.checkout.action'
- compileSdkVersion compile_sdk_version
+ compileSdk compile_sdk_version
defaultConfig {
- minSdkVersion min_sdk_version
- targetSdkVersion target_sdk_version
- versionCode version_code
- versionName version_name
+ minSdk min_sdk_version
+ targetSdk target_sdk_version
testInstrumentationRunner 'androidx.test.runner.AndroidJUnitRunner'
consumerProguardFiles "consumer-rules.pro"
diff --git a/await/build.gradle b/await/build.gradle
index 93a826031d..6354a30f92 100644
--- a/await/build.gradle
+++ b/await/build.gradle
@@ -20,13 +20,11 @@ apply from: "${rootDir}/config/gradle/sharedTasks.gradle"
android {
namespace 'com.adyen.checkout.await'
- compileSdkVersion compile_sdk_version
+ compileSdk compile_sdk_version
defaultConfig {
- minSdkVersion min_sdk_version
- targetSdkVersion target_sdk_version
- versionCode version_code
- versionName version_name
+ minSdk min_sdk_version
+ targetSdk target_sdk_version
testInstrumentationRunner 'androidx.test.runner.AndroidJUnitRunner'
consumerProguardFiles "consumer-rules.pro"
diff --git a/await/src/main/java/com/adyen/checkout/await/AwaitConfiguration.kt b/await/src/main/java/com/adyen/checkout/await/AwaitConfiguration.kt
index 6848d98ecb..a955936e0d 100644
--- a/await/src/main/java/com/adyen/checkout/await/AwaitConfiguration.kt
+++ b/await/src/main/java/com/adyen/checkout/await/AwaitConfiguration.kt
@@ -8,6 +8,7 @@
package com.adyen.checkout.await
import android.content.Context
+import androidx.annotation.VisibleForTesting
import com.adyen.checkout.components.core.Amount
import com.adyen.checkout.components.core.AnalyticsConfiguration
import com.adyen.checkout.components.core.CheckoutConfiguration
@@ -105,7 +106,8 @@ fun CheckoutConfiguration.await(
return this
}
-fun CheckoutConfiguration.getAwaitConfiguration(): AwaitConfiguration? {
+@VisibleForTesting
+internal fun CheckoutConfiguration.getAwaitConfiguration(): AwaitConfiguration? {
return getActionConfiguration(AwaitConfiguration::class.java)
}
diff --git a/bacs/build.gradle b/bacs/build.gradle
index d50e338122..60fe8a0c86 100644
--- a/bacs/build.gradle
+++ b/bacs/build.gradle
@@ -21,13 +21,11 @@ apply from: "${rootDir}/config/gradle/sharedTasks.gradle"
android {
namespace 'com.adyen.checkout.bacs'
- compileSdkVersion compile_sdk_version
+ compileSdk compile_sdk_version
defaultConfig {
- minSdkVersion min_sdk_version
- targetSdkVersion target_sdk_version
- versionCode version_code
- versionName version_name
+ minSdk min_sdk_version
+ targetSdk target_sdk_version
testInstrumentationRunner 'androidx.test.runner.AndroidJUnitRunner'
consumerProguardFiles "consumer-rules.pro"
diff --git a/bacs/src/main/java/com/adyen/checkout/bacs/BacsDirectDebitConfiguration.kt b/bacs/src/main/java/com/adyen/checkout/bacs/BacsDirectDebitConfiguration.kt
index a4a1d40697..dd45b63b65 100644
--- a/bacs/src/main/java/com/adyen/checkout/bacs/BacsDirectDebitConfiguration.kt
+++ b/bacs/src/main/java/com/adyen/checkout/bacs/BacsDirectDebitConfiguration.kt
@@ -131,7 +131,7 @@ fun CheckoutConfiguration.bacsDirectDebit(
return this
}
-fun CheckoutConfiguration.getBacsDirectDebitConfiguration(): BacsDirectDebitConfiguration? {
+internal fun CheckoutConfiguration.getBacsDirectDebitConfiguration(): BacsDirectDebitConfiguration? {
return getConfiguration(PaymentMethodTypes.BACS)
}
diff --git a/bcmc/build.gradle b/bcmc/build.gradle
index 75ae403ba8..907610efe0 100644
--- a/bcmc/build.gradle
+++ b/bcmc/build.gradle
@@ -21,13 +21,11 @@ apply from: "${rootDir}/config/gradle/sharedTasks.gradle"
android {
namespace 'com.adyen.checkout.bcmc'
- compileSdkVersion compile_sdk_version
+ compileSdk compile_sdk_version
defaultConfig {
- minSdkVersion min_sdk_version
- targetSdkVersion target_sdk_version
- versionCode version_code
- versionName version_name
+ minSdk min_sdk_version
+ targetSdk target_sdk_version
testInstrumentationRunner 'androidx.test.runner.AndroidJUnitRunner'
consumerProguardFiles "consumer-rules.pro"
diff --git a/bcmc/src/main/java/com/adyen/checkout/bcmc/BcmcConfiguration.kt b/bcmc/src/main/java/com/adyen/checkout/bcmc/BcmcConfiguration.kt
index 42236dfa79..c6766178ce 100644
--- a/bcmc/src/main/java/com/adyen/checkout/bcmc/BcmcConfiguration.kt
+++ b/bcmc/src/main/java/com/adyen/checkout/bcmc/BcmcConfiguration.kt
@@ -187,7 +187,7 @@ fun CheckoutConfiguration.bcmc(
return this
}
-fun CheckoutConfiguration.getBcmcConfiguration(): BcmcConfiguration? {
+internal fun CheckoutConfiguration.getBcmcConfiguration(): BcmcConfiguration? {
return getConfiguration(PaymentMethodTypes.BCMC)
}
diff --git a/blik/build.gradle b/blik/build.gradle
index 96636feda0..27e5dee456 100644
--- a/blik/build.gradle
+++ b/blik/build.gradle
@@ -21,13 +21,11 @@ apply from: "${rootDir}/config/gradle/sharedTasks.gradle"
android {
namespace 'com.adyen.checkout.blik'
- compileSdkVersion compile_sdk_version
+ compileSdk compile_sdk_version
defaultConfig {
- minSdkVersion min_sdk_version
- targetSdkVersion target_sdk_version
- versionCode version_code
- versionName version_name
+ minSdk min_sdk_version
+ targetSdk target_sdk_version
testInstrumentationRunner 'androidx.test.runner.AndroidJUnitRunner'
consumerProguardFiles "consumer-rules.pro"
diff --git a/blik/src/main/java/com/adyen/checkout/blik/BlikConfiguration.kt b/blik/src/main/java/com/adyen/checkout/blik/BlikConfiguration.kt
index 6ee7c9578e..37c6aa849d 100644
--- a/blik/src/main/java/com/adyen/checkout/blik/BlikConfiguration.kt
+++ b/blik/src/main/java/com/adyen/checkout/blik/BlikConfiguration.kt
@@ -130,7 +130,7 @@ fun CheckoutConfiguration.blik(
return this
}
-fun CheckoutConfiguration.getBlikConfiguration(): BlikConfiguration? {
+internal fun CheckoutConfiguration.getBlikConfiguration(): BlikConfiguration? {
return getConfiguration(PaymentMethodTypes.BLIK)
}
diff --git a/boleto/build.gradle b/boleto/build.gradle
index 26297d34c5..db3eb10a96 100644
--- a/boleto/build.gradle
+++ b/boleto/build.gradle
@@ -20,13 +20,11 @@ apply from: "${rootDir}/config/gradle/sharedTasks.gradle"
android {
namespace 'com.adyen.checkout.boleto'
- compileSdkVersion compile_sdk_version
+ compileSdk compile_sdk_version
defaultConfig {
- minSdkVersion min_sdk_version
- targetSdkVersion target_sdk_version
- versionCode version_code
- versionName version_name
+ minSdk min_sdk_version
+ targetSdk target_sdk_version
testInstrumentationRunner 'androidx.test.runner.AndroidJUnitRunner'
consumerProguardFiles "consumer-rules.pro"
diff --git a/boleto/src/main/java/com/adyen/checkout/boleto/BoletoConfiguration.kt b/boleto/src/main/java/com/adyen/checkout/boleto/BoletoConfiguration.kt
index b586a9c61a..1c4271be0d 100644
--- a/boleto/src/main/java/com/adyen/checkout/boleto/BoletoConfiguration.kt
+++ b/boleto/src/main/java/com/adyen/checkout/boleto/BoletoConfiguration.kt
@@ -145,7 +145,7 @@ fun CheckoutConfiguration.boleto(
return this
}
-fun CheckoutConfiguration.getBoletoConfiguration(): BoletoConfiguration? {
+internal fun CheckoutConfiguration.getBoletoConfiguration(): BoletoConfiguration? {
return BoletoComponent.PAYMENT_METHOD_TYPES.firstNotNullOfOrNull { key ->
getConfiguration(key)
}
diff --git a/card/build.gradle b/card/build.gradle
index d1b10a6949..ae7ecbcb5d 100644
--- a/card/build.gradle
+++ b/card/build.gradle
@@ -21,13 +21,11 @@ apply from: "${rootDir}/config/gradle/sharedTasks.gradle"
android {
namespace 'com.adyen.checkout.card'
- compileSdkVersion compile_sdk_version
+ compileSdk compile_sdk_version
defaultConfig {
- minSdkVersion min_sdk_version
- targetSdkVersion target_sdk_version
- versionCode version_code
- versionName version_name
+ minSdk min_sdk_version
+ targetSdk target_sdk_version
testInstrumentationRunner 'androidx.test.runner.AndroidJUnitRunner'
consumerProguardFiles "consumer-rules.pro"
diff --git a/card/src/main/java/com/adyen/checkout/card/CardConfiguration.kt b/card/src/main/java/com/adyen/checkout/card/CardConfiguration.kt
index 69e6de8a7b..038d52305f 100644
--- a/card/src/main/java/com/adyen/checkout/card/CardConfiguration.kt
+++ b/card/src/main/java/com/adyen/checkout/card/CardConfiguration.kt
@@ -330,7 +330,7 @@ fun CheckoutConfiguration.card(
return this
}
-fun CheckoutConfiguration.getCardConfiguration(): CardConfiguration? {
+internal fun CheckoutConfiguration.getCardConfiguration(): CardConfiguration? {
return getConfiguration(PaymentMethodTypes.SCHEME)
}
diff --git a/card/src/main/java/com/adyen/checkout/card/internal/ui/view/CardView.kt b/card/src/main/java/com/adyen/checkout/card/internal/ui/view/CardView.kt
index 27c1ee85fc..6ab1e427c9 100644
--- a/card/src/main/java/com/adyen/checkout/card/internal/ui/view/CardView.kt
+++ b/card/src/main/java/com/adyen/checkout/card/internal/ui/view/CardView.kt
@@ -302,7 +302,7 @@ class CardView @JvmOverloads constructor(
)
setDualBrandedCardImages(detectedCardTypes, cardOutputData.cardNumberState.validation)
- // TODO: 29/01/2021 get this logic from OutputData
+ // TODO 29/01/2021 get this logic from OutputData
val isAmex = detectedCardTypes.any { it.cardBrand == CardBrand(cardType = CardType.AMERICAN_EXPRESS) }
binding.editTextCardNumber.setAmexCardFormat(isAmex)
diff --git a/card/src/main/res/values-ar/strings.xml b/card/src/main/res/values-ar/strings.xml
index 2e4c2f3497..f4b760ab51 100644
--- a/card/src/main/res/values-ar/strings.xml
+++ b/card/src/main/res/values-ar/strings.xml
@@ -32,7 +32,7 @@
عدد الأقساط
%s أشهر
- %s × %s
+ %1$s × %2$s
الدفع مرة واحدة
الدفع الدوري
diff --git a/card/src/main/res/values-cs-rCZ/strings.xml b/card/src/main/res/values-cs-rCZ/strings.xml
index 6cfb3dc18a..72c48c5363 100644
--- a/card/src/main/res/values-cs-rCZ/strings.xml
+++ b/card/src/main/res/values-cs-rCZ/strings.xml
@@ -32,7 +32,7 @@
Počet splátek
%s měsíců
- %s× %s
+ %1$s× %2$s
Jednorázová platba
Opakující se platba
diff --git a/card/src/main/res/values-da-rDK/strings.xml b/card/src/main/res/values-da-rDK/strings.xml
index a4e6fc42bd..462f9100fc 100644
--- a/card/src/main/res/values-da-rDK/strings.xml
+++ b/card/src/main/res/values-da-rDK/strings.xml
@@ -32,7 +32,7 @@
Antal rater
%s måneder
- %sx %s
+ %1$sx %2$s
Engangsbetaling
Løbende betaling
diff --git a/card/src/main/res/values-de-rDE/strings.xml b/card/src/main/res/values-de-rDE/strings.xml
index ac0f7e6754..3eda689b3e 100644
--- a/card/src/main/res/values-de-rDE/strings.xml
+++ b/card/src/main/res/values-de-rDE/strings.xml
@@ -32,7 +32,7 @@
Anzahl der Raten
%s Monate
- %sx %s
+ %1$sx %2$s
Einmalige Zahlung
Ratenzahlung
diff --git a/card/src/main/res/values-el-rGR/strings.xml b/card/src/main/res/values-el-rGR/strings.xml
index 99982e9f97..12c0538ef2 100644
--- a/card/src/main/res/values-el-rGR/strings.xml
+++ b/card/src/main/res/values-el-rGR/strings.xml
@@ -32,7 +32,7 @@
Αριθμός δόσεων
%s μήνες
- %sx %s
+ %1$sx %2$s
Εφάπαξ πληρωμή
Ανακυκλούμενη πληρωμή
diff --git a/card/src/main/res/values-es-rES/strings.xml b/card/src/main/res/values-es-rES/strings.xml
index 290dbaaaae..550d113c13 100644
--- a/card/src/main/res/values-es-rES/strings.xml
+++ b/card/src/main/res/values-es-rES/strings.xml
@@ -32,7 +32,7 @@
Número de plazos
%s meses
- %sx %s
+ %1$sx %2$s
Pago único
Pago rotativo
diff --git a/card/src/main/res/values-fi-rFI/strings.xml b/card/src/main/res/values-fi-rFI/strings.xml
index eccc53f258..577f5c5f32 100644
--- a/card/src/main/res/values-fi-rFI/strings.xml
+++ b/card/src/main/res/values-fi-rFI/strings.xml
@@ -32,7 +32,7 @@
Asennusten määrä
%s kuukautta
- %s x%s
+ %1$s x%2$s
Kertamaksu
Toistuva maksu
diff --git a/card/src/main/res/values-fr-rFR/strings.xml b/card/src/main/res/values-fr-rFR/strings.xml
index 3a909f9afd..8539aa6ad8 100644
--- a/card/src/main/res/values-fr-rFR/strings.xml
+++ b/card/src/main/res/values-fr-rFR/strings.xml
@@ -32,7 +32,7 @@
Nombre de versements
%s mois
- %sx %s
+ %1$sx %2$s
Paiement unique
Paiement en plusieurs fois
diff --git a/card/src/main/res/values-hr-rHR/strings.xml b/card/src/main/res/values-hr-rHR/strings.xml
index 06578c52a3..63fd707ffd 100644
--- a/card/src/main/res/values-hr-rHR/strings.xml
+++ b/card/src/main/res/values-hr-rHR/strings.xml
@@ -32,7 +32,7 @@
Broj rata
Mjeseci: %s
- %s x %s
+ %1$s x %2$s
Jednokratno plaćanje
Obnovljivo plaćanje
diff --git a/card/src/main/res/values-hu-rHU/strings.xml b/card/src/main/res/values-hu-rHU/strings.xml
index 278a73c72b..6238f73b0e 100644
--- a/card/src/main/res/values-hu-rHU/strings.xml
+++ b/card/src/main/res/values-hu-rHU/strings.xml
@@ -32,7 +32,7 @@
Részletek száma
%s hónap
- %s x %s
+ %1$s x %2$s
Egyösszegű fizetés
Többösszegű fizetés
diff --git a/card/src/main/res/values-it-rIT/strings.xml b/card/src/main/res/values-it-rIT/strings.xml
index 02922571c2..c279af9b2a 100644
--- a/card/src/main/res/values-it-rIT/strings.xml
+++ b/card/src/main/res/values-it-rIT/strings.xml
@@ -32,7 +32,7 @@
Numero di rate
%s mesi
- %s x%s
+ %2$s x%1$s
Pagamento una tantum
Pagamento ricorrente
diff --git a/card/src/main/res/values-ja-rJP/strings.xml b/card/src/main/res/values-ja-rJP/strings.xml
index bc993528b8..70fe6453f4 100644
--- a/card/src/main/res/values-ja-rJP/strings.xml
+++ b/card/src/main/res/values-ja-rJP/strings.xml
@@ -32,7 +32,7 @@
分割回数
%sか月
- %sx %s
+ %1$sx %2$s
一括払い
リボ払い
diff --git a/card/src/main/res/values-ko-rKR/strings.xml b/card/src/main/res/values-ko-rKR/strings.xml
index bd87e5cb0a..70dbe64a66 100644
--- a/card/src/main/res/values-ko-rKR/strings.xml
+++ b/card/src/main/res/values-ko-rKR/strings.xml
@@ -32,7 +32,7 @@
할부 개월 수
%s개월
- %sx %s
+ %1$sx %2$s
일시불 결제
리볼빙 결제
diff --git a/card/src/main/res/values-nb-rNO/strings.xml b/card/src/main/res/values-nb-rNO/strings.xml
index 98f43a4f72..397df6ad0f 100644
--- a/card/src/main/res/values-nb-rNO/strings.xml
+++ b/card/src/main/res/values-nb-rNO/strings.xml
@@ -32,7 +32,7 @@
Antall avdrag
%s måneder
- %sx %s
+ %1$sx %2$s
Engangsbetaling
Gjentakende betaling
diff --git a/card/src/main/res/values-nl-rNL/strings.xml b/card/src/main/res/values-nl-rNL/strings.xml
index 042cbd8e3c..80fb95731b 100644
--- a/card/src/main/res/values-nl-rNL/strings.xml
+++ b/card/src/main/res/values-nl-rNL/strings.xml
@@ -32,7 +32,7 @@
Aantal termijnen
%s maanden
- %sx %s
+ %1$sx %2$s
Eenmalige betaling
Terugkerende betaling
diff --git a/card/src/main/res/values-pl-rPL/strings.xml b/card/src/main/res/values-pl-rPL/strings.xml
index b9083d4ef2..0724167c2d 100644
--- a/card/src/main/res/values-pl-rPL/strings.xml
+++ b/card/src/main/res/values-pl-rPL/strings.xml
@@ -32,7 +32,7 @@
Liczba rat
%s miesięcy
- %sx %s
+ %1$sx %2$s
Płatność jednorazowa
Płatność odnawialna
diff --git a/card/src/main/res/values-pt-rBR/strings.xml b/card/src/main/res/values-pt-rBR/strings.xml
index 4b58ce9c90..fd39955ea6 100644
--- a/card/src/main/res/values-pt-rBR/strings.xml
+++ b/card/src/main/res/values-pt-rBR/strings.xml
@@ -32,7 +32,7 @@
Opções de Parcelamento
%s meses
- %sx %s
+ %1$sx %2$s
Pagamento à vista
Pagamento rotativo
diff --git a/card/src/main/res/values-pt-rPT/strings.xml b/card/src/main/res/values-pt-rPT/strings.xml
index ef6e04208e..a3c53da611 100644
--- a/card/src/main/res/values-pt-rPT/strings.xml
+++ b/card/src/main/res/values-pt-rPT/strings.xml
@@ -32,7 +32,7 @@
Número de prestações
%s meses
- %sx %s
+ %1$sx %2$s
Pagamento único
Pagamento rotativo
diff --git a/card/src/main/res/values-ro-rRO/strings.xml b/card/src/main/res/values-ro-rRO/strings.xml
index 17817225aa..568dd8ea78 100644
--- a/card/src/main/res/values-ro-rRO/strings.xml
+++ b/card/src/main/res/values-ro-rRO/strings.xml
@@ -32,7 +32,7 @@
Număr de rate
%s luni
- %sx %s
+ %1$sx %2$s
Plată unică
Plată recurentă
diff --git a/card/src/main/res/values-ru-rRU/strings.xml b/card/src/main/res/values-ru-rRU/strings.xml
index a63e095fdd..5ca1a2f70b 100644
--- a/card/src/main/res/values-ru-rRU/strings.xml
+++ b/card/src/main/res/values-ru-rRU/strings.xml
@@ -32,7 +32,7 @@
Количество платежей
%s мес.
- %s× %s
+ %1$s× %2$s
Одноразовый платеж
Повторяющаяся оплата
diff --git a/card/src/main/res/values-sk-rSK/strings.xml b/card/src/main/res/values-sk-rSK/strings.xml
index cf3eee1987..d76660487e 100644
--- a/card/src/main/res/values-sk-rSK/strings.xml
+++ b/card/src/main/res/values-sk-rSK/strings.xml
@@ -32,7 +32,7 @@
Počet splátok
%s mesiace/-ov
- %s x %s
+ %1$s x %2$s
Jednorazová platba
Revolvingová platba
diff --git a/card/src/main/res/values-sl-rSI/strings.xml b/card/src/main/res/values-sl-rSI/strings.xml
index 7d6713fb48..7d08cfcc3b 100644
--- a/card/src/main/res/values-sl-rSI/strings.xml
+++ b/card/src/main/res/values-sl-rSI/strings.xml
@@ -32,7 +32,7 @@
Število obrokov
Št. mesecev: %s
- %s × %s
+ %1$s × %2$s
Enkratno plačilo
Revolving plačilo
diff --git a/card/src/main/res/values-sv-rSE/strings.xml b/card/src/main/res/values-sv-rSE/strings.xml
index 9f0ab5fead..b9fb7c99ca 100644
--- a/card/src/main/res/values-sv-rSE/strings.xml
+++ b/card/src/main/res/values-sv-rSE/strings.xml
@@ -32,7 +32,7 @@
Antal delbetalningar
%s månader
- %s x %s
+ %1$s x %2$s
Engångsbetalning
Uppdelad betalning
diff --git a/card/src/main/res/values-zh-rCN/strings.xml b/card/src/main/res/values-zh-rCN/strings.xml
index 556a84c387..23605f2b8e 100644
--- a/card/src/main/res/values-zh-rCN/strings.xml
+++ b/card/src/main/res/values-zh-rCN/strings.xml
@@ -32,7 +32,7 @@
分期付款期数
%s 个月
- %sx %s
+ %1$sx %2$s
全款支付
循环支付
diff --git a/card/src/main/res/values-zh-rTW/strings.xml b/card/src/main/res/values-zh-rTW/strings.xml
index f216da2218..6842e37889 100644
--- a/card/src/main/res/values-zh-rTW/strings.xml
+++ b/card/src/main/res/values-zh-rTW/strings.xml
@@ -32,7 +32,7 @@
分期付款的期數
%s 個月
- %sx %s
+ %1$sx %2$s
一次性付款
延期付款
diff --git a/card/src/main/res/values/strings.xml b/card/src/main/res/values/strings.xml
index 29efdc76a4..6bac9728ed 100644
--- a/card/src/main/res/values/strings.xml
+++ b/card/src/main/res/values/strings.xml
@@ -32,7 +32,7 @@
Number of installments
%s months
- %sx %s
+ %1$sx %2$s
One time payment
Revolving payment
diff --git a/card/src/main/res/values/styles.xml b/card/src/main/res/values/styles.xml
index 47c7083969..2cfeb04f71 100644
--- a/card/src/main/res/values/styles.xml
+++ b/card/src/main/res/values/styles.xml
@@ -83,16 +83,19 @@
- 18sp
+
+
+
@@ -102,8 +105,7 @@
- match_parent
- @dimen/standard_margin
- @dimen/input_height
- - Search Address
- - @string/checkout_address_lookup_hint
- - ?android:attr/textColor
+ - @string/checkout_address_lookup_hint
+ - ?attr/colorOnSurface
diff --git a/cashapppay/build.gradle b/cashapppay/build.gradle
index e48ef3fab4..b368bda3b7 100644
--- a/cashapppay/build.gradle
+++ b/cashapppay/build.gradle
@@ -20,13 +20,11 @@ apply from: "${rootDir}/config/gradle/sharedTasks.gradle"
android {
namespace 'com.adyen.checkout.cashapppay'
- compileSdkVersion compile_sdk_version
+ compileSdk compile_sdk_version
defaultConfig {
- minSdkVersion min_sdk_version
- targetSdkVersion target_sdk_version
- versionCode version_code
- versionName version_name
+ minSdk min_sdk_version
+ targetSdk target_sdk_version
testInstrumentationRunner 'androidx.test.runner.AndroidJUnitRunner'
consumerProguardFiles "consumer-rules.pro"
diff --git a/cashapppay/src/main/java/com/adyen/checkout/cashapppay/CashAppPayConfiguration.kt b/cashapppay/src/main/java/com/adyen/checkout/cashapppay/CashAppPayConfiguration.kt
index 30ce6e4fb0..1081adc6c0 100644
--- a/cashapppay/src/main/java/com/adyen/checkout/cashapppay/CashAppPayConfiguration.kt
+++ b/cashapppay/src/main/java/com/adyen/checkout/cashapppay/CashAppPayConfiguration.kt
@@ -199,7 +199,7 @@ fun CheckoutConfiguration.cashAppPay(
return this
}
-fun CheckoutConfiguration.getCashAppPayConfiguration(): CashAppPayConfiguration? {
+internal fun CheckoutConfiguration.getCashAppPayConfiguration(): CashAppPayConfiguration? {
return getConfiguration(PaymentMethodTypes.CASH_APP_PAY)
}
diff --git a/checkout-core/build.gradle b/checkout-core/build.gradle
index 4aa77ddbce..02ca7d14d9 100644
--- a/checkout-core/build.gradle
+++ b/checkout-core/build.gradle
@@ -20,13 +20,11 @@ apply from: "${rootDir}/config/gradle/sharedTasks.gradle"
android {
namespace 'com.adyen.checkout.core'
- compileSdkVersion compile_sdk_version
+ compileSdk compile_sdk_version
defaultConfig {
- minSdkVersion min_sdk_version
- targetSdkVersion target_sdk_version
- versionCode version_code
- versionName version_name
+ minSdk min_sdk_version
+ targetSdk target_sdk_version
testInstrumentationRunner 'androidx.test.runner.AndroidJUnitRunner'
consumerProguardFiles "consumer-rules.pro"
diff --git a/components-compose/build.gradle b/components-compose/build.gradle
index fe541590e6..4d6f3892b6 100644
--- a/components-compose/build.gradle
+++ b/components-compose/build.gradle
@@ -20,13 +20,11 @@ apply from: "${rootDir}/config/gradle/sharedTasks.gradle"
android {
namespace 'com.adyen.checkout.components.compose'
- compileSdkVersion compile_sdk_version
+ compileSdk compile_sdk_version
defaultConfig {
- minSdkVersion min_sdk_version
- targetSdkVersion target_sdk_version
- versionCode version_code
- versionName version_name
+ minSdk min_sdk_version
+ targetSdk target_sdk_version
testInstrumentationRunner 'androidx.test.runner.AndroidJUnitRunner'
consumerProguardFiles "consumer-rules.pro"
diff --git a/components-core/build.gradle b/components-core/build.gradle
index 64822b57d0..dbbc3facd4 100644
--- a/components-core/build.gradle
+++ b/components-core/build.gradle
@@ -21,13 +21,11 @@ apply from: "${rootDir}/config/gradle/sharedTasks.gradle"
android {
namespace 'com.adyen.checkout.components.core'
- compileSdkVersion compile_sdk_version
+ compileSdk compile_sdk_version
defaultConfig {
- minSdkVersion min_sdk_version
- targetSdkVersion target_sdk_version
- versionCode version_code
- versionName version_name
+ minSdk min_sdk_version
+ targetSdk target_sdk_version
testInstrumentationRunner 'androidx.test.runner.AndroidJUnitRunner'
consumerProguardFiles "consumer-rules.pro"
diff --git a/components-core/src/main/java/com/adyen/checkout/components/core/action/VoucherAction.kt b/components-core/src/main/java/com/adyen/checkout/components/core/action/VoucherAction.kt
index 36134e38e9..fac826e819 100644
--- a/components-core/src/main/java/com/adyen/checkout/components/core/action/VoucherAction.kt
+++ b/components-core/src/main/java/com/adyen/checkout/components/core/action/VoucherAction.kt
@@ -33,7 +33,7 @@ data class VoucherAction(
var alternativeReference: String? = null,
var merchantName: String? = null,
var merchantReference: String? = null,
- // TODO: remove url when it's fixed from backend side
+ // TODO remove url when it's fixed from backend side
var url: String? = null,
var downloadUrl: String? = null,
var instructionsUrl: String? = null,
diff --git a/components-core/src/main/java/com/adyen/checkout/components/core/internal/data/api/StatusRepository.kt b/components-core/src/main/java/com/adyen/checkout/components/core/internal/data/api/StatusRepository.kt
index ba23f8de61..4850b00e36 100644
--- a/components-core/src/main/java/com/adyen/checkout/components/core/internal/data/api/StatusRepository.kt
+++ b/components-core/src/main/java/com/adyen/checkout/components/core/internal/data/api/StatusRepository.kt
@@ -9,25 +9,34 @@
package com.adyen.checkout.components.core.internal.data.api
import androidx.annotation.RestrictTo
+import androidx.annotation.VisibleForTesting
import com.adyen.checkout.components.core.internal.data.model.StatusRequest
import com.adyen.checkout.components.core.internal.data.model.StatusResponse
import com.adyen.checkout.components.core.internal.util.StatusResponseUtils
+import com.adyen.checkout.components.core.internal.util.bufferedChannel
import com.adyen.checkout.core.AdyenLogLevel
import com.adyen.checkout.core.internal.util.adyenLog
import com.adyen.checkout.core.internal.util.runSuspendCatching
import kotlinx.coroutines.CoroutineDispatcher
import kotlinx.coroutines.Dispatchers
+import kotlinx.coroutines.FlowPreview
import kotlinx.coroutines.cancel
import kotlinx.coroutines.currentCoroutineContext
import kotlinx.coroutines.delay
import kotlinx.coroutines.flow.Flow
-import kotlinx.coroutines.flow.MutableSharedFlow
+import kotlinx.coroutines.flow.debounce
import kotlinx.coroutines.flow.flow
import kotlinx.coroutines.flow.map
import kotlinx.coroutines.flow.merge
+import kotlinx.coroutines.flow.onEach
+import kotlinx.coroutines.flow.receiveAsFlow
+import kotlinx.coroutines.flow.transform
import kotlinx.coroutines.isActive
import kotlinx.coroutines.withContext
-import java.util.concurrent.TimeUnit
+import kotlin.time.Duration.Companion.milliseconds
+import kotlin.time.Duration.Companion.seconds
+import kotlin.time.TimeMark
+import kotlin.time.TimeSource
@RestrictTo(RestrictTo.Scope.LIBRARY_GROUP)
interface StatusRepository {
@@ -41,19 +50,36 @@ interface StatusRepository {
class DefaultStatusRepository(
private val statusService: StatusService,
private val clientKey: String,
+ private val timeSource: TimeSource = TimeSource.Monotonic,
private val coroutineDispatcher: CoroutineDispatcher = Dispatchers.IO,
) : StatusRepository {
private var delay: Long = 0
- private val refreshFlow: MutableSharedFlow = MutableSharedFlow(extraBufferCapacity = 1)
+ private val refreshFlow = bufferedChannel()
+ @OptIn(FlowPreview::class)
override fun poll(paymentData: String, maxPollingDuration: Long): Flow> {
- val startTime = System.currentTimeMillis()
+ val startTime = timeSource.markNow()
+
+ updateDelay(startTime, maxPollingDuration)
val pollingFlow = flow {
while (currentCoroutineContext().isActive) {
- val result = fetchStatus(paymentData)
+ emit(paymentData)
+ delay(delay)
+ }
+ }
+
+ return merge(
+ pollingFlow,
+ refreshFlow.receiveAsFlow(),
+ )
+ .debounce(DEBOUNCE_TIME)
+ .map {
+ fetchStatus(it)
+ }
+ .transform { result ->
emit(result)
if (result.isSuccess && StatusResponseUtils.isFinalResult(result.getOrThrow())) {
@@ -61,18 +87,14 @@ class DefaultStatusRepository(
}
if (!updateDelay(startTime, maxPollingDuration)) {
- emit(Result.failure(IllegalStateException("Max polling time has been exceeded.")))
+ adyenLog(AdyenLogLevel.DEBUG) { "Max polling time exceeded" }
+ emit(Result.failure(IllegalStateException("Max polling time exceeded.")))
currentCoroutineContext().cancel()
}
-
- delay(delay)
}
- }
-
- return merge(
- pollingFlow,
- refreshFlow.map { fetchStatus(it) },
- )
+ .onEach {
+ adyenLog(AdyenLogLevel.DEBUG) { "Emitting status: ${it.getOrNull()?.resultCode}" }
+ }
}
private suspend fun fetchStatus(paymentData: String) = withContext(coroutineDispatcher) {
@@ -84,8 +106,8 @@ class DefaultStatusRepository(
/**
* @return Returns if the delay time was updated. If not, that means the max polling time has been exceeded.
*/
- private fun updateDelay(startTime: Long, maxPollingDuration: Long): Boolean {
- val elapsedTime = System.currentTimeMillis() - startTime
+ private fun updateDelay(startTime: TimeMark, maxPollingDuration: Long): Boolean {
+ val elapsedTime = startTime.elapsedNow().inWholeMilliseconds
return when {
elapsedTime <= POLLING_THRESHOLD -> {
delay = POLLING_DELAY_FAST
@@ -103,12 +125,15 @@ class DefaultStatusRepository(
override fun refreshStatus(paymentData: String) {
adyenLog(AdyenLogLevel.VERBOSE) { "refreshStatus" }
- refreshFlow.tryEmit(paymentData)
+ refreshFlow.trySend(paymentData)
}
companion object {
- private val POLLING_DELAY_FAST = TimeUnit.SECONDS.toMillis(2)
- private val POLLING_DELAY_SLOW = TimeUnit.SECONDS.toMillis(10)
- private val POLLING_THRESHOLD = TimeUnit.SECONDS.toMillis(60)
+ private val POLLING_DELAY_FAST = 2.seconds.inWholeMilliseconds
+ private val POLLING_DELAY_SLOW = 10.seconds.inWholeMilliseconds
+ private val POLLING_THRESHOLD = 60.seconds.inWholeMilliseconds
+
+ @VisibleForTesting
+ internal val DEBOUNCE_TIME = 100.milliseconds.inWholeMilliseconds
}
}
diff --git a/components-core/src/test/java/com/adyen/checkout/components/core/internal/data/api/AnalyticsMapperTest.kt b/components-core/src/test/java/com/adyen/checkout/components/core/internal/data/api/AnalyticsMapperTest.kt
index 8d2f680eab..6f39100d6e 100644
--- a/components-core/src/test/java/com/adyen/checkout/components/core/internal/data/api/AnalyticsMapperTest.kt
+++ b/components-core/src/test/java/com/adyen/checkout/components/core/internal/data/api/AnalyticsMapperTest.kt
@@ -119,7 +119,7 @@ internal class AnalyticsMapperTest {
)
val expected = AnalyticsSetupRequest(
- version = "5.3.0",
+ version = "5.3.1",
channel = "android",
platform = "android",
locale = "en_US",
diff --git a/components-core/src/test/java/com/adyen/checkout/components/core/internal/data/api/DefaultStatusRepositoryTest.kt b/components-core/src/test/java/com/adyen/checkout/components/core/internal/data/api/DefaultStatusRepositoryTest.kt
index 0c924c7721..cc529d68b5 100644
--- a/components-core/src/test/java/com/adyen/checkout/components/core/internal/data/api/DefaultStatusRepositoryTest.kt
+++ b/components-core/src/test/java/com/adyen/checkout/components/core/internal/data/api/DefaultStatusRepositoryTest.kt
@@ -8,72 +8,147 @@
package com.adyen.checkout.components.core.internal.data.api
-import app.cash.turbine.test
import com.adyen.checkout.components.core.internal.data.model.StatusResponse
+import com.adyen.checkout.test.LoggingExtension
import com.adyen.checkout.test.TestDispatcherExtension
+import com.adyen.checkout.test.extensions.test
+import kotlinx.coroutines.CancellationException
import kotlinx.coroutines.ExperimentalCoroutinesApi
+import kotlinx.coroutines.cancel
+import kotlinx.coroutines.test.TestCoroutineScheduler
+import kotlinx.coroutines.test.UnconfinedTestDispatcher
+import kotlinx.coroutines.test.advanceUntilIdle
import kotlinx.coroutines.test.runTest
+import kotlinx.coroutines.test.testTimeSource
import org.junit.jupiter.api.Assertions.assertEquals
-import org.junit.jupiter.api.BeforeEach
+import org.junit.jupiter.api.Assertions.assertInstanceOf
+import org.junit.jupiter.api.Assertions.assertTrue
import org.junit.jupiter.api.Test
import org.junit.jupiter.api.extension.ExtendWith
import org.mockito.Mock
import org.mockito.junit.jupiter.MockitoExtension
import org.mockito.kotlin.any
import org.mockito.kotlin.doReturn
+import org.mockito.kotlin.times
+import org.mockito.kotlin.verify
import org.mockito.kotlin.whenever
-import java.util.concurrent.TimeUnit
+import kotlin.time.Duration.Companion.minutes
+import kotlin.time.ExperimentalTime
+import kotlin.time.TimeSource
-@OptIn(ExperimentalCoroutinesApi::class)
-@ExtendWith(MockitoExtension::class, TestDispatcherExtension::class)
+@OptIn(ExperimentalCoroutinesApi::class, ExperimentalTime::class)
+@ExtendWith(MockitoExtension::class, TestDispatcherExtension::class, LoggingExtension::class)
internal class DefaultStatusRepositoryTest(
@Mock private val statusService: StatusService
) {
private lateinit var statusRepository: DefaultStatusRepository
- @BeforeEach
- fun beforeEach() {
- statusRepository = DefaultStatusRepository(statusService, "someclientkey")
- }
-
@Test
fun `when receiving the final result, then it should be emitted and the flow should end`() = runTest {
+ statusRepository = createRepository(testScheduler, testTimeSource)
val response = StatusResponse(resultCode = "final")
whenever(statusService.checkStatus(any(), any())) doReturn response
- statusRepository
- .poll("paymentData", DEFAULT_MAX_POLLING_DURATION)
- .test {
- val expected = Result.success(response)
- assertEquals(expected, awaitItem())
+ val statusFlow = statusRepository
+ .poll("paymentData", MAX_POLLING_DURATION)
+ .test(testScheduler)
+
+ advanceUntilIdle()
+
+ val expected = Result.success(response)
+ assertEquals(expected, statusFlow.latestValue)
- cancelAndIgnoreRemainingEvents()
- }
+ statusFlow.cancel()
}
@Test
fun `when refreshing the status, then the result is emitted immediately`() = runTest {
+ statusRepository = createRepository(testScheduler, testTimeSource)
val refreshResponse = StatusResponse(resultCode = "refresh")
whenever(statusService.checkStatus(any(), any()))
- // return final result first, so polling stops
- .doReturn(StatusResponse(resultCode = "final"), refreshResponse)
+ .doReturn(StatusResponse(resultCode = "pending"), refreshResponse)
- statusRepository
- .poll("paymentData", DEFAULT_MAX_POLLING_DURATION)
- .test {
- skipItems(1)
+ val statusFlow = statusRepository
+ .poll("paymentData", MAX_POLLING_DURATION)
+ .test(testScheduler)
- statusRepository.refreshStatus("test")
+ statusRepository.refreshStatus("test")
+
+ advanceUntilIdle()
+
+ val expected = Result.success(refreshResponse)
+ assertEquals(expected, statusFlow.latestValue)
+
+ statusFlow.cancel()
+ }
- val expected = Result.success(refreshResponse)
- assertEquals(expected, awaitItem())
+ @Test
+ fun `when fetching the status multiple times at the same time, then it is only fetched once`() = runTest {
+ statusRepository = createRepository(testScheduler, testTimeSource)
+ whenever(statusService.checkStatus(any(), any())) doReturn StatusResponse(resultCode = "pending")
+
+ val statusFlow = statusRepository
+ .poll("paymentData", MAX_POLLING_DURATION)
+ .test(testScheduler)
+
+ statusRepository.refreshStatus("test")
+ statusRepository.refreshStatus("test")
+ statusRepository.refreshStatus("test")
+
+ testScheduler.advanceTimeBy(DefaultStatusRepository.DEBOUNCE_TIME + 1)
+
+ verify(statusService, times(1)).checkStatus(any(), any())
+
+ statusFlow.cancel()
+ }
+
+ @Test
+ fun `when polling result is final, then the flow is cancelled`() = runTest {
+ statusRepository = createRepository(testScheduler, testTimeSource)
+ whenever(statusService.checkStatus(any(), any())) doReturn StatusResponse(resultCode = "authorised")
+
+ val statusFlow = statusRepository
+ .poll("paymentData", MAX_POLLING_DURATION)
+ .test(testScheduler)
+
+ testScheduler.advanceTimeBy(DefaultStatusRepository.DEBOUNCE_TIME + 1)
+
+ assertInstanceOf(CancellationException::class.java, statusFlow.completionThrowable)
+
+ statusFlow.cancel()
+ }
+
+ @Test
+ fun `when max polling time is exceeded, then a value is emitted and the flow is cancelled`() = runTest {
+ statusRepository = createRepository(testScheduler, testTimeSource)
+ whenever(statusService.checkStatus(any(), any())) doReturn StatusResponse(resultCode = "pending")
+
+ val statusFlow = statusRepository
+ .poll("paymentData", MAX_POLLING_DURATION)
+ .test(testScheduler)
+
+ testScheduler.advanceTimeBy(MAX_POLLING_DURATION + 2100)
+
+ assertTrue(statusFlow.latestValue.isFailure)
+ assertInstanceOf(CancellationException::class.java, statusFlow.completionThrowable)
+
+ statusFlow.cancel()
+ }
- cancelAndIgnoreRemainingEvents()
- }
+ private fun createRepository(
+ testScheduler: TestCoroutineScheduler,
+ testTimeSource: TimeSource
+ ): DefaultStatusRepository {
+ return DefaultStatusRepository(
+ statusService = statusService,
+ clientKey = "someclientkey",
+ timeSource = testTimeSource,
+ coroutineDispatcher = UnconfinedTestDispatcher(testScheduler),
+ )
}
companion object {
- private val DEFAULT_MAX_POLLING_DURATION = TimeUnit.MINUTES.toMillis(10)
+ private val MAX_POLLING_DURATION = 1.minutes.inWholeMilliseconds
}
}
diff --git a/config/detekt/detekt-baseline.xml b/config/detekt/detekt-baseline.xml
index c59c4cf892..91a8740e51 100644
--- a/config/detekt/detekt-baseline.xml
+++ b/config/detekt/detekt-baseline.xml
@@ -11,14 +11,5 @@
- ForbiddenComment:Logger.kt$Logger$// TODO: 14/02/2019 The idea is for this class to have a system where we can send a stream of logs to the merchant
- ForbiddenComment:CardView.kt$CardView$// TODO: 29/01/2021 get this logic from OutputData
- ForbiddenComment:VoucherAction.kt$VoucherAction$// TODO: remove url when it's fixed from backend side
- ForbiddenComment:ActionComponentDialogFragment.kt$ActionComponentDialogFragment$// TODO: trigger download image flow when user accept storage permission after checking permission type
- ForbiddenComment:ActionComponentDialogFragment.kt$ActionComponentDialogFragment$// TODO: checkout_rationale_title_storage_permission and checkout_rationale_message_storage_permission
- ForbiddenComment:ActionComponentDialogFragment.kt$ActionComponentDialogFragment$// TODO: can be reused based on required permission
- ForbiddenComment:DefaultVoucherDelegate.kt$DefaultVoucherDelegate$// TODO: remove action.url when it's fixed from backend side
- ForbiddenComment:CheckoutSessionInitializer.kt$CheckoutSessionInitializer$// TODO: Once Backend provides the correct amount in the SessionSetupResponse use that in SessionDetails instead of
- ForbiddenComment:SessionDetails.kt$// TODO: Once Backend provides the correct amount in the SessionSetupResponse use that in SessionDetails
diff --git a/config/gradle/versionName.gradle b/config/gradle/buildConfig.gradle
similarity index 85%
rename from config/gradle/versionName.gradle
rename to config/gradle/buildConfig.gradle
index 21cb75cc9f..f43cf2bbcb 100644
--- a/config/gradle/versionName.gradle
+++ b/config/gradle/buildConfig.gradle
@@ -10,5 +10,8 @@ android {
defaultConfig {
buildConfigField "String", "CHECKOUT_VERSION", "\"$version_name\""
}
-}
+ buildFeatures {
+ buildConfig true
+ }
+}
diff --git a/config/gradle/ci.gradle b/config/gradle/ci.gradle
deleted file mode 100644
index 96c11a7606..0000000000
--- a/config/gradle/ci.gradle
+++ /dev/null
@@ -1,17 +0,0 @@
-/*
- * Copyright (c) 2019 Adyen N.V.
- *
- * This file is open source and available under the MIT license. See the LICENSE file for more info.
- *
- * Created by ran on 6/2/2019.
- */
-
-// Notice: The connected android tests are disabled on CI, since Android Studio doesn't
-// officially support macOS Mojave which runs on the Jenkins server.
-// Re-enable it after Android Studio will officially support macOS Mojave,
-// or Android releases will run on a dedicated Jenkins server which runs macOS
-// that supports Android Studio.
-task ci(dependsOn: ['check', 'test', 'connectedAndroidTest']) {
- description = "Continiues integration task dependes on 'check' 'test' and 'runConnectedAndroidTest' tasks."
- group = "verification"
-}
\ No newline at end of file
diff --git a/config/gradle/dependencyGraph.gradle b/config/gradle/dependencyGraph.gradle
index b22a19f8e5..954843f391 100644
--- a/config/gradle/dependencyGraph.gradle
+++ b/config/gradle/dependencyGraph.gradle
@@ -1,5 +1,5 @@
// From: https://github.com/tfcporciuncula/readme-graph/blob/master/gradle/projectDependencyGraph.gradle
-task dependencyGraph {
+tasks.register("dependencyGraph") {
doLast {
def dot = new File(rootProject.rootDir, 'dependency-graph/project.dot')
dot.parentFile.mkdirs()
@@ -43,7 +43,7 @@ task dependencyGraph {
javaProjects.add(project)
}
- project.configurations.all { config ->
+ project.configurations.configureEach { config ->
config.dependencies
.withType(ProjectDependency)
.collect { it.dependencyProject }
@@ -97,7 +97,7 @@ task dependencyGraph {
dot << '\n # Dependencies\n\n'
dependencies.forEach { key, traits ->
- dot << " \"${key.first.path}\" -> \"${key.second.path}\""
+ dot << " \"${key.v1.path}\" -> \"${key.v2.path}\""
if (!traits.isEmpty()) {
dot << " [${traits.join(", ")}]"
}
diff --git a/config/gradle/dokka.gradle b/config/gradle/dokka.gradle
index e74946e12f..9494fbbfba 100644
--- a/config/gradle/dokka.gradle
+++ b/config/gradle/dokka.gradle
@@ -10,7 +10,8 @@
project.plugins.withId("kotlin-android") {
apply plugin: "org.jetbrains.dokka"
- task javadocJar(type: Jar, dependsOn: dokkaJavadoc) {
+ tasks.register("javadocJar", Jar) {
+ dependsOn tasks.named("dokkaJavadoc")
archiveClassifier.set('javadoc')
from dokkaJavadoc.outputDirectory
}
diff --git a/config/gradle/dokkaRoot.gradle b/config/gradle/dokkaRoot.gradle
index 7091bca5b6..8ce02b9404 100644
--- a/config/gradle/dokkaRoot.gradle
+++ b/config/gradle/dokkaRoot.gradle
@@ -9,7 +9,7 @@
apply plugin: "org.jetbrains.dokka"
tasks.named("dokkaHtmlMultiModule") {
- def dokkaDir = "$rootProject.buildDir/docs"
+ def dokkaDir = "${rootProject.layout.buildDirectory.get().asFile}/docs"
outputDirectory.set(file(dokkaDir))
doLast {
copy {
diff --git a/config/gradle/runConnectedAndroidTest.gradle b/config/gradle/runConnectedAndroidTest.gradle
deleted file mode 100644
index 52199acbe1..0000000000
--- a/config/gradle/runConnectedAndroidTest.gradle
+++ /dev/null
@@ -1,22 +0,0 @@
-/*
- * Copyright (c) 2019 Adyen N.V.
- *
- * This file is open source and available under the MIT license. See the LICENSE file for more info.
- *
- * Created by ran on 8/2/2019.
- */
-
-task runConnectedAndroidTest(type: Exec) {
- description = "Runs connected android test on dedicated AVDs."
- group = "verification"
-
- final projectDir = "$rootProject.projectDir"
- final scriptsDir = "$projectDir/config/scripts"
- final moduleName = "$project.name"
- final moduleVersion = "$project.version_name"
-
- workingDir "$scriptsDir"
-
- // TODO disabling instrumented tests until we can make them reliable
-// commandLine './run_connected_android_test.sh', "$moduleName", "$moduleVersion"
-}
\ No newline at end of file
diff --git a/config/gradle/sharedTasks.gradle b/config/gradle/sharedTasks.gradle
index 84248bbd4a..2c21cbdb1e 100644
--- a/config/gradle/sharedTasks.gradle
+++ b/config/gradle/sharedTasks.gradle
@@ -7,8 +7,6 @@
* Created by caiof on 11/2/2019.
*/
-apply from: "${rootDir}/config/gradle/versionName.gradle"
+apply from: "${rootDir}/config/gradle/buildConfig.gradle"
apply from: "${rootDir}/config/gradle/codeQuality.gradle"
-apply from: "${rootDir}/config/gradle/ci.gradle"
apply from: "${rootDir}/config/gradle/release.gradle"
-apply from: "${rootDir}/config/gradle/runConnectedAndroidTest.gradle"
diff --git a/config/gradle/sources.gradle b/config/gradle/sources.gradle
index b7eada6e03..ee680912c8 100644
--- a/config/gradle/sources.gradle
+++ b/config/gradle/sources.gradle
@@ -6,11 +6,11 @@
* Created by ran on 6/2/2019.
*/
-task androidSourcesJar(type: Jar) {
+tasks.register("androidSourcesJar", Jar) {
archiveClassifier.set('sources')
if (project.plugins.findPlugin("com.android.library")) {
from android.sourceSets.main.java.srcDirs
} else {
from sourceSets.main.java.srcDirs
}
-}
\ No newline at end of file
+}
diff --git a/config/module/template/build.gradle b/config/module/template/build.gradle
index 9440cc3aa3..a9cdb3bf30 100644
--- a/config/module/template/build.gradle
+++ b/config/module/template/build.gradle
@@ -10,11 +10,11 @@ ext.mavenArtifactDescription = "Adyen checkout #module_name component client for
apply from: "${rootDir}/config/gradle/sharedTasks.gradle"
android {
- compileSdkVersion compile_sdk_version
+ compileSdk compile_sdk_version
defaultConfig {
- minSdkVersion min_sdk_version
- targetSdkVersion target_sdk_version
+ minSdk min_sdk_version
+ targetSdk target_sdk_version
versionCode version_code
versionName version_name
diff --git a/convenience-stores-jp/build.gradle b/convenience-stores-jp/build.gradle
index 5c0c334f07..a0f8579628 100644
--- a/convenience-stores-jp/build.gradle
+++ b/convenience-stores-jp/build.gradle
@@ -13,13 +13,11 @@ apply from: "${rootDir}/config/gradle/sharedTasks.gradle"
android {
namespace 'com.adyen.checkout.conveniencestoresjp'
- compileSdkVersion compile_sdk_version
+ compileSdk compile_sdk_version
defaultConfig {
- minSdkVersion min_sdk_version
- targetSdkVersion target_sdk_version
- versionCode version_code
- versionName version_name
+ minSdk min_sdk_version
+ targetSdk target_sdk_version
testInstrumentationRunner 'androidx.test.runner.AndroidJUnitRunner'
consumerProguardFiles "consumer-rules.pro"
diff --git a/convenience-stores-jp/src/main/java/com/adyen/checkout/conveniencestoresjp/ConvenienceStoresJPConfiguration.kt b/convenience-stores-jp/src/main/java/com/adyen/checkout/conveniencestoresjp/ConvenienceStoresJPConfiguration.kt
index 7b09b795e8..3cab0365d6 100644
--- a/convenience-stores-jp/src/main/java/com/adyen/checkout/conveniencestoresjp/ConvenienceStoresJPConfiguration.kt
+++ b/convenience-stores-jp/src/main/java/com/adyen/checkout/conveniencestoresjp/ConvenienceStoresJPConfiguration.kt
@@ -112,7 +112,7 @@ fun CheckoutConfiguration.convenienceStoresJP(
return this
}
-fun CheckoutConfiguration.getConvenienceStoresJPConfiguration(): ConvenienceStoresJPConfiguration? {
+internal fun CheckoutConfiguration.getConvenienceStoresJPConfiguration(): ConvenienceStoresJPConfiguration? {
return getConfiguration(PaymentMethodTypes.ECONTEXT_STORES)
}
diff --git a/cse/build.gradle b/cse/build.gradle
index b901eb3604..031932101a 100644
--- a/cse/build.gradle
+++ b/cse/build.gradle
@@ -13,13 +13,11 @@ apply from: "${rootDir}/config/gradle/sharedTasks.gradle"
android {
namespace 'com.adyen.checkout.cse'
- compileSdkVersion compile_sdk_version
+ compileSdk compile_sdk_version
defaultConfig {
- minSdkVersion min_sdk_version
- targetSdkVersion target_sdk_version
- versionCode version_code
- versionName version_name
+ minSdk min_sdk_version
+ targetSdk target_sdk_version
testInstrumentationRunner 'androidx.test.runner.AndroidJUnitRunner'
consumerProguardFiles "consumer-rules.pro"
diff --git a/dependencies.gradle b/dependencies.gradle
index 92212156db..db49c46394 100644
--- a/dependencies.gradle
+++ b/dependencies.gradle
@@ -16,19 +16,19 @@ ext {
// just for example app, don't need to increment
version_code = 1
// The version_name format is "major.minor.patch(-(alpha|beta|rc)[0-9]{2}){0,1}" (e.g. 3.0.0, 3.1.1-alpha04 or 3.1.4-rc01 etc).
- version_name = "5.3.0"
+ version_name = "5.3.1"
// Build Script
- android_gradle_plugin_version = '8.2.0'
+ android_gradle_plugin_version = '8.3.1'
kotlin_version = '1.9.22'
- detekt_gradle_plugin_version = "1.23.4"
+ detekt_gradle_plugin_version = "1.23.5"
dokka_version = "1.9.10"
hilt_version = "2.50"
compose_compiler_version = '1.5.8'
// Code quality
- detekt_version = "1.23.4"
- jacoco_version = '0.8.9'
+ detekt_version = "1.23.5"
+ jacoco_version = '0.8.11'
ktlint_version = '1.0.1'
sonarqube_version = '4.4.1.3373'
@@ -45,9 +45,9 @@ ext {
// Compose Dependencies
compose_activity_version = '1.8.2'
- compose_bom_version = '2023.10.01'
- compose_hilt_version = '1.1.0'
- compose_viewmodel_version = '2.6.2'
+ compose_bom_version = '2024.02.00'
+ compose_hilt_version = '1.2.0'
+ compose_viewmodel_version = '2.7.0'
// Adyen Dependencies
adyen3ds2_version = "2.2.15"
diff --git a/dependency-graph/project.dot b/dependency-graph/project.dot
index 337a0c94f2..964df7374d 100644
--- a/dependency-graph/project.dot
+++ b/dependency-graph/project.dot
@@ -6,17 +6,25 @@ digraph {
# Projects
":3ds2" [fillcolor="#baffc9"];
+ ":ach" [fillcolor="#baffc9"];
":action" [fillcolor="#baffc9"];
+ ":action-core" [fillcolor="#baffc9"];
":await" [fillcolor="#baffc9"];
":bacs" [fillcolor="#baffc9"];
":bcmc" [fillcolor="#baffc9"];
":blik" [fillcolor="#baffc9"];
+ ":boleto" [fillcolor="#baffc9"];
":card" [fillcolor="#baffc9"];
+ ":cashapppay" [fillcolor="#baffc9"];
":checkout-core" [fillcolor="#baffc9"];
+ ":components-compose" [fillcolor="#baffc9"];
":components-core" [fillcolor="#baffc9"];
+ ":convenience-stores-jp" [fillcolor="#baffc9"];
":cse" [fillcolor="#baffc9"];
":dotpay" [fillcolor="#baffc9"];
":drop-in" [fillcolor="#baffc9"];
+ ":drop-in-compose" [fillcolor="#baffc9"];
+ ":econtext" [fillcolor="#baffc9"];
":entercash" [fillcolor="#baffc9"];
":eps" [fillcolor="#baffc9"];
":example-app" [fillcolor="#baffc9"];
@@ -29,16 +37,20 @@ digraph {
":molpay" [fillcolor="#baffc9"];
":online-banking-core" [fillcolor="#baffc9"];
":online-banking-cz" [fillcolor="#baffc9"];
+ ":online-banking-jp" [fillcolor="#baffc9"];
":online-banking-pl" [fillcolor="#baffc9"];
":online-banking-sk" [fillcolor="#baffc9"];
":openbanking" [fillcolor="#baffc9"];
":paybybank" [fillcolor="#baffc9"];
+ ":payeasy" [fillcolor="#baffc9"];
":qr-code" [fillcolor="#baffc9"];
":redirect" [fillcolor="#baffc9"];
":sepa" [fillcolor="#baffc9"];
":sessions-core" [fillcolor="#baffc9"];
+ ":seven-eleven" [fillcolor="#baffc9"];
":test-core" [fillcolor="#baffc9"];
":ui-core" [fillcolor="#baffc9"];
+ ":upi" [fillcolor="#baffc9"];
":voucher" [fillcolor="#baffc9"];
":wechatpay" [fillcolor="#baffc9"];
@@ -46,52 +58,26 @@ digraph {
# Dependencies
- ":3ds2" -> ":ui-core"
- ":3ds2" -> ":3ds2"
- ":3ds2" -> ":test-core" [style=dotted]
- ":action" -> ":3ds2"
- ":action" -> ":await"
- ":action" -> ":qr-code"
- ":action" -> ":redirect"
- ":action" -> ":wechatpay"
- ":action" -> ":voucher"
- ":action" -> ":action"
- ":action" -> ":test-core" [style=dotted]
- ":await" -> ":ui-core"
- ":await" -> ":await"
- ":await" -> ":test-core" [style=dotted]
- ":bacs" -> ":action"
+ ":bacs" -> ":action-core"
":bacs" -> ":ui-core"
+ ":bacs" -> ":sessions-core"
":bacs" -> ":bacs"
":bacs" -> ":test-core" [style=dotted]
- ":bcmc" -> ":action"
- ":bcmc" -> ":card"
- ":bcmc" -> ":bcmc"
- ":bcmc" -> ":test-core" [style=dotted]
- ":blik" -> ":action"
+ ":blik" -> ":action-core"
":blik" -> ":ui-core"
+ ":blik" -> ":sessions-core"
":blik" -> ":blik"
":blik" -> ":test-core" [style=dotted]
- ":card" -> ":action"
- ":card" -> ":cse"
- ":card" -> ":ui-core"
- ":card" -> ":sessions-core"
- ":card" -> ":card"
- ":card" -> ":test-core" [style=dotted]
- ":checkout-core" -> ":checkout-core"
- ":components-core" -> ":checkout-core"
- ":components-core" -> ":components-core"
- ":components-core" -> ":test-core" [style=dotted]
- ":cse" -> ":checkout-core"
- ":cse" -> ":cse"
- ":dotpay" -> ":action"
- ":dotpay" -> ":issuer-list"
- ":dotpay" -> ":dotpay"
- ":drop-in" -> ":action"
+ ":drop-in" -> ":3ds2"
+ ":drop-in" -> ":ach"
+ ":drop-in" -> ":action-core"
":drop-in" -> ":bacs"
":drop-in" -> ":bcmc"
+ ":drop-in" -> ":boleto"
":drop-in" -> ":blik"
":drop-in" -> ":card"
+ ":drop-in" -> ":cashapppay"
+ ":drop-in" -> ":convenience-stores-jp"
":drop-in" -> ":dotpay"
":drop-in" -> ":entercash"
":drop-in" -> ":eps"
@@ -102,90 +88,192 @@ digraph {
":drop-in" -> ":mbway"
":drop-in" -> ":molpay"
":drop-in" -> ":online-banking-cz"
+ ":drop-in" -> ":online-banking-jp"
":drop-in" -> ":online-banking-pl"
":drop-in" -> ":online-banking-sk"
":drop-in" -> ":openbanking"
+ ":drop-in" -> ":payeasy"
":drop-in" -> ":paybybank"
":drop-in" -> ":sepa"
+ ":drop-in" -> ":seven-eleven"
":drop-in" -> ":sessions-core"
+ ":drop-in" -> ":upi"
+ ":drop-in" -> ":wechatpay"
":drop-in" -> ":drop-in"
":drop-in" -> ":test-core" [style=dotted]
- ":entercash" -> ":action"
- ":entercash" -> ":issuer-list"
- ":entercash" -> ":entercash"
- ":eps" -> ":action"
- ":eps" -> ":issuer-list"
- ":eps" -> ":eps"
- ":example-app" -> ":example-app"
- ":example-app" -> ":drop-in" [style=dotted]
- ":giftcard" -> ":action"
- ":giftcard" -> ":cse"
- ":giftcard" -> ":ui-core"
- ":giftcard" -> ":giftcard"
- ":giftcard" -> ":test-core" [style=dotted]
- ":googlepay" -> ":action"
- ":googlepay" -> ":components-core"
- ":googlepay" -> ":googlepay"
- ":googlepay" -> ":test-core" [style=dotted]
- ":ideal" -> ":action"
- ":ideal" -> ":issuer-list"
- ":ideal" -> ":ideal"
- ":instant" -> ":action"
- ":instant" -> ":components-core"
+ ":online-banking-core" -> ":action-core"
+ ":online-banking-core" -> ":ui-core"
+ ":online-banking-core" -> ":sessions-core"
+ ":online-banking-core" -> ":online-banking-core"
+ ":online-banking-core" -> ":test-core" [style=dotted]
+ ":voucher" -> ":ui-core"
+ ":voucher" -> ":voucher"
+ ":voucher" -> ":test-core" [style=dotted]
+ ":ach" -> ":action-core"
+ ":ach" -> ":ui-core"
+ ":ach" -> ":cse"
+ ":ach" -> ":sessions-core"
+ ":ach" -> ":ach"
+ ":ach" -> ":test-core" [style=dotted]
+ ":boleto" -> ":action-core"
+ ":boleto" -> ":ui-core"
+ ":boleto" -> ":sessions-core"
+ ":boleto" -> ":boleto"
+ ":boleto" -> ":test-core" [style=dotted]
+ ":dotpay" -> ":action-core"
+ ":dotpay" -> ":issuer-list"
+ ":dotpay" -> ":dotpay"
+ ":qr-code" -> ":ui-core"
+ ":qr-code" -> ":qr-code"
+ ":qr-code" -> ":test-core" [style=dotted]
+ ":action-core" -> ":await"
+ ":action-core" -> ":qr-code"
+ ":action-core" -> ":redirect"
+ ":action-core" -> ":voucher"
+ ":action-core" -> ":3ds2" [style=dotted]
+ ":action-core" -> ":wechatpay" [style=dotted]
+ ":action-core" -> ":action-core"
+ ":action-core" -> ":test-core" [style=dotted]
+ ":checkout-core" -> ":checkout-core"
+ ":components-core" -> ":checkout-core"
+ ":components-core" -> ":components-core"
+ ":components-core" -> ":test-core" [style=dotted]
+ ":instant" -> ":action-core"
+ ":instant" -> ":sessions-core"
":instant" -> ":instant"
":instant" -> ":test-core" [style=dotted]
- ":issuer-list" -> ":action"
+ ":issuer-list" -> ":action-core"
":issuer-list" -> ":ui-core"
+ ":issuer-list" -> ":sessions-core"
":issuer-list" -> ":issuer-list"
+ ":issuer-list" -> ":3ds2" [style=dotted]
":issuer-list" -> ":test-core" [style=dotted]
- ":mbway" -> ":action"
+ ":issuer-list" -> ":wechatpay" [style=dotted]
+ ":molpay" -> ":action-core"
+ ":molpay" -> ":issuer-list"
+ ":molpay" -> ":molpay"
+ ":mbway" -> ":action-core"
":mbway" -> ":ui-core"
+ ":mbway" -> ":sessions-core"
":mbway" -> ":mbway"
":mbway" -> ":test-core" [style=dotted]
- ":molpay" -> ":action"
- ":molpay" -> ":issuer-list"
- ":molpay" -> ":molpay"
- ":online-banking-core" -> ":action"
- ":online-banking-core" -> ":ui-core"
- ":online-banking-core" -> ":online-banking-core"
- ":online-banking-core" -> ":test-core" [style=dotted]
- ":online-banking-cz" -> ":action"
- ":online-banking-cz" -> ":online-banking-core"
- ":online-banking-cz" -> ":online-banking-cz"
- ":online-banking-pl" -> ":action"
+ ":seven-eleven" -> ":econtext"
+ ":seven-eleven" -> ":seven-eleven"
+ ":await" -> ":ui-core"
+ ":await" -> ":await"
+ ":await" -> ":test-core" [style=dotted]
+ ":online-banking-pl" -> ":action-core"
":online-banking-pl" -> ":issuer-list"
":online-banking-pl" -> ":online-banking-pl"
- ":online-banking-sk" -> ":action"
- ":online-banking-sk" -> ":online-banking-core"
- ":online-banking-sk" -> ":online-banking-sk"
- ":openbanking" -> ":action"
- ":openbanking" -> ":issuer-list"
- ":openbanking" -> ":openbanking"
- ":paybybank" -> ":action"
+ ":action" -> ":3ds2"
+ ":action" -> ":action-core"
+ ":action" -> ":wechatpay"
+ ":action" -> ":action"
+ ":action" -> ":test-core" [style=dotted]
+ ":test-core" -> ":test-core"
+ ":test-core" -> ":checkout-core" [style=dotted]
+ ":online-banking-cz" -> ":action-core"
+ ":online-banking-cz" -> ":online-banking-core"
+ ":online-banking-cz" -> ":online-banking-cz"
+ ":paybybank" -> ":action-core"
":paybybank" -> ":components-core"
":paybybank" -> ":issuer-list"
+ ":paybybank" -> ":sessions-core"
":paybybank" -> ":paybybank"
":paybybank" -> ":test-core" [style=dotted]
- ":qr-code" -> ":ui-core"
- ":qr-code" -> ":qr-code"
- ":qr-code" -> ":test-core" [style=dotted]
+ ":example-app" -> ":example-app"
+ ":example-app" -> ":drop-in" [style=dotted]
+ ":example-app" -> ":components-compose" [style=dotted]
":redirect" -> ":ui-core"
":redirect" -> ":redirect"
":redirect" -> ":test-core" [style=dotted]
- ":sepa" -> ":action"
+ ":online-banking-jp" -> ":econtext"
+ ":online-banking-jp" -> ":online-banking-jp"
+ ":ideal" -> ":action-core"
+ ":ideal" -> ":issuer-list"
+ ":ideal" -> ":ideal"
+ ":components-compose" -> ":components-core"
+ ":components-compose" -> ":sessions-core"
+ ":components-compose" -> ":ui-core"
+ ":components-compose" -> ":components-compose"
+ ":giftcard" -> ":action-core"
+ ":giftcard" -> ":cse"
+ ":giftcard" -> ":ui-core"
+ ":giftcard" -> ":sessions-core"
+ ":giftcard" -> ":giftcard"
+ ":giftcard" -> ":test-core" [style=dotted]
+ ":econtext" -> ":ui-core"
+ ":econtext" -> ":action-core"
+ ":econtext" -> ":sessions-core"
+ ":econtext" -> ":econtext"
+ ":econtext" -> ":3ds2" [style=dotted]
+ ":econtext" -> ":test-core" [style=dotted]
+ ":econtext" -> ":wechatpay" [style=dotted]
+ ":3ds2" -> ":ui-core"
+ ":3ds2" -> ":3ds2"
+ ":3ds2" -> ":test-core" [style=dotted]
+ ":entercash" -> ":action-core"
+ ":entercash" -> ":issuer-list"
+ ":entercash" -> ":entercash"
+ ":eps" -> ":action-core"
+ ":eps" -> ":issuer-list"
+ ":eps" -> ":eps"
+ ":openbanking" -> ":action-core"
+ ":openbanking" -> ":issuer-list"
+ ":openbanking" -> ":openbanking"
+ ":convenience-stores-jp" -> ":econtext"
+ ":convenience-stores-jp" -> ":convenience-stores-jp"
+ ":convenience-stores-jp" -> ":test-core" [style=dotted]
+ ":googlepay" -> ":3ds2"
+ ":googlepay" -> ":action-core"
+ ":googlepay" -> ":components-core"
+ ":googlepay" -> ":sessions-core"
+ ":googlepay" -> ":googlepay"
+ ":googlepay" -> ":test-core" [style=dotted]
+ ":upi" -> ":action-core"
+ ":upi" -> ":ui-core"
+ ":upi" -> ":sessions-core"
+ ":upi" -> ":upi"
+ ":upi" -> ":test-core" [style=dotted]
+ ":drop-in-compose" -> ":drop-in"
+ ":drop-in-compose" -> ":drop-in-compose"
+ ":cashapppay" -> ":action-core"
+ ":cashapppay" -> ":components-core"
+ ":cashapppay" -> ":sessions-core"
+ ":cashapppay" -> ":ui-core"
+ ":cashapppay" -> ":cashapppay"
+ ":cashapppay" -> ":test-core" [style=dotted]
+ ":payeasy" -> ":econtext"
+ ":payeasy" -> ":payeasy"
+ ":cse" -> ":checkout-core"
+ ":cse" -> ":cse"
+ ":sepa" -> ":action-core"
":sepa" -> ":ui-core"
+ ":sepa" -> ":sessions-core"
":sepa" -> ":sepa"
":sepa" -> ":test-core" [style=dotted]
- ":sessions-core" -> ":components-core"
- ":sessions-core" -> ":sessions-core"
- ":sessions-core" -> ":test-core" [style=dotted]
- ":test-core" -> ":test-core"
":ui-core" -> ":components-core"
":ui-core" -> ":ui-core"
- ":voucher" -> ":ui-core"
- ":voucher" -> ":voucher"
- ":voucher" -> ":test-core" [style=dotted]
":wechatpay" -> ":ui-core"
":wechatpay" -> ":wechatpay"
":wechatpay" -> ":test-core" [style=dotted]
+ ":bcmc" -> ":3ds2"
+ ":bcmc" -> ":action-core"
+ ":bcmc" -> ":card"
+ ":bcmc" -> ":sessions-core"
+ ":bcmc" -> ":bcmc"
+ ":bcmc" -> ":test-core" [style=dotted]
+ ":online-banking-sk" -> ":action-core"
+ ":online-banking-sk" -> ":online-banking-core"
+ ":online-banking-sk" -> ":online-banking-sk"
+ ":sessions-core" -> ":components-core"
+ ":sessions-core" -> ":sessions-core"
+ ":sessions-core" -> ":test-core" [style=dotted]
+ ":card" -> ":3ds2"
+ ":card" -> ":action-core"
+ ":card" -> ":cse"
+ ":card" -> ":ui-core"
+ ":card" -> ":sessions-core"
+ ":card" -> ":card"
+ ":card" -> ":test-core" [style=dotted]
}
diff --git a/dependency-graph/project.dot.png b/dependency-graph/project.dot.png
index cb34edec47..0c4d9a9c65 100644
Binary files a/dependency-graph/project.dot.png and b/dependency-graph/project.dot.png differ
diff --git a/docs/ADDRESS_LOOKUP.md b/docs/ADDRESS_LOOKUP.md
index 1b221e22c9..05e3b913cf 100644
--- a/docs/ADDRESS_LOOKUP.md
+++ b/docs/ADDRESS_LOOKUP.md
@@ -9,9 +9,52 @@
```
## Integrating with Address Lookup Functionality
- If you're integrating with Drop-in:
- - Implement the mandatory `onAddressLookupQueryChanged(query: String)` callback and optional `onAddressLookupCompletion(lookupAddress: LookupAddress)` callback.
+ - Implement the mandatory `onAddressLookupQueryChanged(query: String)` callback and optional `onAddressLookupCompletion(lookupAddress: LookupAddress)` callback in your implementation of DropInService.
- Pass the result of these actions by using `AddressLookupDropInServiceResult` class.
+ ```kotlin
+ override fun onAddressLookupQueryChanged(query: String) {
+ // Use the query parameter to make a call to your desired maps endpoint
+ // Map the address objects LookupAddress object and
+ // pass it back to Drop-in as follows:
+ sendAddressLookupResult(AddressLookupDropInServiceResult.LookupResult(options))
+ }
+
+ // Optionally use this callback to get the complete details for a LookupAddress option selected by the shopper
+ override fun onAddressLookupCompletion(lookupAddress: LookupAddress): Boolean {
+ // Make a call to your desired maps endpoint and pass the complete
+ // LookupAddress object back to Drop-in as follows:
+ sendAddressLookupResult(AddressLookupDropInServiceResult.LookupComplete(completeLookupAddress))
+ return true // Return false if you do not need to make an api call
+
+ }
+ ```
- If you're integrating with standalone `CardComponent`:
- Set `AddressLookupCallback` via `CardComponent.setAddressLookupCallback(AddressLookupCallback)` function to receive the related events.
- Pass the result of these actions by calling `CardComponent.setAddressLookupResult(addressLookupResult: AddressLookupResult)`.
+ ```kotlin
+ cardComponent.setAddressLookupCallback(object : AddressLookupCallback {
+ override fun onQueryChanged(query: String) {
+ // Use the query parameter to make a call to your desired maps endpoint
+ // Map the address objects LookupAddress object and
+ // pass it back to card component as follows:
+ cardComponent.updateAddressLookupOptions(options)
+ }
+
+ // Optionally use this callback to get the complete details for a LookupAddress option selected by the shopper
+ override fun onLookupCompletion(lookupAddress: LookupAddress): Boolean {
+ // Make a call to your desired maps endpoint and pass the complete
+ // LookupAddress object back to card component as follows:
+ cardComponent.setAddressLookupResult(AddressLookupResult.Completed(completeLookupAddress))
+ return true // Return false if you do not need to make an api call
+ }
+ })
+ ```
- Delegate back pressed event to `CardComponent` by calling `CardComponent.handleBackPress()` which returns true if the back press is handled by Adyen SDK and false otherwise.
+ ```kotlin
+ override fun onBackPressed() {
+ if (cardComponent?.handleBackPress() == true) return
+ super.onBackPressed()
+ }
+ ```
+## Screenshots
+![address-lookup](https://github.com/Adyen/adyen-android/assets/6615094/ee671606-fbf4-4674-96ec-99a804e53d2e)
diff --git a/dotpay/build.gradle b/dotpay/build.gradle
index 3c38341e1e..dd4376d7dc 100644
--- a/dotpay/build.gradle
+++ b/dotpay/build.gradle
@@ -21,13 +21,11 @@ apply from: "${rootDir}/config/gradle/sharedTasks.gradle"
android {
namespace 'com.adyen.checkout.dotpay'
- compileSdkVersion compile_sdk_version
+ compileSdk compile_sdk_version
defaultConfig {
- minSdkVersion min_sdk_version
- targetSdkVersion target_sdk_version
- versionCode version_code
- versionName version_name
+ minSdk min_sdk_version
+ targetSdk target_sdk_version
testInstrumentationRunner 'androidx.test.runner.AndroidJUnitRunner'
consumerProguardFiles "consumer-rules.pro"
diff --git a/dotpay/src/main/java/com/adyen/checkout/dotpay/DotpayConfiguration.kt b/dotpay/src/main/java/com/adyen/checkout/dotpay/DotpayConfiguration.kt
index 7ca83938d3..a7399d7d48 100644
--- a/dotpay/src/main/java/com/adyen/checkout/dotpay/DotpayConfiguration.kt
+++ b/dotpay/src/main/java/com/adyen/checkout/dotpay/DotpayConfiguration.kt
@@ -116,7 +116,7 @@ fun CheckoutConfiguration.dotpay(
return this
}
-fun CheckoutConfiguration.getDotpayConfiguration(): DotpayConfiguration? {
+internal fun CheckoutConfiguration.getDotpayConfiguration(): DotpayConfiguration? {
return getConfiguration(PaymentMethodTypes.DOTPAY)
}
diff --git a/drop-in-compose/build.gradle b/drop-in-compose/build.gradle
index 6cefd510b4..b6d9386957 100644
--- a/drop-in-compose/build.gradle
+++ b/drop-in-compose/build.gradle
@@ -20,13 +20,11 @@ apply from: "${rootDir}/config/gradle/sharedTasks.gradle"
android {
namespace 'com.adyen.checkout.dropin.compose'
- compileSdkVersion compile_sdk_version
+ compileSdk compile_sdk_version
defaultConfig {
- minSdkVersion min_sdk_version
- targetSdkVersion target_sdk_version
- versionCode version_code
- versionName version_name
+ minSdk min_sdk_version
+ targetSdk target_sdk_version
testInstrumentationRunner 'androidx.test.runner.AndroidJUnitRunner'
consumerProguardFiles "consumer-rules.pro"
diff --git a/drop-in/build.gradle b/drop-in/build.gradle
index b30a953acc..085efd47b2 100644
--- a/drop-in/build.gradle
+++ b/drop-in/build.gradle
@@ -21,13 +21,11 @@ apply from: "${rootDir}/config/gradle/sharedTasks.gradle"
android {
namespace 'com.adyen.checkout.dropin'
- compileSdkVersion compile_sdk_version
+ compileSdk compile_sdk_version
defaultConfig {
- minSdkVersion min_sdk_version
- targetSdkVersion target_sdk_version
- versionCode version_code
- versionName version_name
+ minSdk min_sdk_version
+ targetSdk target_sdk_version
testInstrumentationRunner 'androidx.test.runner.AndroidJUnitRunner'
consumerProguardFiles "consumer-rules.pro"
diff --git a/drop-in/src/main/java/com/adyen/checkout/dropin/DropInConfiguration.kt b/drop-in/src/main/java/com/adyen/checkout/dropin/DropInConfiguration.kt
index 2645bbd554..e6df140c20 100644
--- a/drop-in/src/main/java/com/adyen/checkout/dropin/DropInConfiguration.kt
+++ b/drop-in/src/main/java/com/adyen/checkout/dropin/DropInConfiguration.kt
@@ -475,6 +475,6 @@ fun CheckoutConfiguration.dropIn(
return this
}
-fun CheckoutConfiguration.getDropInConfiguration(): DropInConfiguration? {
+internal fun CheckoutConfiguration.getDropInConfiguration(): DropInConfiguration? {
return getConfiguration(DROP_IN_CONFIG_KEY)
}
diff --git a/drop-in/src/test/java/com/adyen/checkout/dropin/DropInConfigurationTest.kt b/drop-in/src/test/java/com/adyen/checkout/dropin/DropInConfigurationTest.kt
index 3bcb49bc20..d711e96b1a 100644
--- a/drop-in/src/test/java/com/adyen/checkout/dropin/DropInConfigurationTest.kt
+++ b/drop-in/src/test/java/com/adyen/checkout/dropin/DropInConfigurationTest.kt
@@ -1,22 +1,18 @@
package com.adyen.checkout.dropin
import com.adyen.checkout.adyen3ds2.Adyen3DS2Configuration
-import com.adyen.checkout.adyen3ds2.getAdyen3DS2Configuration
import com.adyen.checkout.card.CardConfiguration
-import com.adyen.checkout.card.getCardConfiguration
import com.adyen.checkout.components.core.Amount
import com.adyen.checkout.components.core.AnalyticsConfiguration
import com.adyen.checkout.components.core.AnalyticsLevel
import com.adyen.checkout.components.core.CheckoutConfiguration
+import com.adyen.checkout.components.core.PaymentMethodTypes
import com.adyen.checkout.core.Environment
+import com.adyen.checkout.googlepay.GooglePayComponent
import com.adyen.checkout.googlepay.GooglePayConfiguration
-import com.adyen.checkout.googlepay.getGooglePayConfiguration
import com.adyen.checkout.ideal.IdealConfiguration
-import com.adyen.checkout.ideal.getIdealConfiguration
import com.adyen.checkout.redirect.RedirectConfiguration
-import com.adyen.checkout.redirect.getRedirectConfiguration
import com.adyen.checkout.wechatpay.WeChatPayActionConfiguration
-import com.adyen.checkout.wechatpay.getWeChatPayActionConfiguration
import org.junit.jupiter.api.Assertions.assertEquals
import org.junit.jupiter.api.Assertions.assertNotNull
import org.junit.jupiter.api.Test
@@ -129,12 +125,14 @@ internal class DropInConfigurationTest {
actualDropInConfig?.isRemovingStoredPaymentMethodsEnabled,
)
assertEquals(config.overriddenPaymentMethodInformation, actualDropInConfig?.overriddenPaymentMethodInformation)
- assertNotNull(actual.getCardConfiguration())
- assertNotNull(actual.getGooglePayConfiguration())
- assertNotNull(actual.getIdealConfiguration())
- assertNotNull(actual.getAdyen3DS2Configuration())
- assertNotNull(actual.getRedirectConfiguration())
- assertNotNull(actual.getWeChatPayActionConfiguration())
+ assertNotNull(actual.getConfiguration(PaymentMethodTypes.SCHEME))
+ assertNotNull(
+ GooglePayComponent.PAYMENT_METHOD_TYPES.firstNotNullOfOrNull { key -> actual.getConfiguration(key) },
+ )
+ assertNotNull(actual.getConfiguration(PaymentMethodTypes.IDEAL))
+ assertNotNull(actual.getActionConfiguration(Adyen3DS2Configuration::class.java))
+ assertNotNull(actual.getActionConfiguration(RedirectConfiguration::class.java))
+ assertNotNull(actual.getActionConfiguration(WeChatPayActionConfiguration::class.java))
}
companion object {
diff --git a/econtext/build.gradle b/econtext/build.gradle
index 6f6d5f89ab..67715bcc74 100644
--- a/econtext/build.gradle
+++ b/econtext/build.gradle
@@ -21,13 +21,11 @@ apply from: "${rootDir}/config/gradle/sharedTasks.gradle"
android {
namespace 'com.adyen.checkout.econtext'
- compileSdkVersion compile_sdk_version
+ compileSdk compile_sdk_version
defaultConfig {
- minSdkVersion min_sdk_version
- targetSdkVersion target_sdk_version
- versionCode version_code
- versionName version_name
+ minSdk min_sdk_version
+ targetSdk target_sdk_version
testInstrumentationRunner 'androidx.test.runner.AndroidJUnitRunner'
consumerProguardFiles "consumer-rules.pro"
diff --git a/entercash/build.gradle b/entercash/build.gradle
index a828f8ee6d..c794d5f23a 100644
--- a/entercash/build.gradle
+++ b/entercash/build.gradle
@@ -21,13 +21,11 @@ apply from: "${rootDir}/config/gradle/sharedTasks.gradle"
android {
namespace 'com.adyen.checkout.entercash'
- compileSdkVersion compile_sdk_version
+ compileSdk compile_sdk_version
defaultConfig {
- minSdkVersion min_sdk_version
- targetSdkVersion target_sdk_version
- versionCode version_code
- versionName version_name
+ minSdk min_sdk_version
+ targetSdk target_sdk_version
testInstrumentationRunner 'androidx.test.runner.AndroidJUnitRunner'
consumerProguardFiles "consumer-rules.pro"
diff --git a/entercash/src/main/java/com/adyen/checkout/entercash/EntercashConfiguration.kt b/entercash/src/main/java/com/adyen/checkout/entercash/EntercashConfiguration.kt
index 1a6d5e4d07..c7465bfbc8 100644
--- a/entercash/src/main/java/com/adyen/checkout/entercash/EntercashConfiguration.kt
+++ b/entercash/src/main/java/com/adyen/checkout/entercash/EntercashConfiguration.kt
@@ -116,7 +116,7 @@ fun CheckoutConfiguration.entercash(
return this
}
-fun CheckoutConfiguration.getEntercashConfiguration(): EntercashConfiguration? {
+internal fun CheckoutConfiguration.getEntercashConfiguration(): EntercashConfiguration? {
return getConfiguration(PaymentMethodTypes.ENTERCASH)
}
diff --git a/eps/build.gradle b/eps/build.gradle
index d93edaf52f..e9a92f9234 100644
--- a/eps/build.gradle
+++ b/eps/build.gradle
@@ -21,13 +21,11 @@ apply from: "${rootDir}/config/gradle/sharedTasks.gradle"
android {
namespace 'com.adyen.checkout.eps'
- compileSdkVersion compile_sdk_version
+ compileSdk compile_sdk_version
defaultConfig {
- minSdkVersion min_sdk_version
- targetSdkVersion target_sdk_version
- versionCode version_code
- versionName version_name
+ minSdk min_sdk_version
+ targetSdk target_sdk_version
testInstrumentationRunner 'androidx.test.runner.AndroidJUnitRunner'
consumerProguardFiles "consumer-rules.pro"
diff --git a/eps/src/main/java/com/adyen/checkout/eps/EPSConfiguration.kt b/eps/src/main/java/com/adyen/checkout/eps/EPSConfiguration.kt
index 8034628d7d..b144ff3a3a 100644
--- a/eps/src/main/java/com/adyen/checkout/eps/EPSConfiguration.kt
+++ b/eps/src/main/java/com/adyen/checkout/eps/EPSConfiguration.kt
@@ -127,7 +127,7 @@ fun CheckoutConfiguration.eps(
return this
}
-fun CheckoutConfiguration.getEPSConfiguration(): EPSConfiguration? {
+internal fun CheckoutConfiguration.getEPSConfiguration(): EPSConfiguration? {
return getConfiguration(PaymentMethodTypes.EPS)
}
diff --git a/example-app/build.gradle b/example-app/build.gradle
index 7d8c258ece..9d5b04bcdd 100644
--- a/example-app/build.gradle
+++ b/example-app/build.gradle
@@ -14,31 +14,29 @@ plugins {
}
apply from: "${rootDir}/config/gradle/codeQuality.gradle"
-apply from: "${rootDir}/config/gradle/ci.gradle"
if (file("local.gradle").exists()) {
apply from: "local.gradle"
-} else if (System.getenv('CI')) {
- // if building from CI use example file as it is to ensure the build passes
+} else if (!isIDEBuild()) {
+ // if not building from an IDE, use example file as it is to ensure the build passes (for CI, renovate, etc)
apply from: "example.local.gradle"
} else {
throw new GradleException("File example-app/local.gradle not found. Check example-app/README.md for more instructions.")
}
-// This runConnectedAndroidTest.gradle script is applied,
-// so it will be possible to run the example app connected android tests
-// in Jenkins release process.
-apply from: "${rootDir}/config/gradle/runConnectedAndroidTest.gradle"
+def isIDEBuild() {
+ return project.properties['android.injected.invoked.from.ide'] == 'true'
+}
android {
- compileSdkVersion compile_sdk_version
+ compileSdk compile_sdk_version
defaultConfig {
applicationId "com.adyen.checkout.example"
namespace "com.adyen.checkout.example"
- minSdkVersion min_sdk_version
- targetSdkVersion target_sdk_version
+ minSdk min_sdk_version
+ targetSdk target_sdk_version
versionCode version_code
versionName version_name
@@ -59,6 +57,7 @@ android {
buildFeatures {
compose true
viewBinding true
+ buildConfig true
}
composeOptions {
@@ -70,7 +69,8 @@ dependencies {
// Checkout
implementation project(':drop-in')
implementation project(':components-compose')
-// implementation "com.adyen.checkout:drop-in:5.3.0"
+// implementation "com.adyen.checkout:drop-in:5.3.1"
+// implementation "com.adyen.checkout:components-compose:5.3.1"
// Dependencies
implementation libraries.kotlinCoroutines
diff --git a/giftcard/build.gradle b/giftcard/build.gradle
index 7b25e98f9e..2182400f76 100644
--- a/giftcard/build.gradle
+++ b/giftcard/build.gradle
@@ -20,13 +20,11 @@ apply from: "${rootDir}/config/gradle/sharedTasks.gradle"
android {
namespace 'com.adyen.checkout.giftcard'
- compileSdkVersion compile_sdk_version
+ compileSdk compile_sdk_version
defaultConfig {
- minSdkVersion min_sdk_version
- targetSdkVersion target_sdk_version
- versionCode version_code
- versionName version_name
+ minSdk min_sdk_version
+ targetSdk target_sdk_version
testInstrumentationRunner 'androidx.test.runner.AndroidJUnitRunner'
consumerProguardFiles "consumer-rules.pro"
diff --git a/giftcard/src/main/java/com/adyen/checkout/giftcard/GiftCardConfiguration.kt b/giftcard/src/main/java/com/adyen/checkout/giftcard/GiftCardConfiguration.kt
index 30c1002d29..c10c34159c 100644
--- a/giftcard/src/main/java/com/adyen/checkout/giftcard/GiftCardConfiguration.kt
+++ b/giftcard/src/main/java/com/adyen/checkout/giftcard/GiftCardConfiguration.kt
@@ -146,7 +146,7 @@ fun CheckoutConfiguration.giftCard(
return this
}
-fun CheckoutConfiguration.getGiftCardConfiguration(): GiftCardConfiguration? {
+internal fun CheckoutConfiguration.getGiftCardConfiguration(): GiftCardConfiguration? {
return getConfiguration(PaymentMethodTypes.GIFTCARD)
}
diff --git a/googlepay/build.gradle b/googlepay/build.gradle
index be28dc94a0..1d499b1379 100644
--- a/googlepay/build.gradle
+++ b/googlepay/build.gradle
@@ -21,13 +21,11 @@ apply from: "${rootDir}/config/gradle/sharedTasks.gradle"
android {
namespace 'com.adyen.checkout.googlepay'
- compileSdkVersion compile_sdk_version
+ compileSdk compile_sdk_version
defaultConfig {
- minSdkVersion min_sdk_version
- targetSdkVersion target_sdk_version
- versionCode version_code
- versionName version_name
+ minSdk min_sdk_version
+ targetSdk target_sdk_version
testInstrumentationRunner 'androidx.test.runner.AndroidJUnitRunner'
consumerProguardFiles "consumer-rules.pro"
diff --git a/googlepay/src/main/java/com/adyen/checkout/googlepay/GooglePayConfiguration.kt b/googlepay/src/main/java/com/adyen/checkout/googlepay/GooglePayConfiguration.kt
index 53827e4b6e..70a2bb0b4f 100644
--- a/googlepay/src/main/java/com/adyen/checkout/googlepay/GooglePayConfiguration.kt
+++ b/googlepay/src/main/java/com/adyen/checkout/googlepay/GooglePayConfiguration.kt
@@ -426,10 +426,8 @@ fun CheckoutConfiguration.googlePay(
return this
}
-fun CheckoutConfiguration.getGooglePayConfiguration(): GooglePayConfiguration? {
- return GooglePayComponent.PAYMENT_METHOD_TYPES.firstNotNullOfOrNull { key ->
- getConfiguration(key)
- }
+internal fun CheckoutConfiguration.getGooglePayConfiguration(): GooglePayConfiguration? {
+ return GooglePayComponent.PAYMENT_METHOD_TYPES.firstNotNullOfOrNull { key -> getConfiguration(key) }
}
internal fun GooglePayConfiguration.toCheckoutConfiguration(): CheckoutConfiguration {
diff --git a/gradle.properties b/gradle.properties
index 62eaa483d3..abee3a5a78 100644
--- a/gradle.properties
+++ b/gradle.properties
@@ -11,7 +11,6 @@ android.nonTransitiveRClass=false
# Disable some unused build features in the Android Gradle Plugin to improve build speed.
android.defaults.buildfeatures.aidl=false
-android.defaults.buildfeatures.buildconfig=true
android.defaults.buildfeatures.renderscript=false
android.defaults.buildfeatures.resvalues=false
android.defaults.buildfeatures.shaders=false
diff --git a/gradle/verification-metadata.xml b/gradle/verification-metadata.xml
index 135300d3c4..8dbd49e9bd 100644
--- a/gradle/verification-metadata.xml
+++ b/gradle/verification-metadata.xml
@@ -20,23 +20,7 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
@@ -49,22 +33,6 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
@@ -81,14 +49,6 @@
-
-
-
-
-
-
-
-
@@ -97,38 +57,6 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
@@ -137,48 +65,11 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
@@ -195,14 +86,6 @@
-
-
-
-
-
-
-
-
@@ -243,21 +126,10 @@
-
-
-
-
-
-
-
-
-
-
-
@@ -304,20 +176,12 @@
-
-
-
-
-
-
-
-
-
-
-
+
+
+
-
-
+
+
@@ -341,14 +205,6 @@
-
-
-
-
-
-
-
-
@@ -370,14 +226,6 @@
-
-
-
-
-
-
-
-
@@ -458,22 +306,6 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
@@ -506,114 +338,73 @@
-
-
-
+
+
+
-
-
+
+
-
-
-
+
+
+
-
-
-
-
+
+
-
-
-
+
+
+
-
-
-
-
+
+
-
-
-
+
+
+
+
+
+
-
-
-
+
+
+
-
-
-
+
+
+
-
-
+
+
-
-
-
+
+
+
-
+
-
-
-
+
+
+
-
-
+
+
-
-
-
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
@@ -624,89 +415,97 @@
-
-
-
+
+
+
-
-
+
+
-
-
-
+
+
+
-
+
-
-
-
+
+
+
-
-
+
+
-
-
-
+
+
+
-
+
-
-
-
+
+
+
-
-
-
+
+
+
-
+
-
-
-
+
+
+
-
-
+
+
-
-
-
+
+
+
-
+
-
-
-
+
+
+
-
-
+
+
-
-
-
+
+
+
-
+
-
-
-
+
+
+
-
-
+
+
+
+
+
+
+
+
+
+
@@ -714,7963 +513,3735 @@
-
-
-
+
+
+
+
+
+
-
-
-
+
+
+
-
-
+
+
-
-
-
+
+
+
-
-
+
+
-
-
-
+
+
+
-
-
+
+
-
-
-
+
+
+
-
-
+
+
-
-
-
+
+
+
-
-
+
+
-
-
-
+
+
+
-
-
+
+
-
-
-
+
+
+
-
-
+
+
-
-
-
+
+
+
-
-
+
+
-
-
-
+
+
+
-
-
+
+
-
-
-
+
+
+
-
-
+
+
-
-
-
+
+
+
-
-
+
+
-
-
-
+
+
+
-
-
+
+
-
-
-
-
-
-
+
+
+
-
-
-
+
+
+
-
-
+
+
-
-
-
-
-
-
+
+
+
-
-
-
+
+
+
-
-
+
+
-
-
-
+
+
+
-
-
-
-
+
+
-
-
-
+
+
+
-
-
+
+
-
-
-
+
+
+
-
-
+
+
-
-
-
+
+
+
-
-
+
+
-
-
-
+
+
+
-
-
+
+
-
-
-
+
+
+
-
-
+
+
-
-
-
-
-
-
+
+
+
-
-
-
+
+
+
-
-
+
+
-
-
-
+
+
+
-
-
+
+
-
-
-
+
+
+
-
-
+
+
-
-
-
+
+
+
-
-
+
+
-
-
-
+
+
+
-
-
+
+
-
-
-
+
+
+
-
-
+
+
-
-
-
+
+
+
-
-
+
+
-
-
-
-
-
-
+
+
+
-
-
-
+
+
+
-
-
+
+
-
-
-
+
+
+
-
-
+
+
-
-
-
+
+
+
-
-
+
+
-
-
-
-
-
-
+
+
+
-
-
-
+
+
+
-
-
+
+
-
-
-
-
-
-
+
+
+
-
-
-
+
+
+
-
-
+
+
-
-
-
+
+
+
-
-
+
+
-
-
-
-
-
-
+
+
+
-
-
-
+
+
+
-
-
+
+
-
-
-
+
+
+
-
-
+
+
-
-
-
-
-
-
+
+
+
-
-
-
+
+
+
-
-
+
+
-
-
-
+
+
+
-
-
+
+
-
-
-
+
+
+
-
-
+
+
-
-
-
+
+
+
-
-
+
+
-
-
-
+
+
+
-
-
+
+
-
-
-
+
+
+
-
-
+
+
-
-
-
+
+
+
-
-
+
+
-
-
-
+
+
+
+
+
+
-
-
-
+
+
+
-
-
+
+
-
-
-
+
+
+
+
+
+
-
-
-
+
+
+
-
-
+
+
-
-
-
+
+
+
-
-
+
+
-
-
-
+
+
+
-
-
+
+
-
-
-
+
+
+
-
-
+
+
-
-
-
+
+
+
-
-
+
+
-
-
-
+
+
+
-
-
+
+
-
-
-
+
+
+
-
-
+
+
-
-
-
+
+
+
-
-
+
+
-
-
-
+
+
+
-
-
+
+
-
-
-
+
+
+
-
-
+
+
-
-
-
+
+
+
-
-
+
+
-
-
-
-
-
-
+
+
+
-
-
-
+
+
+
-
-
+
+
-
-
-
+
+
+
-
-
-
-
+
+
-
-
-
+
+
+
+
+
+
-
-
-
+
+
+
-
-
+
+
-
-
-
+
+
+
-
-
+
+
-
-
-
+
+
+
-
-
+
+
-
-
-
+
+
+
-
-
+
+
-
-
-
+
+
+
-
-
+
+
-
-
-
+
+
+
-
-
+
+
-
-
-
+
+
+
-
-
+
+
-
-
-
+
+
+
-
-
+
+
-
-
-
+
+
+
-
-
+
+
-
-
-
+
+
+
-
-
+
+
-
-
-
+
+
+
-
-
+
+
-
-
-
+
+
+
-
-
-
+
+
+
-
-
+
+
-
-
-
+
+
+
-
-
+
+
-
-
-
+
+
+
-
-
+
+
-
-
-
-
-
-
+
+
+
-
-
-
-
+
+
-
-
-
+
+
+
-
-
+
+
-
-
-
+
+
+
+
+
+
-
-
-
+
+
+
-
-
+
+
-
-
-
+
+
+
-
-
+
+
-
-
-
+
+
+
-
-
-
+
+
+
-
-
+
+
-
-
-
+
+
+
-
-
+
+
-
-
-
+
+
+
-
-
+
+
-
-
-
+
+
+
-
-
-
-
-
-
-
+
+
-
-
-
+
+
+
-
-
+
+
-
-
-
-
-
-
+
+
+
-
-
-
-
-
-
+
+
+
-
-
-
+
+
+
-
-
+
+
-
-
-
+
+
+
-
-
+
+
-
-
-
+
+
+
-
-
+
+
-
-
-
+
+
+
-
-
+
+
-
-
-
-
-
-
+
+
+
-
-
-
+
+
+
-
-
+
+
-
-
-
+
+
+
-
-
+
+
-
-
-
+
+
+
-
-
+
+
-
-
-
+
+
+
-
-
+
+