Skip to content

Commit

Permalink
3.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
adyen-git-manager committed Jul 16, 2019
1 parent 9b1c4e2 commit 1322cb0
Show file tree
Hide file tree
Showing 22 changed files with 430 additions and 141 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
import android.arch.lifecycle.Observer;
import android.content.Context;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;

import com.adyen.checkout.adyen3ds2.model.ChallengeResult;
import com.adyen.checkout.adyen3ds2.model.ChallengeToken;
Expand All @@ -40,6 +41,7 @@
import com.adyen.threeds2.RuntimeErrorEvent;
import com.adyen.threeds2.ThreeDS2Service;
import com.adyen.threeds2.Transaction;
import com.adyen.threeds2.customization.UiCustomization;
import com.adyen.threeds2.exception.SDKAlreadyInitializedException;
import com.adyen.threeds2.exception.SDKNotInitializedException;
import com.adyen.threeds2.parameters.ChallengeParameters;
Expand Down Expand Up @@ -68,6 +70,9 @@ public final class Adyen3DS2Component extends BaseActionComponent implements Cha
@SuppressWarnings(Lint.SYNTHETIC)
Transaction mTransaction;

@SuppressWarnings(Lint.SYNTHETIC)
UiCustomization mUiCustomization;

public Adyen3DS2Component(@NonNull Application application) {
super(application);
}
Expand All @@ -92,6 +97,18 @@ public void observe(@NonNull LifecycleOwner lifecycleOwner, @NonNull Observer<Ac
}
}

/**
* Set a {@link UiCustomization} object to be passed to the 3DS2 SDK for customizing the challenge screen.
* Needs to be set before handling any action.
*
* @param uiCustomization The customization object.
*/
public void setUiCustomization(@Nullable UiCustomization uiCustomization) {
synchronized (this) {
mUiCustomization = uiCustomization;
}
}

@Override
@NonNull
protected List<String> getSupportedActionTypes() {
Expand Down Expand Up @@ -179,7 +196,9 @@ private void identifyShopper(final Context context, final String encodedFingerpr
public void run() {
try {
Logger.d(TAG, "initialize 3DS2 SDK");
ThreeDS2Service.INSTANCE.initialize(context, configParameters, null, null);
synchronized (Adyen3DS2Component.this) {
ThreeDS2Service.INSTANCE.initialize(context, configParameters, null, mUiCustomization);
}
} catch (SDKAlreadyInitializedException e) {
// This shouldn't cause any side effect.
Logger.w(TAG, "3DS2 Service already initialized.");
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,15 @@ The Components are available through [jcenter][dl], you only need to add the Gra
Import the Component module for the Payment Method you want to use by adding it to your `build.gradle` file.
For example, for the Drop-in solution you should add:
```groovy
implementation "com.adyen.checkout:drop-in:3.0.0-rc02"
implementation "com.adyen.checkout:drop-in:3.0.0"
```
For a Credit Card component you should add:
```groovy
implementation "com.adyen.checkout:card-ui:3.0.0-rc02"
implementation "com.adyen.checkout:card-ui:3.0.0"
```
For and iDeal component you should add:
```groovy
implementation "com.adyen.checkout:ideal-ui:3.0.0-rc02"
implementation "com.adyen.checkout:ideal-ui:3.0.0"
```

## Drop-in
Expand Down
14 changes: 9 additions & 5 deletions RELEASE_NOTES
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
<ul>
<li>Improve error handling, notify to observer.</li>
<li>3DS2 error flows go to observer.</li>
<li>Bug fixes.</li>
</ul>
#### Android Components (V3)
Version 3.x.x is a completely new way of integrating payments using the Checkout API (payments/) with our UI Components or Drop-in.
It is not compatible with the integrations of version 2.x.x, which used the SDK specific API (paymentSession/).
Version 2.x.x will only receive maintenance for bug fixes, not any new features.
Check the Readme page and documentation website for more information.

- Create default Configuration Builders.
- Add UiCustomization class to 3DS2 component.
- Bug fixes.
10 changes: 10 additions & 0 deletions base-v3/src/main/java/com/adyen/checkout/base/Configuration.java
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,19 @@
*/
public interface Configuration {

/**
* Get shopper's locale.
*
* @return {@link Locale}
*/
@NonNull
Locale getShopperLocale();

/**
* Get the {@link Environment} to be used for network calls to Adyen.
*
* @return The Environment
*/
@NonNull
Environment getEnvironment();
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
/*
* Copyright (c) 2019 Adyen N.V.
*
* This file is open source and available under the MIT license. See the LICENSE file for more info.
*
* Created by caiof on 11/7/2019.
*/

package com.adyen.checkout.base.component;

import android.support.annotation.NonNull;

import com.adyen.checkout.base.Configuration;
import com.adyen.checkout.core.api.Environment;

import java.util.Locale;

public abstract class BaseConfiguration implements Configuration {

private final Locale mShopperLocale;
private final Environment mEnvironment;

public BaseConfiguration(@NonNull Locale shopperLocale, @NonNull Environment environment) {
mShopperLocale = shopperLocale;
mEnvironment = environment;
}

@NonNull
public Environment getEnvironment() {
return mEnvironment;
}

@NonNull
@Override
public Locale getShopperLocale() {
return mShopperLocale;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
/*
* Copyright (c) 2019 Adyen N.V.
*
* This file is open source and available under the MIT license. See the LICENSE file for more info.
*
* Created by caiof on 11/7/2019.
*/

package com.adyen.checkout.base.component;

import android.content.Context;
import android.support.annotation.NonNull;

import com.adyen.checkout.base.Configuration;
import com.adyen.checkout.core.api.Environment;
import com.adyen.checkout.core.util.LocaleUtil;

import java.util.Locale;

public abstract class BaseConfigurationBuilder<ConfigurationT extends Configuration> {

@NonNull
protected Locale mBuilderShopperLocale;

@NonNull
protected Environment mBuilderEnvironment;

/**
* Constructor that provides default values.
*
* @param context A Context
*/
public BaseConfigurationBuilder(@NonNull Context context) {
this(LocaleUtil.getLocale(context), Environment.TEST);
}

/**
* Base constructor with the required fields.
*
* @param shopperLocale The Locale of the shopper.
* @param environment The {@link Environment} to be used for network calls to Adyen.
*/
public BaseConfigurationBuilder(@NonNull Locale shopperLocale, @NonNull Environment environment) {
mBuilderShopperLocale = shopperLocale;
mBuilderEnvironment = environment;
}

public void setShopperLocale(@NonNull Locale builderShopperLocale) {
mBuilderShopperLocale = builderShopperLocale;
}

public void setEnvironment(@NonNull Environment builderEnvironment) {
mBuilderEnvironment = builderEnvironment;
}

@NonNull
public abstract ConfigurationT build();
}
8 changes: 4 additions & 4 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ ext {

buildscript {
// Build Script
ext.version_android_gradle_plugin = "3.4.1"
ext.version_kotlin_gradle_plugin = "1.3.31"
ext.version_android_gradle_plugin = '3.4.2'
ext.version_kotlin_gradle_plugin = "1.3.41"
ext.version_detekt_gradle_plugin = "1.0.0-RC14"
ext.version_bintray_gradle_plugin = "1.8.4"

Expand All @@ -35,7 +35,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 = "3.0.0-rc01"
ext.version_name = "3.0.0"

// Code quality
ext.version_ktlint = '0.32.0'
Expand All @@ -53,7 +53,7 @@ allprojects {
ext.version_support_library = "28.0.0"
ext.version_lifecycle_extensions = "1.1.1"
ext.version_adyen_cse = "1.0.5"
ext.version_adyen3ds2 = "2.1.0-rc01"
ext.version_adyen3ds2 = "2.1.0-rc02"

// Drop-in
ext.version_kotlin = "1.3.31"
Expand Down
Loading

0 comments on commit 1322cb0

Please sign in to comment.