From ba047328e1f5d1b615c7b9f8dbcb3266d48eec27 Mon Sep 17 00:00:00 2001 From: Stanislav Mukhametshin Date: Wed, 15 Aug 2018 17:12:07 +0300 Subject: [PATCH 1/2] ASDK-451-fix Added gatewayMerchantId --- .../main/java/ru/tinkoff/acquiring/sdk/EnterCardFragment.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ui/src/main/java/ru/tinkoff/acquiring/sdk/EnterCardFragment.java b/ui/src/main/java/ru/tinkoff/acquiring/sdk/EnterCardFragment.java index 785c410..9399a8f 100644 --- a/ui/src/main/java/ru/tinkoff/acquiring/sdk/EnterCardFragment.java +++ b/ui/src/main/java/ru/tinkoff/acquiring/sdk/EnterCardFragment.java @@ -339,7 +339,7 @@ public void onStart() { onCardReady(); } - if (androidPayParams != null && androidPayParams.getPublicKey() != null) { + if (androidPayParams != null) { initGoogleApiClient(); initAndroidPay(); } else { @@ -433,6 +433,7 @@ private PaymentDataRequest createPaymentDataRequest() { PaymentMethodTokenizationParameters params = PaymentMethodTokenizationParameters.newBuilder() .setPaymentMethodTokenizationType(WalletConstants.PAYMENT_METHOD_TOKENIZATION_TYPE_PAYMENT_GATEWAY) + .addParameter("gatewayMerchantId", sdk.getTerminalKey()) .addParameter("gateway", "tinkoff") .build(); From 0c931f822d829690076ff0c57f259ebcb7d332a5 Mon Sep 17 00:00:00 2001 From: Stanislav Mukhametshin Date: Wed, 15 Aug 2018 17:58:53 +0300 Subject: [PATCH 2/2] ASDK-452-fix Removed public key --- .../acquiring/sample/SettingsSdkManager.java | 13 ------------- .../acquiring/sample/ui/PayableActivity.java | 1 - .../tinkoff/acquiring/sdk/AndroidPayParams.java | 16 ---------------- 3 files changed, 30 deletions(-) diff --git a/sample/src/main/java/ru/tinkoff/acquiring/sample/SettingsSdkManager.java b/sample/src/main/java/ru/tinkoff/acquiring/sample/SettingsSdkManager.java index 395a3cd..ad929b5 100644 --- a/sample/src/main/java/ru/tinkoff/acquiring/sample/SettingsSdkManager.java +++ b/sample/src/main/java/ru/tinkoff/acquiring/sample/SettingsSdkManager.java @@ -5,9 +5,6 @@ import android.preference.PreferenceManager; import android.support.annotation.StyleRes; -import java.util.HashMap; -import java.util.Map; - import ru.tinkoff.acquiring.sample.camera.DemoCameraScanner; import ru.tinkoff.acquiring.sdk.ICameraCardScanner; import ru.tinkoff.acquiring.sdk.card.io.CameraCardIOScanner; @@ -21,15 +18,9 @@ public class SettingsSdkManager { private final Context context; private final SharedPreferences preferences; - private final Map keys = new HashMap<>(); - public SettingsSdkManager(Context context) { this.context = context; this.preferences = PreferenceManager.getDefaultSharedPreferences(context); - - keys.put(context.getString(R.string.acq_sp_default_value_terminal_id), "BHpsDK6YMP9Ps1drHv5yiTunqgCNTZM5rPIxToLDWKgLvCFHVSuqccxN/aHxeAXDbb61B8s3plQadugtL2Ln9pc="); - keys.put(context.getString(R.string.acq_sp_test_sdk_terminal_id), "BGbkgMjU6/bQyKzDkO4Vz5Qs9Qw5tHWZq3puUwMcqKCDUNMYcrxOgaHjFWdB3khRzQhe8mgxaQoEKxnUDmxsKD8="); - keys.put(context.getString(R.string.acq_sp_sdk_non_3ds_terminal_id), null); } public boolean isCustomKeyboardEnabled() { @@ -107,8 +98,4 @@ public ICameraCardScanner getCameraScanner() { } return new DemoCameraScanner(); } - - public String getAndroidPayPublicKey(String terminal) { - return keys.get(terminal); - } } diff --git a/sample/src/main/java/ru/tinkoff/acquiring/sample/ui/PayableActivity.java b/sample/src/main/java/ru/tinkoff/acquiring/sample/ui/PayableActivity.java index e3698ce..d9e1ee1 100644 --- a/sample/src/main/java/ru/tinkoff/acquiring/sample/ui/PayableActivity.java +++ b/sample/src/main/java/ru/tinkoff/acquiring/sample/ui/PayableActivity.java @@ -117,7 +117,6 @@ protected void initPayment(final Money amount, String terminalId = settings.getTerminalId(); AndroidPayParams androidPayParams = new AndroidPayParams.Builder() .setEnvironment(WalletConstants.ENVIRONMENT_TEST) - .setPublicKey(settings.getAndroidPayPublicKey(terminalId)) .build(); PayFormActivity .init(terminalId, MerchantParams.PASSWORD, MerchantParams.PUBLIC_KEY) diff --git a/ui/src/main/java/ru/tinkoff/acquiring/sdk/AndroidPayParams.java b/ui/src/main/java/ru/tinkoff/acquiring/sdk/AndroidPayParams.java index 0115b62..b4ccfb0 100644 --- a/ui/src/main/java/ru/tinkoff/acquiring/sdk/AndroidPayParams.java +++ b/ui/src/main/java/ru/tinkoff/acquiring/sdk/AndroidPayParams.java @@ -46,7 +46,6 @@ public AndroidPayParams[] newArray(int size) { public static class Builder { private String merchantName = ""; - private String publicKey; private String countryCode = "RU"; private boolean isPhoneRequired = false; private boolean isAddressRequired = false; @@ -95,15 +94,9 @@ public Builder setMerchantName(String merchantName) { return this; } - public Builder setPublicKey(String publicKey) { - this.publicKey = publicKey; - return this; - } - public AndroidPayParams build() { AndroidPayParams params = new AndroidPayParams(); params.merchantName = this.merchantName; - params.publicKey = this.publicKey; params.countryCode = this.countryCode; params.isPhoneRequired = this.isPhoneRequired; params.isAddressRequired = this.isAddressRequired; @@ -118,7 +111,6 @@ public AndroidPayParams build() { public static final String CURRENCY_CODE = "RUB"; private String merchantName; - private String publicKey; private String countryCode; private boolean isPhoneRequired; private boolean isAddressRequired; @@ -133,7 +125,6 @@ private AndroidPayParams() { private AndroidPayParams(Parcel in) { merchantName = in.readString(); - publicKey = in.readString(); countryCode = in.readString(); isPhoneRequired = in.readByte() != 0; isAddressRequired = in.readByte() != 0; @@ -146,7 +137,6 @@ private AndroidPayParams(Parcel in) { @Override public void writeToParcel(Parcel dest, int flags) { dest.writeString(merchantName); - dest.writeString(publicKey); dest.writeString(countryCode); dest.writeByte((byte) (isPhoneRequired ? 1 : 0)); dest.writeByte((byte) (isAddressRequired ? 1 : 0)); @@ -165,10 +155,6 @@ public String getMerchantName() { return merchantName; } - public String getPublicKey() { - return publicKey; - } - public String getCountryCode() { return countryCode; } @@ -196,6 +182,4 @@ public int getBuyButtonAppearance() { public int getTheme() { return theme; } - - }