Redirection Flow (Paytm app is not installed on the user’s device)
For redirection flow, the status of Payment will be delivered via PaytmPaymentTransactionCallback. This interface has multiple methods as given below to get an error or completion status of the transaction.
//this function gets called with a response after the payment is done or canceled.
void onTransactionResponse(@Nullable Bundle inResponse){
Toast.makeText(getApplicationContext(), "Payment Transaction response " + inResponse.toString(), Toast.LENGTH_LONG).show();
}
//this function gets called with an error message and response bundle when there is any error while starting the payment.
void onTransactionCancel(String inErrorMessage,@Nullable Bundle inResponse){
}
//this function gets called when there is an error in loading a web page or exception in response that needs to be sent to the merchant.
void onErrorLoadingWebPage(int iniErrorCode, String inErrorMessage, String inFailingUrl){
}
// this function gets called when any ui element throws an error while loading.
void someUIErrorOccurred(String inErrorMessage) {
}
//this function gets called when there is no network available.
void networkNotAvailable(){
}
//this function gets called when there is an error message while starting the payment.
void onErrorProceed(String error){
}
Sample Response
"Bundle"[
{
"STATUS"="TXN_SUCCESS",
"ORDERID"="Order Id",
"CHARGEAMOUNT"="0.00",
"TXNAMOUNT"="1.00",
"TXNDATE"="2020-07-21 19:00:05.0",
"MID"="Merchant Id",
"TXNID"="Transaction Value",
"RESPCODE"="01",
"PAYMENTMODE"="UPI",
"BANKTXNID"="Bank transaction Id",
"CURRENCY"="INR",
"GATEWAYNAME"="ICICI",
"RESPMSG"="Txn Success"
}
]