Back to project page klarna-on-demand-android.
The source code is released under:
Apache License
If you think the Android project klarna-on-demand-android listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package com.klarna.ondemand; //w w w.ja va 2s .co m import java.util.Locale; final class UrlHelper { private static final String KlarnaPlaygroundUrl = "https://inapp.playground.klarna.com"; private static final String KlarnaProductionUrl = "https://inapp.klarna.com"; static String baseUrl() { if(Context.getApiKey().startsWith("test_")) { return KlarnaPlaygroundUrl; } return KlarnaProductionUrl; } static String registrationUrl() { return String.format("%s/registration/new?api_key=%s&locale=%s", baseUrl(), Context.getApiKey(), defaultLocale()); } static String preferencesUrl(String token) { return String.format("%s/users/%s/preferences?api_key=%s&locale=%s", baseUrl(), token, Context.getApiKey(), defaultLocale()); } static String defaultLocale() { return Locale.getDefault().getLanguage(); } }