Payment
- The user scans the QR code or follows the link.
- The user is redirecting to the mobile app, where he makes a payment.
- Paykassma sends a postback to the merchant's side.
- Funds are credited to the user’s balance on the merchant platform.
Payment window integration (plugin)
Example of a link to open a UPI S payment window:
https://plugin.{server_URL}/? label =label ¤cy_code =INR &lang =en &wallet_type =upi_s &custom_transaction_id=custom_transaction_id |
---|
wallet_type=upi_s currency_code=INR Available languages (lang): en, hi (Hindi)
Pay attention to the description of the parameters payment_url_success_id / payment_url_fail_id/ payment_url_pending_id and success_url / fail_url / pending_url.
To use payment_url_success_id / payment_url_fail_id / payment_url_pending_id you need to send the URLs to Paykassma support and use the received IDs in the parameters.
To use success_url / fail_url / pending_url you must use hashing URLs ( For more details on hashing click here ).
For the description of all the plug-in parameters click here.
API integration
Creating payment
User can choose the payment method:
- Scan the Qr code and pay in the app.
- Follow the link (only in the mobile version) to the mobile application and pay there.
URL: http://api.{server_URL}/api/v1/payment/create/upi_s?secret={pluginapi_secret}
Request method:
POST
Format:
JSON
Parameters:
Name | Type | Required | Description |
mode | string | yes | "upi_collect_qr". |
amount | float | yes | Amount of payment. |
currency | string | yes | Currency code. |
label | string | yes | The unique identifier (ID) of the user who makes the payment. |
wallet_type | string | yes | "upi_s". |
custom_transaction_id | string | yes | Transaction ID in the Client's system. Must be unique. |
secret | string | yes | API access key. |
{ "mode": "upi_collect_qr", "currency": "INR", "label": "test_user55", "wallet_type": "upi_s", "amount": 100, "custom_transaction_id": "test_custom1234" }
{ "status": "ok", "data": { "order_id": "6a12ce38b3164c53", "qr_string": "iVBORw0KGgoAAAANSUhEUgAAALwAAAC8CAYAAADCScSrAAAAAklEQVR4AewaftIAAAnmSURBVO3BQY4cy5LAQDLR978yR0uHFvEQqJK+Bulm9gtrvcTDWi/ysNaLPKz1Ij/8RuVvqjhROamYVKaKT6icVJyoTBWTylRxojJVTCpTxaQyVUwqU8UNlaliUvmbKqaHtV7kYa0XeVjrRX74DxXfpPKJipOKSWWqmFROKk5UpopPqNxQOVGZKiaVq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_data": "upi://pay?pa=test@bank&pn=Test%20test&am=100&tn=IT32021661770570987&tr=IT32021661770570987", "message": "QR Code generated successfully" } }
{ 'status': 'fail', 'message': 'MESSAGE' }
QR code generation
It is necessary to generate a QR code based on the data in "qr_data" obtained from the previous request:
upi://pay?pa=test@bank&pn=Test%20test&am=100&tn=IT32021661770570987&tr=IT32021661770570987
You can generate a QR code this way:
https://chart.googleapis.com/chart?chs=250x250&cht=qr&chl=<?php echo urlencode($qrstring); ?>&choe=UTF-8
The generated QR must be displayed to the user.
For mobile devices, you can display a link to go to the UPI mobile app to make the payment.
Take the universal link from the "qr_data" field.
For IOS mobile devices, if the universal link does not work, you can use the solution: https://stackoverflow.com/questions/65273125/invoking-upi-apps-from-my-react-native-app-works-in-ios-but-not-in-android, that is, for the specified mobile applications, enter the exact link → replacing “upi://” from the qr_data line with the following substring:
- Paytm → paytmmp://;
- Phonepe →phonepe://;
- GPay →tez://upi/
and universal link (upi://)
Checking payment status (Optional request)
URL: http://api.{server_URL}/api/v1/payment/upi_s/status?secret={pluginapi_secret}
Request method:
POST
Format:
JSON
Parameters:
Name | Type | Required | Max Length | Description |
order_id | string | yes | no limit | The order number received in response to the payment creation request (regardless of the payment method). |
{ "order_id": "029391c747902d94" }
{ "status": "success" }
{ "status": "processing" }
{ "status": "failed" }
If the payment is unsuccessful, the transaction is not created in the system, and no postback is sent to the client.
{ 'status': 'fail', 'message': 'MESSAGE' }
Deposit postback
For the general documentation on post backs click here.
Example of deposit postback for UPI S
{ "signature": "3f46dc3adfed87c65fa8f2be952927dbceffa100", "wallet_type": "upi_s", "amount": 700, "currency_code": "INR", "label": "2537232", "direction": "ingoing", "created_datetime": "2023-08-25 10:47:40", "access_key": "FQ9jMwrNSkFbyMNqYFf6Ed4xeKmjHK", "additional_data": [ { "activated_datetime": "2023-08-15 21:29:01", "exchanger_identifier": "s132nfinite0-4@okhdfcbank", "comment": "", "amount": "700", "currency_code": "INR", "wallet_type": "upi_s", "stockpiling_id": 1430926, "transaction_id": "322712363408", "transaction_type": 0, "plugin_custom_order_id": "qG7h123nud8AqUqn", "withdrawal_id": null, "withdrawal_status": null, "account_number": "", "account_name": "", "account_email": "", "bank_details": { "bank_code": "", "branch_code": "" } ] }
The Paykassma server is waiting for a response in json {"status": "ok"} response code 200, otherwise, when receiving a different response, Paykassma will forward the postback with a certain frequency.
Repeated postbacks must also be answered with {"status":"ok"} response code 200.
Withdrawals for users
Payments to users are made by using IMPS method ( for more details on IMPS method click here).