Project

General

Profile

Specification » History » Version 8

Soh Keong, 02/05/2013 03:29 PM

1 1 Soh Keong
h1. Specification
2
3
h1. Activity Diagram
4
5 6 Soh Keong
!ecpg.png!
6 1 Soh Keong
7
h1. Programming Guide
8
9
h2. Resources
10
11
h3. SCM
12
13
see [[wiki#SCM]]
14
15
h3. Jar File Download
16
17
"Download Page":http://192.168.2.13:50000/redmine/projects/ecpg/files
18
19
h3. Classes
20
21
* *com.ecosway.ecpg.common* - CommonConstants, CommonProperties
22
* *com.ecosway.ecpg.dao* - ECPGInterface
23
* *com.ecosway.ecpg.model* - CommonECPG, PaymentECPG, ResponseECPG
24 5 Soh Keong
* *com.ecosway.ecpg.service* - ECPGService, ECPGServiceImpl
25 1 Soh Keong
26
h3. properties file
27
28
* *ecpg.properties*
29
30
# *merchant.id*       - Merchant id, given by NCCC (National Credit Card Center of R.O.C)
31
# *payment.url*       - Front-end payment page URL
32
# *terminal.id*       - Terminal id, given by NCCC (National Credit Card Center of R.O.C)
33
34
h3. Database Table
35
36
<pre>
37
CREATE TABLE ECOS.ECPG_INTERFACE (
38
	ORDER_ID VARCHAR(15) NOT NULL, 
39
	TRX_TYPE VARCHAR(5),
40
	SHOPPER_REF_NO INTEGER,
41
	CHARGE_AMT DECIMAL(15,2),
42
	APP_CODE VARCHAR(8),
43
	STATUS VARCHAR(2), 
44
	ERROR_CODE VARCHAR(3),
45
	ERROR_DESC VARCHAR(60),
46
	IS_VALID CHARACTER NOT NULL, 
47
	PAY_DATE TIMESTAMP,
48
	CREATE_DATETIME TIMESTAMP NOT NULL,
49
	MODIFY_DATETIME TIMESTAMP, 
50
	PRIMARY KEY (ORDER_ID))
51
</pre>
52
53
*Get ECPG URL*
54
55
<pre>
56
com.ecosway.ecpg.service.ECPGService service = new com.ecosway.ecpg.service.ECPGServiceImpl();
57
58
String URL = service.getURL(Connection conn, PaymentECPG payment);
59
60
</pre>
61
62
# *conn*           - Database connection.
63
# *payment*        - PaymentECPG object.
64
> * *orderId*      - Order ID.
65 2 Soh Keong
> * *amount*       - Transaction amount.
66
> * *trxType*      - Transaction Type.
67
> * *shopperRefNo* - Shopper Reference Number.
68
> * *returnURL*    - Page to be return after transaction.
69 8 Soh Keong
> * *trxMode*      - Value may get from com.ecosway.ecpg.common.CommonConstants (TRANSMODE_BASIC & TRANSMODE_INSTALLMENT).
70
> * *install*      - Number of installment. (Require only if trxMode = TRANSMODE_INSTALLMENT)
71 2 Soh Keong
72 5 Soh Keong
*Update ECPG Response into Database*
73 2 Soh Keong
74
<pre>
75 4 Soh Keong
com.ecosway.ecpg.service.ECPGService service = new com.ecosway.ecpg.service.ECPGServiceImpl();
76 7 Soh Keong
com.ecosway.ecpg.model.ResponseECPG res = service.updateTransaction(Connection conn, HttpServletRequest request)
77 2 Soh Keong
</pre>
78
79
# *ResponseECPG*
80
> * orderId      - String
81
> * amount       - double
82
> * status       - String
83
> * responseCode - String
84
> * responseMsg  - String
85
> * authCode     - String
86
> * payDate      - Date
87
> * valid        - boolean
88 8 Soh Keong
> * trxMode      - String
89
> * firstAmt     - double
90
> * eachAmt      - double
91
> * fee          - double