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; /*from www . ja va2 s . c o m*/ /** * Manages the application-wide context for Klarna on Demand payments. */ public class Context { private static String apiKey; /** * Sets the API key to use in following calls. * @param apiKey Merchant's public API key for this application. */ public static void setApiKey(String apiKey){ Context.apiKey = apiKey; } /** * Returns the API key set using {@link #setApiKey(String) setApiKey}. * @return Merchant's public API key for this application. */ protected static String getApiKey(){ if (apiKey == null) { throw new RuntimeException("You must set the API key first."); } return apiKey; } }