Skip to content

Commit 30e02b0

Browse files
committed
Checkout not translated when passing in certain values in checkout wrapper
1 parent a943507 commit 30e02b0

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

affirm/src/main/java/com/affirm/android/AffirmConstants.java

+2
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,8 @@ private AffirmConstants() {
8888
static final String CHECKOUT_CAAS_EXTRA = "checkout_caas_extra";
8989
static final String CHECKOUT_MONEY = "checkout_money";
9090
static final String CHECKOUT_CARD_AUTH_WINDOW = "checkout_card_auth_window";
91+
static final String CHECKOUT_META = "meta";
92+
static final String CHECKOUT_META_LOCALE = "locale";
9193
static final String CREDIT_DETAILS = "credit_details";
9294
static final String VCN_REASON = "vcn_reason";
9395
static final String NEW_FLOW = "new_flow";

affirm/src/main/java/com/affirm/android/CheckoutRequest.java

+6
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@
2525
import static com.affirm.android.AffirmConstants.CHECKOUT;
2626
import static com.affirm.android.AffirmConstants.CHECKOUT_HEADER_AFFIRM_LOCALE;
2727
import static com.affirm.android.AffirmConstants.CHECKOUT_HEADER_COUNTRY_CODE;
28+
import static com.affirm.android.AffirmConstants.CHECKOUT_META;
29+
import static com.affirm.android.AffirmConstants.CHECKOUT_META_LOCALE;
2830
import static com.affirm.android.AffirmConstants.CHECKOUT_PATH;
2931
import static com.affirm.android.AffirmConstants.MERCHANT;
3032
import static com.affirm.android.AffirmConstants.METADATA;
@@ -193,6 +195,10 @@ public JsonObject body() {
193195
checkoutJson.add(MERCHANT, merchantJson);
194196
checkoutJson.addProperty(API_VERSION_KEY, API_VERSION_VALUE);
195197

198+
JsonObject metaJson = new JsonObject();
199+
metaJson.addProperty(CHECKOUT_META_LOCALE, AffirmPlugins.get().locale());
200+
checkoutJson.add(CHECKOUT_META, metaJson);
201+
196202
// Need to set `platform_type` & `platform_affirm` by default
197203
JsonObject metadataJson = checkoutJson.getAsJsonObject(METADATA);
198204
if (metadataJson == null) {

0 commit comments

Comments
 (0)