Skip to content

Commit

Permalink
Merge pull request #5330 from ghubstan/01-clarify-paymentacct-form-co…
Browse files Browse the repository at this point in the history
…untry-field

Disambiguate payment acct json form's "country" field
  • Loading branch information
ripcurlx authored Mar 18, 2021
2 parents c8d01a2 + 6725264 commit d8676fd
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,10 @@ protected final void verifyEmptyForm(File jsonForm, String paymentMethodId, Stri
assertEquals(paymentMethodId, emptyForm.get(PROPERTY_NAME_PAYMENT_METHOD_ID));
assertEquals("your accountname", emptyForm.get(PROPERTY_NAME_ACCOUNT_NAME));
for (String field : fields) {
assertEquals("your " + field.toLowerCase(), emptyForm.get(field));
if (field.equals("country"))
assertEquals("your two letter country code", emptyForm.get(field));
else
assertEquals("your " + field.toLowerCase(), emptyForm.get(field));
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,10 @@ private void writeInnerMutableFields(JsonWriter out, PaymentAccount account) {

String fieldName = field.getName();
out.name(fieldName);
out.value("your " + fieldName.toLowerCase());
if (fieldName.equals("country"))
out.value("your two letter country code");
else
out.value("your " + fieldName.toLowerCase());
}
} catch (Exception ex) {
String errMsg = format("cannot create a new %s json form",
Expand Down

0 comments on commit d8676fd

Please sign in to comment.