Project

General

Profile

Actions

Specification » History » Revision 18

« Previous | Revision 18/38 (diff) | Next »
Soh Keong, 11/25/2020 02:31 PM


Specification

Activity Diagram

Programming Guide

Jar version

version Description
1.0 Init

Jar File Download

Jar

Classes

  • com.ecosway.mol.common - CommonConstants, CommonProperties
  • com.ecosway.mol.dao - MOLInterface
  • com.ecosway.mol.model - CommonMOL, PaymentMOL, ResponseMOL
  • com.ecosway.mol.service - MOLService
  • com.ecosway.mol.service.impl - MOLServiceImpl
  • com.ecosway.mol.utils - HashUtils

properties file

  • mol.properties
  1. merchant.id - Merchant login name given by MOLPay
  2. payment.url - Front-end payment page URL
  3. verification.code - Verify Key provided by MOLPay to merchant.

Database Table

CREATE TABLE MOL_INTERFACE (
    ORDER_ID VARCHAR(15) NOT NULL, 
    TRX_TYPE VARCHAR(5),
    SHOPPER_REF_NO INTEGER,
    CURRENCY VARCHAR(3),
    CHARGE_AMT DECIMAL(15,2), 
    PAYMENT_METHOD VARCHAR(15),
    APP_CODE VARCHAR(20), 
    TRAN_ID INTEGER, 
    STATUS VARCHAR(2), 
    ERROR_CODE VARCHAR(20),
    ERROR_DESC VARCHAR(100),
    IS_VALID CHARACTER NOT NULL, 
    PAY_DATE TIMESTAMP,
    CREATE_DATETIME TIMESTAMP NOT NULL,
    MODIFY_DATETIME TIMESTAMP, 
    PRIMARY KEY (ORDER_ID));

Get MOLPay URL

com.ecosway.mol.service.MOLService service = new com.ecosway.mol.service.impl.MOLServiceImpl();

String URL = service.getURL(Connection conn, PaymentMOL payment);
String URL = service.getURL(Connection conn, PaymentMOL payment, String propertiesFileName);

  1. conn - Database connection.
  2. payment - PaymentMOL object.
  • orderId - Order ID.
  • amount - Transaction amount. (Must greater than 1)
  • currency - Currency. (Max 3 characters)
  • name - Shopper Name.
  • email - Shopper Email.
  • mobile - Shopper Mobile.
  • description - Transaction description.
  • trxType - Transaction Type.
  • country - Shopper country. Two letter ISO-3166 country code. (http://www.iso.org/iso/en/prods-services/iso3166ma/02iso-3166-code-lists/list-en1.html)
  • shopperRefNo - Shopper Reference Number.
  • returnURL - Page to be return after transaction.
  • paymentMethod - Identity which payment method to process the payment. (example : credit card or fpx)

Update MOLPay Response into Database

com.ecosway.mol.service.MOLService service = new com.ecosway.mol.service.impl.MOLServiceImpl();
com.ecosway.mol.model.ResponseMOL res = service.updateTransaction(Connection conn, HttpServletRequest request)
com.ecosway.mol.model.ResponseMOL res = service.updateTransaction(Connection conn, HttpServletRequest request, String propertiesFileName)
  1. ResponseMOL
  • orderId - String
  • amount - double
  • tranId - int
  • status - String
  • errorCode - String
  • errorDesc - String
  • currency - String
  • payDate - Date
  • valid - boolean

Updated by Soh Keong almost 4 years ago · 18 revisions