Skip to content

Commit

Permalink
Merge pull request #1455 from Adyen/develop
Browse files Browse the repository at this point in the history
Release 5.2.0
  • Loading branch information
araratthehero authored Jan 30, 2024
2 parents 05c0582 + bf3d787 commit 796b359
Show file tree
Hide file tree
Showing 97 changed files with 3,704 additions and 521 deletions.
16 changes: 16 additions & 0 deletions .github/workflows/check_develop.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
name: Check Develop

on:
push:
branches:
- 'develop'

concurrency:
group: 'develop'
cancel-in-progress: true

jobs:
sonar_cloud:
name: SonarCloud
uses: ./.github/workflows/sonar_cloud.yml
secrets: inherit
4 changes: 4 additions & 0 deletions .github/workflows/check_pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,7 @@ jobs:
name: Test
uses: ./.github/workflows/run_tests.yml
needs: assemble
sonar_cloud:
name: SonarCloud
uses: ./.github/workflows/sonar_cloud.yml
secrets: inherit
35 changes: 35 additions & 0 deletions .github/workflows/check_release_notes.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Check Release Notes

# Every PR with a label should include an update to the release notes
on:
pull_request:
branches-ignore:
- 'main'
types: [ opened, synchronize, reopened, labeled, unlabeled ]

concurrency:
group: ${{ github.workflow }}-${{ github.head_ref }}
cancel-in-progress: true

jobs:
release-notes-check:
# https://github.com/actions/virtual-environments/
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- name: Check release notes
if: |
contains(github.event.pull_request.labels.*.name, 'Breaking change') ||
contains(github.event.pull_request.labels.*.name, 'Feature') ||
contains(github.event.pull_request.labels.*.name, 'Fix')
run: |
git fetch origin develop --depth 1
if [ -n "$(git diff origin/develop RELEASE_NOTES.md)" ]
then
echo "RELEASE_NOTES.md was updated"
exit 0
else
echo "::error::Add release notes for your PR by updating RELEASE_NOTES.md"
exit 1
fi
2 changes: 1 addition & 1 deletion .github/workflows/publish_docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ jobs:

# Deploy to GitHub Pages
- name: Deploy GitHub Pages
uses: JamesIves/github-pages-deploy-action@v4.4.3
uses: JamesIves/github-pages-deploy-action@v4.5.0
with:
BRANCH: gh-pages
FOLDER: build/docs/
34 changes: 34 additions & 0 deletions .github/workflows/sonar_cloud.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: SonarCloud

on:
workflow_call

jobs:
sonar_cloud:
name: Run SonarCloud
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
with:
fetch-depth: '0'

- name: Set up JDK
uses: actions/setup-java@v3
with:
distribution: 'zulu'
java-version: 17
cache: 'gradle'

- name: Cache SonarCloud packages
uses: actions/cache@v3
with:
path: ~/.sonar/cache
key: ${{ runner.os }}-sonar
restore-keys: ${{ runner.os }}-sonar

- name: Build and analyze
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
run: ./gradlew detekt assDeb teDebUnTe jacocoDebugTestReport lintDeb sonar
14 changes: 9 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,27 +31,31 @@ Import the corresponding module in your `build.gradle` file.

For Drop-in:
```groovy
implementation "com.adyen.checkout:drop-in-compose:5.1.0"
implementation "com.adyen.checkout:drop-in-compose:5.2.0"
```
For the Credit Card component:
```groovy
implementation "com.adyen.checkout:card:5.1.0"
implementation "com.adyen.checkout:components-compose:5.1.0"
implementation "com.adyen.checkout:card:5.2.0"
implementation "com.adyen.checkout:components-compose:5.2.0"
```

### Without Jetpack Compose

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

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

## UI Customization

[See the UI Customization Guide for more.](docs/UI_CUSTOMIZATION.md)

## Migrate from v4

If you are upgrading from 4.x.x to a current release, check out our [migration guide][migration.guide].
Expand Down
31 changes: 13 additions & 18 deletions RELEASE_NOTES.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[//]: # (This file will be used for the release notes on GitHub when publishing.)
[//]: # (Types of changes: `Breaking changes` `New` `Added` `Changed` `Deprecated` `Removed` `Fixed`)
[//]: # (Types of changes: `Breaking changes` `New` `Added` `Improved` `Changed` `Deprecated` `Removed` `Fixed`)
[//]: # (Example:)
[//]: # (## Added)
[//]: # ( - New payment method)
Expand All @@ -9,27 +9,22 @@
[//]: # ( - Configurations public constructor are deprecated, please use each Configuration's builder to make a Configuration object)

## New
- 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.
- 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`.
- 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).
- For stored cards, Drop-in now shows the card name (for example **Visa** or **Mastercard**) instead of **Credit Card**.
- 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).
- 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**.
- For Google Pay:
- 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.
- 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).
- We added a [UI customization guide](docs/UI_CUSTOMIZATION.md), which explains how to customize the styles and string resources.

## Improved
- 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.

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

## Changed
- Dependency versions:
| Name | Version |
|--------------------------------------------------------------------------------------------------------|-------------------------------|
| [AndroidX Compose Activity](https://developer.android.com/jetpack/androidx/releases/activity#1.8.0) | **1.8.0** |
| [Material Design](https://m2.material.io/) | **1.10.0** |
| [Gradle](https://docs.gradle.org/8.4/release-notes.html) | **8.4** |
| [Android Gradle plugin](https://developer.android.com/build/releases/gradle-plugin) | **8.1.2** |
| [AndroidX Compose BoM](https://developer.android.com/jetpack/compose/bom/bom-mapping) | **2023.10.01** |
| [AndroidX Recyclerview](https://developer.android.com/jetpack/androidx/releases/recyclerview#1.3.2) | **1.3.2** |
| [AndroidX Fragment](https://developer.android.com/jetpack/androidx/releases/fragment#1.6.2) | **1.6.2** |
| [Kotlin](https://kotlinlang.org/docs/releases.html#release-details) | **1.9.21** |
| [Android Gradle plugin](https://developer.android.com/build/releases/gradle-plugin) | **8.2.0** |
| [AndroidX Compose compiler](https://developer.android.com/jetpack/androidx/releases/compose-compiler) | **1.5.7** |
| [AndroidX Compose Activity](https://developer.android.com/jetpack/androidx/releases/activity#1.8.1) | **1.8.1** |
| [AndroidX Browser](https://developer.android.com/jetpack/androidx/releases/browser#1.7.0) | **1.7.0** |
5 changes: 2 additions & 3 deletions SECURITY.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# Reporting Security Issues
# Disclosing security issues

We welcome reports of possible vulnerabilities or issues as part of our responsible disclosure program. For more information go to
https://support.adyen.com/hc/en-us/articles/115001187330-How-do-I-report-a-possible-security-issue-to-Adyen
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).
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,7 @@ import com.adyen.checkout.components.core.internal.util.get
import com.adyen.checkout.components.core.internal.util.viewModelFactory
import com.adyen.checkout.core.exception.ComponentException
import com.adyen.checkout.core.internal.data.api.HttpClientFactory
import com.adyen.checkout.cse.internal.ClientSideEncrypter
import com.adyen.checkout.cse.internal.DateGenerator
import com.adyen.checkout.cse.internal.DefaultGenericEncrypter
import com.adyen.checkout.cse.internal.GenericEncryptorFactory
import com.adyen.checkout.sessions.core.CheckoutSession
import com.adyen.checkout.sessions.core.SessionComponentCallback
import com.adyen.checkout.sessions.core.internal.SessionComponentEventHandler
Expand Down Expand Up @@ -117,9 +115,7 @@ constructor(

val addressService = AddressService(httpClient)
val addressRepository = DefaultAddressRepository(addressService)
val dateGenerator = DateGenerator()
val clientSideEncrypter = ClientSideEncrypter()
val genericEncrypter = DefaultGenericEncrypter(clientSideEncrypter, dateGenerator)
val genericEncryptor = GenericEncryptorFactory.provide()
val analyticsRepository = analyticsRepository ?: DefaultAnalyticsRepository(
analyticsRepositoryData = AnalyticsRepositoryData(
application = application,
Expand All @@ -139,7 +135,7 @@ constructor(
publicKeyRepository = publicKeyRepository,
addressRepository = addressRepository,
submitHandler = SubmitHandler(savedStateHandle),
genericEncrypter = genericEncrypter,
genericEncryptor = genericEncryptor,
componentParams = componentParams,
order = order
)
Expand Down Expand Up @@ -191,9 +187,7 @@ constructor(

val addressService = AddressService(httpClient)
val addressRepository = DefaultAddressRepository(addressService)
val dateGenerator = DateGenerator()
val clientSideEncrypter = ClientSideEncrypter()
val genericEncrypter = DefaultGenericEncrypter(clientSideEncrypter, dateGenerator)
val genericEncryptor = GenericEncryptorFactory.provide()
val analyticsRepository = analyticsRepository ?: DefaultAnalyticsRepository(
analyticsRepositoryData = AnalyticsRepositoryData(
application = application,
Expand All @@ -214,7 +208,7 @@ constructor(
publicKeyRepository = publicKeyRepository,
addressRepository = addressRepository,
submitHandler = SubmitHandler(savedStateHandle),
genericEncrypter = genericEncrypter,
genericEncryptor = genericEncryptor,
componentParams = componentParams,
order = checkoutSession.order
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ import com.adyen.checkout.core.exception.ComponentException
import com.adyen.checkout.core.internal.util.LogUtil
import com.adyen.checkout.core.internal.util.Logger
import com.adyen.checkout.cse.EncryptionException
import com.adyen.checkout.cse.internal.BaseGenericEncrypter
import com.adyen.checkout.cse.internal.BaseGenericEncryptor
import com.adyen.checkout.ui.core.internal.data.api.AddressRepository
import com.adyen.checkout.ui.core.internal.ui.AddressFormUIState
import com.adyen.checkout.ui.core.internal.ui.ButtonComponentViewType
Expand Down Expand Up @@ -66,7 +66,7 @@ internal class DefaultACHDirectDebitDelegate(
private val publicKeyRepository: PublicKeyRepository,
private val addressRepository: AddressRepository,
private val submitHandler: SubmitHandler<ACHDirectDebitComponentState>,
private val genericEncrypter: BaseGenericEncrypter,
private val genericEncryptor: BaseGenericEncryptor,
override val componentParams: ACHDirectDebitComponentParams,
private val order: Order?
) : ACHDirectDebitDelegate, ButtonDelegate, UIStateDelegate {
Expand Down Expand Up @@ -277,12 +277,12 @@ internal class DefaultACHDirectDebitDelegate(
}

try {
val encryptedBankAccountNumber = genericEncrypter.encryptField(
val encryptedBankAccountNumber = genericEncryptor.encryptField(
fieldKeyToEncrypt = ENCRYPTION_KEY_FOR_BANK_ACCOUNT_NUMBER,
fieldValueToEncrypt = outputData.bankAccountNumber.value,
publicKey = publicKey
)
val encryptedBankLocationId = genericEncrypter.encryptField(
val encryptedBankLocationId = genericEncryptor.encryptField(
fieldKeyToEncrypt = ENCRYPTION_KEY_FOR_BANK_LOCATION_ID,
fieldValueToEncrypt = outputData.bankLocationId.value,
publicKey = publicKey
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ import com.adyen.checkout.components.core.internal.ui.model.FieldState
import com.adyen.checkout.components.core.internal.ui.model.Validation
import com.adyen.checkout.components.core.paymentmethod.ACHDirectDebitPaymentMethod
import com.adyen.checkout.core.Environment
import com.adyen.checkout.cse.internal.BaseGenericEncrypter
import com.adyen.checkout.cse.internal.test.TestGenericEncrypter
import com.adyen.checkout.cse.internal.BaseGenericEncryptor
import com.adyen.checkout.cse.internal.test.TestGenericEncryptor
import com.adyen.checkout.test.TestDispatcherExtension
import com.adyen.checkout.test.extensions.test
import com.adyen.checkout.ui.core.internal.data.api.AddressRepository
Expand Down Expand Up @@ -72,14 +72,14 @@ internal class DefaultACHDirectDebitDelegateTest(

private lateinit var publicKeyRepository: TestPublicKeyRepository
private lateinit var addressRepository: TestAddressRepository
private lateinit var genericEncrypter: TestGenericEncrypter
private lateinit var genericEncryptor: TestGenericEncryptor
private lateinit var delegate: DefaultACHDirectDebitDelegate

@BeforeEach
fun setUp() {
publicKeyRepository = TestPublicKeyRepository()
addressRepository = TestAddressRepository()
genericEncrypter = TestGenericEncrypter()
genericEncryptor = TestGenericEncryptor()
delegate = createAchDelegate()
}

Expand Down Expand Up @@ -325,7 +325,7 @@ internal class DefaultACHDirectDebitDelegateTest(

@Test
fun `encryption fails, then component state should be invalid`() = runTest {
genericEncrypter.shouldThrowException = true
genericEncryptor.shouldThrowException = true

delegate.initialize(CoroutineScope(UnconfinedTestDispatcher()))

Expand Down Expand Up @@ -676,7 +676,7 @@ internal class DefaultACHDirectDebitDelegateTest(
analyticsRepository: AnalyticsRepository = this.analyticsRepository,
publicKeyRepository: PublicKeyRepository = this.publicKeyRepository,
addressRepository: AddressRepository = this.addressRepository,
genericEncrypter: BaseGenericEncrypter = this.genericEncrypter,
genericEncryptor: BaseGenericEncryptor = this.genericEncryptor,
submitHandler: SubmitHandler<ACHDirectDebitComponentState> = this.submitHandler,
configuration: ACHDirectDebitConfiguration = getAchConfigurationBuilder().build(),
order: OrderRequest? = TEST_ORDER,
Expand All @@ -687,7 +687,7 @@ internal class DefaultACHDirectDebitDelegateTest(
publicKeyRepository = publicKeyRepository,
addressRepository = addressRepository,
submitHandler = submitHandler,
genericEncrypter = genericEncrypter,
genericEncryptor = genericEncryptor,
componentParams = ACHDirectDebitComponentParamsMapper(null, null).mapToParams(configuration, null),
order = order
)
Expand Down
2 changes: 2 additions & 0 deletions bacs/src/main/res/values/styles.xml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@
<item name="android:inputType">textEmailAddress</item>
</style>

<style name="AdyenCheckout.Bacs.Switch" />

<style name="AdyenCheckout.Bacs.Switch.Amount" parent="AdyenCheckout.Switch">
<item name="android:text">@string/bacs_consent_amount</item>
<item name="android:layout_marginBottom">@dimen/standard_quarter_margin</item>
Expand Down
Loading

0 comments on commit 796b359

Please sign in to comment.