Deployment And Programming Guide » History » Version 1
Soh Keong, 04/12/2013 02:24 PM
1 | 1 | Soh Keong | h1. Deployment And Programming Guide |
---|---|---|---|
2 | |||
3 | h2. Resources |
||
4 | |||
5 | h3. SCM |
||
6 | |||
7 | see [[wiki#SCM]] |
||
8 | |||
9 | h3. File Download |
||
10 | |||
11 | "Jar file":http://192.168.2.13:50000/redmine/attachments/download/430/mPay-1.0-SNAPSHOT.jar |
||
12 | "mPay API":http://192.168.2.13:50000/redmine/attachments/download/429/mPay_api.rar (Please unzip it.) |
||
13 | "mPay cert and properties file":http://192.168.2.13:50000/redmine/attachments/download/428/mPay2.rar (Unzip to /data/mPay2 folder) |
||
14 | |||
15 | h3. properties file |
||
16 | |||
17 | * *mPay.properties* |
||
18 | |||
19 | # *payment.url* - Provided by mPay |
||
20 | # *merchantid* - Provided by mPay |
||
21 | # *merchant_tid* - Provided by mPay |
||
22 | # *serverCertPath* - server cert location and name |
||
23 | # *merchantCertPath* - merchant cert location and name |
||
24 | # *merchantCertPwd* - Provided by mPay |
||
25 | |||
26 | h3. Database Table |
||
27 | |||
28 | <pre> |
||
29 | |||
30 | CREATE TABLE MPAY_INTERFACE ( |
||
31 | ORDER_ID VARCHAR(15) NOT NULL, |
||
32 | TRX_TYPE VARCHAR(15) NOT NULL, |
||
33 | SHOPPER_REF_NO INTEGER NOT NULL, |
||
34 | CHARGE_AMT DECIMAL(15,2) NOT NULL, |
||
35 | RESPONSE_CODE VARCHAR(4), |
||
36 | IS_VALID CHARACTER NOT NULL, |
||
37 | PAY_DATE TIMESTAMP, |
||
38 | CREATE_DATETIME TIMESTAMP NOT NULL, |
||
39 | MODIFY_DATETIME TIMESTAMP, |
||
40 | PRIMARY KEY (ORDER_ID)) |
||
41 | </pre> |
||
42 | |||
43 | |||
44 | *Get URL* |
||
45 | |||
46 | <pre> |
||
47 | com.ecosway.mpay.service.MPayService service = new com.ecosway.mpay.service.MPayServiceImpl(); |
||
48 | |||
49 | String url = service.getURL(Connection conn, PaymentMPay pay)); |
||
50 | </pre> |
||
51 | |||
52 | # *conn* - Database connection. |
||
53 | # *payment* - PaymentMPay object. |
||
54 | > * *aordernum* - Order ID. |
||
55 | > * *aamt* - Transaction amount. |
||
56 | > * *acurrencycode* - Currency Code of transaction. Allowed only HKD, RMB and USD |
||
57 | > * *acustomizeddata* - Remark message |
||
58 | > * *aTransactionType* - Transaction Type. |
||
59 | > * *aShopperRefID* - Shopper Reference Number. |
||
60 | > * *adatetime* - Order date of transaction. The value should be in the format of "yyyyMMddHHmmss" |
||
61 | > * *acardtype* - To identify the payment method. ("14" represent PRC2.) |
||
62 | > * *areturnurl* - Payment response will passed to in normal cases. |
||
63 | > * *afailurl* - Payment response will passed to in abnormal cases. |
||
64 | > * *alocale* - language used. Allowed only en_US, zh_TW, zh_CN. |
||
65 | |||
66 | |||
67 | |||
68 | *Update mPay Response into Database* |
||
69 | |||
70 | <pre> |
||
71 | com.ecosway.mpay.service.MPayService service = new com.ecosway.mpay.service.MPayServiceImpl(); |
||
72 | com.ecosway.mpay.model.ResponseMPay res = service.updateTransaction(Connection conn, HttpServletRequest res) |
||
73 | </pre> |
||
74 | |||
75 | # *ResponseMPay* |
||
76 | > * aordernum - String |
||
77 | > * aamt - double |
||
78 | > * acurrencycode - String |
||
79 | > * acustomizeddata - String |
||
80 | > * aValid - boolean |
||
81 | > * asysdatetime - java.util.Date |
||
82 | > * arefnum - String |
||
83 | > * asettledate - String |
||
84 | > * arspcode - String |
||
85 | > * aauthcode - String |