Project

General

Profile

Actions

Specification

Programming Guide

Jar version

version Description
1.0 Init

Jar File Download

Jar
Properties
Servlet

properties file

  • mocean.properties
  1. api.key.{DB}.{country/project}
  2. api.secret.{DB}.{country/project}
  3. url.domain - Mocean Domain name
  4. url.sms - Send SMS
  5. url.otp.ppc - OTP via sms and voice
  6. url.otp.ppa - OTP via sms
  7. url.verify - Verify OTP code
  8. url.query - Message delivery status
  9. dlr.mask - Delivery Report 0=No, 1=Yes
  10. response.format - JSON/XML
  11. otp.validity.in.second
  12. local.valid.period.in.second
  13. connection.timeout
  14. connection.read.timeout
  15. allow.list - If enable, only phone number in the list allow to sent.

Database Table

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))

SMS Service

com.mocean.service.MoceanService service = new com.mocean.service.MoceanService();

sendSms

com.mocean.bean.MoceanMessageBean result = service.sendSms(Connection conn, com.mocean.bean.RequestSmsSendBean bean)
  1. conn - Database connection.
  2. 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_*
  1. result - MoceanMessageBean object.
  • statusCode
  • otpId
  • errorMessage
  • messageId
  • messageIdExtra - For exceed more than 1 sms sent. (max length per sms = 153)
  • totalSms
  • deliveryStatus
  • creditDeducted

deliveryReport

com.mocean.bean.MoceanMessageBean result = service.deliveryReport(Connection conn, HttpServletRequest request)
  1. conn - Database connection.
  2. request - javax.servlet.http.HttpServletRequest.
  1. result - ResultBean object.
  • statusCode
  • deliveryStatus
  • messageId

sendOTP

com.mocean.bean.MoceanMessageBean result = service.sendOTPNormal(Connection conn, RequestOtpSendBean bean)
com.mocean.bean.MoceanMessageBean result = service.sendOTPAdvance(Connection conn, RequestOtpSendBean bean)
  1. conn - Database connection.
  2. 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_*
  1. result - MoceanMessageBean object.
  • statusCode
  • otpId
  • errorMessage
  • messageId

verifyPin

com.mocean.bean.MoceanMessageBean result = service.verifyPin(Connection conn, RequestVerifyOtpBean bean)
  1. conn - Database connection.
  2. bean - RequestVerifyOtpBean object.
  • messageId
  • otpCode
  • OrderId
  • companyName - com.mocean.constant.CommonConstant.COMPANY_NAME_*
  1. result - MoceanMessageBean object.
  • statusCode
  • otpId
  • errorMessage
  • messageId

Updated by Soh Keong over 1 year ago ยท 8 revisions