Class: in.verse.mpayment.PaymentService

This class is the entry-point to the IPayy SDK. Call the getPaymentIntent() to obtain the payment intent and then invoke android startActivityForResult() to initiate the payment process. Method Summary

Parameter NameDescription
merchantKeyMerchant Key provided by ipayy during provision
appKeyApplication Key provided by IPayy during provision
contextThe current activity context
ipayyHandlerAn instance of in.verse.mpayment.handler.IPayyHandler which should be used to handle the payment response.
itemThe item being purchased

in.verse.mpayment.request.ItemDetail

The entity class which describes the item being purchased. Constructor

Parameter NameDescription
itemIdUnique identifier for the item
itemNameItem Name displayed to the end user on the IPayy pages
preferredPriceActual price of the item to be charged to the end-user
discountValueRebate to be applied to the actual price of the item
discountTypeThe unit for Rebate. Rebate can be defined as a percentage of the actual price or as a fixed value.
DiscountType.PERCENTAGE - specifies a percentage based discount
DiscountType.AMOUNT - specifies a discount of a fixed value.

Example: If discountValue = 50 and discountType = DiscountType.PERCENTAGE then a 50% rebate to be applied on the actual price of the item. If the actual price is ₹ 10.00 then the end user would be charged ₹ 5.00 only

in.verse.mpayment.request.Item

This class encapsulates the ItemDetail class and accepts a currency parameter. As of now, only Currency.INR is supported. Constructor

Parameter NameDescription
itemDetailItemDetail object which specifies the details of the item to be purchased
currencyCurrency in which the amount would be charged.
Only Currency.INR is supported currently.

in.verse.mpayment.handler.IPayyHandler

This interface provides three methods which are used to handle the three response scenarios from a payment request. The request can result in a billing success, failure or it can be canceled. The corresponding method of the implementing class is invoked by the PaymentActivity depending on the outcome. If the handler reference is not provided, the response can still be handled by overriding the onActivityResult() in the activity which started the PaymentActivity.

MethodDescription
public void onIPayySuccess(SuccessPaymentResponse successResponse)The onIPayySuccess method is invoked when the end-user billing was successful. The SuccessPaymentResponse object contains the transaction response details.
public void onIPayyFailure(FailedPaymentResponse failureResponse)In the event of a billing failure due to any reason, the onIPayyFailure method is invoked.The FailedPaymentResponse object contains the details of the failed transaction along with failure and error codes to identify the type of failure.
public void onIPayyCancel(Item item)If the end user cancels the payment at any stage, the onIPayyCancel method is invoked.The Item object contains the item details which the user was trying to purchase before he canceled the payment.

in.verse.mpayment.response.SuccessPaymentResponse

This class contains the transaction details when the billing was successful.

VisibilityReturn TypeNameDescription
publicLonggetTransactionId()Returns the IPayy Transaction ID for the Payment Request
publicDategetTransactionDate()Returns the Transaction Date
publicBigDecimalgetAmountCharged()Returns the final amount charged to the end user (after applicable discounts).
publicStringgetCurrency()Returns the currency for the transaction.
publicStringgetRequestId()Returns the Request ID generated by the IPayy Android SDK for the transaction.
publicin.verse.mpayment.request.ItemgetRequestedItem()The item object which was passed to the PaymentActivity containing the details of the item to be purchased.
publicStringgetCustomerCode()The Unique Identifier for the customer generated by the IPayy System.

 

in.verse.mpayment.response.FailedPaymentResponse

This class contains the transaction failure details in case the billing was unsuccessful.

VisibilityReturn TypeMethod NameDescription
publicStringgetRequestId()Returns the Request ID generated by the IPayy Android SDK for the transaction.
publicin.verse.mpayment.request.ItemgetRequestedItem()The item object which was passed to the PaymentActivity containing the details of the item to be purchased.
publicStringgetCustomerCode()The Unique Identifier for the customer generated by the IPayy System.
publicStringgetFailureCode()The failure code in case billing failed.
publicStringgetErrorCode()The error code in case the payment request failed due to some error.
publicStringgetErrorMessage()A descriptive message for the error code.

 

Failure Codes

The failure codes in case billing failed due to a user-action or recognized failures by the operator service.

Failure CodeDescription / Reason
STSession Timeout
PFEnd User exceeded maximum number of retries for OTP validation
NENetwork Error
LBBilling failed due to Low Balance
ISBilling failed due to incorrect selection of operator by the end-user while accessing via non-recognized gateways.
OFBilling failed due to operator service failures.

 

Error Codes

The error codes in case billing failed due to configuration, invalid request, unexpected service failures etc.

Error TypeError CodeError Description
Request Format / Value ErrorsIRQ0101A required resource could not be found with the specified parameters. (or)
No valid OTP payment requests could be found.
Request Format / Value ErrorsIRQ0102The request could not be read or understood.
Request Format / Value ErrorsIRQ0103The token is expired. Please provide a fresh token.
Request Format / Value ErrorsIRQ0104The request could not be read or understood as a required parameter is missing or the parameter values are not in the correct format. Please try again with the correct parameters.
Request Format / Value ErrorsIRQ0201The specified resource already exists. Duplication is not allowed.
Request Format / Value ErrorsIRQ0401You are using an incorrect gateway to access this service.
Request Format / Value ErrorsIRQ0601The service cannot support the content provided by the client.
Credential / Authorization ErrorsICR0201The iPayy PIN / OTP token did not match.
Credential / Authorization ErrorsICR0401The operation cannot be authorized with the specified credentials.
Subscriber / Discovery ErrorsISC0101The MSISDN specified / detected could not be normalized. Please contact the iPayy team if the issue persists.
Subscriber / Discovery ErrorsISC0201The Mobile Number is temporarily barred or has exceeded the operator billing threshold.
Subscriber / Discovery ErrorsISC0301This service is not available to regular customers.
Service ErrorsSER0101The SMS could not be sent. Please contact the iPayy team if the issue persists.
Service ErrorsSER0102The USSD session could not be established. Please contact the iPayy team if the issue persists.
Service ErrorsSER0201An error occurred due to which we were unable to process the transaction.
Service ErrorsSER0401An error occurred while processing the payment. Please try again with the correct parameters.
Service ErrorsSER0501An error occurred while obtaining consent or processing the payment. Please try again with the correct parameters.
Service ErrorsSER0701A Data Store error occurred. Please retry the request again. If the error persists, please contact the iPayy team.
Service ErrorsSER1501Carrier link is currently down. Please try after sometime.
Unexpected ErrorUXE0001Unexpected Error
Configuration ErrorCFG0101The application is currently not live for the operator and price point. Please contact the iPayy team for more information.
Configuration ErrorCFG0102An error occurred while trying to obtain consent. Please retry again.
Configuration ErrorCFG0501An internal configuration error occurred. Please contact the iPayy team if the issue persists.
Configuration ErrorCFG0601An error occurred while obtaining consent for the carrier. Please contact the iPayy team if the issue persists.