Project

General

Profile

Specification » History » Version 3

Soh Keong, 03/23/2023 11:56 AM

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