際際滷

際際滷Share a Scribd company logo
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
{
//failure
getresponse.exception=error//exceptionisastringdefinedinClass
Response
}
}
}
Relatedmethod:
BooleancheckwithDB(pay_id);
RelatedClass:
ClassResponse

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