Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android integration with CCAvenue

I have an android app and want to integrate with CCAvenue payment gateway same as flipkart and others.but i don't know how can i integrate CCAvenue because there is no SDK provided. I have used paypal sdk thats so simple to integrate.but not able to integrate CCAvenue. So please help me for this problem. Thanks.

like image 379
Manoj Tarkar Avatar asked Jul 28 '14 08:07

Manoj Tarkar


3 Answers

Edit: I've not been able to find a good public download link for the Integration Kit, the original links (CCAvenue Link and Xamarin Component Store) are now obsolete. It seems you now have to register as a merchant before you can download the Integration Kit for Mobile:

https://www.ccavenue.com/inapp_payments.jsp

The below information was accurate as of May 2015 and Oct 2017 revisions, however, has not been re-verified since the SDK is no longer publicly available (and I no longer work with this payment gateway)

Integration with CCAvenue is possible using their Mobile Integration Kit.

They describe two ways of integrating with their payment gateway, seamless and non-seamless. Either way requires you to redirect the user to a web page to complete the payment process or acquire authorisation from the users bank. Once done CCAvenue can redirect the user to whatever URL you prefer. This could be a website, merchant server API or a custom URI like myapp:// where you could handle the response locally.

Further Reading

Seamless means you have the opportunity to present the payment options natively and collect all required fields first, then submit this to CCAvenue.

Non-Seamless means you just pass the amount and currency to CCAvenue and the billing and payment details are collected from the redirected page.

Either way will you require you to handle integration with CCAvenue with a separate WebView Activity to which CCAvenue provide sample code for.

like image 104
Daniel Maclean Avatar answered Oct 07 '22 00:10

Daniel Maclean


  1. First of all, you need to set up a CCAvenue account. Go to the Sign Up page, choose the Startup Pro plan and fill out your details. On creating your account, you will recieve an e-mail on your entered e-mail address to verify your e-mail. Once you verify your e-mail, you will recieve an activation e-mail which will give you your CCAvenue Account Login ID and you will be required to set your password. Set your account password amd make sure you read the e-mails that you receive thoroughly.

  2. Login to CCAvenue M.A.R.S Panel (Dashboard). In the Settings > API keys tab , you would get the Merchant ID , Access Code as well as the Working Key. The working key is also named as the encryption key in the dashboard provided to your from CCAvenue. Copy these keys to a safe place for later use.

  3. To secure the data transmitted from mobile while initiating the transaction, CCAvenue has implemented a time-based RSA key pair value which needs to be fetched uniquely for every transaction. These files should be uploaded on your web server.

  4. To download these files, Login to CCAvenue Dashboard. Now go to Resources > Mobile Integration Kit. Further click on RSA & Response Handling. Download the PHP files from here. You can also use the JSP and ASP.NET files but make sure your web server supports these functionalities before you use them. PHP is supported by every web server so I am using PHP.

  5. You will find 4 files on unzipping your PHP download. These are: cacert.pem, ccavResponseHandler.php, Crypto.php and GetRSA.php. You will find 4 files on unzipping your PHP download. These are: cacert.pem, ccavResponseHandler.php, Crypto.php and GetRSA.php. Now follow the following steps:

    (a) Upload these 4 files on your web server.

    (b) In the GetRSA.php file, put your access code in the 4th line like this: 'access_code'=>"XXXXXXXXXXXXXXXXXX",

    (c) In the 20th line, you need to put the path where you have uploaded your cacert.pem file. For example: curl_setopt($ch, CURLOPT_CAINFO, $_SERVER['DOCUMENT_ROOT'].'/RSA/cacert.pem');

    (d) In the ccavResponseHandler.php file, put your working key in the 6th line like this: $workingKey='105B05A21AD102EBA62C051720CC3FA2';

That's all for the server part. Download the Implementation kit from CCAvenue account or you may refer the following link for android implementation:

CCAvenue Payment Gateway Integration in Android

like image 20
Archit Goel Avatar answered Oct 06 '22 23:10

Archit Goel


To do that in the NonSeamless way follow these steps:- (BTW SeamLess method is also very similar.)

  1. Make an merchant account in CCAvenue by clicking here.
  2. After the account has been created(and confirmed and verified by the CCAvenue ), goto the Resources section to download the mobile kit. Also make sure to copy the CCAvenue_Merchant_id, CCAvenue_Access_Code, CCAvenue_Working_Key present in your account.
  3. Do make sure that your Public IP address has been whitelisted on CCAvenue's end.
  4. Place GetRSA.jsp and ccavResponseHandler.jsp files on your server which will be in the mobile kit.
  5. In your App, mention the path of GetRSA file kept on your server. (Read the Non-SeamLess demo kit code to know where you need to put the path).
  6. Call GetRSA from your app which is kept on the your server for fetching the RSA public key.
  7. Using the fetched public key merchant will encrypt parameters(Amount, Currency).
  8. After encrypting the parameters you will post the encrypted value along with the other billing shipping details(if any) to the CCAvenue server via a browser(embedded WebView) post.
  9. The user will be redirected to the CCAvenue's billing shipping page where he will fill in the required details including the payment option.
  10. After filling the required details he will be redirected to the bank page wherein he will authorize himself.
  11. After authorization he will be redirected to CCAvenue and a response i.e. Success or failure will be sent to the merchant page which was configured as return url during registration.
  12. You should then decrypt the response, which can then be parsed to get transaction status.

Note :

  • Access code and order ID should be the same as passed during the RSA call.

  • Order ID should always be unique

  • The transaction should hit the CCAvenue server within 60 seconds after receiving the RSA key.

  • Working key posted in ccavResponseHandler file should be corresponding to the Accesscode being posted to CCAvenue.

like image 3
Gáüřãv Jõşhï Avatar answered Oct 06 '22 23:10

Gáüřãv Jõşhï