Skip to content

Commit

Permalink
3.5.0
Browse files Browse the repository at this point in the history
  • Loading branch information
adyen-git-manager committed Oct 22, 2019
1 parent 3ab59ea commit aa84d72
Show file tree
Hide file tree
Showing 129 changed files with 2,155 additions and 1,125 deletions.
7 changes: 0 additions & 7 deletions 3ds2/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,6 @@ android {
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"

}

buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
}

dependencies {
Expand Down
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,16 @@
[//]: <> (Add changes that not released yet into `Unreleased` section)
[//]: <> (Comment `Unreleased` section if there are no changes)
[//]: <> (## [Unreleased])
## [3.5.0] - 2019-10-21
### Added
- WeChatPay SDK payment method.
### Changed
- Renamed `RecurringDetail` to `StoredPaymentMethod` to match the object array names on the [documentation](https://docs.adyen.com/api-explorer/#/PaymentSetupAndVerificationService/v50/paymentMethods__section_resParams).
- Added the fields `holderName` and `shopperEmail` that were missing.
- Precise CVC check in CardComponent for Amex card type.
### Deprecated
- Created new deprecated `RecurringDetail` to maintain backwards compatibility for now.

## [3.4.1] - 2019-10-07
### Added
- MolpayComponents can how handle multiple MolPay PaymentMethods (molpay_ebanking_fpx_MY, molpay_ebanking_TH, molpay_ebanking_VN)
Expand Down
9 changes: 5 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@ 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.4.1"
implementation "com.adyen.checkout:drop-in:3.5.0"
```
For a Credit Card component you should add:
```groovy
implementation "com.adyen.checkout:card-ui:3.4.1"
implementation "com.adyen.checkout:card-ui:3.5.0"
```

## Drop-in
Expand Down Expand Up @@ -65,15 +65,16 @@ Don't forget to also add the service your manifest.
Some payment methods need additional configuration. For example, to enable the card form, the Drop-in needs a public key from the Customer Area to be used for encryption. These payment method specific configuration parameters can be set in the `DropInConfiguration`:

```kotlin
val dropInConfiguration = DropInConfiguration.Builder(this@MainActivity, YourDropInService::class.java)
val dropInConfiguration = DropInConfiguration.Builder(this@MainActivity,
resultIntent, YourDropInService::class.java)
.addCardConfiguration(cardConfiguration)
.build()
```

After serializing the payment methods and creating the configuration, the Drop-in is ready to be initialized. Just call the `.startPayment()` method, the final result sent on the `CallResult` will be added to your `resultIntent` to start your Activity.

```kotlin
DropIn.INSTANCE.startPayment(this@YourActivity, mPaymentMethodsApiResponse, dropInConfiguration, resultIntent)
DropIn.startPayment(this@YourActivity, paymentMethodsApiResponse, dropInConfiguration)
```

## Components
Expand Down
5 changes: 3 additions & 2 deletions README_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,15 +65,16 @@ Don't forget to also add the service your manifest.
Some payment methods need additional configuration. For example, to enable the card form, the Drop-in needs a public key from the Customer Area to be used for encryption. These payment method specific configuration parameters can be set in the `DropInConfiguration`:

```kotlin
val dropInConfiguration = DropInConfiguration.Builder(this@MainActivity, YourDropInService::class.java)
val dropInConfiguration = DropInConfiguration.Builder(this@MainActivity,
resultIntent, YourDropInService::class.java)
.addCardConfiguration(cardConfiguration)
.build()
```

After serializing the payment methods and creating the configuration, the Drop-in is ready to be initialized. Just call the `.startPayment()` method, the final result sent on the `CallResult` will be added to your `resultIntent` to start your Activity.

```kotlin
DropIn.INSTANCE.startPayment(this@YourActivity, mPaymentMethodsApiResponse, dropInConfiguration, resultIntent)
DropIn.startPayment(this@YourActivity, paymentMethodsApiResponse, dropInConfiguration)
```

## Components
Expand Down
3 changes: 1 addition & 2 deletions RELEASE_NOTES
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
<ul>
<li>UI Updates</li>
<li>Update Molpay component to support Thailand and Vietnam</li>
<li>Added WeChatPay component</li>
<li>Bug Fixes</li>
</ul>
7 changes: 0 additions & 7 deletions base-ui/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,6 @@ android {

testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}

buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
}

dependencies {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,10 @@ public void attach(@NonNull ComponentT component, @NonNull LifecycleOwner lifecy
}

@NonNull
public ComponentT getComponent() {
protected ComponentT getComponent() {
if (mComponent == null) {
throw new RuntimeException("Should not get Component before it's attached");
}
return mComponent;
}
}
7 changes: 0 additions & 7 deletions base-v3/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,6 @@ android {
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"

}

buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
}

dependencies {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ protected void done() {
final BitmapDrawable result = get(SAFETY_TIMEOUT, TimeUnit.MILLISECONDS);
notifyLogo(result);
} catch (ExecutionException e) {
Logger.e(TAG, "Execution failed.", e);
Logger.e(TAG, "Execution failed for logo - " + getLogoUrl());
notifyFailed();
} catch (InterruptedException e) {
Logger.e(TAG, "Execution interrupted.", e);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ public abstract class BasePaymentComponent<ConfigurationT extends Configuration,

private final MutableLiveData<ComponentError> mComponentErrorLiveData = new MutableLiveData<>();

@NonNull
@Nullable
private OutputDataT mOutputData;

private final MutableLiveData<OutputDataT> mOutputLiveData = new MutableLiveData<>();
Expand All @@ -57,8 +57,6 @@ public abstract class BasePaymentComponent<ConfigurationT extends Configuration,
public BasePaymentComponent(@NonNull PaymentMethod paymentMethod, @NonNull ConfigurationT configuration) {
super(paymentMethod, configuration);
assertSupported(paymentMethod);
mOutputData = createEmptyOutputData();
mOutputLiveData.setValue(mOutputData);
}

@SuppressWarnings("MissingDeprecated")
Expand Down Expand Up @@ -96,7 +94,7 @@ public PaymentComponentState getState() {
*/
public final void inputDataChanged(@NonNull InputDataT inputData) {
final OutputDataT newOutputData = onInputDataChanged(inputData);
if (!mOutputData.equals(newOutputData)) {
if (!newOutputData.equals(mOutputData)) {
mOutputData = newOutputData;
mOutputLiveData.setValue(mOutputData);
notifyStateChanged();
Expand Down Expand Up @@ -137,7 +135,7 @@ public void sendAnalyticsEvent(@NonNull Context context) {
}
}

@NonNull
@Nullable
protected OutputDataT getOutputData() {
return mOutputData;
}
Expand All @@ -151,9 +149,6 @@ protected OutputDataT getOutputData() {
@NonNull
protected abstract OutputDataT onInputDataChanged(@NonNull InputDataT inputData);

@NonNull
protected abstract OutputDataT createEmptyOutputData();

@NonNull
@WorkerThread
protected abstract PaymentComponentState createComponentState();
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
/*
* 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 15/10/2019.
*/

package com.adyen.checkout.base.component;

public final class EmptyInputData implements InputData {
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
/*
* 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 15/10/2019.
*/

package com.adyen.checkout.base.component;

public final class EmptyOutputData implements OutputData {
@Override
public boolean isValid() {
return true;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

import com.adyen.checkout.base.model.paymentmethods.PaymentMethod;
import com.adyen.checkout.base.model.paymentmethods.PaymentMethodsGroup;
import com.adyen.checkout.base.model.paymentmethods.RecurringDetail;
import com.adyen.checkout.base.model.paymentmethods.StoredPaymentMethod;
import com.adyen.checkout.core.exception.ModelSerializationException;
import com.adyen.checkout.core.model.JsonUtils;
import com.adyen.checkout.core.model.ModelObject;
Expand Down Expand Up @@ -46,7 +46,7 @@ public JSONObject serialize(@NonNull PaymentMethodsApiResponse modelObject) {
try {
jsonObject.putOpt(GROUPS, ModelUtils.serializeOptList(modelObject.getGroups(), PaymentMethodsGroup.SERIALIZER));
jsonObject.putOpt(STORED_PAYMENT_METHODS,
ModelUtils.serializeOptList(modelObject.getStoredPaymentMethods(), RecurringDetail.SERIALIZER));
ModelUtils.serializeOptList(modelObject.getStoredPaymentMethods(), StoredPaymentMethod.SERIALIZER));
jsonObject.putOpt(PAYMENT_METHODS, ModelUtils.serializeOptList(modelObject.getPaymentMethods(), PaymentMethod.SERIALIZER));
} catch (JSONException e) {
throw new ModelSerializationException(PaymentMethodsApiResponse.class, e);
Expand All @@ -60,15 +60,15 @@ public PaymentMethodsApiResponse deserialize(@NonNull JSONObject jsonObject) {
final PaymentMethodsApiResponse paymentMethodsApiResponse = new PaymentMethodsApiResponse();
paymentMethodsApiResponse.setGroups(ModelUtils.deserializeOptList(jsonObject.optJSONArray(GROUPS), PaymentMethodsGroup.SERIALIZER));
paymentMethodsApiResponse.setStoredPaymentMethods(
ModelUtils.deserializeOptList(jsonObject.optJSONArray(STORED_PAYMENT_METHODS), RecurringDetail.SERIALIZER));
ModelUtils.deserializeOptList(jsonObject.optJSONArray(STORED_PAYMENT_METHODS), StoredPaymentMethod.SERIALIZER));
paymentMethodsApiResponse.setPaymentMethods(
ModelUtils.deserializeOptList(jsonObject.optJSONArray(PAYMENT_METHODS), PaymentMethod.SERIALIZER));
return paymentMethodsApiResponse;
}
};

private List<PaymentMethodsGroup> groups;
private List<RecurringDetail> storedPaymentMethods;
private List<StoredPaymentMethod> storedPaymentMethods;
private List<PaymentMethod> paymentMethods;

@Override
Expand All @@ -82,7 +82,7 @@ public List<PaymentMethodsGroup> getGroups() {
}

@Nullable
public List<RecurringDetail> getStoredPaymentMethods() {
public List<StoredPaymentMethod> getStoredPaymentMethods() {
return storedPaymentMethods;
}

Expand All @@ -95,7 +95,7 @@ public void setGroups(@Nullable List<PaymentMethodsGroup> groups) {
this.groups = groups;
}

public void setStoredPaymentMethods(@Nullable List<RecurringDetail> storedPaymentMethods) {
public void setStoredPaymentMethods(@Nullable List<StoredPaymentMethod> storedPaymentMethods) {
this.storedPaymentMethods = storedPaymentMethods;
}

Expand Down
Loading

0 comments on commit aa84d72

Please sign in to comment.