This API documentation summarizes a "pay" API that allows a user to make a payment to another user. The API takes in parameters like the payer and payee user IDs, amount in paise, and an RSA signature. It returns a response object indicating whether the payment was successful or failed, with further error details provided in case of failure. Sample Java code is also provided to process the payment and return the response.
1 of 2
Download to read offline
More Related Content
Response Pay API_Sample_with_SMEInputs
1. Inputs receivedfromSME in Raw format:
1) Please write the API documentation for the following API. The documentation is for consumption by third
party developers of our organization. The API is exposed by our organization server engineers. The
programming language used is java.
Method name:
pay
Parameters:
payer (user ID of the user making the payment), payee (user id of the user who should receive the payment),
amountInPaise, signature (RSA digital signature of these parameters, signed with the payer's private key)
Response:
If the payment is successful, then the response will contain a boolean parameter called "success", set to true. If
it failed, the response will contain a string parameter called "error", with an error message.
API Documentation
API name: Response pay(intpayerid,intpayee id,intamtInPaise,StringRSA_Key)
Usage:Response isa customclassthat containsa Boolean value toT and Stringvalue toSuccess.This
classcreates a getresponse objectthatresultina Booleanparameterwhose statusis settotrue whenit
issuccessor resultin a Stringparametersetto failure whenits exceptionissettoerror.
Successhere meansthe paymentissuccessful anderrormeanspaymentnotsuccessful.
Parameter Types:
Payerid Integer
Payee id Integer
amtInPaise Integer
RSA Key Integer
Java Code Sample:
Classprocesspay
{
Response pay(intpayerid,intpayee id,intamtInPaise,StringRSA_Key)
{
Response getresponse=new Response ();
if
{
checkwithDB(pay_id)
{
//success
getresponse.result=T//resultisabooleandefinedinClassResponse
}
else