cordova - How to integrate CCAvenue to Ionic2

2019-07-21 11:36发布

问题:

I am new in IONIC2 and Angular2. In my application I need payment gateway of CCavenue with merchant server. Please give me steps for that Issue.

回答1:

There is no official native plugin for CCAvenue yet.You have few options here.

Option 1: You have to write a native Cordova plugin using CCAvenue native android/iOS SDK.

Option 2: There is an unofficial plugin which is for Ionic1.Maybe you can use it with Ionic2 after some changes.Here it is.

Option 3: You have to use officially supported payment gateways like Paypal, Stripe etc.

Note:

Normally most of the Ionic2 native plugins are supported for Android and iOS.So you just need to install only one plugin for both platforms.Here is such a plugin Stripe.



回答2:

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