Skip to content

Commit 796b359

Browse files
Merge pull request #1455 from Adyen/develop
Release 5.2.0
2 parents 05c0582 + bf3d787 commit 796b359

File tree

97 files changed

+3704
-521
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

97 files changed

+3704
-521
lines changed

.github/workflows/check_develop.yml

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
name: Check Develop
2+
3+
on:
4+
push:
5+
branches:
6+
- 'develop'
7+
8+
concurrency:
9+
group: 'develop'
10+
cancel-in-progress: true
11+
12+
jobs:
13+
sonar_cloud:
14+
name: SonarCloud
15+
uses: ./.github/workflows/sonar_cloud.yml
16+
secrets: inherit

.github/workflows/check_pr.yml

+4
Original file line numberDiff line numberDiff line change
@@ -22,3 +22,7 @@ jobs:
2222
name: Test
2323
uses: ./.github/workflows/run_tests.yml
2424
needs: assemble
25+
sonar_cloud:
26+
name: SonarCloud
27+
uses: ./.github/workflows/sonar_cloud.yml
28+
secrets: inherit
+35
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
name: Check Release Notes
2+
3+
# Every PR with a label should include an update to the release notes
4+
on:
5+
pull_request:
6+
branches-ignore:
7+
- 'main'
8+
types: [ opened, synchronize, reopened, labeled, unlabeled ]
9+
10+
concurrency:
11+
group: ${{ github.workflow }}-${{ github.head_ref }}
12+
cancel-in-progress: true
13+
14+
jobs:
15+
release-notes-check:
16+
# https://github.com/actions/virtual-environments/
17+
runs-on: ubuntu-latest
18+
19+
steps:
20+
- uses: actions/checkout@v4
21+
- name: Check release notes
22+
if: |
23+
contains(github.event.pull_request.labels.*.name, 'Breaking change') ||
24+
contains(github.event.pull_request.labels.*.name, 'Feature') ||
25+
contains(github.event.pull_request.labels.*.name, 'Fix')
26+
run: |
27+
git fetch origin develop --depth 1
28+
if [ -n "$(git diff origin/develop RELEASE_NOTES.md)" ]
29+
then
30+
echo "RELEASE_NOTES.md was updated"
31+
exit 0
32+
else
33+
echo "::error::Add release notes for your PR by updating RELEASE_NOTES.md"
34+
exit 1
35+
fi

.github/workflows/publish_docs.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ jobs:
3434

3535
# Deploy to GitHub Pages
3636
- name: Deploy GitHub Pages
37-
uses: JamesIves/github-pages-deploy-action@v4.4.3
37+
uses: JamesIves/github-pages-deploy-action@v4.5.0
3838
with:
3939
BRANCH: gh-pages
4040
FOLDER: build/docs/

.github/workflows/sonar_cloud.yml

+34
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
name: SonarCloud
2+
3+
on:
4+
workflow_call
5+
6+
jobs:
7+
sonar_cloud:
8+
name: Run SonarCloud
9+
runs-on: ubuntu-latest
10+
11+
steps:
12+
- uses: actions/checkout@v4
13+
with:
14+
fetch-depth: '0'
15+
16+
- name: Set up JDK
17+
uses: actions/setup-java@v3
18+
with:
19+
distribution: 'zulu'
20+
java-version: 17
21+
cache: 'gradle'
22+
23+
- name: Cache SonarCloud packages
24+
uses: actions/cache@v3
25+
with:
26+
path: ~/.sonar/cache
27+
key: ${{ runner.os }}-sonar
28+
restore-keys: ${{ runner.os }}-sonar
29+
30+
- name: Build and analyze
31+
env:
32+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any
33+
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
34+
run: ./gradlew detekt assDeb teDebUnTe jacocoDebugTestReport lintDeb sonar

README.md

+9-5
Original file line numberDiff line numberDiff line change
@@ -31,27 +31,31 @@ Import the corresponding module in your `build.gradle` file.
3131

3232
For Drop-in:
3333
```groovy
34-
implementation "com.adyen.checkout:drop-in-compose:5.1.0"
34+
implementation "com.adyen.checkout:drop-in-compose:5.2.0"
3535
```
3636
For the Credit Card component:
3737
```groovy
38-
implementation "com.adyen.checkout:card:5.1.0"
39-
implementation "com.adyen.checkout:components-compose:5.1.0"
38+
implementation "com.adyen.checkout:card:5.2.0"
39+
implementation "com.adyen.checkout:components-compose:5.2.0"
4040
```
4141

4242
### Without Jetpack Compose
4343

4444
For Drop-in:
4545
```groovy
46-
implementation "com.adyen.checkout:drop-in:5.1.0"
46+
implementation "com.adyen.checkout:drop-in:5.2.0"
4747
```
4848
For the Credit Card component:
4949
```groovy
50-
implementation "com.adyen.checkout:card:5.1.0"
50+
implementation "com.adyen.checkout:card:5.2.0"
5151
```
5252

5353
The library is available on [Maven Central][mavenRepo].
5454

55+
## UI Customization
56+
57+
[See the UI Customization Guide for more.](docs/UI_CUSTOMIZATION.md)
58+
5559
## Migrate from v4
5660

5761
If you are upgrading from 4.x.x to a current release, check out our [migration guide][migration.guide].

RELEASE_NOTES.md

+13-18
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[//]: # (This file will be used for the release notes on GitHub when publishing.)
2-
[//]: # (Types of changes: `Breaking changes` `New` `Added` `Changed` `Deprecated` `Removed` `Fixed`)
2+
[//]: # (Types of changes: `Breaking changes` `New` `Added` `Improved` `Changed` `Deprecated` `Removed` `Fixed`)
33
[//]: # (Example:)
44
[//]: # (## Added)
55
[//]: # ( - New payment method)
@@ -9,27 +9,22 @@
99
[//]: # ( - Configurations public constructor are deprecated, please use each Configuration's builder to make a Configuration object)
1010

1111
## New
12-
- The [BcmcComponent](https://adyen.github.io/adyen-android/bcmc/com.adyen.checkout.bcmc/-bcmc-component/index.html) now supports co-badged Bancontact cards and card brand detection.
13-
- The [BcmcComponentState](https://adyen.github.io/adyen-android/bcmc/com.adyen.checkout.bcmc/-bcmc-component-state/index.html) now contains 3 extra fields: `cardBrand`, `binValue` and `lastFourDigits`.
14-
- You can now override payment method names in Drop-in by using [DropInConfiguration.Builder.overridePaymentMethodName(type, name)](https://adyen.github.io/adyen-android/drop-in/com.adyen.checkout.dropin/-drop-in-configuration/-builder/override-payment-method-name.html).
15-
- For stored cards, Drop-in now shows the card name (for example **Visa** or **Mastercard**) instead of **Credit Card**.
16-
- Now it is possible to show installment amounts for card payments using [InstallmentConfiguration.showInstallmentAmount](https://adyen.github.io/adyen-android/card/com.adyen.checkout.card/-installment-configuration/show-installment-amount.html) in [CardConfiguration.Builder.setInstallmentConfigurations()](https://adyen.github.io/adyen-android/card/com.adyen.checkout.card/-card-configuration/-builder/set-installment-configurations.html).
17-
- For gift cards, you can now hide the PIN text field by setting [GiftCardConfiguration.Builder.setPinRequired()](https://adyen.github.io/adyen-android/giftcard/com.adyen.checkout.giftcard/-gift-card-configuration/-builder/set-pin-required.html) to **false**.
18-
- For Google Pay:
19-
- When initializing the [Google Pay button](https://docs.adyen.com/payment-methods/google-pay/android-component/#2-show-the-google-pay-button), you can now use [GooglePayComponent.getGooglePayButtonParameters()](https://adyen.github.io/adyen-android/googlepay/com.adyen.checkout.googlepay/-google-pay-component/get-google-pay-button-parameters.html) to get the `allowedPaymentMethods` attribute.
20-
- You can now use [AllowedAuthMethods](https://adyen.github.io/adyen-android/googlepay/com.adyen.checkout.googlepay/-allowed-auth-methods/index.html) and [AllowedCardNetworks](https://adyen.github.io/adyen-android/googlepay/com.adyen.checkout.googlepay/-allowed-card-networks/index.html) to easily access to the possible values for [GooglePayConfiguration.Builder.setAllowedAuthMethods()](https://adyen.github.io/adyen-android/googlepay/com.adyen.checkout.googlepay/-google-pay-configuration/-builder/set-allowed-auth-methods.html) and [GooglePayConfiguration.Builder.setAllowedCardNetworks()](https://adyen.github.io/adyen-android/googlepay/com.adyen.checkout.googlepay/-google-pay-configuration/-builder/set-allowed-card-networks.html).
12+
- We added a [UI customization guide](docs/UI_CUSTOMIZATION.md), which explains how to customize the styles and string resources.
13+
14+
## Improved
15+
- The integration now uses JSON Web Encryption (JWE) with RSA OAEP 256 and AES GCM 256 for encryption. You do not need to make any changes to your integration.
2116

2217
## Fixed
23-
- Fixed a bug where components would not be displayed in Jetpack Compose lazy lists.
18+
- For Drop-in, error dialogs no longer display user unfriendly messages when using the Sessions flow.
19+
- Overriding some of the XML styles without specifying a parent style no longer causes a build error.
20+
- The Await and QR Code action components no longer get stuck in a loading state after the payment is completed.
2421

2522
## Changed
2623
- Dependency versions:
2724
| Name | Version |
2825
|--------------------------------------------------------------------------------------------------------|-------------------------------|
29-
| [AndroidX Compose Activity](https://developer.android.com/jetpack/androidx/releases/activity#1.8.0) | **1.8.0** |
30-
| [Material Design](https://m2.material.io/) | **1.10.0** |
31-
| [Gradle](https://docs.gradle.org/8.4/release-notes.html) | **8.4** |
32-
| [Android Gradle plugin](https://developer.android.com/build/releases/gradle-plugin) | **8.1.2** |
33-
| [AndroidX Compose BoM](https://developer.android.com/jetpack/compose/bom/bom-mapping) | **2023.10.01** |
34-
| [AndroidX Recyclerview](https://developer.android.com/jetpack/androidx/releases/recyclerview#1.3.2) | **1.3.2** |
35-
| [AndroidX Fragment](https://developer.android.com/jetpack/androidx/releases/fragment#1.6.2) | **1.6.2** |
26+
| [Kotlin](https://kotlinlang.org/docs/releases.html#release-details) | **1.9.21** |
27+
| [Android Gradle plugin](https://developer.android.com/build/releases/gradle-plugin) | **8.2.0** |
28+
| [AndroidX Compose compiler](https://developer.android.com/jetpack/androidx/releases/compose-compiler) | **1.5.7** |
29+
| [AndroidX Compose Activity](https://developer.android.com/jetpack/androidx/releases/activity#1.8.1) | **1.8.1** |
30+
| [AndroidX Browser](https://developer.android.com/jetpack/androidx/releases/browser#1.7.0) | **1.7.0** |

SECURITY.md

+2-3
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
# Reporting Security Issues
1+
# Disclosing security issues
22

3-
We welcome reports of possible vulnerabilities or issues as part of our responsible disclosure program. For more information go to
4-
https://support.adyen.com/hc/en-us/articles/115001187330-How-do-I-report-a-possible-security-issue-to-Adyen
3+
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).

ach/src/main/java/com/adyen/checkout/ach/internal/provider/ACHDirectDebitComponentProvider.kt

+5-11
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,7 @@ import com.adyen.checkout.components.core.internal.util.get
4343
import com.adyen.checkout.components.core.internal.util.viewModelFactory
4444
import com.adyen.checkout.core.exception.ComponentException
4545
import com.adyen.checkout.core.internal.data.api.HttpClientFactory
46-
import com.adyen.checkout.cse.internal.ClientSideEncrypter
47-
import com.adyen.checkout.cse.internal.DateGenerator
48-
import com.adyen.checkout.cse.internal.DefaultGenericEncrypter
46+
import com.adyen.checkout.cse.internal.GenericEncryptorFactory
4947
import com.adyen.checkout.sessions.core.CheckoutSession
5048
import com.adyen.checkout.sessions.core.SessionComponentCallback
5149
import com.adyen.checkout.sessions.core.internal.SessionComponentEventHandler
@@ -117,9 +115,7 @@ constructor(
117115

118116
val addressService = AddressService(httpClient)
119117
val addressRepository = DefaultAddressRepository(addressService)
120-
val dateGenerator = DateGenerator()
121-
val clientSideEncrypter = ClientSideEncrypter()
122-
val genericEncrypter = DefaultGenericEncrypter(clientSideEncrypter, dateGenerator)
118+
val genericEncryptor = GenericEncryptorFactory.provide()
123119
val analyticsRepository = analyticsRepository ?: DefaultAnalyticsRepository(
124120
analyticsRepositoryData = AnalyticsRepositoryData(
125121
application = application,
@@ -139,7 +135,7 @@ constructor(
139135
publicKeyRepository = publicKeyRepository,
140136
addressRepository = addressRepository,
141137
submitHandler = SubmitHandler(savedStateHandle),
142-
genericEncrypter = genericEncrypter,
138+
genericEncryptor = genericEncryptor,
143139
componentParams = componentParams,
144140
order = order
145141
)
@@ -191,9 +187,7 @@ constructor(
191187

192188
val addressService = AddressService(httpClient)
193189
val addressRepository = DefaultAddressRepository(addressService)
194-
val dateGenerator = DateGenerator()
195-
val clientSideEncrypter = ClientSideEncrypter()
196-
val genericEncrypter = DefaultGenericEncrypter(clientSideEncrypter, dateGenerator)
190+
val genericEncryptor = GenericEncryptorFactory.provide()
197191
val analyticsRepository = analyticsRepository ?: DefaultAnalyticsRepository(
198192
analyticsRepositoryData = AnalyticsRepositoryData(
199193
application = application,
@@ -214,7 +208,7 @@ constructor(
214208
publicKeyRepository = publicKeyRepository,
215209
addressRepository = addressRepository,
216210
submitHandler = SubmitHandler(savedStateHandle),
217-
genericEncrypter = genericEncrypter,
211+
genericEncryptor = genericEncryptor,
218212
componentParams = componentParams,
219213
order = checkoutSession.order
220214
)

ach/src/main/java/com/adyen/checkout/ach/internal/ui/DefaultACHDirectDebitDelegate.kt

+4-4
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ import com.adyen.checkout.core.exception.ComponentException
2929
import com.adyen.checkout.core.internal.util.LogUtil
3030
import com.adyen.checkout.core.internal.util.Logger
3131
import com.adyen.checkout.cse.EncryptionException
32-
import com.adyen.checkout.cse.internal.BaseGenericEncrypter
32+
import com.adyen.checkout.cse.internal.BaseGenericEncryptor
3333
import com.adyen.checkout.ui.core.internal.data.api.AddressRepository
3434
import com.adyen.checkout.ui.core.internal.ui.AddressFormUIState
3535
import com.adyen.checkout.ui.core.internal.ui.ButtonComponentViewType
@@ -66,7 +66,7 @@ internal class DefaultACHDirectDebitDelegate(
6666
private val publicKeyRepository: PublicKeyRepository,
6767
private val addressRepository: AddressRepository,
6868
private val submitHandler: SubmitHandler<ACHDirectDebitComponentState>,
69-
private val genericEncrypter: BaseGenericEncrypter,
69+
private val genericEncryptor: BaseGenericEncryptor,
7070
override val componentParams: ACHDirectDebitComponentParams,
7171
private val order: Order?
7272
) : ACHDirectDebitDelegate, ButtonDelegate, UIStateDelegate {
@@ -277,12 +277,12 @@ internal class DefaultACHDirectDebitDelegate(
277277
}
278278

279279
try {
280-
val encryptedBankAccountNumber = genericEncrypter.encryptField(
280+
val encryptedBankAccountNumber = genericEncryptor.encryptField(
281281
fieldKeyToEncrypt = ENCRYPTION_KEY_FOR_BANK_ACCOUNT_NUMBER,
282282
fieldValueToEncrypt = outputData.bankAccountNumber.value,
283283
publicKey = publicKey
284284
)
285-
val encryptedBankLocationId = genericEncrypter.encryptField(
285+
val encryptedBankLocationId = genericEncryptor.encryptField(
286286
fieldKeyToEncrypt = ENCRYPTION_KEY_FOR_BANK_LOCATION_ID,
287287
fieldValueToEncrypt = outputData.bankLocationId.value,
288288
publicKey = publicKey

ach/src/test/java/com/adyen/checkout/ach/internal/ui/DefaultACHDirectDebitDelegateTest.kt

+7-7
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@ import com.adyen.checkout.components.core.internal.ui.model.FieldState
2626
import com.adyen.checkout.components.core.internal.ui.model.Validation
2727
import com.adyen.checkout.components.core.paymentmethod.ACHDirectDebitPaymentMethod
2828
import com.adyen.checkout.core.Environment
29-
import com.adyen.checkout.cse.internal.BaseGenericEncrypter
30-
import com.adyen.checkout.cse.internal.test.TestGenericEncrypter
29+
import com.adyen.checkout.cse.internal.BaseGenericEncryptor
30+
import com.adyen.checkout.cse.internal.test.TestGenericEncryptor
3131
import com.adyen.checkout.test.TestDispatcherExtension
3232
import com.adyen.checkout.test.extensions.test
3333
import com.adyen.checkout.ui.core.internal.data.api.AddressRepository
@@ -72,14 +72,14 @@ internal class DefaultACHDirectDebitDelegateTest(
7272

7373
private lateinit var publicKeyRepository: TestPublicKeyRepository
7474
private lateinit var addressRepository: TestAddressRepository
75-
private lateinit var genericEncrypter: TestGenericEncrypter
75+
private lateinit var genericEncryptor: TestGenericEncryptor
7676
private lateinit var delegate: DefaultACHDirectDebitDelegate
7777

7878
@BeforeEach
7979
fun setUp() {
8080
publicKeyRepository = TestPublicKeyRepository()
8181
addressRepository = TestAddressRepository()
82-
genericEncrypter = TestGenericEncrypter()
82+
genericEncryptor = TestGenericEncryptor()
8383
delegate = createAchDelegate()
8484
}
8585

@@ -325,7 +325,7 @@ internal class DefaultACHDirectDebitDelegateTest(
325325

326326
@Test
327327
fun `encryption fails, then component state should be invalid`() = runTest {
328-
genericEncrypter.shouldThrowException = true
328+
genericEncryptor.shouldThrowException = true
329329

330330
delegate.initialize(CoroutineScope(UnconfinedTestDispatcher()))
331331

@@ -676,7 +676,7 @@ internal class DefaultACHDirectDebitDelegateTest(
676676
analyticsRepository: AnalyticsRepository = this.analyticsRepository,
677677
publicKeyRepository: PublicKeyRepository = this.publicKeyRepository,
678678
addressRepository: AddressRepository = this.addressRepository,
679-
genericEncrypter: BaseGenericEncrypter = this.genericEncrypter,
679+
genericEncryptor: BaseGenericEncryptor = this.genericEncryptor,
680680
submitHandler: SubmitHandler<ACHDirectDebitComponentState> = this.submitHandler,
681681
configuration: ACHDirectDebitConfiguration = getAchConfigurationBuilder().build(),
682682
order: OrderRequest? = TEST_ORDER,
@@ -687,7 +687,7 @@ internal class DefaultACHDirectDebitDelegateTest(
687687
publicKeyRepository = publicKeyRepository,
688688
addressRepository = addressRepository,
689689
submitHandler = submitHandler,
690-
genericEncrypter = genericEncrypter,
690+
genericEncryptor = genericEncryptor,
691691
componentParams = ACHDirectDebitComponentParamsMapper(null, null).mapToParams(configuration, null),
692692
order = order
693693
)

bacs/src/main/res/values/styles.xml

+2
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,8 @@
3131
<item name="android:inputType">textEmailAddress</item>
3232
</style>
3333

34+
<style name="AdyenCheckout.Bacs.Switch" />
35+
3436
<style name="AdyenCheckout.Bacs.Switch.Amount" parent="AdyenCheckout.Switch">
3537
<item name="android:text">@string/bacs_consent_amount</item>
3638
<item name="android:layout_marginBottom">@dimen/standard_quarter_margin</item>

0 commit comments

Comments
 (0)