Web integration
Checkout
Payment Form integrates Swipez Payment Gateway in your website to accept payments quickly. In this integration method, you prepare the checkout form with the correct order and payee details and redirect the payee from your checkout page to the payment screen.
The Checkout form provides payees with a streamlined flow for initiating payments. Payee enters payment details on the payment screen and completes the payment.
Steps to integrate with Swipez Payment Gateway,
Step 1: Create Checkout Form
Customers transactions are associated with a unique identifier reference no for each transaction. The transaction amount is associated with an identifier transaction amount. To process the payments for these transactions, you must send us the reference no and the corresponding transaction amount. We send you the payment status against each transaction.
You need to send us a few more details to process the payment. Click here to see all the Request Parameters.
See the code below on how to generate a valid signature for Checkout integration.
Create a sample HTML form like shown below. Ensure to fill in the correct credentials for account id and secret key. You will get account id and xway key from Swipez support.
For Production/Live Environment set the action attribute of the form to: https://www.swipez.in/xway/secure
For Test Environment set the action attribute to: https://h7sak8am43.swipez.in/xway/secure
Request Parameters
Payment form accepts all the request parameters mentioned below. Ensure you send us all the required fields. Requests with an invalid secure hash will be rejected.
Parameter
Required
Description
account_id
Yes
Your account ID
return_url
Yes
The URL to which the user must be redirected after completing the payment.
reference_no
Yes
Your unique transaction reference number.
amount
Yes
Transaction amount.
description
No
Transaction description for your reference.
name
Yes
Name of the payee.
phone
Yes
Mobile number of the payee.
Yes
Email ID of the payee.
address
No
Address of payee.
city
No
City of payee.
state
No
State of payee.
postal_code
No
Zipcode of payee.
udf1
No
Extra custom parameter.
udf2
No
Extra custom parameter.
udf3
No
Extra custom parameter.
udf4
No
Extra custom parameter.
udf5
No
Extra custom parameter.
secure_hash
Yes
Request secure_hash.
Step 2: Generate secure hash
Every request to Swipez must contain authentication information to establish the identity of the user making the request. We use a digital signature to validate each transaction. This will ensure integrity of the signed data against tampering.
In the sample form above, generate a secure hash for every checkout. The signature is generated as the HMAC value of the data being passed which is using MD5 hash function in combination with your xway key.
We will generate a secure hash at our end and want you to do the same with the posted data and match it with the passed argument.
Secure hash generation varies across integration methods, ensure you are using the right secure hash generation method.
Webhook Notification
Webhooks are events that notify you about the payment. A notification is sent to your backend from Swipez when payments are successful. These notifications are useful in cases when the internet connection is unstable or slow while the payment is being processed. This will allow you to reconcile all the successful orders at your end.
Notifications are sent only for successful payments.
Sometimes you may receive the same notification more than once. It is recommended to ensure that your implementation of the webhook is idempotent.
Response Parameters
Swipez sends details about every transaction to return Url. These parameters will be posted to the services you host on these URLs.
The return Url is the webpage where your customer will be redirected to after completing the payment on the Swipez payment page, we will post the response parameters to this page.
The response parameters which Swipez posts to these URLs are available below:
Parameter
Description
reference_no
Your transaction reference number for which transaction has been processed.
amount
Transaction amount.
request_amount
Your requested amount.
transaction_id
Swipez generated unique transaction ID. Example, X000054545
bank_ref_no
Bank reference number.
status
Payment transaction status eg. success or failed.
mode
Payment mode eg. CREDIT_CARD, DEBIT_CARD, NET_BANKING
date
Transaction date eg. 2021-01-03 11:42:13
message
Transaction message. eg. Transaction Successful.
billing_name
Payee name.
billing_email
Payee email id.
billing_mobile
Payee mobile number.
billing_address
Payee address.
billing_city
Payee city.
billing_state
Payee state.
billing_postal_code
Payee pincode.
udf1
Extra custom parameter.
udf2
Extra custom parameter.
udf3
Extra custom parameter.
udf4
Extra custom parameter.
udf5
Extra custom parameter.
checksum
Response checksum to validate response.
Response Verification
Similar to every request signature, we send a digital signature in our response message. We recommend you verify this response signature to check the authenticity of the transaction response. This will ensure that the response has not tampered.PHP PYTHON ASP .NET
Integration Kits
The integration kits for all major platforms are available below:
Platform
Link
PHP
ASP .NET
Node.js
Python
Ruby
Magento
Woo-commerce
After the integration is complete, you can test the flow of the transaction before you start accepting payments online.
You can make a test transaction using the test card details available below. You can verify the payment status using the PG Dashboard, APIs. After completing the test, you can start accepting payments from your customers in real-time.
Card Details
Card Number
Expiry
CVV
Name
4111 1111 1111 1111
07/23
123
Test
Last updated
Was this helpful?