public final class IPaySDK
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static class |
IPaySDK.CheckoutState
Values to mark Checkout State
|
static class |
IPaySDK.CheckoutStatus
Values to define Checkout Status
|
static interface |
IPaySDK.InitializeCallback
Callback passed to the
initialize(Context) function. |
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
CHECKOUT_ID_KEY
checkout id key
|
static java.lang.String |
CHECKOUT_STATUS_KEY
checkout status key
|
static int |
DEFAULT_CHECKOUT_REQUEST_CODE
request code to create Checkout Activity.
|
static java.lang.String |
IPAY_APP_PACKAGE_NAME
iPay Bangladesh Ltd.
|
Modifier and Type | Method and Description |
---|---|
static java.lang.String |
getCheckoutCallBackActivity() |
static int |
getCheckoutRequestCode() |
static void |
initialize(android.content.Context applicationContext)
As iPay SDK initializes automatically(This function is called automatically on app start up),
there is no necessity to call this method.
|
static void |
initialize(android.content.Context applicationContext,
IPaySDK.InitializeCallback initializeCallback)
As iPay SDK initializes automatically(This function is called automatically on app start up),
there is no necessity to call this method.
|
static boolean |
isDebugLogEnabled() |
static boolean |
isInitialized()
Indicates whether the iPay SDK has been initialized.
|
static IPaySDK.CheckoutState |
performCheckout(android.app.Activity activity,
java.lang.String checkoutUrl)
If the device have iPay app installed, for a valid checkout url, this method will perform a checkout through
iPay app.
|
static IPaySDK.CheckoutState |
performCheckout(android.app.Activity activity,
java.lang.String checkoutUrl,
boolean shouldThrow)
If the device have iPay app installed, for a valid checkout url, this method will perform a checkout through
iPay app.
|
static IPaySDK.CheckoutState |
performCheckout(android.app.Activity activity,
java.lang.String checkoutUrl,
boolean shouldThrow,
boolean useCallbackActivity)
If the device have iPay app installed, for a valid checkout url, this method will perform a checkout through
iPay app.
|
static IPaySDK.CheckoutState |
performCheckoutWithFallback(android.app.Activity activity,
java.lang.String checkoutUrl,
boolean useCallbackActivity,
CheckoutCallbackActionUrls checkoutCallbackActionUrls)
For a valid checkout url, this method will perform a checkout through iPay app.
|
static IPaySDK.CheckoutState |
performCheckoutWithFallback(android.app.Activity activity,
java.lang.String checkoutUrl,
CheckoutCallbackActionUrls checkoutCallbackActionUrls)
For a valid checkout url, this method will perform a checkout through iPay app.
|
static void |
setCheckoutCallBackActivity(android.content.Context context,
java.lang.String checkoutCallBackActivity) |
static void |
setCheckoutRequestCode(int requestCode)
Sets request code for starting checkout activity.
|
static void |
setDebugLogEnabled(boolean debugLogEnabled)
Sets value to identify whether the SDK should Log SDK events.
|
public static final int DEFAULT_CHECKOUT_REQUEST_CODE
public static final java.lang.String IPAY_APP_PACKAGE_NAME
public static final java.lang.String CHECKOUT_STATUS_KEY
public static final java.lang.String CHECKOUT_ID_KEY
public static void initialize(android.content.Context applicationContext)
applicationContext
- The application contextpublic static void initialize(android.content.Context applicationContext, IPaySDK.InitializeCallback initializeCallback)
applicationContext
- The application contextinitializeCallback
- An initialize callback to get the status of the initialization.public static IPaySDK.CheckoutState performCheckout(android.app.Activity activity, java.lang.String checkoutUrl)
activity
- An android ActivitycheckoutUrl
- iPay checkout urlpublic static IPaySDK.CheckoutState performCheckout(android.app.Activity activity, java.lang.String checkoutUrl, boolean shouldThrow)
IPaySDKException
exception. Otherwise it will
open Play Store to install the iPay app.activity
- An android ActivitycheckoutUrl
- iPay checkout urlshouldThrow
- should the method throw an exception for error or notIPaySDKException
- if the param shouldThrow is true then this method will throw
IPaySDKException
if IPay app isn't installed on device.public static IPaySDK.CheckoutState performCheckout(android.app.Activity activity, java.lang.String checkoutUrl, boolean shouldThrow, boolean useCallbackActivity)
IPaySDKException
exception. Otherwise it will
open Play Store to install the iPay app. When the param useCallbackActivity is true, after completing a checkout.
IPaySDK will send necessary data to the provided callback activity not to the activity from it was called.activity
- An android ActivitycheckoutUrl
- iPay checkout urlshouldThrow
- Should the method throw an exception for error or notuseCallbackActivity
- Should the method send the data to another activity for completing
the checkout or notIPaySDKException
- if the param shouldThrow is true then this method will throw
IPaySDKException
if IPay app isn't installed on device.public static IPaySDK.CheckoutState performCheckoutWithFallback(android.app.Activity activity, java.lang.String checkoutUrl, CheckoutCallbackActionUrls checkoutCallbackActionUrls)
WebView
. IPaySDK will send necessary data to the calling activity.activity
- An android ActivitycheckoutUrl
- iPay checkout urlcheckoutCallbackActionUrls
- all three callback urls which was give to iPay during the creation of the checkoutpublic static IPaySDK.CheckoutState performCheckoutWithFallback(android.app.Activity activity, java.lang.String checkoutUrl, boolean useCallbackActivity, CheckoutCallbackActionUrls checkoutCallbackActionUrls)
WebView
. When the param useCallbackActivity is true, after completing a checkout.
IPaySDK will send necessary data to the provided callback activity not to the activity from it was called.activity
- An android ActivitycheckoutUrl
- iPay checkout urluseCallbackActivity
- Should the method send the data to another activity for completing
the checkout or notcheckoutCallbackActionUrls
- all three callback urls which was give to iPay during the creation of the checkoutpublic static boolean isInitialized()
public static boolean isDebugLogEnabled()
public static void setDebugLogEnabled(boolean debugLogEnabled)
debugLogEnabled
- indicates boolean value, whether the log should be printed or not.public static int getCheckoutRequestCode()
IPayCheckoutActivity
.public static void setCheckoutRequestCode(int requestCode)
requestCode
- Value for request code.java.lang.IllegalArgumentException
- if the param value is less than 0.public static java.lang.String getCheckoutCallBackActivity()
public static void setCheckoutCallBackActivity(android.content.Context context, java.lang.String checkoutCallBackActivity)
context
- An android contextcheckoutCallBackActivity
- Callback activity canonical namejava.lang.IllegalArgumentException
- if the activity does not exists or not declared in
AndroidManifest.xml. For more info see
PackageManager.getActivityInfo(ComponentName, int)