-
Notifications
You must be signed in to change notification settings - Fork 68
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #300 from Adyen/feature/blik_v3
Blik on v3
- Loading branch information
Showing
59 changed files
with
1,008 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
79 changes: 79 additions & 0 deletions
79
base-v3/src/main/java/com/adyen/checkout/base/model/payments/request/BlikPaymentMethod.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,79 @@ | ||
/* | ||
* Copyright (c) 2020 Adyen N.V. | ||
* | ||
* This file is open source and available under the MIT license. See the LICENSE file for more info. | ||
* | ||
* Created by josephj on 4/12/2020. | ||
*/ | ||
|
||
package com.adyen.checkout.base.model.payments.request; | ||
|
||
import android.os.Parcel; | ||
import android.support.annotation.NonNull; | ||
import android.support.annotation.Nullable; | ||
|
||
import com.adyen.checkout.base.util.PaymentMethodTypes; | ||
import com.adyen.checkout.core.exception.ModelSerializationException; | ||
import com.adyen.checkout.core.model.JsonUtils; | ||
|
||
import org.json.JSONException; | ||
import org.json.JSONObject; | ||
|
||
@SuppressWarnings({"MemberName", "PMD.DataClass"}) | ||
public class BlikPaymentMethod extends PaymentMethodDetails { | ||
|
||
@NonNull | ||
public static final Creator<BlikPaymentMethod> CREATOR = new Creator<>(BlikPaymentMethod.class); | ||
|
||
public static final String PAYMENT_METHOD_TYPE = PaymentMethodTypes.BLIK; | ||
|
||
private static final String BLIK_CODE = "blikCode"; | ||
|
||
@NonNull | ||
public static final Serializer<BlikPaymentMethod> SERIALIZER = new Serializer<BlikPaymentMethod>() { | ||
|
||
@NonNull | ||
@Override | ||
public JSONObject serialize(@NonNull BlikPaymentMethod modelObject) { | ||
final JSONObject jsonObject = new JSONObject(); | ||
try { | ||
// getting parameters from parent class | ||
jsonObject.putOpt(PaymentMethodDetails.TYPE, modelObject.getType()); | ||
|
||
jsonObject.putOpt(BLIK_CODE, modelObject.getBlikCode()); | ||
} catch (JSONException e) { | ||
throw new ModelSerializationException(BlikPaymentMethod.class, e); | ||
} | ||
return jsonObject; | ||
} | ||
|
||
@NonNull | ||
@Override | ||
public BlikPaymentMethod deserialize(@NonNull JSONObject jsonObject) { | ||
final BlikPaymentMethod blikPaymentMethod = new BlikPaymentMethod(); | ||
|
||
// getting parameters from parent class | ||
blikPaymentMethod.setType(jsonObject.optString(PaymentMethodDetails.TYPE, null)); | ||
|
||
blikPaymentMethod.setBlikCode(jsonObject.optString(BLIK_CODE, null)); | ||
|
||
return blikPaymentMethod; | ||
} | ||
}; | ||
|
||
private String blikCode; | ||
|
||
@Override | ||
public void writeToParcel(@NonNull Parcel dest, int flags) { | ||
JsonUtils.writeToParcel(dest, SERIALIZER.serialize(this)); | ||
} | ||
|
||
@Nullable | ||
public String getBlikCode() { | ||
return blikCode; | ||
} | ||
|
||
public void setBlikCode(@Nullable String blikCode) { | ||
this.blikCode = blikCode; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
/* | ||
* Copyright (c) 2020 Adyen N.V. | ||
* | ||
* This file is open source and available under the MIT license. See the LICENSE file for more info. | ||
* | ||
* Created by josephj on 4/12/2020. | ||
*/ | ||
|
||
// Maven artifact | ||
ext.mavenArtifactId = "blik-base" | ||
ext.mavenArtifactName = "Adyen checkout blik-base component" | ||
ext.mavenArtifactDescription = "Adyen checkout blik-base component client for Adyen's Checkout API." | ||
|
||
apply plugin: 'com.android.library' | ||
|
||
android { | ||
compileSdkVersion compile_sdk_version | ||
|
||
defaultConfig { | ||
minSdkVersion min_sdk_version | ||
targetSdkVersion target_sdk_version | ||
versionCode version_code | ||
versionName version_name | ||
|
||
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" | ||
} | ||
} | ||
|
||
dependencies { | ||
//Tests | ||
testImplementation "junit:junit:$junit_version" | ||
androidTestImplementation "com.android.support.test:runner:$support_test_runner_version" | ||
androidTestImplementation "com.android.support.test.espresso:espresso-core:$espresso_version" | ||
|
||
// Checkout | ||
api project(':base-v3') | ||
} | ||
|
||
// This sharedTasks.gradle script is applied at the end of this build.gradle script, | ||
// since javadocs.gradle script is dependent on android.compileSdkVersion property, | ||
// which is set on the android block above. | ||
apply from: "../config/gradle/sharedTasks.gradle" |
Oops, something went wrong.