Project

General

Profile

Specification » History » Version 2

Soh Keong, 11/30/2020 04:58 PM

1 1 Soh Keong
{{toc}}
2
3
h1. Specification
4
5
h1. Programming Guide
6
7
h3. Jar version 
8
9
|_. version |_. Description  |
10
| 1.2.1     | Init           |
11
12
h3. Jar File Download
13
14
"Jar":/redmine/attachments/download/530/wechat-1.2.1.jar
15
"Properties":/redmine/attachments/download/531/wechat.properties
16
"Lib":/redmine/attachments/download/532/lib.rar
17
18
h3. properties file
19
20
* *wechat.properties*
21
22
# *payment.url*             
23
# *qr.url*             
24
# *mid*             
25
# *tid*             
26
# *msg.src*             
27
# *msg.id*             
28
# *md5.key*             
29
# *inst.mid*             
30
# *msg.type*             
31
# *charset*             
32
# *http.connection.timeout*  
33
# *http.read.timeout*         
34
35
h3. Database Table
36
37
<pre>
38
CREATE TABLE WECHAT_INTERFACE ( 
39
    ORDER_ID VARCHAR(15) NOT NULL, 
40
    TRX_TYPE VARCHAR(15) NOT NULL, 
41
    SHOPPER_REF_NO INTEGER NOT NULL, 
42
    CURRENCY VARCHAR(3),
43
    CHARGE_AMT DECIMAL(15,2) NOT NULL, 
44
    QR_CODE VARCHAR(255),
45
    RESPONSE_CODE VARCHAR(15), 
46
    RESPONSE_MSG VARCHAR(100),
47
    IS_VALID CHARACTER NOT NULL, 
48
    PAY_DATE TIMESTAMP, 
49
    CREATE_DATETIME TIMESTAMP NOT NULL, 
50
    MODIFY_DATETIME TIMESTAMP, 
51
    PRIMARY KEY (ORDER_ID)) 
52
</pre>
53
54
h2. Method
55
56
<pre>
57 2 Soh Keong
com.vmart.wechat.service.WechatService service = new com.vmart.wechat.service.WechatService(); 
58
</pre>
59 1 Soh Keong
60 2 Soh Keong
h3. getDataURI / checkBillStatus
61
62
<pre>
63
com.vmart.wechat.model.ResponseWechat response = service.getDataURI(Connection conn, com.vmart.wechat.model.PaymentWechat payment)
64
com.vmart.wechat.model.ResponseWechat response = service.checkBillStatus(Connection conn, com.vmart.wechat.model.PaymentWechat payment)
65 1 Soh Keong
</pre>
66 2 Soh Keong
67
# *conn*           - Database connection.
68
# *payment*        - PaymentWechat object.
69
> * *orderId*          - Order ID.
70
> * *amount*           - Transaction amount.
71
> * *currency*         - 
72
> * *requestTimestamp* - 
73
> * *trxType*          - 
74
> * *shopperRefNo*     - 
75
> * *notifyUrl*        - Backend Status
76
> * *returnUrl*        - Frontend redirect
77
78
# *response*        - ResponseWechat object.
79
> * *errorCode*          - String
80
> * *errorDesc*          - String
81
> * *orderId*            - Order ID.
82
> * *qrCodeId*           - 
83
> * *billQRCode*         - Img billQRCode
84
85
86
h3. updateTransaction
87
88
<pre>
89
com.vmart.wechat.model.ResponseWechat updateTransaction(Connection conn, HttpServletRequest request)
90
</pre>
91
92
# *conn*           - Database connection.
93
# *request*        - ResponseWechat object.
94
> * *errorCode*      - String
95
> * *errorDesc*      - String
96
> * *orderId*        - String
97
> * *trxType*        - Transaction Type.
98
> * *valid*          - boolean