#1 Where is server coding?
Posted: Tue Sep 25, 2018 12:20 pm
Hi team,
where that we can be defined the API, for the client could be get data.
where that we can be defined the API, for the client could be get data.
Forum for Appzillon Developers
https://forum.appzillon.com//
How can I know the logic on the back-end? where can I code the logic? (scripts folder or setting on the interface only?)
Code: Select all
<dependency>
<groupId>com.iexceed.appzillon</groupId>
<artifactId>appzillon-frameworks</artifactId>
<version>3.5.3.S1</version>
</dependency>
Code: Select all
public class FundTransferImpl extends ExternalServicesRouter {
private static final Logger LOG = LoggerFactory.getLoggerFactory().getFrameWorksLogger(ServerConstants.LOGGER_FRAMEWORKS,
FundTransferImpl.class.toString());
public void serviceRequestDispatcher(Message pMessage, SpringCamelContext pContext)
throws ExternalServicesRouterException, InvalidPayloadException, ClassNotFoundException, URIException {
//write your logic here
JSONObject lgenOTPJSON = new JSONObject();
lgenOTPJSON.put("payload", pMessage.getRequestObject().getRequestJson());
//set request format
pMessage.getRequestObject().setRequestJson(new JSONObject().put("generateOTPRequest", lgenOTPJSON));
OTPEngineService otpEngine = new OTPEngineService();
otpEngine.generateOtp(pMessage); // for generating OTP
LOG.debug("OTP Response is : " + pMessage.getResponseObject().getResponseJson());
String otp = pMessage.getResponseObject().getResponseJson().getJSONObject("generateOTPResponse").get("otp") + ""; // OTP received
//Send otp to user's registered mobile no
}
}
Code: Select all
var params = {}
params.refno = "434234234";
params.otp = "123456";
apz.server.validateandProcessOTP(params);
Code: Select all
UPDATE `TB_ASMI_SECURITY_PARAMETERS` SET
`OTP_LENGTH`='6', // OTP to be generated of length
`OTP_VALIDATION_COUNT`='3', // OTP lock count after 'N' incorrect OTP attempts
`OTP_EXPIRY`='300', // OTP expiry in seconds
`OTP_RESEND`='Y', // is resnding OTP allowed or not 'Y'/'N'
`OTP_FORMAT`='NUMERIC', // NUMERIC, ALPHA, ALPHANUMERIC
`OTP_RESEND_COUNT`='2', // No of times OTP can be resent
`OTP_RESEND_LOCK_TIMEOUT`='300' // OTP lock timeout in seconds
WHERE `APP_ID` = 'Admin'; // Appzillon ApplicationId