Cordova wrapper around Razorpay's Android and iOS SDKs
Objective-C Java JavaScript
Latest commit 4d01a71 Dec 17, 2016 @selvagsz selvagsz committed on GitHub Update readme with link to sample apps

Cordova/Phonegap bindings for Razorpay's Mobile SDKs

Official Cordova/Phonegap plugin for integrating Razorpay's checkout.

Supported platforms

  • Android
  • iOS
  • Browser

You can check out the sample apps for cordova, ionic1 & ionic2 in


Install the plugin

cd your-project-folder
cordova platform add android      # optional
cordova platform add ios          # optional
cordova platform add browser      # optional
cordova plugin add --save

(or, phonegap plugin add --save)

Integration code

var options = {
  description: 'Credits towards consultation',
  image: '',
  currency: 'INR',
  key: 'rzp_test_1DP5mmOlF5G5ag',
  amount: '5000',
  name: 'foo',
  prefill: {
    email: '',
    contact: '8879524924',
    name: 'Pranav Gupta'
  theme: {
    color: '#F37254'

var successCallback = function(payment_id) {
  alert('payment_id: ' + payment_id)

var cancelCallback = function(error) {
  alert(error.description + ' (Error '+error.code+')')
}, successCallback, cancelCallback)

Change the options accordingly. Supported options can be found here.

Things to be taken care:

  • Add the integration code snippet after deviceready event.

  • On browser platform, change the Content Security Policy to whitelist the domain.

<meta http-equiv="Content-Security-Policy" content="default-src 'self' https://* data: gap: 'unsafe-eval'; style-src 'self' 'unsafe-inline'; media-src *">