Specification » History » Version 11
Soh Keong, 09/14/2023 02:39 PM
1 | 1 | Soh Keong | {{toc}} |
---|---|---|---|
2 | |||
3 | h1. Specification |
||
4 | |||
5 | h1. Activity Diagram |
||
6 | 6 | Soh Keong | |
7 | 1 | Soh Keong | !flow.png! |
8 | !flow_UnionPay.png! |
||
9 | |||
10 | h1. Programming Guide |
||
11 | |||
12 | 2 | Soh Keong | h2. Jar version |
13 | 1 | Soh Keong | |
14 | 4 | Soh Keong | |_. version |_. Description | |
15 | | 1.3 | Init | |
||
16 | | 1.5 | Added Installment | |
||
17 | 1 | Soh Keong | |
18 | h3. Jar File Download |
||
19 | |||
20 | 4 | Soh Keong | "Jar":/redmine/attachments/download/571/TaiShin-1.5.jar |
21 | 1 | Soh Keong | "Properties":/redmine/attachments/download/539/taishin.properties |
22 | |||
23 | 2 | Soh Keong | h2. properties file |
24 | 1 | Soh Keong | |
25 | * *taishin.properties* |
||
26 | |||
27 | 2 | Soh Keong | # *sender* |
28 | # *version* |
||
29 | # *merchant.id* |
||
30 | # *sub.merchant.id* |
||
31 | # *terminal.id* |
||
32 | # *union.pay.timeout.in.minute* |
||
33 | # *union.pay.ip.address* |
||
34 | # *payment.url.credit.card* |
||
35 | # *payment.url.union.pay* |
||
36 | # *query.url.credit.card* |
||
37 | # *query.url.union.pay* |
||
38 | # *cacerts.alias* |
||
39 | # *cacerts.file* |
||
40 | # *cacerts.Pass* |
||
41 | # *CONNECTION_TIMEOUT* |
||
42 | # *READ_TIMEOUT* |
||
43 | |||
44 | h2. Database Table |
||
45 | |||
46 | <pre> |
||
47 | CREATE TABLE TSPG_INTERFACE ( |
||
48 | ORDER_ID VARCHAR(15) NOT NULL, |
||
49 | TRX_TYPE VARCHAR(5), |
||
50 | SHOPPER_REF_NO INTEGER, |
||
51 | CURRENCY VARCHAR(3), |
||
52 | CHARGE_AMT DECIMAL(15,2), |
||
53 | TSPG_PAYMENT_TYPE INTEGER, |
||
54 | APP_CODE VARCHAR(8), |
||
55 | STATUS VARCHAR(2), |
||
56 | ERROR_CODE VARCHAR(5), |
||
57 | ERROR_DESC VARCHAR(100), |
||
58 | 1 | Soh Keong | IS_VALID CHARACTER NOT NULL, |
59 | TRAN_ID VARCHAR(30), |
||
60 | PAY_DATE TIMESTAMP, |
||
61 | 4 | Soh Keong | INST_ORDER_ID VARCHAR(15), |
62 | INST_PERIOD INTEGER, |
||
63 | INST_DOWN_PAY DECIMAL(15,2), |
||
64 | INST_PAY DECIMAL(15,2), |
||
65 | 2 | Soh Keong | CREATE_DATETIME TIMESTAMP NOT NULL, |
66 | MODIFY_DATETIME TIMESTAMP, |
||
67 | PRIMARY KEY (ORDER_ID)) |
||
68 | </pre> |
||
69 | |||
70 | |||
71 | h2. Tai Shin Service |
||
72 | |||
73 | <pre> |
||
74 | com.aces.ts.service.TaiShinService service = new com.aces.ts.service.TaiShinService(); |
||
75 | </pre> |
||
76 | |||
77 | h3. getURL |
||
78 | |||
79 | <pre> |
||
80 | String url = service.getURL(Connection conn, PaymentTaiShin payment) |
||
81 | </pre> |
||
82 | |||
83 | # *conn* - Database connection. |
||
84 | # *payment* - PaymentTaiShin object. |
||
85 | > * *orderId* - Order ID. |
||
86 | > * *amount* - Transaction amount. |
||
87 | > * *currency* - com.aces.ts.common.CommonConstants.CURRENCY_CODE_TAIWAN |
||
88 | > * *trxType* - |
||
89 | > * *tsPaymentMethod* - com.aces.ts.common.CommonConstants.PARAM_PAY_TYPE_CREDIT_CARD | PARAM_PAY_TYPE_UNION_PAY |
||
90 | > * *layout* - com.aces.ts.common.CommonConstants.PARAM_LAYOUT_NORMAL_WEB | PARAM_LAYOUT_MOBILE_WEB |
||
91 | > * *description* - |
||
92 | > * *captFlag* - com.aces.ts.common.CommonConstants.PARAM_CAPT_FLAG_ASYNCHRONOUS | PARAM_CAPT_FLAG_SYNCHRONOUS |
||
93 | > * *resultFlag* - com.aces.ts.common.CommonConstants.PARAM_RESULT_FLAG_NO_DETAILS | PARAM_RESULT_FLAG_WITH_DETAILS |
||
94 | > * *browserReturnURL* - |
||
95 | > * *serverReturnURL* - |
||
96 | > * *shopperRefNo* - |
||
97 | 5 | Soh Keong | > * *InstallPeriod* - |
98 | 2 | Soh Keong | |
99 | 3 | Soh Keong | h3. updateTransaction |
100 | 2 | Soh Keong | |
101 | <pre> |
||
102 | 7 | Soh Keong | ResponseTaiShin = updateTransaction(Connection conn, HttpServletRequest request) |
103 | 2 | Soh Keong | </pre> |
104 | |||
105 | # *ResponseTaiShin* |
||
106 | > * errorCode - |
||
107 | > * errorDesc - |
||
108 | > * orderId - String |
||
109 | > * amount - double |
||
110 | > * currency - |
||
111 | > * appCode - |
||
112 | > * tranId - |
||
113 | 1 | Soh Keong | > * status - |
114 | > * payDate - Date |
||
115 | > * valid - boolean |
||
116 | 4 | Soh Keong | > * installmentOrderId - |
117 | > * installmentPeriod - |
||
118 | > * installmentDownPay - |
||
119 | > * installmentPay - |
||
120 | 8 | Soh Keong | |
121 | h2. Keystore |
||
122 | |||
123 | h3. Windows |
||
124 | |||
125 | cd C:\java\JDK8\bin |
||
126 | keytool -import -file "C:\project\paymentGateway\TW\TSPG\taishin_live.cer" -keystore "E:\DevelopmentTools\java\JDK8\jre\lib\security\cacerts" -alias "taishin_live" |
||
127 | keytool -list -v -keystore "C:\java\JDK8\jre\lib\security\cacerts" -storepass changeit -alias "taishin_live" |
||
128 | keytool -delete -keystore "C:\java\JDK8\jre\lib\security\cacerts" -storepass changeit -alias "taishin_live" |
||
129 | |||
130 | h3. Linux |
||
131 | 11 | Soh Keong | |
132 | 10 | Soh Keong | cp /usr/local/jdk1.8.0_171/jre/lib/security/cacerts /usr/local/jdk1.8.0_171/jre/lib/security/cacerts.bak |
133 | /usr/local/jdk1.8.0_171/bin/keytool -delete -v -keystore "/usr/local/jdk1.8.0_171/jre/lib/security/cacerts" -alias "taishin" -storepass changeit |
||
134 | 9 | Soh Keong | /usr/local/jdk1.8.0_171/bin/keytool -importcert -file "/data/tspg/taishin.cer" -alias "taishin" -keystore "/usr/local/jdk1.8.0_171/jre/lib/security/cacerts" -storepass changeit |
135 | /usr/local/jdk1.8.0_171/bin/keytool -list -v -keystore "/usr/local/jdk1.8.0_171/jre/lib/security/cacerts" -alias "taishin" -storepass changeit |