Project

General

Profile

Actions

Specification » History » Revision 2

« Previous | Revision 2/10 (diff) | Next »
Soh Keong, 03/01/2023 12:08 PM


Specification

Activity Diagram

3D

Non-3D

Programming Guide

Jar version

version Description
1.0 Init

Jar File Download

"Jar":
"Properties":
"JSP CreatePayment":

Classes

  • com.ecpay.bean.aces - AcesRequestBean, AcesResponseBean
  • com.ecpay.common - CommonConstant, CommonProperties, PaymentTypeEnum
  • com.ecpay.dao - EcPayInterface
  • com.ecpay.service - EcPayService
  • com.ecpay.utils - CommonUtils, HashUtil, HttpUtil

properties file

  • ecPay.properties
  1. merchant.id - Merchant login name given by EcPay
  2. hash.key - From portal
  3. hash.iv - From portal
  4. payment.url - by EcPay
  5. query.trade.url - by EcPay
  6. url.token - by EcPay
  7. url.create - by EcPay
  8. local.create.payment.page - Mall Page
  9. local.non.3d.result.page - Mall Page
  10. CONNECTION_TIMEOUT - 5000 ms
  11. READ_TIMEOUT - 30000 ms

Database Table

CREATE TABLE ECPAY_INTERFACE (
    ORDER_ID VARCHAR(15) NOT NULL, 
    TRX_TYPE VARCHAR(5),
    SHOPPER_REF_NO INTEGER,
    CURRENCY VARCHAR(3),
    CHARGE_AMT DECIMAL(15,2), 
    ORDER_DATETIME TIMESTAMP NOT NULL,
    STEPS VARCHAR(10),
    TRANS_CODE INTEGER, 
    TRANS_MESSAGE VARCHAR(200), 
    RTN_CODE INTEGER,
    RTN_MESSAGE VARCHAR(210),
    TRADE_NO VARCHAR(20),
    TRADE_DATE TIMESTAMP,
    TRADE_STATUS VARCHAR(8),
    PAYMENT_TYPE VARCHAR(20),
    INST_PERIOD INTEGER,
    INST_DOWN_PAY INTEGER,
    INST_MONTH_PAY INTEGER,    
    CARD_AUTH_CODE VARCHAR(6),
    CARD_BANK VARCHAR(30),
    IS_VALID CHARACTER NOT NULL DEFAULT 'N', 
    PAY_DATE TIMESTAMP,
    CREATE_DATETIME TIMESTAMP NOT NULL DEFAULT CURRENT TIMESTAMP,
    MODIFY_DATETIME TIMESTAMP, 
    PRIMARY KEY (ORDER_ID))

EcPay Service

com.ecpay.service.EcPayService service = new com.ecpay.service.EcPayService();

getUrl

String url = service.getUrl(Connection conn, AcesRequestBean bean)
  1. conn - Database connection.
  2. payment - PaymentMOL object.
  • orderId - Order ID.
  • totalAmount - Transaction amount. (Integer)
  • orderDatetime - LocalDateTime
  • trxType - Transaction Type.
  • shopperRefNo - Shopper Reference Number.
  • currency - CommonConstant.CURRENCY_TAIWAN
  • CreditInstallment - Support multiple period with comma delimiter. Example (6,12,24)
  • returnUrl - Backend Response
  • orderResultUrl - Frontend Response
  • transactionDescription - Example : Aces Sales
  • ItemName - Example : Aces Product
  1. url - CreatePaymentPage's URL
  2. Parameter - in URL
  • orderId -
  • token -
  • language - Will display in Payment Page

createPaymentPage (Web JS)

Refer : https://developers.ecpay.com.tw/?p=8989
Sample Page (JSP CreatePayment) : /redmine/projects/ecpay/wiki/Specification/edit#Jar-File-Download

String url = service.getUrl(Connection conn, String orderId, String token);

For
1. 3D : Redirect to 3D page
2. Non-3D : Redirect to Receipt Page

updateTransaction

AcesResponseBean updateTransaction(Connection conn, HttpServletRequest request)

Updated by Soh Keong almost 2 years ago · 2 revisions