#asdfghi - localization

1 messages · Page 1 of 1 (latest)

brave palmBOT
dreamy glen
#

Hi 👋

Locals are defined in the user's browser and that is what the Stripe dashboard picks up.

fervent laurel
#

We use the Java Stripe library to generate account links. We expect that the onboarding page will appear for the users in their locale (currently hungarian), which was set during account link generation, and not the browser default. Is there a way to achieve that, or the Stripe API doesn't provide such functionality?

Here is the code we use for generating links:
public Account createConnectedAccount() throws StripeException {
Map<String, Object> params = new HashMap<>();
params.put("type", "standard");
params.put("country", "HU");
return Account.create(params);
}

public AccountLink createAccountLink(String accountId, Boolean fromStart) throws StripeException {
Map<String, Object> params = new HashMap<>();
params.put("account", accountId);
Optional<String> adminUrl = Arrays.stream(appProperties.getAdminUrl().split("#"))
.filter((url) -> !url.contains("localhost")).findFirst();
String adminUrlSuffix = activeProfile.equals("prod") ? "" : "/medalyst/admin/app/";
adminUrl.ifPresent(url -> {
params.put("refresh_url", url + adminUrlSuffix + "payment/refreshAccountLink");
params.put("return_url",url + adminUrlSuffix + "payment/onboardingFinished");
});
params.put("type", fromStart ? "account_onboarding" : "account_update");

return AccountLink.create(params);
}

[...]

account = stripeUtils.createConnectedAccount();
AccountLink accountLink = stripeUtils.createAccountLink(account.getId(), true);

dreamy glen
#

The country specified on the Account identifies the country in which the business is legally operating, not the locale.