Skip to content

Commit

Permalink
Merge pull request #1925 from Adyen/develop
Browse files Browse the repository at this point in the history
Release 5.8.0
  • Loading branch information
ozgur00 authored Dec 5, 2024
2 parents 6c5f6d2 + 71d88ce commit a456abd
Show file tree
Hide file tree
Showing 305 changed files with 7,862 additions and 1,548 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/assemble.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
java-version: 17

- name: Gradle cache
uses: gradle/actions/setup-gradle@v3
uses: gradle/actions/setup-gradle@v4
with:
cache-read-only: false

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/check_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
java-version: 17

- name: Gradle cache
uses: gradle/actions/setup-gradle@v3
uses: gradle/actions/setup-gradle@v4
with:
cache-read-only: true

Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/code_analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
java-version: 17

- name: Gradle cache
uses: gradle/actions/setup-gradle@v3
uses: gradle/actions/setup-gradle@v4
with:
cache-read-only: true

Expand All @@ -42,7 +42,7 @@ jobs:
java-version: 17

- name: Gradle cache
uses: gradle/actions/setup-gradle@v3
uses: gradle/actions/setup-gradle@v4
with:
cache-read-only: true

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/generate_dependency_graph.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
java-version: 17

- name: Gradle cache
uses: gradle/actions/setup-gradle@v3
uses: gradle/actions/setup-gradle@v4
with:
cache-read-only: true

Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/publish_docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
java-version: 17

- name: Gradle cache
uses: gradle/actions/setup-gradle@v3
uses: gradle/actions/setup-gradle@v4
with:
cache-read-only: true

Expand All @@ -38,7 +38,7 @@ jobs:

# Deploy to GitHub Pages
- name: Deploy GitHub Pages
uses: JamesIves/[email protected].4
uses: JamesIves/[email protected].9
with:
BRANCH: gh-pages
FOLDER: build/docs/
4 changes: 2 additions & 2 deletions .github/workflows/publish_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
java-version: 17

- name: Gradle cache
uses: gradle/actions/setup-gradle@v3
uses: gradle/actions/setup-gradle@v4
with:
cache-read-only: true

Expand Down Expand Up @@ -77,5 +77,5 @@ jobs:
tag_name: ${{ env.PROJECT_VERSION }}
release_name: ${{ env.PROJECT_VERSION }}
body_path: ${{ github.workspace }}/RELEASE_NOTES.md
draft: false
draft: true
prerelease: false
4 changes: 2 additions & 2 deletions .github/workflows/run_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
java-version: 17

- name: Gradle cache
uses: gradle/actions/setup-gradle@v3
uses: gradle/actions/setup-gradle@v4
with:
cache-read-only: false

Expand All @@ -42,7 +42,7 @@ jobs:
java-version: 17

- name: Gradle cache
uses: gradle/actions/setup-gradle@v3
uses: gradle/actions/setup-gradle@v4
with:
cache-read-only: false

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/run_ui_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:
java-version: 17

- name: Gradle cache
uses: gradle/actions/setup-gradle@v3
uses: gradle/actions/setup-gradle@v4
with:
cache-read-only: false

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/sonar_cloud.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
java-version: 17

- name: Gradle cache
uses: gradle/actions/setup-gradle@v3
uses: gradle/actions/setup-gradle@v4
with:
cache-read-only: true

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/update_verification_metadata.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
java-version: 17

- name: Gradle cache
uses: gradle/actions/setup-gradle@v3
uses: gradle/actions/setup-gradle@v4
with:
cache-read-only: true

Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/validate_public_api.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
java-version: 17

- name: Gradle cache
uses: gradle/actions/setup-gradle@v3
uses: gradle/actions/setup-gradle@v4
with:
cache-read-only: true

Expand All @@ -28,10 +28,10 @@ jobs:
bash ./scripts/process_api_changes.sh
- name: Comment on PR
uses: thollander/actions-comment-pull-request@v2
uses: thollander/actions-comment-pull-request@v3
with:
filePath: "${{ github.workspace }}/api_changes.md"
comment_tag: api_changes
file-path: "${{ github.workspace }}/api_changes.md"
comment-tag: api_changes
mode: recreate

- name: Check if successful
Expand Down
22 changes: 11 additions & 11 deletions 3ds2/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@
*/

plugins {
id 'com.android.library'
id 'kotlin-android'
id 'kotlin-parcelize'
alias libs.plugins.android.library
alias libs.plugins.kotlin.android
alias libs.plugins.kotlin.parcelize
}

// Maven artifact
Expand All @@ -21,11 +21,11 @@ apply from: "${rootDir}/config/gradle/sharedTasks.gradle"

android {
namespace 'com.adyen.checkout.adyen3ds2'
compileSdk compile_sdk_version
compileSdk libs.versions.compile.sdk.get().toInteger()

defaultConfig {
minSdk min_sdk_version
targetSdk target_sdk_version
minSdk libs.versions.min.sdk.get().toInteger()
targetSdk libs.versions.target.sdk.get().toInteger()

testInstrumentationRunner 'androidx.test.runner.AndroidJUnitRunner'
consumerProguardFiles "consumer-rules.pro"
Expand All @@ -41,14 +41,14 @@ dependencies {
api project(':ui-core')

// Dependencies
api libraries.adyen3ds2
api libs.adyen3ds2

//Tests
testImplementation testFixtures(project(':test-core'))
testImplementation testFixtures(project(':components-core'))
testImplementation testFixtures(project(':ui-core'))
testImplementation testLibraries.json
testImplementation testLibraries.junit5
testImplementation testLibraries.mockito
testImplementation testLibraries.kotlinCoroutines
testImplementation libs.json
testImplementation libs.bundles.junit
testImplementation libs.bundles.mockito
testImplementation libs.bundles.kotlin.coroutines.test
}
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,15 @@ package com.adyen.checkout.adyen3ds2.internal.data.api

import com.adyen.checkout.adyen3ds2.internal.data.model.SubmitFingerprintRequest
import com.adyen.checkout.adyen3ds2.internal.data.model.SubmitFingerprintResponse
import com.adyen.checkout.core.DispatcherProvider
import com.adyen.checkout.core.internal.data.api.HttpClient
import com.adyen.checkout.core.internal.data.api.post
import kotlinx.coroutines.CoroutineDispatcher
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.withContext

internal class SubmitFingerprintService(
private val httpClient: HttpClient,
private val coroutineDispatcher: CoroutineDispatcher = Dispatchers.IO,
private val coroutineDispatcher: CoroutineDispatcher = DispatcherProvider.IO,
) {

suspend fun submitFingerprint(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,11 @@ import com.adyen.checkout.components.core.internal.ui.model.CommonComponentParam
import com.adyen.checkout.components.core.internal.ui.model.DropInOverrideParams
import com.adyen.checkout.components.core.internal.util.get
import com.adyen.checkout.components.core.internal.util.viewModelFactory
import com.adyen.checkout.core.DispatcherProvider
import com.adyen.checkout.core.internal.data.api.HttpClientFactory
import com.adyen.checkout.core.internal.util.LocaleProvider
import com.adyen.checkout.ui.core.internal.DefaultRedirectHandler
import com.adyen.threeds2.ThreeDS2Service
import kotlinx.coroutines.Dispatchers

class Adyen3DS2ComponentProvider
@RestrictTo(RestrictTo.Scope.LIBRARY_GROUP)
Expand Down Expand Up @@ -105,7 +105,7 @@ constructor(
adyen3DS2Serializer = adyen3DS2DetailsParser,
redirectHandler = redirectHandler,
threeDS2Service = ThreeDS2Service.INSTANCE,
coroutineDispatcher = Dispatchers.Default,
coroutineDispatcher = DispatcherProvider.Default,
application = application,
analyticsManager = analyticsManager,
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -189,8 +189,7 @@ internal class DefaultAdyen3DS2DelegateTest(
assertTrue(exceptionFlow.latestValue is ComponentException)
}

// commenting this out because of failing tests, should be fixed later in collaboration with the 3DS2 team
// @Test
@Test
fun `3ds2 sdk throws an exception while initializing, then an exception emitted`() = runTest {
val error = InvalidInputException("test", null)
threeDS2Service.initializeError = error
Expand All @@ -203,8 +202,7 @@ internal class DefaultAdyen3DS2DelegateTest(
assertEquals(error, exceptionFlow.latestValue.cause)
}

// commenting this out because of failing tests, should be fixed later in collaboration with the 3DS2 team
// @Test
@Test
fun `3ds2 sdk returns an initialization error, then details are emitted`() = runTest {
val transStatus = "X"
val additionalDetails = "mockAdditionalDetails"
Expand Down Expand Up @@ -357,8 +355,7 @@ internal class DefaultAdyen3DS2DelegateTest(
transaction.assertDoChallengeCalled()
}

// commenting this out because of failing tests, should be fixed later in collaboration with the 3DS2 team
// @Test
@Test
fun `challenge fails, then an exception is emitted`() = runTest {
initializeChallengeTransaction(this).apply {
shouldThrowError = true
Expand Down Expand Up @@ -418,8 +415,7 @@ internal class DefaultAdyen3DS2DelegateTest(
@DisplayName("when transaction is")
inner class TransactionTest {

// commenting this out because of failing tests, should be fixed later in collaboration with the 3DS2 team
// @Test
@Test
fun `completed, then details are emitted`() = runTest {
val details =
JSONObject("{\"threeds2.challengeResult\":\"eyJ0cmFuc1N0YXR1cyI6InRyYW5zYWN0aW9uU3RhdHVzIn0=\"}")
Expand All @@ -438,8 +434,7 @@ internal class DefaultAdyen3DS2DelegateTest(
assertEquals(expected.details.toString(), detailsFlow.latestValue.details.toString())
}

// commenting this out because of failing tests, should be fixed later in collaboration with the 3DS2 team
// @Test
@Test
fun `completed and creating details fails, then an error is emitted`() = runTest {
val error = ComponentException("test")
// We have to mock the serializer in order to throw an exception
Expand Down Expand Up @@ -487,8 +482,7 @@ internal class DefaultAdyen3DS2DelegateTest(
assertNotNull(detailsFlow.latestValue.details)
}

// commenting this out because of failing tests, should be fixed later in collaboration with the 3DS2 team
// @Test
@Test
fun `error, then details are emitted`() = runTest {
val detailsFlow = delegate.detailsFlow.test(testScheduler)

Expand Down Expand Up @@ -636,9 +630,8 @@ internal class DefaultAdyen3DS2DelegateTest(
analyticsManager.assertLastEventEquals(expectedDisplayedEvent)
}

// commenting this out because of failing tests, should be fixed later in collaboration with the 3DS2 team
// @ParameterizedTest
// @MethodSource("com.adyen.checkout.adyen3ds2.internal.ui.DefaultAdyen3DS2DelegateTest#challengeResult")
@ParameterizedTest
@MethodSource("com.adyen.checkout.adyen3ds2.internal.ui.DefaultAdyen3DS2DelegateTest#challengeResult")
fun `when challenge result is returned, then event is tracked`(
challengeResult: ChallengeResult,
analyticsResult: ThreeDS2Events.Result
Expand All @@ -655,8 +648,7 @@ internal class DefaultAdyen3DS2DelegateTest(
}
}

// commenting this out because of failing tests, should be fixed later in collaboration with the 3DS2 team
// @Test
@Test
fun `when details are emitted, then state is cleared`() = runTest {
val savedStateHandle = SavedStateHandle().apply {
set(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package com.adyen.checkout.adyen3ds2.internal.ui
import com.adyen.threeds2.ChallengeResult
import com.adyen.threeds2.ChallengeStatusHandler
import org.junit.jupiter.api.BeforeEach
import org.junit.jupiter.api.Test

internal class SharedChallengeStatusHandlerTest {

Expand All @@ -11,8 +12,7 @@ internal class SharedChallengeStatusHandlerTest {
SharedChallengeStatusHandler.reset()
}

// commenting this out because of failing tests, should be fixed later in collaboration with the 3DS2 team
// @Test
@Test
fun `when onCompletion is triggered, then listener is called`() {
val onCompletionListener = TestOnCompletionListener()
SharedChallengeStatusHandler.onCompletionListener = onCompletionListener
Expand All @@ -22,8 +22,7 @@ internal class SharedChallengeStatusHandlerTest {
onCompletionListener.assertOnCompletionCalled()
}

// commenting this out because of failing tests, should be fixed later in collaboration with the 3DS2 team
// @Test
@Test
fun `when onCompletion is triggered and no listener is set, then onCompletion is queued until a listener is set`() {
val onCompletionListener = TestOnCompletionListener()
SharedChallengeStatusHandler.onCompletion(ChallengeResult.Completed("test"))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ internal class Adyen3DS2ComponentParamsMapperTest {
shopperLocale = Locale.GERMAN,
environment = Environment.EUROPE,
clientKey = TEST_CLIENT_KEY_2,
analyticsParams = AnalyticsParams(AnalyticsParamsLevel.NONE, TEST_CLIENT_KEY_2),
analyticsParams = AnalyticsParams(AnalyticsParamsLevel.INITIAL, TEST_CLIENT_KEY_2),
isCreatedByDropIn = true,
amount = Amount(
currency = "CAD",
Expand Down
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.7.0"
implementation "com.adyen.checkout:drop-in-compose:5.8.0"
```
For the Credit Card component:
```groovy
implementation "com.adyen.checkout:card:5.7.0"
implementation "com.adyen.checkout:components-compose:5.7.0"
implementation "com.adyen.checkout:card:5.8.0"
implementation "com.adyen.checkout:components-compose:5.8.0"
```

### Without Jetpack Compose

For Drop-in:
```groovy
implementation "com.adyen.checkout:drop-in:5.7.0"
implementation "com.adyen.checkout:drop-in:5.8.0"
```
For the Credit Card component:
```groovy
implementation "com.adyen.checkout:card:5.7.0"
implementation "com.adyen.checkout:card:5.8.0"
```

The library is available on [Maven Central][mavenRepo].
Expand All @@ -71,7 +71,7 @@ Please let us know if you find any issues.

For development and testing purposes the project is accompanied by a test app. See [here](example-app/README.md) how to set it up and run it.

To test your integration you could use [Adyen Test Cards Android][adyenTestCardsAndroid]. This will allow you to easily prefill test payment method information.
To test your integration you could use [Adyen Test Cards Android][adyenTestCardsAndroid]. This will allow you to easily autofill test payment method information.

## Support

Expand Down
Loading

0 comments on commit a456abd

Please sign in to comment.