public final class SDKUtils
extends java.lang.Object
This class designed for getting information and validating various case to check whether the system is perfect to run the SDK or not.
A number of the methods in this class are for debugging or informational purposes. Most of the methods may not be needed to call by the developers.
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
IPAY_COM_BD
Checkout Url host name.
|
Constructor and Description |
---|
SDKUtils() |
Modifier and Type | Method and Description |
---|---|
protected static android.content.pm.ActivityInfo |
getActivityInfo(android.content.Context context,
java.lang.String className) |
static boolean |
hasInternetPermissions(android.content.Context context,
boolean shouldThrow)
Checks whether
|
static boolean |
hasIPayCheckoutActivity(android.content.Context context,
boolean shouldThrow) |
protected static boolean |
hasIPayCheckoutActivity(android.content.Context context,
IPaySDK.InitializeCallback initializeCallback,
boolean shouldThrow) |
static boolean |
isChromeInstalled(android.content.Context context)
Checks if Chrome is installed or not.
|
static boolean |
isIPayAppInstalled(android.content.Context context,
boolean shouldThrow)
Checks if iPay is installed or not.
|
static boolean |
isValidCheckoutCallbackActionUrls(CheckoutCallbackActionUrls checkoutCallbackActionUrls) |
static boolean |
isValidIPayCheckoutUrl(java.lang.String checkoutUrl) |
static boolean |
isValidUrlSchemeAdded(android.content.Context context,
boolean shouldThrow)
Checks if the callback deeplink url is a valid one or not.
|
protected static boolean |
isValidUrlSchemeAdded(android.content.Context context,
IPaySDK.InitializeCallback initializeCallback,
boolean shouldThrow)
Checks if the callback deeplink url is a valid one or not.
|
static boolean |
notNull(java.lang.Object arg,
java.lang.String name)
Validation method to check, whether the variable is null or not.
|
protected static boolean |
notNull(java.lang.Object arg,
java.lang.String name,
IPaySDK.InitializeCallback initializeCallback)
Validation method to check, whether the variable is null or not.
|
static void |
openIPayInPlayStore(android.content.Context context)
Opens the play store to install iPay.
|
protected static void |
printSomeFancyIPaySDK()
Just fancy artwork.
|
public static final java.lang.String IPAY_COM_BD
public static boolean isValidIPayCheckoutUrl(java.lang.String checkoutUrl)
checkoutUrl
- Url to validatepublic static boolean notNull(java.lang.Object arg, java.lang.String name)
arg
- Validating argumentname
- Validation variable nameIPaySDKException
- Wraps NullPointerException.
If the argument is null when the param initializeCallback is also null.protected static boolean notNull(java.lang.Object arg, java.lang.String name, IPaySDK.InitializeCallback initializeCallback)
arg
- Validating argumentname
- Validation variable nameinitializeCallback
- Callback instance to return exception as initialize fallbackIPaySDKException
- Wraps NullPointerException.
If the argument is null when the param initializeCallback is also null.public static boolean hasIPayCheckoutActivity(android.content.Context context, boolean shouldThrow)
context
- An android contextshouldThrow
- Should the method throw an exception for error or notIPaySDKInitializeException
- If the param shouldThrow is true method will throw the exception
when the IPayCheckoutActivity is not declared in AndroidManifest.xml
or present.protected static boolean hasIPayCheckoutActivity(android.content.Context context, IPaySDK.InitializeCallback initializeCallback, boolean shouldThrow)
context
- An android contextinitializeCallback
- Callback instance to return exception as initialize fallbackshouldThrow
- should the method throw an exception for error or notIPaySDKInitializeException
- If the param shouldThrow is true method will throw the exception
when the IPayCheckoutActivity is not declared in AndroidManifest.xml
or present.protected static android.content.pm.ActivityInfo getActivityInfo(android.content.Context context, java.lang.String className) throws android.content.pm.PackageManager.NameNotFoundException, java.lang.NullPointerException
context
- An android contextclassName
- name of the android activity classandroid.content.pm.PackageManager.NameNotFoundException
java.lang.NullPointerException
public static boolean isIPayAppInstalled(android.content.Context context, boolean shouldThrow)
In case of iPay app isn't install it is recommended that prompt user to install iPay app.
To perform install iPay app via Play Store please see/use openIPayInPlayStore(Context)
context
- An android contextshouldThrow
- should the method throw an exception for error or notpublic static boolean isChromeInstalled(android.content.Context context)
context
- An android contextpublic static boolean hasInternetPermissions(android.content.Context context, boolean shouldThrow)
context
- An android contextshouldThrow
- Should the method throw an exception for error or notpublic static boolean isValidUrlSchemeAdded(android.content.Context context, boolean shouldThrow)
context
- An android contextshouldThrow
- Should the method throw an exception for error or notIPaySDKInitializeException
- If the param shouldThrow is true method will throw the exception
for an invalid url callback scheme.protected static boolean isValidUrlSchemeAdded(android.content.Context context, IPaySDK.InitializeCallback initializeCallback, boolean shouldThrow)
context
- An android contextinitializeCallback
- Callback instance to return exception as initialize fallbackshouldThrow
- Should the method throw an exception for error or notIPaySDKInitializeException
- If the param shouldThrow is true method will throw the exception
for an invalid url callback scheme.public static void openIPayInPlayStore(android.content.Context context)
context
- An android contextpublic static boolean isValidCheckoutCallbackActionUrls(CheckoutCallbackActionUrls checkoutCallbackActionUrls)
protected static void printSomeFancyIPaySDK()