PHP Server Integration
PHP Server Integration
Document
WWW.SABPAISA.IN
Dummy card/UPI Details
CVV - 234
CVV - 234
CVV - 234
UPI ID merchant@sabpaisa
Open
Integration Guidelines Document
INTRODUCTION
This document is to provide the overview of the Payment Gateway integration provided by
SabPaisa. The document contains required information for SabPaisa PG integration to
setup/integrate the PG platform.
BENEFIT OF APPROACH
This document aims to provide help to quickly integrate SabPaisa PG into the existing
application. The document contains a sample code to help the developer understand the flow of
data from merchant’s application to SabPaisa and the other way round. It also contains a table
specifying the information which should be sent by merchant’s application in the form of
parameters to SabPaisa so that the any request can be processed correctly. SabPaisa will send
numerous response codes to merchant’s application which would be parsed to effectively
communicate with the SabPaisa system. These error codes have also been mentioned along
with their description.
Merchant needs to set-up the language-based environment for the integration in his system.
The required documentation or plugin along with UAT credentials are to be shared with the
Merchant team from SabPaisa.
The merchant needs the flag for Seamless to be enabled from SabPaisa backend team.
PROCESS FLOW
The payer on merchant’s platform enters Mandatory details in the available form.
The payer then proceeds for making payment with the amount to be paid.
Here, the merchant application sends the request containing payer details along with unique
Transaction Id to SabPaisa
The payer selects appropriate payment mode and proceeds further to make the payment.
If all the required verification details (like OTP, Card Details, UPI Pin, Net Banking ID and Password,
etc.) entered correctly then payer’s account is debited with the transaction amount.
1. When the transaction is complete, the SabPaisa PG will be redirected to merchant’s platform
with SabPaisa Response Code.
2. The merchant’s platform update its system with SabPaisa Response Code accordingly.
Note - Integration wise technical details and steps has mentioned in below document.
Kindly refer and follow the same.
ENDPOINT URLs
Test https://stage-securepay.sabpaisa.in/SabPaisa/sabPaisaInit?v=1
Production https://securepay.sabpaisa.in/SabPaisa/sabPaisaInit?v=1
Latest
Version 1.0, 10th Aug, 2022
Version
Parameter Mandatory
SR Parameter Name Length Description
Type / Optional
Transaction Id
4 clientTxnId AlphaNumeric Mandatory 100
generated by Client
Amount entered by
6 amount Numeric Mandatory 10
the Payee
Username shared by
8 transUserName AlphaNumeric Mandatory 50
SabPaisa
Password shared by
9 transUserPassword AlphaNumeric Mandatory 50
SabPaisa
Currency type of
11 amountType Alphabet Optional 3
amount - INR, USD
Merchant Category
34 mcc Numeric Mandatory 20
Code
When the transaction is completed, the merchant’s application will receive a response from SabPaisa on the
configured URLs which will be shared by merchant team to SabPaisa.
The response will be based on the result of the transaction. The parameters coming in SabPaisa response
are shown in the table below.
Mandatory
SR Parameter Name Parameter Type Length Description
/ Optional
Amount of
6 amount Numeric Mandatory 10
transaction
Currency type of
11 amountType Alphabet Optional 3
amount - INR,USD
Mandator
33 statusCode Numeric 10 Status Code
y
Transaction Id
Mandator
35 sabPaisaTxnld Alphabet 18 generation at
y
SabPaisa
Response Message
36 sabPaisaMessage AlphaNumeric Mandatory 255
from SabPaisa
Response Message
37 bankMessage AlphaNumeric Optional 255
from Bank
Transaction Id
40 bankTxnld AlphaNumeric Optional 255
generated by bank
Merchant Category
42 mcc Numeric Optional 20
Code
Update transaction as
0000 Success
successful.
REQUEST FORMAT
Method - POST
The SabPaisa PG takes the data in the form and when the payee clicks submit button, the checkout page
opens up (This form can be customized by the merchant as per his requirements).
The request string should be passed in form data. The sample code for form data is given by:
<form th:action="@{ https://securepay.sabpaisa.in/SabPaisa/sabPaisaInit?v=1}" th:method="post">
<form>
Note - encData is the encrypted string made by concatenating all the parameters. The encryption - decryption logic
is mentioned below.
encData=4t1+Q1AZRSonkt440UFulH9fSrej7ddGfq34t7YEnQe58WRgmS4cyAJHtqSxkBt09R0JXB
FPznNp8zXWR77S5wNwJH7LGQHKosB+VC+lsDDLpozIgJwF3XYBXsGg15qIiwpwbPP8zShZAevLUpw
IKzY5QmILUkKXBN9NJuDuQv5fPDjPZDOxnXUnAxOYcqlOlpfB0AMoScXcZp4SSne6rq0HR5tb193A
kwZ8JNgre1tULhXUv/my8f4F4nvnXiIexf41rp2AC7Wjs/JuB4KDZ1sTsGMYX34xtAs2gDPzv9MA3
hCAgmVYD0KM6x+VjD/WtxiMBcBms5FgGz0q+GXvl6CI+2lyRWLbmqUzo3mOCuk=
The encData is the encrypted String of the request parameters and client code. The sample string for request
parameters is also mentioned below:
NOTE - If the Mandatory parameters are not being passed in encData then, the PG will give the error:
NOTE - The clientTxnId should be generated using random function so that for every transaction, a unique
transaction id is generated, else the PG will give the error:
Method - POST
Parameter – encResponse
Callback Response is the response which will be sent to the merchant platform from SabPaisa.
It will be sent to the URL which the merchant is passing in the request parameter i.e. callbackUrl as
mentioned in the Request Parameters Table.
ENCRYPTION – DECRYPTION FORMAT
arr = decText.split("&"); //stored the decrypted response in the array and split all the parameters by &
operator.
enencData: 9RqbDxxOic87ZOH8yKN2xCcUTt/Sf+VmMzdhzEtND7YRyRsV714JtzDxGbGrDnzVAORp4oITsFk
vFhJbqIG5lin+iZjoGSTCj0/xQRAciKBHGOVXAvkqgNk+a/OImj2bj89eSUohQPL116cFlEo40/DuIku
p+VUE0v1x8+VmMgKz2ljnE1J5iK+xc/AHU7DyDNV4lBBnDtfbpUDruM9td8rtVYpJBOn3YixdYPZK
0OGPC9EgRk55NqkCiJTJqFC83+8nx7T+BgJ7qznl/vx0tsoUlkc2necgL/+vQRmsddb21Nc9XdyXK JX7yQkBpTJ0
enencData :: payerName=Ram
TEST&[email protected]&payerMobile=9999999999&clientTxnId=WLKKEYTJUDEJC
9NOB08A&amount=25&clientCode=DEMO1&transUserName=bhabesh.jha_2211&transUserPassword=
DEMO1_SP2211&callbackUrl=http://localhost:9094/pgresponse&channelId=W
SAMPLE RESPONSE
The merchant can coordinate with their Account Manager for any issue they face during the integration of
PG. The Account Manager will connect the merchant team with support team.
The mail Id for PG support is [email protected] . The merchant can also drop the mail with
the Client Code and screenshot of the issue on this mail id and the support team will connect with the
merchant
Thank You!