Project

General

Profile

Specification » History » Version 5

Soh Keong, 04/15/2021 01:46 PM

1 1 Soh Keong
{{toc}}
2
3
h1. Specification
4
5
h1. Activity Diagram
6
7
!paymentPage.jpg!
8
9
h1. Programming Guide
10
11
h2. Jar version 
12
13
|_. version |_. Description     |
14
| 1.o       | Init              |
15
16
h3. Jar File Download
17
18 4 Soh Keong
"Jar":/redmine/attachments/download/591/ctbc-1.0.jar
19
"Properties":/redmine/attachments/download/590/ctbc.properties
20
"Lib":/redmine/attachments/download/592/posapi_mac_j_npg.jar
21 1 Soh Keong
22
h2. properties file
23
24
* *ctcb.properties*
25
     
26
# *merchant.id*  
27
# *terminal.id*  
28
# *mer.id*
29
# *key*
30 4 Soh Keong
# *terminal.id.installment*  
31
# *mer.id.installment*
32
# *key.installment*
33 1 Soh Keong
# *payment.url.credit.card*
34
# *CONNECTION_TIMEOUT*    
35
# *READ_TIMEOUT*
36
37
h2. Database Table
38
39
<pre>
40 5 Soh Keong
CREATE TABLE CTBC_INTERFACE (
41
	ORDER_ID VARCHAR(15) NOT NULL, 
42
	TRX_TYPE VARCHAR(5), 
43
	SHOPPER_REF_NO INTEGER, 
44
	CURRENCY VARCHAR(3),
45
	CHARGE_AMT DECIMAL(15,2), 
46
	APP_CODE VARCHAR(8), 
47
	STATUS VARCHAR(2), 
48
	ERROR_CODE VARCHAR(5), 
49
	ERROR_DESC VARCHAR(100), 
50
	IS_VALID CHARACTER NOT NULL DEFAULT 'N', 
51
	TRAN_ID VARCHAR(30),
52
	PAY_DATE TIMESTAMP, 
53
	INST_PERIOD INTEGER,
54
	CREATE_DATETIME TIMESTAMP DEFAULT CURRENT_TIMESTAMP, 
55
	MODIFY_DATETIME TIMESTAMP, 
56
	PRIMARY KEY (ORDER_ID))
57 1 Soh Keong
</pre>    
58
59
60
h2. China Trust Service
61
62
<pre>
63
com.aces.ctcb.service.ChinaTrustService service = new com.aces.ctcb.service.ChinaTrustService();
64
</pre>
65
66
h3. getURL
67
68
<pre>
69
String url = service.getURL(Connection conn, PaymentCtcb payment)
70
</pre>
71
72
# *conn*           - Database connection.
73
# *payment*        - PaymentCtcb object.
74
> * *orderId*          - Order ID.
75 2 Soh Keong
> * *amount*           - Transaction amount. 
76
> * *currency*         - com.aces.ctcb.common.CommonConstants.CURRENCY_CODE_TAIWAN
77 1 Soh Keong
> * *trxType*          - 
78 2 Soh Keong
> * *returnURL*        - 
79
> * *shopperRefNo*     - 
80 5 Soh Keong
> * *InstallPeriod*    - only applicable for Installment.
81 2 Soh Keong
> * *TrxTypeCtcb*      - com.aces.ctcb.common.CommonConstants.TRANSACTION_TYPE_NORMAL || INSTALLMENT 
82 1 Soh Keong
> * *Language*         - com.aces.ctcb.common.CommonConstants.CUSTOMIZE_TRADITIONAL_CHINESE || SIMPLIFIED_CHINESE || ENGLISH
83
84
h3. updateTransaction
85
86
<pre>
87
ResponseCtcb res = updateTransaction(Connection conn, HttpServletRequest request)
88
</pre>
89 2 Soh Keong
90
# *ResponseCtcb*
91 5 Soh Keong
> * recordErrorCode - 0
92 2 Soh Keong
> * recordErrorMsg  - 
93 5 Soh Keong
> * trxErrorCode    - 00
94 2 Soh Keong
> * trxErrorMsg     -
95 5 Soh Keong
> * status          - 0 
96
> * orderId         - 
97
> * amount          -
98
> * trxType         -
99
> * authCode        -
100
> * TranId          -
101
> * valid           -