Download Ccavenue Integration Kit For Android
Ford Sync2 headunit OEM touch control Apple CarPlay & Android Auto. Plug and Play easy install. đ https://soso.co.nz/product/ford-sync2-apple-carplay-android. How to download CCAvenue gateway integration kit for Android, iOS and Windows Step 1: Create an Merchant Account Step 2: Login to Merchant Account Step 3. Visit Resources â Mobile Integration Kit â Download Integration Kits. Easy Integration With our detailed integration kit and APIs, integrate and go live with CCAvenue in the. Thanks for sharing a very interesting article about Easy way to integration of ccavenue payment gateway using php. This is very useful information for online blog review readers. Keep it up such a nice posting like this. You need to request for the Android Integration Kit (in addition to your test account credentials such.
Accept mobile payments in any Android App using our native Android SDK. With our mobile SDKs, you do not need to worry about PCI DSS compliance by eliminating the need to send card data to your server. Instead, our libraries send the card data directly to PayU servers which are PCI-DSS Compliant. The PayUmoney mobile SDKs ensure strong encryption and data security to ensure complete peace of mind to your users.
Have a look at the animated image below to understand payment collection through PayUmoney Plug & Play Android SDK.
This integration guide will assist you in integrating with the PayUmoney Android SDK and the PayUmoney Plug n Play module to provide a complete payment experience to your users.
Features Supported
The following features are supported in the PayUmoney Plug and Play Android SDK.
- Saved Cards
- Auto-OTP Read and Entry
- Multiple Payment methods
- Ready to use Payment UI
Payment Modes Supported
The following payment modes are supported in the PayUmoney Plug and Play Android SDK.
- EMI
- UPI
- Wallets
Prerequisites
Meet the Prerequisites
Set up the SDK
Import and configure the PayUmoney PnP SDK
Server Side Changes
Calculate the security hash value on your server
Set Payments Parameters
Provide details of customer and transaction to the SDK
Response Handling
Verify response hash and display transaction status to the customer
Start the Payment Flow
Invoke the function to open the checkout page
Set the hash
Build Payment Parameters and set the server computed hash
Getting Started with the Android SDK
This guide will take you through building your appâs payment flow using the PayUmoney Android SDK. The SDK handles collection, storage, and reuse of your userâs payment details, and can also be used to collect billing info. Have a look at the Android SDK Payment Activity Diagram before you take the deep dive.
Prerequisites
Meet the Prerequisites
Set up the SDK
Import and configure the PayUmoney PnP SDK
Server Side Changes
Calculate the security hash value on your server
Set Payments Parameters
Provide details of customer and transaction to the SDK
Response Handling
Verify response hash and display transaction status to the customer
Start the Payment Flow
Invoke the function to open the checkout page
Set the hash
Build Payment Parameters and set the server computed hash
Prerequisites
- Sign up with PayUmoney as merchant
- Get the Merchant Id,Key and Salt, which are available on your merchant dashboard
Selecting the right SDK
The PayUmoney SDK provides a set of optional modules that provide several additional features during Payment Acceptance. Based on your needs, please select the appropriate modules to enhance your userâs payment experience:
- PayUmoney Core SDK (Mandatory) â This is the base SDK required to accept payments in your app. The Core SDK is mandatorily required. All other modules are optional and work on top of the Core SDK.
- PayUmoney PnP Module: The PayUmoney PnP (Plug n Play) module provides a rich and well-designed set of ready to use screens that provide a superior payment experience to your users. The PnP module works on top of the PayUmoney Core SDK and allows you to provide multiple payment methods to your users with minimal effort.
- PayU Custom Browser: The Custom Browser (CB) provides OTP assist features such as auto read of OTP, entry, and submission in the Bankâs 2-Factor authentication page.
- Note:
- The Core SDK does not contain User Interfaces for accepting payments. If only the Core SDK is used, you must create the UI for displaying the checkout form and the subsequent payment information entry. Please use the PnP module if want a ready-to-use set of checkout UI experiences. To integrate with the Core SDK, please Contact our Integration Support team.
Setting up the PnP SDK
To import and configure the PayUmoney SDK in your project, please implement the following changes in your app:
Import PayUmoney SDK as a Gradle Dependency
In your projectâs build.gradle file, please add the PayUmoney Plug and Play (PnP) SDK module as a dependency by adding the following line:
Calculate Server-Side Hash
Download Ccavenue Integration Kit For Android Sdk
The only server side change required while integrating PayUmoney Android SDK is generating a hash parameter for both the payment request & response.
A hash is an encrypted value (checksum) that must be sent by the merchant in a payment request that is then sent back by PayUmoney in the payment response. A hash is used to protect transactions against âman in the middleâ attacks.
Hash Generation for Payment Request
Use the following sample java sequence to generate a request hash.
- Note:
- The entire hash logic is built on the assumption âSaltâ is always safe with the merchant. Hence, it is very important for the merchant to keep the âSaltâ safe by adhering to the best security practices. For eg: Merchant should always compute from the server side and never from the client side, should never share the âSaltâ & âKeyâ over emails or directly commit on public repositories like Github.
Set Payments Params
To start using the PayUmoney PnP SDK, you need you initialize the SDK by providing details about the customer and the transaction. Please use the sample code provided below to setup the SDK initializer.
The âudfâ fields below stand for âuser defined fieldâ. These are optional fields to pass custom information about the transaction to PayUmoney. You may pass up to 5 UDF fields.
Build payment params and set the hash
The hash computed on the server side should be passed as an input parameter to the transaction request and hence needs to be passed to the SDK as shown below:
Start the Payment Flow
Invoke the following function to open the checkout page. The Customer will now interact with PayUmoney screens till the transaction is complete.
Inputs:
- PayUmoneySdkInitializer.PaymentParam â paymentparams (initialized in step 2)
- Activity â activity context
- Style â theme resource
Example:
<style name=âAppTheme.Greenâ parent=âPayumoneyAppThemeâ>
<item name=âcolorPrimaryâ>@color/persian_green_primary</item>
<item name=âcolorPrimaryDarkâ>@color/persian_green_dark</item>
<item name=âcolorAccentâ>@color/persian_green_accent</item>
<item name=âcolorButtonNormalâ>@color/persian_green_primary</item>
<item name=âalertDialogThemeâ>@style/AlertDialogStyle_green</item>
<item name=âactionMenuTextColorâ>@color/white</item>
</style>
- isOverrideResultScreenFalse â PNP will take care of Transaction result screen
True â merchant will take care of Transaction result screen
Start the Payment Flow
Invoke the following function to open the checkout page. The Customer will now interact with PayUmoney screens till the transaction is complete.
Inputs:
- PayUmoneySdkInitializer.PaymentParam â paymentparams (initialized in step 2)
- Activity â activity context
- Style â theme resource
Example:
<style name=âAppTheme.Greenâ parent=âPayumoneyAppThemeâ>
<item name=âcolorPrimaryâ>@color/persian_green_primary</item>
<item name=âcolorPrimaryDarkâ>@color/persian_green_dark</item>
<item name=âcolorAccentâ>@color/persian_green_accent</item>
<item name=âcolorButtonNormalâ>@color/persian_green_primary</item>
<item name=âalertDialogThemeâ>@style/AlertDialogStyle_green</item>
<item name=âactionMenuTextColorâ>@color/white</item>
</style>
- isOverrideResultScreenFalse â PNP will take care of Transaction result screen
True â merchant will take care of Transaction result screen
Response Handling
The PayUmoney SDK provides default response handling and screens thereby removing the need for you to create your own screens or handle the response from the PayUmoney server.
The default screens are illustrated in the screenshots below:

If you need custom screens for transaction success and failure, please review the steps below.
When making a payment using the PayUmoney Android SDK gives two types of payment response:
- A client-side response in the callback function
- A server to server callback on the Webhook, if set from the PayUmoney dashboard.
To know when the payment has completed, override the onActivityResult in your activity as exemplified in the sample code below
Blue iris 3 key generator. Now, you will need to add these lines of JavaScript to your success and failure pages (SURL, FURL) for the Android SDK to be able to detect the result.
Success Page:
PayUmoney.success()
Failure Page:
PayUmoney.failure()
Download Ccavenue Integration Kit For Android Tv Box
Before transaction response is displayed to the user, please verify the authenticity of the transaction by
generating a response hash.
The hash generated by you should match the one send by PayUmoney in response.
Managing User Login
The PayUmoney SDK provides a simple mechanism to allow users to log into their PayUmoney account and utilize features such a Saved Cards, PayUmoney wallet balance etc when making payments.
- isUserLoggedIn() â Return true if user is logged in else return false
- logoutUser() â Log out logged in user
Order Review
Through the PayUmoney PnP SDK, you can provide an interface to your users to allow them to review an orderâs details. To display a review order screen, you will need to pass the details of the order that you want to display. While the SDK controls the look and feel of the Order Review screen, the content itself is defined by you.
To set the order details, pass the information to the PnP SDK in the form of key:value pairs with the key being the row descriptor and the value being the corresponding value associated with that descriptor.
For example:
Testing the Integration
For using SDK in test mode you need to follow the below-mentioned steps.
- PayUmoneySdkInitializer.PaymentParam.Builder().setIsDebug(true)
- Send the SURL/FURL, MerchantId and key accordingly for test and live mode.Goto âParameters Sectionâ to know what this means.
| S.No. | Parameter Name | Required | Value |
|---|---|---|---|
| 1. | key | Compulsory | Merchant key provided by PayUmoney |
| 2. | Txnid | Compulsory | Unique transaction id to be sent by the merchant. |
| 3. | Amount | Compulsory | Payment amount (Type cast to float) |
| 4. | ProductInfo | Compulsory | Product Description |
| 5. | firstName | Compulsory | Only alphabets a-z are allowed |
| 6. | Compulsory | Customerâs email id | |
| 7. | phone | Compulsory | Mobile or landline number (numerics only) |
| 8. | udf1 | User defined field 1 | |
| 9. | udf2 | User defined field 2 | |
| 10. | udf3 | User defined field 3 | |
| 11. | udf4 | User defined field 4 | |
| 12. | udf5 | User defined field 5 | |
| 13. | SURL | Compulsory | URL called on payment completion |
| 14. | FURL | Compulsory | URL called on payment failure |
| 15. | hash | Compulsory | Hash or Checksum = sha512(key txnid amount productinfo firstname email udf1 udf2 udf3 udf4 udf5 salt) (SALT is provided by PayUmoney) |
- Note:
- udf1 to udf5 are user-defined fields. These are meant to send any additional values that you need to post. However, if you donât feel the need to post any additional params, even then you will need post these params with blank values.
| S.No. | Parameter Name | Description | Sample Value |
|---|---|---|---|
| 1. | status | Transaction Status. (Described in detail in the Transaction Status section) | success |
| 2. | firstname | Firstname of the payer | Tom |
| 3. | amount | Transaction Amount | 1.0 |
| 4. | txnid | Transaction Id passed by the merchant | 0nf725 |
| 5. | hash | Security hash generated in response to protect against data tampering. Merchant is required to generate a response hash and verify it against this hash. | 127e2c44016aa4c3dd5bacc09b0239b09c6174f275c0ec4c8ec7da3db915a754407849cf2537f8655255ac54ee652c4ef972c721462ec9d0a67c08b66bdbb6ba |
| 6. | productinfo | Book1 | |
| 7. | mobile | Mobile No of the payer | 7406740707 |
| 8. | Email Id of the payer | abc@payu.in | |
| 9. | payuMoneyId | The PayUmoney transaction id. | 144190307 |
| 10. | mode | Payment Mode in:
| NB |
Transaction Response Parameters
This section contains the details about different response parameters encountered when transacting using PayUmoney.
Transaction Status
A transaction can have several different statuses as explained in the table below.
| S.No. | Status | Description |
|---|---|---|
| 1. | Not Started | The transaction has not been started yet. |
| 2. | Initiated | The transaction has been started but not completed. |
| 3. | Money With PayUmoney | The transaction was successful and the transaction amount is with PayUmoney. |
| 4. | Under Dispute | A dispute for the transaction has been raised. |
| 5. | Refunded | The entire amount of the transaction has been refunded. |
| 6. | Partially Refunded | A part of the amount of the transaction has been refunded. |
| 7. | Bounced | Incomplete or no details provided at PayUmoney payment page. |
| 8. | Failed | The transaction didnât complete due to a failure. |
| 9. | Settlement in Process | Settlement for the transaction is in process. |
| 10. | Completed | The transaction is settled and complete. |
Sample App
To understand the PayUmoney payment flow, you may download and install our sample app and choose to Pay using PayUmoney.
Download Link: https://github.com/payu-intrepos/payumoney-new-sample-app
We recently made an Android app and a web-app for our client (Kabra Express) with CCAvenue as the payment gateway. Kabra Express is one of the largest travel company in Gujarat and has operations throughout the country.
CCAvenue is one of the biggest payment gateways in India. It supports multiple payment options, mobile payments (via WebView) and is highly secure.
Download Ccavenue Integration Kit For Android Download
However, the lack of proper documentation makes its integration with mobile apps a bit troublesome. Looking at how many people use CCAvenue, we decided to help the community by writing an article on
Prerequisites
- Get your public IP address whitelisted at CCAvenue in both production and staging environment (mail them about it, mentioning your merchant ID)
- Get access code and encryption key from the dashboard. For this, youâll need to ask the support to generate these for your hosts (like localhost or example.com etc).
The whole mechanism relies on RSA. RSA (RivestâShamirâAdleman) is one of the first public-key cryptosystems and is widely used for secure data transmission. In such a cryptosystem, the encryption key is public and it is different from the decryption key which is kept secret (private).
Download Ccavenue Integration Kit For Android Developers
This request/response flow, as it happens
- Mobile app sends a request to the PHP server for RSA keys.
- The PHP server calls the CCAvenue server, with the access code and a unique order ID.
- CCAvenue replies with a text string which is the RSA key.
- This RSA keys is then sent back to the Android app in the response.
- Using the RSA key, the mobile app encrypts the payment information like customer info, order id, amount etc and performs a POST request using WebView to reach the CCAvenue payment page. The fields that are encrypted includes amount, currency, billing_tel (phone number), billing_email, billing_name. The user is presented with the CCAvenue payment page.
- Depending on the payment status (success/failure), CCAvenue redirects the user to the respective URL on the PHP server.
- The server, after parsing the gateway response, returns an HTML page (to the WebView) which has the Java-JS bridging code. The Java code is executed from the JS (inside the HTML page) and the user is sent to the activity in the app accordingly.
Explaining the flow
Step 1, 2, 3 and 4: All these steps happen in a single request-response cycle, initiated by the mobile app. The PHP server gets a request for RSA key from the app, it calls CCAvenue API using cURL. An example code is below:
The response sent by the server will have the RSA key (from the above code), order id (must be unique and a whole number), access code, merchant id, redirect (success) and cancel URLs.
As soon as the app gets this RSA key (and other parameters in response), it encrypts amount, currency, billing_tel (phone number), billing_email, billing_name using this key. The Java code for encryption method is below:
The string returned by this method is POSTed to CCAvenueâs transaction URL via a WebView (code provided below) along with other parameters received from the server. The payment page is now presented to the user. Depending on the success or failure of the payment, the server and then the app will get the response.
Now comes the interesting part. You must be wondering- how does our app know if the payment was successful or failure? After all, the WebView is completely detached from the normal flow of the app as it renders HTML pages. The magic lies in the JS-Java bridge that allows execution of Java from JavaScript in Android! You can read more about it here.
Hereâs how it happens (assuming that the payment has been made successfully):
The success URL sent to CCAvenue is our serverâs URL. This URL when hit on redirection, will cause a series of events: response decryption, transaction status checks, updating the database, sending relevant emails and finally returning an HTML page in the response (Keep in mind that itâs the WebView thatâs getting redirected along with the POST data from CCAvenue). This HTML is extremely simple:
See the line Payment.onSucess()? This is the magic sauce.
We attach something called as a JavaScript interface to the WebView. This interface is given a name (Payment, in our case). This interfaceâs object is made available to JS and it calls the methods of its equivalent Java class. A sample code is below:
As you can see, âPaymentâ is just a simple class with two methods and @JavascriptInterface annotation. This annotation tells the WebView to bind JS-Java objects together and hence, calling Payment.onSuccess from JS is similar to calling it from Java!
onSucess() sets the result code, and finishes the WebView activity. This way our app know if the payment was successful or failure.
This concludes the journey of integrating CCAvenue in an Android app in case of non-seamless integration. We almost always prefer this way when integrating other payment gateways too (if they donât have an SDK). We also almost always go with non-seamless integration as it requires little adherence to compliance.