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