Project

General

Profile

Specification » History » Revision 6

Revision 5 (Soh Keong, 04/07/2023 10:43 AM) → Revision 6/8 (Soh Keong, 04/11/2023 02:55 PM)

{{toc}} 

 h1. Specification 

 h2. Programming Guide 

 h3. Jar version  

 |_. version |_. Description                          | 
 | 1.0         | Init                                   | 


 h3. Jar File Download 

 "Jar":/redmine/attachments/download/750/Mocean-1.0.jar "Jar":/redmine/attachments/download/746/Mocean-1.0.jar 
 "Properties":/redmine/attachments/download/742/mocean.properties 
 "Servlet":/redmine/attachments/download/741/MoceanServlet.class 

 h3. properties file 

 * *mocean.properties* 

 # *api.key.{DB}.{country/project}* 
 # *api.secret.{DB}.{country/project}* 
 # *url.domain*                               - Mocean Domain name 
 # *url.sms*                                  - Send SMS 
 # *url.otp.ppc*                              - OTP via sms and voice 
 # *url.otp.ppa*                              - OTP via sms 
 # *url.verify*                               - Verify OTP code 
 # *url.query*                                - Message delivery status 
 # *dlr.mask*                                 - Delivery Report    0=No, 1=Yes 
 # *response.format*                          - JSON/XML 
 # *otp.validity.in.second* 
 # *local.valid.period.in.second* 
 # *connection.timeout* 
 # *connection.read.timeout* 
 # *allow.list*                               - If enable, only phone number in the list allow to sent. 

 h2. Database Table 

 <pre> 
 CREATE TABLE MOCEAN_INTERFACE ( 
	 OTP_ID VARCHAR(15) NOT NULL, 
	 MOBILE VARCHAR(15) NOT NULL,  
	 TRX_CODE VARCHAR(5) NOT NULL, 
	 SHOPPER_REF_NO INTEGER,  
	 STATUS_CODE VARCHAR(5), 
	 STATUS_DESC VARCHAR(100), 
	 REQUEST_ID VARCHAR(50), 
	 REQUEST_ID_EXTRA VARCHAR(100), 
	 DELIVERY_STATUS INTEGER, 
	 TOTAL_SMS INTEGER, 
	 CREATE_DATETIME TIMESTAMP NOT NULL DEFAULT CURRENT TIMESTAMP, 
	 MODIFY_DATETIME TIMESTAMP, 
	 ORDER_ID VARCHAR(15), 
	 PRIMARY KEY (OTP_ID)) 
 </pre> 

 h2. SMS Service 

 <pre> 
 com.mocean.service.MoceanService service = new com.mocean.service.MoceanService(); 
 </pre> 

 h3. sendSms  

 <pre> 
 com.mocean.bean.MoceanMessageBean result = service.sendSms(Connection conn, com.mocean.bean.RequestSmsSendBean bean) 
 </pre> 

 # *conn*             - Database connection. 
 # *bean*             - RequestSmsSendBean object. 
 > * *shopperRefNo*      
 > * *otpId*             - Auto setter 
 > * *transactionCode* 
 > * *mobile* 
 > * *sender* 
 > * *content* 
 > * *responseUrl*       - Backend Response with PUT servlet 
 > * *charset* 
 > * *companyName*       - com.mocean.constant.CommonConstant.COMPANY_NAME_* 


 # *result*          - MoceanMessageBean object. 
 > * *statusCode* 
 > * *otpId* 
 > * *errorMessage* 
 > * *messageId*      
 > * *messageIdExtra*    - For exceed more than 1 sms sent. (max length per sms = 153) 
 > * *totalSms*    
 > * *deliveryStatus*  
 > * *creditDeducted* 

 h3. deliveryReport 

 <pre> 
 com.mocean.bean.MoceanMessageBean result = service.deliveryReport(Connection conn, HttpServletRequest request) 
 </pre> 

 # *conn*             - Database connection. 
 # *request*          - javax.servlet.http.HttpServletRequest. 

 # *result*          - ResultBean object. 
 > * *statusCode* 
 > * *deliveryStatus* 
 > * *messageId* 


 h3. sendOTP  

 <pre> 
 com.mocean.bean.MoceanMessageBean result = service.sendOTPNormal(Connection conn, RequestOtpSendBean bean) 
 com.mocean.bean.MoceanMessageBean result = service.sendOTPAdvance(Connection conn, RequestOtpSendBean bean) 
 </pre> 

 # *conn*             - Database connection. 
 # *bean*             - RequestOtpSendBean object. 
 > * *shopperRefNo*      
 > * *otpId*             - Auto setter 
 > * *transactionCode* 
 > * *mobile* 
 > * *sender* 
 > * *otpLenght*         - Possible value 4 & 6 
 > * *validInSecond*     - Possible value range from 60 to 3600 
 > * *companyName*       - com.mocean.constant.CommonConstant.COMPANY_NAME_* 

 # *result*          - MoceanMessageBean object. 
 > * *statusCode* 
 > * *otpId* 
 > * *errorMessage* 
 > * *messageId*  

 h3. verifyPin 

 <pre> 
 com.mocean.bean.MoceanMessageBean result = service.verifyPin(Connection conn, RequestVerifyOtpBean bean) 
 </pre> 

 # *conn*             - Database connection. 
 # *bean*             - RequestVerifyOtpBean object. 
 > * *messageId*      
 > * *otpCode*            
 > * *OrderId* 
 > * *companyName*       - com.mocean.constant.CommonConstant.COMPANY_NAME_* 

 # *result*          - MoceanMessageBean object. 
 > * *statusCode* 
 > * *otpId* 
 > * *errorMessage* 
 > * *messageId*