Integration

Integration with the PayU OTP Parser SDK in 3 steps:

  1. Include the SDK in your application.

  2. Initiate the SDK.

  3. Override these callbacks

Include the SDK in your Application

Add below dependency in the application's build.gradle.

implementation 'in.payu:native-otp-reader:1.1.3'

Initiate the SDK

OtpParser otpParser = OtpParser.Companion.getInstance(ComponentActivity activity);
otpParser.startListening(OtpCallback otpCallback)
    
    OtpCallback otpCallback = new OtpCallback() {
           @Override
           public void onOtpReceived(@NotNull String otp) {
             //When user gets the OTP  
           }

           @Override
           public void onUserDenied() {
//User user denied the permission
           }
       };

Override these Callbacks

You need to override these ActivityCompat callbacks and call OtpParser methods.

Last updated

Was this helpful?