Skip to content

Latest commit

 

History

History
121 lines (90 loc) · 3.4 KB

README.md

File metadata and controls

121 lines (90 loc) · 3.4 KB

Features

Flutter package which allows to make Web payments via Pay.

Below is a list of status codes sent by the PayU system. Some status codes may be sent with a more detailed message.

Getting started

After sending a request for a new order, a response will be returned by the API. The payment link is based on regular Payu integration involving REST API described here. Those requests should be handled by the merchant's backend.

Sample response to a new order request:

{ 
  "status":{ 
    "statusCode":"SUCCESS",
  },
  "redirectUri":"{payment_summary_page_url}",
  "orderId":"WZHF5FFDRJ140731GUEST000P01",
  "extOrderId":"{your_order_identifier}",
}

The redirectUri field includes payment link, so later it would be passed to the WebPaymentsRequest.

Here is a full list of payment methods available from Payu.

Status Codes

SUCCESS

Request has been processed correctly. redirectUri is provided in the response.

final result = await Navigator.of(context).push<WebPaymentsResult>(
  MaterialPageRoute(
    builder: (context) => const WebPaymentsPage(
      request: WebPaymentsRequest(
        type: WebPaymentsRequestType.payByLink,
        redirectUri: ...,
        continueUri: ...,
      ),
    ),
  ),
);

WARNING_CONTINUE_REDIRECT

Request has been processed correctly. redirectUri is provided in the response. Applies to transparent integration, if order request contains payMethods with following payment type values: orx, bnx, gbx, nlx.

final result = await Navigator.of(context).push<WebPaymentsResult>(
  MaterialPageRoute(
    builder: (context) => const WebPaymentsPage(
      request: WebPaymentsRequest(
        type: WebPaymentsRequestType.payByLink,
        redirectUri: ...,
        continueUri: ...,
      ),
    ),
  ),
);

WARNING_CONTINUE_3DS

3DS authorization is required. Redirect the buyer to perform 3DS authentication process.

final result = await Navigator.of(context).push<WebPaymentsResult>(
  MaterialPageRoute(
    builder: (context) => const WebPaymentsPage(
      request: WebPaymentsRequest(
        type: WebPaymentsRequestType.threeDS,
        redirectUri: ...,
        continueUri: ...,
      ),
    ),
  ),
);

WARNING_CONTINUE_CVV

CVV/CVC authorization required. In this case redirectUri from OrderCreateResponse must contain query parameter for refReqId key.

  1. Create CVVAuthorizationExtractor instance:
final extractor = CVVAuthorizationExtractor();
  1. Extract refReqId query parameter from it:
final refReqId = extractor.extractRefReqId(redirectUri);
  1. If refReqId is not null present the CVVAuthorizationAlertDialog instance. This dialog has the TextField for cvv.
final result = await showDialog<CVVAuthorizationResult>(
  context: context,
  builder: (context) => const CVVAuthorizationAlertDialog(refReqId: refReqId),
);
  1. If the result is CVVAuthorizationResult.success then the order has been paid.