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.
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.
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: ...,
),
),
),
);
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: ...,
),
),
),
);
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: ...,
),
),
),
);
CVV/CVC
authorization required. In this case redirectUri
from OrderCreateResponse
must contain query parameter for refReqId
key.
- Create
CVVAuthorizationExtractor
instance:
final extractor = CVVAuthorizationExtractor();
- Extract
refReqId
query parameter from it:
final refReqId = extractor.extractRefReqId(redirectUri);
- If
refReqId
is notnull
present theCVVAuthorizationAlertDialog
instance. This dialog has theTextField
forcvv
.
final result = await showDialog<CVVAuthorizationResult>(
context: context,
builder: (context) => const CVVAuthorizationAlertDialog(refReqId: refReqId),
);
- If the
result
isCVVAuthorizationResult.success
then the order has been paid.