Project

General

Profile

Actions

Programming Guide

This guide describes how to integrate online mall with the QIWI.

Demo Application: (refer to the Merchant Account to get the merchant details)

http://192.168.2.68:8080/TestPage/page/qiwi/sample_payment_form.jsp

you're conducting testing in QIWI production environment

Steps-By-Steps

  1. First, go through the Payment Flow
  2. To redirect the customer to QIWI, prepare the following HTML form:
    • action - must be http://w.qiwi.ru/setInetBill_utf.do
    • method - must use post method
    • from - merchant ID (refer to the Merchant Account to get the merchant details)
    • txn_id - unique transaction ID, e.g. order ID
    • to - customer's MSISDN, e.g. mobile phone number
    • summ - payment amount, e.g. 10.22
    • com - description of this payment
    • lifetime - bill’s lifetime in hours (max 45 days)
    • example:
      <form method="post" action="http://w.qiwi.ru/setInetBill_utf.do"/>
      <table>
          <tr><td>eCosway Shop ID:</td>
              <td><input name="from" type="text" value="2042"/></td>
      
          </tr>
          <tr><td>eCosway Order ID:</td>
              <td><input name="txn_id" type="text" value="test-order-1"/></td>
      
          </tr>
          <tr><td>Customer Mobile No.:</td>
              <td><input name="to" type="text" value="9161234567"/></td>
      
          </tr>
          <tr><td>Payment Amount (RUB a.k.a Rouble):</td>
              <td><input name="summ" type="text" value="2.15"/></td>
      
          </tr>
          <tr><td>Payment Description:</td>
              <td><input name="com" type="text" value="For registration fee"/></td>
      
          </tr>
          <tr><td>Lifetime(hours):</td>
              <td><input name="lifetime" type="text" value="24"/></td>
          </tr>
          <tr>
              <td><input type="submit" value="Pay Now"/>
              </td>
      
          </tr>
      </table>
      </form>
      
  3. Prepare a servlet or JSP to capture the payment status callback.
    1. the servlet or JSP must accept this 2 query parameter, paymentResponse and cardGateway
      String paymentResponse = request.getParameter("paymentResponse");
      String cardGateway = request.getParameter("cardGateway"); // always will be 'qiwi'
      
      • the value of cardGateway will be always qiwi
    2. decrypt the parameter using EncryptAES utils:
      String decryptedResponse = new EncryptAES().decryptSKey(request.getParameter("paymentResponse"));
      
    3. the decrypted paymentResponse parameter consists of transaction ID, payment result and status code and delimited by comma
      test-order-1,true,60
      
      • transaction ID - usually this is order ID
      • payment result - true means success; false means failed
      • status code - new bill status
    4. include the full URL of this JSP or Servlet into delegate.url property [/data/qiwi-provider/application.properties], for example:
      delegate.url=http://127.0.0.1:8080/ecosway/qiwiPaymentStatusUpdate.jsp
      
    5. Important Note: This is your responsibility to persist this payment result into the respective interface table.
  4. done.

Updated by Soh Keong over 11 years ago · 15 revisions