Project

General

Profile

Actions

Deployment And Programming Guide

Resources

SCM

see wiki

File Download

Jar file
mPay API (Please unzip it.)
mPay cert and properties file (Unzip to /data/mPay2 folder)
Sample payment JSP
Sample response JSP

properties file

  • mPay.properties
  1. payment.url - Provided by mPay
  2. enquiry.url - Provided by mPay
  3. merchantid - Provided by mPay
  4. merchant_tid - Provided by mPay
  5. serverCertPath - server cert location and name
  6. merchantCertPath - merchant cert location and name
  7. merchantCertPwd - Provided by mPay

Database Table


CREATE TABLE MPAY_INTERFACE ( 
    ORDER_ID VARCHAR(15) NOT NULL, 
    TRX_TYPE VARCHAR(15) NOT NULL, 
    SHOPPER_REF_NO INTEGER NOT NULL, 
    CHARGE_AMT DECIMAL(15,2) NOT NULL, 
    RESPONSE_CODE VARCHAR(4), 
    IS_VALID CHARACTER NOT NULL, 
    PAY_DATE TIMESTAMP, 
    CREATE_DATETIME TIMESTAMP NOT NULL, 
    MODIFY_DATETIME TIMESTAMP, 
    PRIMARY KEY (ORDER_ID)) 

Get URL

com.ecosway.mpay.service.MPayService service = new com.ecosway.mpay.service.MPayServiceImpl();

String url = service.getURL(Connection conn, PaymentMPay pay));
  1. conn - Database connection.
  2. payment - PaymentMPay object.
  • aordernum - Order ID.
  • aamt - Transaction amount.
  • acurrencycode - Currency Code of transaction. Allowed only HKD, RMB and USD
  • acustomizeddata - Remark message
  • aTransactionType - Transaction Type.
  • aShopperRefID - Shopper Reference Number.
  • adatetime - Order date of transaction. The value should be in the format of "yyyyMMddHHmmss"
  • acardtype - get value from com.ecosway.mpay.common.CommonConstant.CARD_TYPE_PRC
  • areturnurl - Payment response will passed to in normal cases.
  • afailurl - Payment response will passed to in abnormal cases.
  • alocale - language used. Allowed only en_US, zh_TW, zh_CN.

Update mPay Response into Database

com.ecosway.mpay.service.MPayService service = new com.ecosway.mpay.service.MPayServiceImpl();
com.ecosway.mpay.model.ResponseMPay res = service.updateTransaction(Connection conn, HttpServletRequest res)
  1. ResponseMPay
  • aordernum - String
  • aamt - double
  • acurrencycode - String
  • acustomizeddata - String
  • aValid - boolean
  • asysdatetime - java.util.Date
  • arefnum - String
  • asettledate - String
  • arspcode - String
  • aauthcode - String

Updated by Soh Keong over 11 years ago ยท 8 revisions