Skip to content

Commit

Permalink
Merge pull request #395 from Adyen/develop
Browse files Browse the repository at this point in the history
Release 4.0.0-beta03
  • Loading branch information
jreij authored May 19, 2021
2 parents ada45bd + de38c23 commit 754f49e
Show file tree
Hide file tree
Showing 135 changed files with 1,797 additions and 997 deletions.
24 changes: 18 additions & 6 deletions .github/workflows/publish_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,25 @@ jobs:

# TODO: add more tests or rely on check_release workflow?

# Packages and publishes the AARs to Bintray
- name: Publish to Bintray
run: ./gradlew bintrayUpload --stacktrace
# Base64 decodes and pipes the GPG key content into the secret file
- name: Prepare environment
env:
BINTRAY_USER: ${{secrets.BINTRAY_USER}}
BINTRAY_KEY: ${{secrets.BINTRAY_KEY}}
# BINTRAY_GPG_PASSPHRASE: ${{secrets.BINTRAY_GPG_PASSPHRASE}}
GPG_KEY_CONTENTS: ${{ secrets.GPG_KEY_CONTENTS }}
SIGNING_SECRET_KEY_RING_FILE: ${{ secrets.SIGNING_SECRET_KEY_RING_FILE }}
run: |
git fetch --unshallow
sudo bash -c "echo '$GPG_KEY_CONTENTS' | base64 -d > '$SIGNING_SECRET_KEY_RING_FILE'"
# Packages and publishes to Maven Central
- name: Publish to Maven Central
run: ./gradlew publishReleasePublicationToSonatypeRepository --max-workers 1 --stacktrace
env:
OSSRH_USERNAME: ${{ secrets.OSSRH_USERNAME }}
OSSRH_PASSWORD: ${{ secrets.OSSRH_PASSWORD }}
SIGNING_KEY_ID: ${{ secrets.SIGNING_KEY_ID }}
SIGNING_PASSWORD: ${{ secrets.SIGNING_PASSWORD }}
SIGNING_SECRET_KEY_RING_FILE: ${{ secrets.SIGNING_SECRET_KEY_RING_FILE }}
SONATYPE_STAGING_PROFILE_ID: ${{ secrets.SONATYPE_STAGING_PROFILE_ID }}

# Get the version name from a script and save to environment variable.
- name: Set PROJECT_VERSION
Expand Down
2 changes: 1 addition & 1 deletion 3ds2/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ ext.mavenArtifactId = "3ds2"
ext.mavenArtifactName = "Adyen checkout 3DS2 component"
ext.mavenArtifactDescription = "Adyen Checkout 3DS2 component client for Adyen's Checkout API."

apply from: "../config/gradle/sharedTasks.gradle"
apply from: "${rootDir}/config/gradle/sharedTasks.gradle"

android {
compileSdkVersion compile_sdk_version
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,8 @@ class Adyen3DS2Component(application: Application, configuration: Adyen3DS2Confi
)
}

override fun getSupportedPaymentMethodTypes(): List<String>? = null

@Throws(ComponentException::class)
override fun handleActionInternal(activity: Activity, action: Action) {
when (action.type) {
Expand Down Expand Up @@ -269,7 +271,10 @@ class Adyen3DS2Component(application: Application, configuration: Adyen3DS2Confi
acsTransactionID = challenge.acsTransID
acsRefNumber = challenge.acsReferenceNumber
acsSignedContent = challenge.acsSignedContent
threeDSRequestorAppURL = ChallengeParameters.getEmbeddedRequestorAppURL(getApplication())
// This field was introduced in version 2.2.0 so older protocols don't expect it to be present and might throw an error.
if (challenge.messageVersion != PROTOCOL_VERSION_2_1_0) {
threeDSRequestorAppURL = ChallengeParameters.getEmbeddedRequestorAppURL(getApplication())
}
}
}

Expand Down Expand Up @@ -310,13 +315,14 @@ class Adyen3DS2Component(application: Application, configuration: Adyen3DS2Confi
val TAG = LogUtil.getTag()

@JvmField
val PROVIDER: ActionComponentProvider<Adyen3DS2Component> = ActionComponentProviderImpl(
val PROVIDER: ActionComponentProvider<Adyen3DS2Component, Adyen3DS2Configuration> = ActionComponentProviderImpl(
Adyen3DS2Component::class.java, Adyen3DS2Configuration::class.java
)

private const val FINGERPRINT_DETAILS_KEY = "threeds2.fingerprint"
private const val CHALLENGE_DETAILS_KEY = "threeds2.challengeResult"
private const val DEFAULT_CHALLENGE_TIME_OUT = 10
private const val PROTOCOL_VERSION_2_1_0 = "2.1.0"

private var sGotDestroyedWhileChallenging = false
}
Expand Down
33 changes: 22 additions & 11 deletions RELEASE_NOTES.md
Original file line number Diff line number Diff line change
@@ -1,22 +1,33 @@
[//]: # (This file will be used for the release notes on GitHub when publishing.)
[//]: # (Types of changes: `Added` `Changed` `Deprecated` `Removed` `Fixed` `Security`)
[//]: # (Example:)
[//]: # (### Added)
[//]: # (## Added)
[//]: # ( - New payment method)
[//]: # ( ### Changed)
[//]: # (## Changed)
[//]: # ( - DropIn service's package changed from `com.adyen.dropin` to `com.adyen.dropin.services`)
[//]: # ( ### Deprecated)
[//]: # ( # Deprecated)
[//]: # ( - Configurations public constructor are deprecated, please use each Configuration's builder to make a Configuration object)

## Added
- Validation of PublicKey in CSE module if it's used standalone.
- 'isReady' flag to ComponentState because some components might require some initialization time even if all the inputs are valid.
- 'isValid' now checks both 'isInputValid' and 'isReady' to be true.

## Fixed
- Handle Intent results if DropInActivity got destroyed.
- Queue API request if DropInService is not yet bound to DropInActivity

- Support for Pix payment method.
- `QRCodeComponent` to handle action type `qrCode` from payment method `pix`.
- Support for other payment methods with a qrCode action will be added in the future.
- Support for returning `returnUrlQueryString` from redirect URL for some redirect payment methods like Swish.

## Changed
- New releases are now published to [Maven Central](https://repo1.maven.org/maven2/com/adyen/checkout/)
- A `Configuration` object is now required when initializing any component. Action Components did not require it previously.
- Provided default `GooglePayConfiguration` and `CardConfiguration` in Drop-in. It's not required to manually set these configurations in `DropInConfiguration.Builder` anymore.
- The default Google Pay environment will automatically follow the Adyen environment. It will be initialized as `ENVIRONMENT_TEST` when using Adyen's `TEST` environment, otherwise it will be set to `ENVIRONMENT_PRODUCTION`.
- The `merchantAccount` parameter in `GooglePayConfiguration.Builder` is now optional. You can remove it from the builder constructor, or use `GooglePayConfiguration.Builder.setMerchantAccount` if you need to pass it manually.
- Updated 3DS2 SDK to version 2.2.2
- Updated Material Components dependency to 1.3.0.
- Screenshots are now allowed in Debug builds, when the Card component is displayed.

## Fixed
- Passing `threeDSRequestorAppURL` to the SDK in the 3DS2 Component only when protocol version is 2.2.0 or higher since this is not expected in 2.1.0
- Style in TextInputLayout where in some scenarios text color would be too light and hard to see.

## Removed
- `WeChatPayComponent` since it didn't have any function. Instead you can simply check if the App is available by calling: `WeChatPayProvider.isAvailable`.
- `PaymentComponentProvider.isAvailable` since most payment methods are always available. Replaced it with `PaymentMethodAvailabilityCheck`, only implemented for methods that need to check for availability.
2 changes: 1 addition & 1 deletion await/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ ext.mavenArtifactId = "await"
ext.mavenArtifactName = "Adyen Checkout Await component"
ext.mavenArtifactDescription = "Adyen checkout await component for Adyen's Checkout API."

apply from: "../config/gradle/sharedTasks.gradle"
apply from: "${rootDir}/config/gradle/sharedTasks.gradle"

android {
compileSdkVersion compile_sdk_version
Expand Down
22 changes: 14 additions & 8 deletions await/src/main/java/com/adyen/checkout/await/AwaitComponent.java
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@
import androidx.lifecycle.MutableLiveData;
import androidx.lifecycle.Observer;

import com.adyen.checkout.await.api.StatusResponseUtils;
import com.adyen.checkout.await.model.StatusResponse;
import com.adyen.checkout.components.status.api.StatusResponseUtils;
import com.adyen.checkout.components.status.model.StatusResponse;
import com.adyen.checkout.components.ActionComponentData;
import com.adyen.checkout.components.ActionComponentProvider;
import com.adyen.checkout.components.ViewableComponent;
Expand All @@ -30,6 +30,8 @@
import com.adyen.checkout.components.base.lifecycle.BaseLifecycleObserver;
import com.adyen.checkout.components.model.payments.response.Action;
import com.adyen.checkout.components.model.payments.response.AwaitAction;
import com.adyen.checkout.components.status.StatusRepository;
import com.adyen.checkout.components.util.PaymentMethodTypes;
import com.adyen.checkout.core.exception.CheckoutException;
import com.adyen.checkout.core.exception.ComponentException;
import com.adyen.checkout.core.log.LogUtil;
Expand All @@ -49,7 +51,7 @@ public class AwaitComponent extends BaseActionComponent<AwaitConfiguration>

private static final String PAYLOAD_DETAILS_KEY = "payload";

public static final ActionComponentProvider<AwaitComponent> PROVIDER
public static final ActionComponentProvider<AwaitComponent, AwaitConfiguration> PROVIDER
= new ActionComponentProviderImpl<>(AwaitComponent.class, AwaitConfiguration.class, true);

final StatusRepository mStatusRepository;
Expand Down Expand Up @@ -78,7 +80,7 @@ public void onChanged(@Nullable ComponentException e) {
}
};

public AwaitComponent(@NonNull Application application, @Nullable AwaitConfiguration configuration) {
public AwaitComponent(@NonNull Application application, @NonNull AwaitConfiguration configuration) {
super(application, configuration);
if (configuration == null) {
// This component requires the client key from the configuration to work.
Expand All @@ -94,12 +96,16 @@ protected List<String> getSupportedActionTypes() {
return Collections.unmodifiableList(Arrays.asList(supportedCodes));
}

@NonNull
@Override
protected List<String> getSupportedPaymentMethodTypes() {
final String[] supportedPaymentMethods = {PaymentMethodTypes.BLIK, PaymentMethodTypes.MB_WAY};
return Collections.unmodifiableList(Arrays.asList(supportedPaymentMethods));
}

@Override
protected void handleActionInternal(@NonNull Activity activity, @NonNull Action action) throws ComponentException {
final Configuration configuration = getConfiguration();
if (configuration == null) {
throw new ComponentException("Configuration not found");
}
mPaymentMethodType = action.getPaymentMethodType();
// Notify UI to get the logo.
createOutputData(null);
Expand Down Expand Up @@ -161,7 +167,7 @@ public AwaitOutputData getOutputData() {

@Override
public void sendAnalyticsEvent(@NonNull Context context) {
// TODO: 28/08/2020 Do we have an event for this?
// noop
}


Expand Down
5 changes: 4 additions & 1 deletion await/src/main/java/com/adyen/checkout/await/AwaitView.java
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,9 @@ private void updateLogo() {
}

private void updateMessageText() {
if (getMessageTextResource() == null) {
return;
}
mTextViewOpenApp.setText(getMessageTextResource());
}

Expand All @@ -126,7 +129,7 @@ private Integer getMessageTextResource() {
case PaymentMethodTypes.MB_WAY:
return R.string.checkout_await_message_mbway;
default:
return R.string.checkout_await_message_blik;
return null;
}
}
}
4 changes: 2 additions & 2 deletions await/src/main/res/layout/await_view.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@
android:id="@+id/imageView_logo"
style="@style/AdyenCheckout.Image.Logo.Large"
android:layout_gravity="center_horizontal"

android:contentDescription="@null" />
android:contentDescription="@null"
tools:ignore="RequiredSize" />

<TextView
android:id="@+id/textView_open_app"
Expand Down
13 changes: 0 additions & 13 deletions await/src/main/res/values/dimens.xml

This file was deleted.

19 changes: 0 additions & 19 deletions await/src/main/res/values/styles.xml

This file was deleted.

6 changes: 3 additions & 3 deletions bcmc/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ plugins {

// Maven artifact
ext.mavenArtifactId = "bcmc"
ext.mavenArtifactName = "Adyen checkout bcmc UI component"
ext.mavenArtifactDescription = "Adyen checkout bcmc UI component client for Adyen's Checkout API."
ext.mavenArtifactName = "Adyen checkout BCMC component"
ext.mavenArtifactDescription = "Adyen checkout BCMC component client for Adyen's Checkout API."

apply from: "../config/gradle/sharedTasks.gradle"
apply from: "${rootDir}/config/gradle/sharedTasks.gradle"

android {
compileSdkVersion compile_sdk_version
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,9 @@
*/
package com.adyen.checkout.bcmc

import android.app.Application
import androidx.lifecycle.ViewModelProvider
import androidx.lifecycle.ViewModelStoreOwner
import com.adyen.checkout.card.repository.PublicKeyRepository
import com.adyen.checkout.components.ComponentAvailableCallback
import com.adyen.checkout.components.PaymentComponentProvider
import com.adyen.checkout.components.base.GenericPaymentMethodDelegate
import com.adyen.checkout.components.base.lifecycle.viewModelFactory
Expand All @@ -33,13 +31,4 @@ class BcmcComponentProvider : PaymentComponentProvider<BcmcComponent, BcmcConfig
}
return ViewModelProvider(viewModelStoreOwner, bcmcFactory).get(BcmcComponent::class.java)
}

override fun isAvailable(
applicationContext: Application,
paymentMethod: PaymentMethod,
configuration: BcmcConfiguration,
callback: ComponentAvailableCallback<BcmcConfiguration>
) {
callback.onAvailabilityResult(true, paymentMethod, configuration)
}
}
2 changes: 1 addition & 1 deletion blik/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ ext.mavenArtifactId = "blik"
ext.mavenArtifactName = "Adyen Checkout Blik Component"
ext.mavenArtifactDescription = "Adyen Checkout Blik Component"

apply from: "../config/gradle/sharedTasks.gradle"
apply from: "${rootDir}/config/gradle/sharedTasks.gradle"

android {
compileSdkVersion compile_sdk_version
Expand Down
17 changes: 8 additions & 9 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -10,22 +10,20 @@ ext {

buildscript {
// Build Script
ext.android_gradle_plugin_version = '4.0.0'
ext.kotlin_version = '1.4.21'
ext.android_gradle_plugin_version = '4.1.0'
ext.kotlin_version = '1.4.32'
ext.detekt_gradle_plugin_version = "1.13.1"
ext.bintray_gradle_plugin_version = "1.8.5"
ext.spotbugs_gradle_plugin_version = "4.5.1"
ext.dokka_version = "1.4.20"

repositories {
google()
jcenter()
mavenCentral()
maven { url "https://plugins.gradle.org/m2/" }
}

dependencies {
classpath "com.android.tools.build:gradle:$android_gradle_plugin_version"
classpath "com.jfrog.bintray.gradle:gradle-bintray-plugin:$bintray_gradle_plugin_version"
classpath "io.gitlab.arturbosch.detekt:detekt-gradle-plugin:$detekt_gradle_plugin_version"
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath "gradle.plugin.com.github.spotbugs.snom:spotbugs-gradle-plugin:$spotbugs_gradle_plugin_version"
Expand All @@ -45,7 +43,7 @@ allprojects {
// just for example app, don't need to increment
ext.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).
ext.version_name = "4.0.0-beta02"
ext.version_name = "4.0.0-beta03"

// Code quality
ext.ktlint_version = '0.40.0'
Expand All @@ -69,12 +67,12 @@ allprojects {
ext.fragment_version = "1.2.5"
ext.appcompat_version = "1.2.0"
ext.recyclerview_version = "1.1.0"
ext.material_version = "1.2.1"
ext.material_version = "1.3.0"
ext.browser_version = "1.3.0"

// Adyen Dependencies
ext.adyen_cse_version = "1.0.5"
ext.adyen3ds2_version = "2.2.0"
ext.adyen3ds2_version = "2.2.2"

// External Dependencies
ext.play_services_wallet_version = '18.1.2'
Expand All @@ -99,7 +97,8 @@ allprojects {

repositories {
google()
jcenter()
mavenCentral()
jcenter() // Koin is still not migrated
}
}

Expand Down
2 changes: 1 addition & 1 deletion card/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ ext.mavenArtifactId = "card"
ext.mavenArtifactName = "Adyen Checkout Card component"
ext.mavenArtifactDescription = "Adyen checkout Card component client for Adyen's Checkout API."

apply from: "../config/gradle/sharedTasks.gradle"
apply from: "${rootDir}/config/gradle/sharedTasks.gradle"

android {
compileSdkVersion compile_sdk_version
Expand Down
Loading

0 comments on commit 754f49e

Please sign in to comment.