Programming Guide » History » Version 7
chin-yeh, 03/07/2012 10:08 AM
1 | 1 | chin-yeh | {{toc}} |
---|---|---|---|
2 | |||
3 | h1. Programming Guide |
||
4 | |||
5 | 2 | chin-yeh | This guide describes how to integrate online mall with the QIWI. |
6 | 1 | chin-yeh | |
7 | *Demo Application:* _(refer to the [[wiki#Merchant-Account|Merchant Account]] to get the merchant details)_ |
||
8 | > http://192.168.2.68/qiwi-provider/sample_payment_form.html |
||
9 | |||
10 | h2. Steps-By-Steps |
||
11 | 2 | chin-yeh | |
12 | 7 | chin-yeh | # First, go through the [[wiki#Overview|Payment Flow]] |
13 | 2 | chin-yeh | # To redirect the customer to QIWI, prepare the following <code>HTML form</code>: |
14 | ** *action* - must be http://w.qiwi.ru/setInetBill_utf.do |
||
15 | ** *from* - merchant ID |
||
16 | 5 | chin-yeh | ** *txn_id* - unique transaction ID, _e.g. order ID_ |
17 | ** *to* - customer's MSISDN, _e.g. mobile phone number_ |
||
18 | ** *summ* - payment amount, _e.g. 10.22_ |
||
19 | 2 | chin-yeh | ** *com* - description of this payment |
20 | ** _example_: |
||
21 | <pre> |
||
22 | <code class="HTML"> |
||
23 | <form method="post" action="http://w.qiwi.ru/setInetBill_utf.do"/> |
||
24 | <table> |
||
25 | <tr><td>eCosway Shop ID:</td> |
||
26 | <td><input name="from" type="text" value="2042"/></td> |
||
27 | |||
28 | </tr> |
||
29 | <tr><td>eCosway Order ID:</td> |
||
30 | <td><input name="txn_id" type="text" value="test-order-1"/></td> |
||
31 | |||
32 | </tr> |
||
33 | <tr><td>Customer Mobile No.:</td> |
||
34 | <td><input name="to" type="text" value="9161234567"/></td> |
||
35 | |||
36 | </tr> |
||
37 | <tr><td>Payment Amount (RUB a.k.a Rouble):</td> |
||
38 | <td><input name="summ" type="text" value="2.15"/></td> |
||
39 | |||
40 | </tr> |
||
41 | <tr><td>Payment Description:</td> |
||
42 | <td><input name="com" type="text" value="For registration fee"/></td> |
||
43 | |||
44 | </tr> |
||
45 | <tr> |
||
46 | <td><input type="submit" value="Pay Now"/> |
||
47 | </td> |
||
48 | |||
49 | </tr> |
||
50 | </table> |
||
51 | </form> |
||
52 | </code> |
||
53 | </pre> |
||
54 | # Prepare a <code>servlet</code> or <code>JSP</code> to capture the payment status callback. |
||
55 | ## the <code>servlet</code> or <code>JSP</code> must accept this query parameter, *paymentResponse* |
||
56 | <pre>String paymentResponse = request.getParameter("paymentResponse");</pre> |
||
57 | ## decrypt the parameter using *EncryptAES* utils: |
||
58 | <pre> |
||
59 | <code class="JAVA"> |
||
60 | String decryptedResponse = new EncryptAES().decryptSKey(request.getParameter("paymentResponse")); |
||
61 | </code> |
||
62 | </pre> |
||
63 | ## the decrypted <code>paymentResponse</code> parameter consists of *transaction ID*, *payment result*, and *from who* and delimited by <code>comma</code> |
||
64 | <pre> |
||
65 | test-order-1,true,qiwi |
||
66 | </pre> |
||
67 | 6 | chin-yeh | ## include the *full URL* of this <code>JSP</code> or <code>Servlet</code> into *delegate.url* property <code>[/data/qiwi-provider/application.properties]</code>, for example: |
68 | <pre> |
||
69 | delegate.url=http://127.0.0.1:8080/ecosway/qiwiPaymentStatusUpdate.jsp |
||
70 | </pre> |
||
71 | 2 | chin-yeh | ## *Important Note:* This is your responsibility to persist this payment result into the respective <code>interface</code> table. |
72 | # done. |