diff --git a/core/src/main/java/com/hyperwallet/android/model/graphql/keyed/Country.java b/core/src/main/java/com/hyperwallet/android/model/graphql/keyed/Country.java index 29cc8e06..5adc6e1b 100644 --- a/core/src/main/java/com/hyperwallet/android/model/graphql/keyed/Country.java +++ b/core/src/main/java/com/hyperwallet/android/model/graphql/keyed/Country.java @@ -38,6 +38,8 @@ public class Country implements KeyedNode { private static final String CURRENCIES = "currencies"; private final Set mCurrencies; + + private final String mDefaultCurrencyCode; private final String mCode; private final MappedConnection mCurrencyMappedConnection; private final String mName; @@ -52,6 +54,7 @@ public Country(@NonNull final JSONObject country) throws JSONException, NoSuchMe mCode = country.optString(COUNTRY_CODE); mName = country.optString(COUNTRY_NAME); mCurrencies = new LinkedHashSet<>(1); + mDefaultCurrencyCode = country.optString("defaultCurrencyCode"); JSONObject currencies = country.optJSONObject(CURRENCIES); if (currencies != null && currencies.length() != 0) { mCurrencyMappedConnection = new MappedConnection<>(currencies, Currency.class); @@ -78,6 +81,14 @@ public String getName() { return mName; } + /** + * @return Currency code represented in ISO 4217 three-letter code format + */ + + public String getDefaultCurrency() { + return mDefaultCurrencyCode; + } + /** * @return set of {@code Currency} represented by this {@code Country} instance */ diff --git a/core/src/main/java/com/hyperwallet/android/model/graphql/query/TransferMethodConfigurationKeysQuery.java b/core/src/main/java/com/hyperwallet/android/model/graphql/query/TransferMethodConfigurationKeysQuery.java index 0d8209dd..38a512a0 100644 --- a/core/src/main/java/com/hyperwallet/android/model/graphql/query/TransferMethodConfigurationKeysQuery.java +++ b/core/src/main/java/com/hyperwallet/android/model/graphql/query/TransferMethodConfigurationKeysQuery.java @@ -35,6 +35,7 @@ public class TransferMethodConfigurationKeysQuery implements GqlQuery { + "\t\tnodes {\n" + "\t\t\tcode\n" + "\t\t\tname\n" + + "\t\t\tdefaultCurrencyCode\n" + "\t\t\tcurrencies {\n" + "\t\t\t\tnodes {\n" + "\t\t\t\t\tcode\n" diff --git a/core/src/test/java/com/hyperwallet/android/GqlTransactionBuilderTest.java b/core/src/test/java/com/hyperwallet/android/GqlTransactionBuilderTest.java index 00cb06f6..24040454 100644 --- a/core/src/test/java/com/hyperwallet/android/GqlTransactionBuilderTest.java +++ b/core/src/test/java/com/hyperwallet/android/GqlTransactionBuilderTest.java @@ -57,6 +57,7 @@ public void testBuild_withRequiredParametersOnly() { + "\t\tnodes {\n" + "\t\t\tcode\n" + "\t\t\tname\n" + + "\t\t\tdefaultCurrencyCode\n" + "\t\t\tcurrencies {\n" + "\t\t\t\tnodes {\n" + "\t\t\t\t\tcode\n" diff --git a/core/src/test/java/com/hyperwallet/android/GqlTransactionTest.java b/core/src/test/java/com/hyperwallet/android/GqlTransactionTest.java index 0f1ec9de..103636de 100644 --- a/core/src/test/java/com/hyperwallet/android/GqlTransactionTest.java +++ b/core/src/test/java/com/hyperwallet/android/GqlTransactionTest.java @@ -82,6 +82,7 @@ public void testPerformRequest_usingHttpPost() throws IOException { + "\t\tnodes {\n" + "\t\t\tcode\n" + "\t\t\tname\n" + + "\t\t\tdefaultCurrencyCode\n" + "\t\t\tcurrencies {\n" + "\t\t\t\tnodes {\n" + "\t\t\t\t\tcode\n" diff --git a/core/src/test/java/com/hyperwallet/android/model/graphql/query/TransferMethodConfigurationKeysQueryTest.java b/core/src/test/java/com/hyperwallet/android/model/graphql/query/TransferMethodConfigurationKeysQueryTest.java index c08f26ba..ec7429fe 100644 --- a/core/src/test/java/com/hyperwallet/android/model/graphql/query/TransferMethodConfigurationKeysQueryTest.java +++ b/core/src/test/java/com/hyperwallet/android/model/graphql/query/TransferMethodConfigurationKeysQueryTest.java @@ -15,6 +15,7 @@ public void testToQuery_returnsQuery() { + "\t\tnodes {\n" + "\t\t\tcode\n" + "\t\t\tname\n" + + "\t\t\tdefaultCurrencyCode\n" + "\t\t\tcurrencies {\n" + "\t\t\t\tnodes {\n" + "\t\t\t\t\tcode\n"