In the Standard Checkout integration method, you prepare the checkout form with the correct order and customer details and redirect users from your checkout page to Cashfree’s payment screen. Cashfree payment gateway supports all major payment methods such as credit and debit cards, wallets, UPI, and net banking.

The Checkout form provides customers with a streamlined flow for initiating payments. Your customers enter payment details on the payment screen hosted by Cashfree and complete the payment. Cashfree handles the PCI compliance guidelines on your behalf in this integration method.

Watch the video to know how to integrate Cashfree Payment Gateway using PHP.

# Steps to Create Checkout Form

  1. [Create Checkout Form](🔗)

  2. [Generate Signature](🔗)

  3. [Submit Checkout Form](🔗)

## Create Checkout Form

Customers orders are associated with a unique identifier orderId for each order. The order amount is associated with an identifier orderAmount. To process the payments for these orders, you must send us the orderId and the corresponding orderAmount. We send you the payment status against each order.

You need to send us a few more details to process the payment. Click [here](🔗) to see all the Request Parameters.

Every request to Cashfree must contain authentication information to establish the identity of the user making the request, we use the signature field for this authentication.

See the code below on how to generate a valid signature for Checkout integration.

Create a sample HTML form as shown below. Ensure to fill in the correct credentials for appId and secret key. You can find your AppId and Secret key in the merchant dashboard.

For Production/Live Environment set the action attribute of the form to: ****

For Test Environment set the action attribute to: ****


### Request Parameters

The checkout form accepts all the request parameters mentioned below. Ensure you send us all the required fields. Requests with an invalid signature will be rejected.

appIdYesYour app ID.
orderIdYesOrder/Invoice ID.
orderAmountYesBill amount of the order.
orderCurrencyNoCurrency for the order. The default currency is INR. See [Currencies Supported](🔗) for the list of available currencies. Contact [[email protected]](🔗) to enable new currencies.
orderNoteNoText that will help customers know more about their order.
customerNameYesName of the customer.
customerPhoneYesPhone number of the customer.
customerEmailYesEmail ID of the customer.
merchantDataNoA base 64 encoded json array (as a key value pair). Maximum 10 pairs allowed, at max 64 chars for each key and 256 chars for each value.
returnUrlYesThe URL to which the user must be redirected to after completing the payment. We recommend you to use an HTTPS URL for the returnURL.
notifyUrlNoNotification URL is for server-server communication. This URL receives a notification for every successful order. notifyUrl must be an HTTPS URL.
paymentModesNoPayment modes allowed to complete the payment for the order. Available values: cc, dc, nb, upi, paypal, wallet. Example values: "cc", "cc,dc", "paypal, nb", etc. If this parameter is empty, all available payment modes are displayed.
signatureYesRequest signature.

## Generate Signature

Every request to Cashfree 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 signature for every checkout. The signature is generated as the HMAC value of the data being passed which is using SHA256 hash function in combination with your secret key.

We will generate a signature at our end and want you to do the same with the posted data and match it with the passed argument.

Signature generation varies across integration methods, ensure you are using the right signature generation method.

You can find your appId and secret key in the merchant dashboard [here](🔗).

## Submit Checkout Form

Once you have the checkout form prepared, paste below HTML just before the closing </form> tag. By default all the fields in the above HTML form are hidden, you can make them visible by removing the type="hidden" text from every input field.

Do not add a name parameter to the HTML submit button.

Alternatively, you can submit the above form automatically on page load without waiting for the user's click. To do this, paste the below javascript code just before the closing body tag.

# Webhook Notification

Webhooks are events that notify you about the payment. A notification is sent to your backend from Cashfree 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 will be sent to notifyUrl which is a part of the [request parameter](🔗) specified while creating an order request.

  • 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

CashFree sends details about every transaction to both returnUrl and the notifyUrl. These parameters will be posted to the services you host on these URLs.

The returnUrl is the webpage where your customer will be redirected to after completing the payment on the Cashfree payment page, we will post the response parameters to this page. Cashfree will also post form variables to notifyUrl you specify, which runs a program to process these variables.

orderIdOrder ID for which transaction has been processed. Example, GZ-212
orderAmountBill amount of the order. Example, 256.00
referenceIdCashfree generated unique transaction ID. Example, 140388038803
txStatusPayment status for that order. Values can be: SUCCESS, FLAGGED, PENDING, FAILED, CANCELLED, USER_DROPPED.
paymentModePayment mode used by customers to make the payment. Example, DEBIT_CARD, PREPAID_CARD, MobiKwik.
txMsgMessage related to the transaction. Payment failure reason is included here.
txTimeTime of the transaction
signatureResponse signature.

# 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.

# Integration Kits

The integration kits for all major platforms are available below:

  • PHP -

  • Java -

  • Node.js -

  • .net -

  • Python -

  • Ruby -

# Test the Integration

After the integration is complete, you can test the flow of the transaction before you start accepting payments online. Click [here](🔗) to know how to view/generate API keys.

You can make a test transaction using the test card and net banking details available below. You can verify the payment status using the PG Dashboard, APIs, or webhooks. After completing the test, you can start accepting payments from your customers in real-time.

**Card Details**

Card NumberExpiryCVVName
4444 3333 2222 111107/23123Test
4111 1111 1111 111107/23123Test

*_Netbanking Details_

BankPayment Code
Test Bank3333

## Test Signature

Generate a signature and verify it using the checksum tool available <a href="" target="_blank">here</a>.

If you see the message, **Failed to verify merchant credentials**, check and correct the details you provided in the checksum tool.

(Script tags will be stripped)