Skip to content

Commit

Permalink
Remove enabled field from KountConfiguration
Browse files Browse the repository at this point in the history
  • Loading branch information
lkorth committed May 24, 2016
1 parent d9d8330 commit 85a9b5f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
"merchantId": "integration_merchant_id",
"merchantAccountId": "integration_merchant_account_id",
"kount": {
"enabled": true,
"kountMerchantId": "600000"
}
}
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
package com.braintreepayments.api.models;

import android.text.TextUtils;

import org.json.JSONObject;

/**
* Contains the remote Kount configuration for the Braintree SDK.
*/
public class KountConfiguration {

private final static String ENABLED_KEY = "enabled";
private final static String KOUNT_MERCHANT_ID_KEY = "kountMerchantId";

private boolean mEnabled;
private String mKountMerchantId;

/**
Expand All @@ -26,8 +26,7 @@ public static KountConfiguration fromJson(JSONObject json) {
}

KountConfiguration kountConfiguration = new KountConfiguration();
kountConfiguration.mEnabled = json.optBoolean(ENABLED_KEY);
kountConfiguration.mKountMerchantId = json.optString(KOUNT_MERCHANT_ID_KEY, "0");
kountConfiguration.mKountMerchantId = json.optString(KOUNT_MERCHANT_ID_KEY, "");

return kountConfiguration;
}
Expand All @@ -36,7 +35,7 @@ public static KountConfiguration fromJson(JSONObject json) {
* @return {@code true} if Kount is enabled, {@code false} otherwise.
*/
public boolean isEnabled() {
return mEnabled;
return !TextUtils.isEmpty(mKountMerchantId);
}

/**
Expand Down

0 comments on commit 85a9b5f

Please sign in to comment.