CRICPAYZ PAYMENT
INTEGRATION
DOCUMENTATION V 1.0
CONTENTS
1. INTRODUCTION 2
2. TERMS & DEFINITION 2
3. WORKFLOW 3
4. API FUNCTIONS 4
4.1 Check Status of Payment Method 4
4.2 Payment Request 4
4.3 Transaction status 5
4.4 Payout Request Bank 6
5. DECRYPT FUNCTION 8
6. DEPOSIT / PAYOUT CALL BACK API ( Provide by Operator , Required ) 9
7. CALL BACK PAGE URL ( Optional ) 10
8. PAYMENT (Deposit) METHOD 10
1. INTRODUCTION
This document provides technical specs for our Operator to perform integration and integration
tests with Cricpayz Payment Gateway. This documentation includes functions, parameters, results
and error response.
2. TERMS & DEFINITION
Name Description
Operator Partners who want to integrate with Cricpayz payment gateway
Payment Provider Provider API Payment for Operator
BO Site Backoffice site, used for Operator to verify transaction, check balance, can make
deposit request and for settlement.
Member Site A website for member to login and create transaction through Cricpayz
Payment Gateway
User/Member Customer who create transaction through Cricpayz Payment Gateway
3. WORKFLOW
4. API FEATURES
4.1 Pre Requirement Provide by Provider
● Server info & API URL
● Credential api : api key, secret key, merchant code
● Credential BO : username , password, TOTP QR
4.2 Pre Requirement Provide by Operator :
● API Callback url ( mandatory ). Used to forward transaction status, shown
at point 7
4.3 Api Security
● IP Whitelisting
● TOTP for Back Office login
4. API FUNCTIONS
4.1 Check Status of Payment Method
The operator has to call below api to check the status before displaying that payment
method to the user.
Method : GET
{base_url}/api/appuser/checkDWStatus/{merchantCode}
● base_url : Provided by provider
● merchantCode : Provided by provider
Response Ex:
{
"status": "Success",
"data": [
{
"Payin_UPI": 1,
"Payin_IMPS": 0,
"Payout_IMPS": 1
}
]
}
Note : Here 0 means Method is currently under maintenance
and 1 means Method is available so user can do the transaction
4.2 Payment Request
To be able to send payment request to Cricpayz, operator has to call below API :
Method : POST
{base_url}/api/appuser/loginPaymentGateway
● base_url : Provided by provider
No Parameters Name Requi Description
red
1 merchantCode Y Provided by provider
2 transaction_code Y Generated by operator,use
string data type. Must be
unique for each transaction.
3 amount Y Provided by operator. String
Data Type
4 userId Y Use string data type
5 paymentMethod Y Payment method is required in
String data type.
6 upi N Take input from user.
It’s user’s UPI. it’s not
mandatory.
Request example :
{
"amount":"1000",
"userId":”ruthjones6161@gmail.com”,
"merchantCode":"CP97546866656895517",
"transaction_code": “DW-4268798999”,
“paymentMethod”:”P001”,
“upi”: “rjones@ybl”
}
Success Response : 200 code
{
"status": "Success",
"message": "Payment Gateway Login Successfully!",
"accessURL":
"https://payment.cricpayz.io/#/?orderId=23528FAB-FA53-416B-AC26-764B684EFD6A "
}
After that you have to redirect this url in a window and complete the payment process.
4.3 Transaction status
This api is used to check the transaction status. It requires 2 post parameters.
method : POST
url : {base_url}/api/appuser/checkStatusByTrn
No Parameters Description
1 merchantCode Provided by provider
2 transaction_code String data type.The transaction
code.
Request Body :
{
"merchantCode":"CP97546866656895517",
"transaction_code":"DW-4268798999"
}
Success Response : 200 Code
{
"statusCode": "Success",
"trn_status": "Pending" // can be Incomplete, Pending, Successful or Failed
}
4.4 Payout Request Bank
This api is used for payout in Bank account requests submission. It requires some parameters
to submit payouts.
Method : POST
url : {baseurl}/api/appuser/doWithdraw
Type : json
Json :
{
"amount":"required|string",
"userId":”required”,
"account_holder": "required|string",
"account_number": "required|string",
"ifsc_code":"required|string",
"merchantCode":"required|string",
"transaction_code":"required|string"
}
Payout Parameters :
No Parameters Name Required Description
1 merchantCode Y Provided by provider
2 transaction_code Y Use string data type. Must be unique for
each transactions
3 amount Y Use String Data type
4 userId Y Use String Data type
5 account_holder Y Use string values.
6 account_number Y Use string values.
7 ifsc_code Y Use string values.
5. DECRYPT FUNCTION
Here is the code you can use for Decrypt the encrypted callback data
For Node js:
For PHP :
6. DEPOSIT/PAYOUT CALL BACK API ( Provide by Operator ,
Required )
After the operator sends payment requests ( see point 5.1 ), then the provider will process it. Once
the provider gets the transaction status ( success or failed ), the provider will call this api to forward
the transaction status.
● Callback Payment API Url : can be set on BO
● Method : POST
● CAllback Url :Provided by operator
● Parameter : Json body
NOTE : Please test all type callbacks ( Success, Reject, Reject than Success and modified the amount
and then approved ) before moving production.
Ex. Body : {
“transaction_code”:”DW-59869634”,
“data”:”78c7ff31b00d12a6fa48f51660a616a291244f278490c85b3ef7e5e0060a118654026d423c7d9
680e7d04d8f51400173480022bf770bb1c72a1385f850f0c22ff124cb9c53802632b0b5f570e564c5f9f
60037aa3d3061082b99cc50b96fe236”
}
Provider will send the parameter on key format, then operator need to decrypt it using
encrypt/decrypt function as shown at point 6.For key, you need to decrypt with secretKey and
secretIv. After decrypt the data parameter you will find that the parameters are :
No Parameter Description
1 transaction_code String data type. The transaction code that
sent by operator on loginpaymentgateway
/doWithdraw.
2 transaction_status If the operator gets 1 that means
the transaction is successful and if
the operator gets 2 that means it
failed.
3 transaction_amount The actual amount of the transaction.
4 transaction_fee Fee on the transaction.
5 remark If the transaction is rejected then
you will get the reason in this else it
will be blank.
7. REDIRECT PAGE URL ( Optional )
● Call back Page: can be set on BO
It is possible to set a callback page. When the transaction gets completed then the page will be
redirected to the callback URL page.
8. PAYMENT (Deposit) METHOD
Payment Code Payment Method
PS001 UPI Intent
PS002 UPI Gateway
PS003 IMPS (Net Banking)
PS004 NEFT (Net Banking)
PS005 RTGS (Net Banking)