Przejdź do głównej zawartości

Webview Module

Main purpose in using this module is to help end user successfully pay via PBL (online payment), or handle additional verification 3DS, PEX, and won't leave the application prematurely. This not means that the cash was transferred from user to merchant - this needs additional time to process. This module consist of Android widget - webview. PBL (Pay By Links) & 3DS are types of payment when user needs to use browser to pay for the purchased products.

Handling PBL Payment:

webview PBL flow chart

  1. Checkout/Payment Process - User select pay with PBL (login to specific bank and pay)
  2. Checkout/Payment Process - At the end of local check out request is send to merchant backend to create an order on PayU side
  3. Checkout/Payment Process - Response from created order is passed from merchant backend to Mobile SDK (via mobile app)
  4. Handle User Payment - payment-library-webview-module check if user paid for shopping using selected bank
  5. Payment Status - Status code is passed to mobile app

Base flow for 3DS looks the same as PBL payments.

Initial conditions:

  • Order with PBL was successfully created and placed.

  • Order Response contained at least redirectUrl.

Order Request with PBL Specified as a Payment Method
"continueUrl": "", // this value can determine path for redirect Url in mobile web components
"notifyUrl": "",
"customerIp": "",
"merchantPosId": "PosId",
"description": "RTV market",
"currencyCode": "PLN",
"totalAmount": "1000",
"buyer": {
"email": "",
"phone": "666*****6",
"firstName": "John",
"lastName": "Doe",
"language": "pl"
"products": [
"name": "Wireless Mouse for Laptop",
"unitPrice": "500",
"quantity": "1"

Its important to pass correct continueURL parameter to Mobile SDK in order to end payment process.

  • Success Status - it means that the transaction finished successfully on mobile, but merchant need to receive notification from payU backend that bank proceed the payment; the criteria are: last redirect url was continueUrl with query parameteres (without error & without failure keywords) or without any query.

  • Error/Failure Status - it means that the transaction finished with an issue & criteria are: last redirect url was continueUrl with query parameters Error or Failure

After passing URL you are redirected to the financial institution site, because of this you are leaving PayU page for a moment. Any occuring errors e.g. with SSL (this can happen when certificates are wrongly configured or out of date) are not caused by PayU.

Payment Authorization

Currently there is a support for two types of Payment Authorization in WebView:

  • PAY_BY_LINK - when PBL was selected as payment method

  • 3DS - when received "WARNING_CONTINUE_3DS"

Dynamic Configuration

Create object AuthorizationDetails with using AuthorizationDetailsBuilder with setting at least link from redirectUrl & continueUrl:

new AuthorizationDetails.AuthorizationDetailsBuilder()
.withAuthorizationType(PaymentAuthorization._3DS) (or PaymentAuthorization.PAY_BY_LINK)
.withContinueUrl("") //needed for payments, this url is a property that could be passed
//in OrderCreateRequest or it is a shop page that was verfied by PayU Administrators
.withLink("") //redirect link from OCR request

It will be good to pass orderId and PaymentId, but this properties are optional and will be returned only if they were passed to mobile SDK (Full list of properties).

Then you can pass the authorization details:, authorizationDetails)

Previous, starter Activity will be informed in **onActivityResult() method when payment process will end.

Status Codes in enum
Status CodeDescription
Successful transaction.
Transaction failed (e.g. timeout).
Transaction failed - SSL Validation failed for given url. Please contact provider of mentioned web page.
Transaction cancelled by user.
Transaction needs to be confirmed by CVV code.

Intent in **onActivityResult() will contain a Parcelable with key: "INTENT_WEB_PAYMENT_EXTRA".

protected void onActivityResult(int requestCode, int resultCode, Intent data) {
if (requestCode == WebPaymentService.REQUEST_CODE) {
PaymentDetails paymentDetails = WebPaymentService.extractPaymentResult(data);
Log.v(TAG, paymentDetails.toString());

In some cases (if your POS is not configurated for this) there could be a need to handle additional payment verification after 3DS payment.


In this case WARNING_CONTINUE_CVV will be returned as a payment status. This can be handled by other component - payment-add-card-module.

PEX (Pay by External)

This type of payment works same as PBL.

Only Condition for PEX is OCR created with it as a PaymentType:


And response to it with statusCode WARNING_CONTINUE_REDIRECT with redirect url:

"orderId": "ZGKCGS ... 01",
"status": {
"redirectUri": ""

This information should be provided to handle PEX payment type:

new AuthorizationDetails.Builder()

and this object should be passed to WebPaymentService:, authorizationDetails);