Initialize

In your Application class onCreate() method, initialize the SDK:

override fun onCreate( {
super.onCreate()PayContactlessEmbed.getInstance().start(this, orgID, googleCloudID)
}
  • Must be called before performing any transactions

  • Ensures the SDK is ready for doSale, and other major payment flows

Required Parameters:

  • Context: Application context

  • Organization Id: Predefined organization identifier

  • Google Clould Project Number: Project Number of your project on Google Cloud

circle-exclamation
Play Integrity Configurationchevron-right

Remember to pass the these parameters as arguments when invoking the start method.

By adhering to these steps, you'll ensure the proper and utilization of the Merchant PayContactless SDK library functions.

The SDK needs the activity result to parse the Payment activity reponse. The onAcitivtyResult method of the SDK must be called in MainActivity onActivityResult method.

PayContactlessEmbed.getInstance().onActivityResult(requestCode,resultCode,data)

A sample usage is highlighted below;

  override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) {
        super.onActivityResult(requestCode, resultCode, data)
        PayContactlessEmbed.getInstance().onActivityResult(requestCode,resultCode,data)
    }

Last updated