Specification » History » Version 4
Soh Keong, 03/23/2023 05:15 PM
1 | 1 | Soh Keong | {{toc}} |
---|---|---|---|
2 | |||
3 | h1. Specification |
||
4 | |||
5 | h2. Programming Guide |
||
6 | |||
7 | h3. Jar version |
||
8 | |||
9 | |_. version |_. Description | |
||
10 | | 1.0 | Init | |
||
11 | |||
12 | |||
13 | h3. Jar File Download |
||
14 | |||
15 | 4 | Soh Keong | "Jar":/redmine/attachments/download/740/mocean-1.0.jar |
16 | "Properties":/redmine/attachments/download/742/mocean.properties |
||
17 | "Servlet":/redmine/attachments/download/741/MoceanServlet.class |
||
18 | 1 | Soh Keong | |
19 | h3. properties file |
||
20 | |||
21 | * *mocean.properties* |
||
22 | |||
23 | # *api.key.{DB}.{country/project}* |
||
24 | # *api.secret.{DB}.{country/project}* |
||
25 | # *url.domain* - Mocean Domain name |
||
26 | # *url.sms* - Send SMS |
||
27 | # *url.otp.ppc* - OTP via sms and voice |
||
28 | # *url.otp.ppa* - OTP via sms |
||
29 | # *url.verify* - Verify OTP code |
||
30 | # *url.query* - Message delivery status |
||
31 | # *dlr.mask* - Delivery Report 0=No, 1=Yes |
||
32 | # *response.format* - JSON/XML |
||
33 | # *otp.validity.in.second* |
||
34 | # *local.valid.period.in.second* |
||
35 | # *connection.timeout* |
||
36 | # *connection.read.timeout* |
||
37 | # *allow.list* - If enable, only phone number in the list allow to sent. |
||
38 | |||
39 | h2. Database Table |
||
40 | |||
41 | <pre> |
||
42 | CREATE TABLE MOCEAN_INTERFACE ( |
||
43 | OTP_ID VARCHAR(15) NOT NULL, |
||
44 | MOBILE VARCHAR(15) NOT NULL, |
||
45 | TRX_CODE VARCHAR(5) NOT NULL, |
||
46 | SHOPPER_REF_NO INTEGER, |
||
47 | STATUS_CODE VARCHAR(5), |
||
48 | STATUS_DESC VARCHAR(100), |
||
49 | REQUEST_ID VARCHAR(50), |
||
50 | REQUEST_ID_EXTRA VARCHAR(100), |
||
51 | DELIVERY_STATUS INTEGER, |
||
52 | TOTAL_SMS INTEGER, |
||
53 | CREATE_DATETIME TIMESTAMP NOT NULL DEFAULT CURRENT TIMESTAMP, |
||
54 | MODIFY_DATETIME TIMESTAMP, |
||
55 | ORDER_ID VARCHAR(15), |
||
56 | PRIMARY KEY (OTP_ID)) |
||
57 | </pre> |
||
58 | |||
59 | h2. SMS Service |
||
60 | |||
61 | <pre> |
||
62 | 2 | Soh Keong | com.mocean.service.MoceanService service = new com.mocean.service.MoceanService(); |
63 | 1 | Soh Keong | </pre> |
64 | 2 | Soh Keong | |
65 | h3. sendSms |
||
66 | |||
67 | <pre> |
||
68 | com.mocean.bean.MoceanMessageBean result = service.sendSms(Connection conn, com.mocean.bean.RequestSmsSendBean bean) |
||
69 | </pre> |
||
70 | |||
71 | # *conn* - Database connection. |
||
72 | 3 | Soh Keong | # *bean* - RequestSmsSendBean object. |
73 | 2 | Soh Keong | > * *shopperRefNo* |
74 | > * *otpId* - Auto setter |
||
75 | > * *transactionCode* |
||
76 | > * *mobile* |
||
77 | > * *sender* |
||
78 | > * *content* |
||
79 | > * *responseUrl* - Backend Response with PUT servlet |
||
80 | > * *charset* |
||
81 | > * *companyName* - com.mocean.constant.CommonConstant.COMPANY_NAME_* |
||
82 | |||
83 | |||
84 | 3 | Soh Keong | # *result* - MoceanMessageBean object. |
85 | 2 | Soh Keong | > * *statusCode* |
86 | > * *otpId* |
||
87 | > * *errorMessage* |
||
88 | > * *messageId* |
||
89 | > * *messageIdExtra* - For exceed more than 1 sms sent. (max length per sms = 153) |
||
90 | > * *totalSms* |
||
91 | 1 | Soh Keong | > * *deliveryStatus* |
92 | > * *creditDeducted* |
||
93 | 3 | Soh Keong | |
94 | h3. deliveryReport |
||
95 | |||
96 | <pre> |
||
97 | com.mocean.bean.MoceanMessageBean result = service.deliveryReport(Connection conn, HttpServletRequest request) |
||
98 | </pre> |
||
99 | |||
100 | # *conn* - Database connection. |
||
101 | # *request* - javax.servlet.http.HttpServletRequest. |
||
102 | |||
103 | # *result* - ResultBean object. |
||
104 | > * *statusCode* |
||
105 | > * *deliveryStatus* |
||
106 | > * *messageId* |
||
107 | |||
108 | |||
109 | h3. sendOTP |
||
110 | |||
111 | <pre> |
||
112 | com.mocean.bean.MoceanMessageBean result = service.sendOTPNormal(Connection conn, RequestOtpSendBean bean) |
||
113 | com.mocean.bean.MoceanMessageBean result = service.sendOTPAdvance(Connection conn, RequestOtpSendBean bean) |
||
114 | </pre> |
||
115 | |||
116 | # *conn* - Database connection. |
||
117 | # *bean* - RequestOtpSendBean object. |
||
118 | > * *shopperRefNo* |
||
119 | > * *otpId* - Auto setter |
||
120 | > * *transactionCode* |
||
121 | > * *mobile* |
||
122 | > * *sender* |
||
123 | > * *otpLenght* - Possible value 4 & 6 |
||
124 | > * *validInSecond* - Possible value range from 60 to 3600 |
||
125 | > * *companyName* - com.mocean.constant.CommonConstant.COMPANY_NAME_* |
||
126 | |||
127 | # *result* - MoceanMessageBean object. |
||
128 | > * *statusCode* |
||
129 | > * *otpId* |
||
130 | > * *errorMessage* |
||
131 | > * *messageId* |
||
132 | |||
133 | h3. verifyPin |
||
134 | |||
135 | <pre> |
||
136 | com.mocean.bean.MoceanMessageBean result = service.verifyPin(Connection conn, RequestVerifyOtpBean bean) |
||
137 | </pre> |
||
138 | |||
139 | # *conn* - Database connection. |
||
140 | # *bean* - RequestVerifyOtpBean object. |
||
141 | > * *messageId* |
||
142 | > * *otpCode* |
||
143 | > * *OrderId* |
||
144 | > * *companyName* - com.mocean.constant.CommonConstant.COMPANY_NAME_* |
||
145 | |||
146 | # *result* - MoceanMessageBean object. |
||
147 | > * *statusCode* |
||
148 | > * *otpId* |
||
149 | > * *errorMessage* |
||
150 | > * *messageId* |