SDK Integration
  • Getting Started
  • Onboarding Requirements
  • Hash Generation
  • Test Merchant list
  • Android
    • Android SDK Offering
    • PayUCheckoutPro
      • Integration
      • Build the Payment Params
        • Additional Params
      • Hash Generation
      • Set up the payment hashes
      • Initiate the Payment
      • Customized Integration
        • Set Webview Properties
        • SDK Configuration
        • Additional Offerings
      • Offers Integration
      • Convenience Fee Integration
      • Custom Note Integration
      • MCP Integration
    • Core
      • Supported Payment Types
      • TPV Integration
      • Merchant Web Services
        • Getting Enabled Payment Options
        • GetCheckoutDetails API
        • Lookup API
    • Custom Browser
      • Integration
        • CustomBrowser Config
        • CustomBrowserCallback
        • Supporting below Lollipop Versions
        • Third-Party Payments Support
      • Sample App
      • Change Logs
    • Native OTP Assist
      • Integration
      • Customization
      • Change Logs
    • UPI
      • Integration
      • TPV Integration in UPI
      • Sample App
      • Change Logs
    • Google Payâ„¢
      • Integration
      • Sample App
    • PhonePe
      • Integration
      • Sample App
      • Change Logs
    • OlaMoney
    • PayU OTP Parser
      • Integration
    • FAQ Android
  • iOS
    • PayUCheckoutPro
      • Integration
      • Advanced Integration
      • Set up the payment hashes
      • Convenience Fee Integration
      • MCP Integration
      • Custom Note Integration
    • Core
      • POD Integration
      • Seamless
      • Web Services
      • Objective C-Non-Seamless
      • Standing Instructions
      • TPV Integration
      • Sample App
    • Custom Browser
      • Sample App
    • OlaMoney
    • Native OTP Assist
      • Integration
      • Customization
    • UPI
      • Integration
      • Sample App
    • PayUParams
      • PayUSIParams
      • PayUBeneficiaryParams
  • Releasing to Apple
  • React-Native
    • PayUCheckoutPro
      • Integration
      • Set up the payment hashes
      • Advanced Integration
      • Change Logs
    • Core
    • Non-Seamless Wrapper
    • TPV (beta)
      • Integration
  • FAQ iOS
Powered by GitBook
On this page
  • Getting Started
  • CheckForPaymentAvailability
  • Invoking CustomBrowser

Was this helpful?

  1. Android
  2. Custom Browser

Integration

This section describes how to integrate CustomBrowser in your app module.

PreviousCustom BrowserNextCustomBrowser Config

Last updated 3 years ago

Was this helpful?

Getting Started

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

'in.payu:payu-custom-browser:7.10.1'

If you are getting this error, Default interface methods are only supported starting with Android N (--min-api 24): Landroidx/lifecycle/DefaultLifecycleObserver;onCreate(Landroidx/lifecycle/LifecycleOwner;)V Add compileOptions on Apps Gradle,

android {
 compileOptions {
        sourceCompatibility 1.8
        targetCompatibility 1.8
    }
    }

From version 7.4.0 onwards it is mandatory to import UPI sdk in case you want to make payments via any UPI option viz. : UPI Intent, Collect, Google Pay, PhonePe ,SamsungPay along with the changes mentioned .

Merchants are advised to add below permission in application's AndroidManifest.xml to support OTP assist.

<uses-permission android:name="android.permission.RECEIVE_SMS" />

In case your application's supports min sdk less than 20 then kindly do these in your surl/furl.

CheckForPaymentAvailability

Function in CustomBrowser class. Checks for payment option type availability.

Input:
    Activity : activity instance
    PaymentOption : Payment Option type e.g.PaymentOption.SAMSUNGPAY,PaymentOption.PHONEPE
    PayUCustomBrowserCallback : this class provide callbacks 
    paymentOptionHash : Payment Related Details Hash
    merchantKey       : PayU Merchant Key
    user_credentials  : User credentials or use "default"
        
//Code Sample
       
new CustomBrowser().checkForPaymentAvailability(Activity activity, PaymentOption paymentOption,  PayUCustomBrowserCallback payUCustomBrowserCallback, String paymentOptionHash, String merchantKey, String user_credentials)

Invoking CustomBrowser

Invoking Custombrowser is just a 3 step procedure.

Post Url can be any of the following:

CustomBrowserConfig customBrowserConfig = new CustomBrowserConfig(merchantKey,txnId);
customBrowserConfig.setPayuPostData(<Post Data>);
customBrowserConfig.setPostUrl(<Post Url>);

3. Call method addCustomBrowser() like below:

Input:
    Activity : activity instance
    CustomBrowserConfig : configuration object of the custom browser
    PayUCustomBrowserCallback : this class provide callbacks 
        
//Code Sample      
        
new CustomBrowser().addCustomBrowser( Activity activity, CustomBrowserConfig customBrowserConfig, PayUCustomBrowserCallback cbPayUCustomBrowserCallback)

Create a basic object of CustomBrowserConfig like below(For more Configurations supported visit ):

Production -

Staging -

2. Create an object of .

here
https://secure.payu.in/_payment
https://test.payu.in/_payment
PayUCustomBrowserCallback
here
changes
dependency