Project

General

Profile

Deployment And Programming Guide » History » Version 3

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