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