Specification » History » Version 3
Soh Keong, 12/08/2020 03:20 PM
1 | 1 | Soh Keong | {{toc}} |
---|---|---|---|
2 | |||
3 | h1. Specification |
||
4 | |||
5 | h1. Activity Diagram |
||
6 | !flow.png! |
||
7 | !flow_UnionPay.png! |
||
8 | |||
9 | h1. Programming Guide |
||
10 | |||
11 | 2 | Soh Keong | h2. Jar version |
12 | 1 | Soh Keong | |
13 | |_. version |_. Description | |
||
14 | | 1.3 | Init | |
||
15 | |||
16 | h3. Jar File Download |
||
17 | |||
18 | "Jar":/redmine/attachments/download/540/TaiShin-1.3.jar |
||
19 | "Properties":/redmine/attachments/download/539/taishin.properties |
||
20 | |||
21 | 2 | Soh Keong | h2. properties file |
22 | 1 | Soh Keong | |
23 | * *taishin.properties* |
||
24 | |||
25 | 2 | Soh Keong | # *sender* |
26 | # *version* |
||
27 | # *merchant.id* |
||
28 | # *sub.merchant.id* |
||
29 | # *terminal.id* |
||
30 | # *union.pay.timeout.in.minute* |
||
31 | # *union.pay.ip.address* |
||
32 | # *payment.url.credit.card* |
||
33 | # *payment.url.union.pay* |
||
34 | # *query.url.credit.card* |
||
35 | # *query.url.union.pay* |
||
36 | # *cacerts.alias* |
||
37 | # *cacerts.file* |
||
38 | # *cacerts.Pass* |
||
39 | # *CONNECTION_TIMEOUT* |
||
40 | # *READ_TIMEOUT* |
||
41 | |||
42 | h2. Database Table |
||
43 | |||
44 | <pre> |
||
45 | CREATE TABLE TSPG_INTERFACE ( |
||
46 | ORDER_ID VARCHAR(15) NOT NULL, |
||
47 | TRX_TYPE VARCHAR(5), |
||
48 | SHOPPER_REF_NO INTEGER, |
||
49 | CURRENCY VARCHAR(3), |
||
50 | CHARGE_AMT DECIMAL(15,2), |
||
51 | TSPG_PAYMENT_TYPE INTEGER, |
||
52 | APP_CODE VARCHAR(8), |
||
53 | STATUS VARCHAR(2), |
||
54 | ERROR_CODE VARCHAR(5), |
||
55 | ERROR_DESC VARCHAR(100), |
||
56 | IS_VALID CHARACTER NOT NULL, |
||
57 | TRAN_ID VARCHAR(30), |
||
58 | PAY_DATE TIMESTAMP, |
||
59 | CREATE_DATETIME TIMESTAMP NOT NULL, |
||
60 | MODIFY_DATETIME TIMESTAMP, |
||
61 | PRIMARY KEY (ORDER_ID)) |
||
62 | </pre> |
||
63 | |||
64 | |||
65 | h2. Tai Shin Service |
||
66 | |||
67 | <pre> |
||
68 | com.aces.ts.service.TaiShinService service = new com.aces.ts.service.TaiShinService(); |
||
69 | </pre> |
||
70 | |||
71 | h3. getURL |
||
72 | |||
73 | <pre> |
||
74 | String url = service.getURL(Connection conn, PaymentTaiShin payment) |
||
75 | </pre> |
||
76 | |||
77 | # *conn* - Database connection. |
||
78 | # *payment* - PaymentTaiShin object. |
||
79 | > * *orderId* - Order ID. |
||
80 | > * *amount* - Transaction amount. |
||
81 | > * *currency* - com.aces.ts.common.CommonConstants.CURRENCY_CODE_TAIWAN |
||
82 | > * *trxType* - |
||
83 | > * *tsPaymentMethod* - com.aces.ts.common.CommonConstants.PARAM_PAY_TYPE_CREDIT_CARD | PARAM_PAY_TYPE_UNION_PAY |
||
84 | > * *layout* - com.aces.ts.common.CommonConstants.PARAM_LAYOUT_NORMAL_WEB | PARAM_LAYOUT_MOBILE_WEB |
||
85 | > * *description* - |
||
86 | > * *captFlag* - com.aces.ts.common.CommonConstants.PARAM_CAPT_FLAG_ASYNCHRONOUS | PARAM_CAPT_FLAG_SYNCHRONOUS |
||
87 | > * *resultFlag* - com.aces.ts.common.CommonConstants.PARAM_RESULT_FLAG_NO_DETAILS | PARAM_RESULT_FLAG_WITH_DETAILS |
||
88 | > * *browserReturnURL* - |
||
89 | > * *serverReturnURL* - |
||
90 | > * *shopperRefNo* - |
||
91 | |||
92 | 3 | Soh Keong | h3. updateTransaction |
93 | 2 | Soh Keong | |
94 | <pre> |
||
95 | ResponseTaiShin updateTransaction(Connection conn, HttpServletRequest request) |
||
96 | </pre> |
||
97 | |||
98 | # *ResponseTaiShin* |
||
99 | > * errorCode - |
||
100 | > * errorDesc - |
||
101 | > * orderId - String |
||
102 | > * amount - double |
||
103 | > * currency - |
||
104 | > * appCode - |
||
105 | > * tranId - |
||
106 | > * status - |
||
107 | > * payDate - Date |
||
108 | > * valid - boolean |