Skip to content

Commit

Permalink
Merge pull request #1367 from Adyen/develop
Browse files Browse the repository at this point in the history
Release 5.0.0
  • Loading branch information
jreij authored Oct 18, 2023
2 parents 639ca08 + e54b3ab commit 4820936
Show file tree
Hide file tree
Showing 165 changed files with 830 additions and 461 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/assemble.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Set up JDK
uses: actions/setup-java@v3
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 @@ -15,7 +15,7 @@ jobs:
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
# https://github.com/marketplace/actions/checkout
- uses: actions/checkout@v3
- uses: actions/checkout@v4

# Setup Java 17
# https://github.com/marketplace/actions/setup-java-jdk
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 @@ -9,7 +9,7 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Set up JDK
uses: actions/setup-java@v3
Expand All @@ -29,7 +29,7 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Set up JDK
uses: actions/setup-java@v3
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 @@ -8,7 +8,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
ref: ${{ github.head_ref }}
fetch-depth: 0
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/publish_docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
# https://github.com/marketplace/actions/checkout
- uses: actions/checkout@v3
- uses: actions/checkout@v4

# Setup Java 17
# https://github.com/marketplace/actions/setup-java-jdk
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/publish_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
ref: main

Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/run_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Set up JDK
uses: actions/setup-java@v3
Expand All @@ -34,7 +34,7 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Set up JDK
uses: actions/setup-java@v3
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 @@ -9,7 +9,7 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
ref: ${{ github.head_ref }}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ class Adyen3DS2Configuration private constructor(
override val environment: Environment,
override val clientKey: String,
override val analyticsConfiguration: AnalyticsConfiguration?,
override val amount: Amount,
override val amount: Amount?,
val uiCustomization: UiCustomization?,
val threeDSRequestorAppURL: String?,
) : Configuration {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,9 @@ internal class DefaultAdyen3DS2Delegate(
fingerprintToken.directoryServerPublicKey,
// directoryServerRootCertificates
fingerprintToken.directoryServerRootCertificates,
).build()
)
.deviceParameterBlockList(componentParams.deviceParameterBlockList)
.build()

val coroutineExceptionHandler = CoroutineExceptionHandler { _, throwable ->
Logger.e(TAG, "Unexpected uncaught 3DS2 Exception", throwable)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@ internal data class Adyen3DS2ComponentParams(
override val clientKey: String,
override val analyticsParams: AnalyticsParams,
override val isCreatedByDropIn: Boolean,
override val amount: Amount,
override val amount: Amount?,
val uiCustomization: UiCustomization?,
val threeDSRequestorAppURL: String?,
val deviceParameterBlockList: Set<String>?,
) : ComponentParams
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

package com.adyen.checkout.adyen3ds2.internal.ui.model

import androidx.annotation.VisibleForTesting
import com.adyen.checkout.adyen3ds2.Adyen3DS2Configuration
import com.adyen.checkout.components.core.internal.ui.model.AnalyticsParams
import com.adyen.checkout.components.core.internal.ui.model.ComponentParams
Expand Down Expand Up @@ -38,6 +39,8 @@ internal class Adyen3DS2ComponentParamsMapper(
amount = amount,
uiCustomization = uiCustomization,
threeDSRequestorAppURL = threeDSRequestorAppURL,
// Hardcoded for now, but in the feature we could make this configurable
deviceParameterBlockList = DEVICE_PARAMETER_BLOCK_LIST,
)
}

Expand All @@ -63,4 +66,11 @@ internal class Adyen3DS2ComponentParamsMapper(
amount = sessionParams.amount ?: amount,
)
}

companion object {
private const val PHONE_NUMBER_PARAMETER = "A005"

@VisibleForTesting
internal val DEVICE_PARAMETER_BLOCK_LIST = setOf(PHONE_NUMBER_PARAMETER)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ import com.adyen.threeds2.exception.InvalidInputException
import com.adyen.threeds2.exception.SDKRuntimeException
import com.adyen.threeds2.parameters.ChallengeParameters
import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.ExperimentalCoroutinesApi
import kotlinx.coroutines.test.TestDispatcher
import kotlinx.coroutines.test.runTest
import org.json.JSONException
Expand All @@ -66,7 +65,6 @@ import org.mockito.kotlin.whenever
import java.io.IOException
import java.util.Locale

@OptIn(ExperimentalCoroutinesApi::class)
@ExtendWith(MockitoExtension::class, TestDispatcherExtension::class)
internal class DefaultAdyen3DS2DelegateTest(
@Mock private val submitFingerprintRepository: SubmitFingerprintRepository,
Expand All @@ -89,7 +87,9 @@ internal class DefaultAdyen3DS2DelegateTest(
observerRepository = ActionObserverRepository(),
savedStateHandle = SavedStateHandle(),
componentParams = Adyen3DS2ComponentParamsMapper(null, null)
.mapToParams(configuration, null),
.mapToParams(configuration, null)
// Set it to null to avoid a crash in 3DS2 library (they use Android APIs)
.copy(deviceParameterBlockList = null),
submitFingerprintRepository = submitFingerprintRepository,
paymentDataRepository = paymentDataRepository,
adyen3DS2Serializer = adyen3DS2Serializer,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ internal class Adyen3DS2ComponentParamsMapperTest {
clientKey: String = TEST_CLIENT_KEY_1,
analyticsParams: AnalyticsParams = AnalyticsParams(AnalyticsParamsLevel.ALL),
isCreatedByDropIn: Boolean = false,
amount: Amount = Amount.EMPTY,
amount: Amount? = null,
uiCustomization: UiCustomization? = null,
threeDSRequestorAppURL: String? = null,
) = Adyen3DS2ComponentParams(
Expand All @@ -117,6 +117,7 @@ internal class Adyen3DS2ComponentParamsMapperTest {
amount = amount,
uiCustomization = uiCustomization,
threeDSRequestorAppURL = threeDSRequestorAppURL,
deviceParameterBlockList = Adyen3DS2ComponentParamsMapper.DEVICE_PARAMETER_BLOCK_LIST,
)

companion object {
Expand Down
Loading

0 comments on commit 4820936

Please sign in to comment.