API Reference

SDK Initialization

Steps:


1: In your application Add code sinpet in manifest:


<queries>

    <package android:name="com.payment.sdk" />

</queries>


2:In main Activity call SDK and pass parameters code snipet below: 



startApplication("com.payment.sdk")


fun startApplication(packageName: String) {

    try {

        val intent = Intent("android.intent.action.MAIN")

        intent.addCategory("android.intent.category.LAUNCHER")

        intent.addFlags(Intent.FLAG_ACTIVITY_NO_ANIMATION)

        val resolveInfoList = packageManager.queryIntentActivities(intent, 0)

        for (info in resolveInfoList) if (info.activityInfo.packageName.equals(

                packageName, ignoreCase = true)) {

            launchComponent(info.activityInfo.packageName, info.activityInfo.name)

            return

        }

        // No match, so application is not installed

        showInMarket(packageName)

    } catch (e: Exception) {

        showInMarket(packageName)

    }

}



private fun launchComponent(packageName: String, name: String) {

    val bundle = Bundle()

    bundle.putString("amountStr",amountStr) // amount =0 for Balance inque

    bundle.putString("transType",transactionType) // BE, CW

    bundle.putString("orderID",binding.orderId.text.toString())

    bundle.putString("mobile",binding.mobileNo.text.toString())

    bundle.putString("submerchantID",binding.submerchantID.text.toString())

    bundle.putString("transDevice",binding.transDevice.text.toString()) 

   //pax/morefun

    bundle.putString("shopName",binding.shopName.text.toString())

    bundle.putString("brandName",binding.brandName.text.toString())

    bundle.putString("sdkKey",binding.sdkKey.text.toString())


    val intent = Intent("android.intent.action.MAIN")

    intent.addCategory("android.intent.category.LAUNCHER")

    intent.component = ComponentName(packageName, name)

    intent.putExtras(bundle)

    intent.flags = Intent.FLAG_ACTIVITY_NEW_TASK

    startActivity(intent)

}



private fun showInMarket(packageName: String) {

    val intent = Intent(Intent.ACTION_VIEW, Uri.parse("market://details?id=$packageName"))

    intent.flags = Intent.FLAG_ACTIVITY_NEW_TASK

    startActivity(intent)

}