CCAvenue Payment Gateway Integration Guide

The purpose of this document is to lay down the payment integration with CCAvenue that is required for a merchant (or BSP) that has implemented a chatbot using WhatsApp Business APIs and needs to accept payments from WhatsApp users.

This document outlines the necessary APIs that must be integrated and how the integration works in conjunction with the WhatsApp Business API integration. While not a comprehensive guide, it serves as a general overview to assist in understanding the payment gateway integration process. Any specific or unique details related to the payment gateway must be determined by the merchant (or BSP).

In terms of integrating with the WA P2M product, this document covers the requests and responses highlighted in red within the flow diagram.

CCAvenue integration with WhatsApp Payments

Setup

Please use documentation from CCAVenue for steps to authenticate with their server.

To simplify the explanation, the following examples will only address the body of the final payload that will ultimately be included in the final object required for successful authentication with their API. It is important to consult CCAvenue's documentation for guidance on how this final object must be structured.

You must have the following details before you can proceed:

  1. Successfully authenticate
  2. Details from the payment configuration you already configured on the WhatsApp Business Account.
    • Merchant category code
    • Merchant’s VPA

Initiate Payment API

Sample payload to POST to https://secure.ccavenue.com/transaction.do

Request

curl -X POST -d 'card_name=UPI&order_id=67314339998877&currency=INR&payment_option=OPTUPI&card_type=UPI&merchant_id=2&amount=100.00&re direct_url=https://merchantredirecturl.com'
NameDescriptionType

merchant_id

Merchant Id is a unique identifier generated by CCAvenue for each activated merchant.

Numeric

order_id

This ID is used by merchants to identify the order. Ensure that you send a unique id with each request.

Alphanumeric (30) Characters allowed: Alphabet (A-Z), (a-z), Numbers, - (hyphen), / (slash) ,_ (underscore)

currency

The currency in which you want to process the transaction. INR – Indian Rupee

"INR"

amount

Order Amount

Numeric (12, 2)

redirect_url

CCAvenue will post the status of the order along with the parameters to this URL. If you do not send this value, order status will be sent back to the URL configured in dynamic event notifications module in your MARS account. If there is no URL configured in the MARS account, PG will display the status of the order on the CCAvenue confirmation page.

Alphanumeric (100)
Characters allowed: Alphabet (A-Z), (a-z), Numbers, / (slash),_ (underscore)

card_type

Type of card used by the customer.

UPI

"UPI"

card_name

Name of the card used by the customer. This list will be provided by CCAvenue.

UPI

"UPI"

Sample response from CCAvenue

{
"status":"0",
"enc_response":"68b4c0ff090e439119f91d0ace1930973e5a2fc244b122e255170de2b412d486269678930fc2c175a64357a882854f62e5adb6d4476f629df3bb532cc5c82828258ed40b09181949c48e6b9365eabf9dc9e1acb5308f5d6776e2400e0c4ac4282afd81e3a66519b3734192062a49b51d956f93d9cebf4d49b9480ed6cbcdb5f87e50c7a3bd052dca39718738a49a5e22408a8656052fa506458ca1f904970fdf"
}

Decrypted Sample Response

{
"errorCode":"",
"errorMessage":"",
"intentUrl":"upi://pay?pa=vpa@samplebank&pn=Infibeam Avenues Limited&tr=123123123123&am=100.0&cu=INR&mc=8299"
}

Parse the response

  • Use the value of tr in the response value marked by the key intentUrl and pass it as the reference_id while setting up the parameters object to send for the order details message using the WhatsApp API.
  • Make sure to verify the values in the intentUrl key that you receive in the response with the payment configuration you created on the WhatsApp Manager:
    • The value of pa is the merchant VPA. This value must match the UPI ID on the payment_configuration you send us on the “parameters” object.
    • The value of mc must match the MCC code you put into payment configuration.

Status webhook

When an event occurs, such as the successful processing of a payment in your CCAvenue account, CCAvenue generates an event object. This event object contains essential details, including the event type and associated data. CCAvenue forwards this event object to a designated URL in your account's webhook settings through an HTTP POST request.

Payment status

Use the webhook notification above to find the payment status using the Payment status API.

Request

Sample payload to POST to https://api.ccavenue.com/apis/servlet/DoWebTrans

{
"orderNo": "11111111", 
"referenceNo": "111111111111"
}

Parse the response

Utilize the order_status retrieved from the response above and transmit the corresponding status message via WhatsApp API.

Billdesk's WhatsApp integration process

  1. Once partner initiates request to Billdesk, a request form is sent from Billdesk to collect values like: Partner IPs to allowlist, partner callback URLs, and merchant account to trigger setting up a UAT environment.
  2. Once the request form is shared, Billdesk shares the UAT credentials and API docs so partners can build their solution in UAT. This takes about 4-5 days.
  3. Partners can test integrations by using a web tool (replace [tr-value] in the URL with the tr value from the "createTransactions" response, and you can simulate a success / response.
  4. Partners must apply for a UAT sign off post this which typically takes 1-2 days where Billdesk E2E tests the solution or ask for screenshots if E2E test is not possible. For WhatsApp, Billdesk checks to see if the app tray opens up and redirects to the right apps successfully.
  5. Once sign off is received, a production environment is created that takes about a week, post which credentials for production are shared.