Skip to main content

CCAvenue Payment Gateway Integration in php - part 1

In this tutorial, we will see how to integrate CCAvenue payment gateway in PHP. CCAvenue is one of the leading online payment gateway service provider similar to other popular providers PayPal, Citrus, PayUMoney etc. Easy integration is an advantage of CCAvenue payment gateway.



For integration of CCAvenue, you should follow few steps -

1. Registration with CCAvenue - 

To start the integration, you should first get registered with CCAvenue. This is free and easy process. Here, you should mention the details asked by CCAvenue and you will get many things in return. After login to the CCAvenue dashboard and you will get the Merchant ID and Working Key, which will be useful later in an integration process.

2. Create a form for submitting to CCAvenue payment gateway - 

This is the main process of integration of CCAvenue in php. To integrate and make the form working properly, CCAvenue has provided certain types of input names that are required to be used exactly in the same way as provided. Copy the below code and paste it in your project code. You might need to arrange the input controls as per you requirement. 
<form method="POST" name="customerData" action="ccav-request-handler.php">

<input type="hidden" name="tid" id="tid" /> 
<input type="hidden" name="merchant_id" value=""/> 
<input type="hidden" name="order_id" value=""/> 
<input type="hidden" name="amount" value=""/>
<input type="hidden" name="currency" value="INR"/>
<input type="hidden" name="redirect_url" value=""/>
<input type="hidden" name="cancel_url" value=""/>
<input type="hidden" name="language" value="EN"/>

<h5>Billing information(optional):</h5>

<label>Billing Name:</label>
<input type="text" name="billing_name" value="Charli"/>
<label>Billing Address:</label>
<input type="text" name="billing_address" value="Room no 1101, near Railway station Ambad"/>
<label>Billing City:</label><input type="text" name="billing_city" value="Indore"/>
<label>Billing State:</label><input type="text" name="billing_state" value="MH"/>
<label>Billing Zip:</label><input type="text" name="billing_zip" value="425001"/>
<label>Billing Country:</label><input type="text" name="billing_country" value="India"/>
<label>Billing Tel:</label><input type="text" name="billing_tel" value="9999999999"/>
<label>Billing Email:</label><input type="text" name="billing_email" value="test@test.com"/> 

<label>Additional Info:</label>

<label>Merchant Param1:</label>
<input type="text" name="merchant_param1" value="additional Info."/> 
<label>Merchant Param2:</label>
<input type="text" name="merchant_param2" value="additional Info."/>
<label>Merchant Param3:</label>
<input type="text" name="merchant_param3" value="additional Info."/>                
<label>Merchant Param4:</label>
<input type="text" name="merchant_param4" value="additional Info."/>                    
<label>Merchant Param5:</label>
<input type="text" name="merchant_param5" value="additional Info."/>

</form>



For sending additional information,you need to set some custom input names with values after payment. Look at the additional information section in the above code. IN this section, you can see labels Merchant Param1Merchant Param2 and so on. You can change the names of label but names of input should be  merchant_param1, merchant_param2 etc. You can't change them with custom names like say home_address, office email etc. If you change them CCAvenue process will not send them to the function after successful transaction.
In the next chapter, we will learn How to handle the CCAvenue response in php  after the successful payment.

In this tutorial, we have learnt, how to integrate CCAvenue payment gateway in PHP. If you like this post, please share it with your friends.

Comments

Popular posts from this blog

CCAvenue avoid Error Code 21002 currency required parameter missing

In this tutorial, we will see how to avoid Error Code 21002 currency required parameter missing. This is a usual problem that occurs after connecting our application to the CCAvenue payment gateway. Due to some input values that are missing by developers while coding, such error occurs. CCAvenue is one of the leading online payment gateway service provider similar to other popular providers PayPal, Citrus, PayUMoney etc. Easy integration is an advantage of CCAvenue payment gateway. But, due to very minor mistakes in coding, developers get few errors while integrating CCAvenue with their application. CCAvenue have provided some guidelines of integration that are necessarily needed to be followed while integrating it into the application. Inputs values like amount, currency, merchant_id, redirect_url, cancel_url etc are minimum required and should be included in the form before sending the data to CCAvenue page. If we avoid them or forgot to use them into the code, CCAvenue th

CCAvenue avoid Error Code 21003 amount required parameter missing

In this tutorial, we will see how to avoid Error Code 21003 amount required parameter missing. This is another problem that occurs due to very minor mistake made by developer after connecting an application to the CCAvenue payment gateway. Due to some input values that are missing by developers while coding, such error occurs. CCAvenue is one of the leading online payment gateway service provider similar to other popular providers PayPal, Citrus, PayUMoney etc. Easy integration is an advantage of CCAvenue payment gateway. As per the guidelines of integration provided by CCAvenue that are necessarily needed to be followed while integrating it into the application. Input values like amount, currency, merchant_id, redirect_url, cancel_url etc are minimum required and should be included in the form before sending the data to CCAvenue page. If we avoid them or forgot to use them into the code, CCAvenue throws an error. As mentioned above, Amount is one of the required values that

CCAvenue avoid Error Code 21001 order id required parameter missing

In this tutorial, we will see how to avoid Error Code 21001 order_id required parameter missing. This is a usual problem that occurs after connecting our application to the CCAvenue payment gateway. But, it is not a big issue to solve. CCAvenue is one of the leading online payment gateway service provider similar to other popular providers PayPal, Citrus, PayUMoney etc. Easy integration is an advantage of CCAvenue payment gateway. But, due to very minor mistakes in coding, developers get few errors while integrating CCAvenue with their application. CCAvenue have provided some guidelines of integration that are necessarily needed to follow while integrating it into the application. It includes some parameters or inputs that are minimum required like amount, currency, merchant_id, redirect_url, cancel_url etc. If we avoid them or forgot to use them into the code, CCAvenue throws the error. As mentioned above Order Id is one of the required values that should be mentioned in co