Razorpay is provide payment solutions to online merchants. You can easily integrate with your application for payment solution.
Here we provide steps to integrate it with Ionic Framwork 3.
Step - 1
So, first of all install
Step- 2
Inside the src folder create a file named delclation declaration.d.ts
put these following declaration inside the declaration.d.ts
Now your integrtation is ready to use.
Step-3
In your application goto page where you want to use Razorpay and use these code sample.
Reference is taken from gitHub https://github.com/razorpay
If you are facing any problem comment below.Thank You.
Here we provide steps to integrate it with Ionic Framwork 3.
Step - 1
So, first of all install
razorpay-cordova
plugin plugin in your application.cordova plugin add https://github.com/razorpay/razorpay-cordova.git --save
Step- 2
Inside the src folder create a file named delclation declaration.d.ts
put these following declaration inside the declaration.d.ts
declare module '*';
declare var RazorpayCheckout: any;
Now your integrtation is ready to use.
Step-3
In your application goto page where you want to use Razorpay and use these code sample.
import { Component } from '@angular/core';
@Component({
selector: 'page-home',
templateUrl: 'home.html'
})
export class HomePage {
pay() {
var options = {
description: 'Credits towards consultation',
image: 'https://i.imgur.com/3g7nmJC.png',
currency: 'INR',
key: 'rzp_test_1DP5mmOlF5G5ag',
amount: '5000',
name: 'foo',
prefill: {
email: 'demo@email.com',
contact: '1234567890',
name: 'My Name'
},
theme: {
color: '#F37254'
},
modal: {
ondismiss: function() {
alert('dismissed')
}
}
};
var successCallback = function(payment_id) {
alert('payment_id: ' + payment_id);
};
var cancelCallback = function(error) {
alert(error.description + ' (Error ' + error.code + ')');
};
RazorpayCheckout.open(options, successCallback, cancelCallback);
}
}
Reference is taken from gitHub https://github.com/razorpay
If you are facing any problem comment below.Thank You.
This comment has been removed by the author.
ReplyDeleteHi, I have changed everything, But am getting the below Error.
ReplyDeleteRazorpayCheckout is not defined
at PaymentPayUMoneyPage.webpackJsonp.298.PaymentPayUMoneyPage.pay (http://localhost:8001/build/main.js:837:9)
at new PaymentPayUMoneyPage
Can you please help me out
cordova plugin add https://github.com/razorpay/razorpay-cordova.git --save
DeleteInstall it again .
Thank you, your solution works me
DeleteStarting PC software engineers should begin immediately building up awesome propensities for making PC programs clear for individuals. integration developers conditions give a strong structure to achieving this objective.
ReplyDeleteAcccording to video integration developers Investigate the two schools of programming. Some get a kick out of the chance to compose code and aggregate it independently, others jump at the chance to compose the code inside programming worked for programming. Both have their own allure and furthermore have there put in the realm of programming development.
ReplyDeletec++ programming tutorial
ReplyDeleteWonderful, just what a blog it is! This blog has provided the helpful data to us continue the good work.
This comment has been removed by the author.
ReplyDeletehi i am facing issue follow all step so please help me
DeleteERROR ReferenceError: RazorpayCheckout is not defined
i have define declare module '*';
declare var RazorpayCheckout: any;
in src > declaration.d.ts
and i used all code where i click Pay button but now i am getting these error so please help me for solve out as soon as possible.
thankyou
I have done another way currently working properly
Deletehow u did..can u share the sample code..its not working for me
DeleteHai Saroj .Run it in your mobile(ionic cordova run android) or install ionic cordova platform add browser and then run ionic run browser .it Works for me
Deletehelo can you find the solutions?
ReplyDeleteRazorpay payment closing(showing error payment canceled) when reopen the app by clicking on app icon in mobile
ReplyDeletewhat about html?
ReplyDeleteHi sir i have process payment with credit card numberso...how to pass card and cvv number in the options param?
ReplyDeletedeclaration.d.ts is not there in my ionic v 3.9 where should i declare that in that case?
ReplyDeleteHi, am getting error while using razorpay in my ionic app which is RazorpayCheckout is not defined. how to solve this issue plz help me
ReplyDeleteMy ionic info:
Ionic:
Ionic CLI : 5.0.0 (C:\Users\Ramya\AppData\Roaming\npm\node_modules\ionic)
Ionic Framework : ionic-angular 3.9.2
@ionic/app-scripts : 3.2.3
Cordova:
Cordova CLI : not installed
Cordova Platforms : not available
Cordova Plugins : cordova-plugin-ionic-keyboard 2.1.3, cordova-plugin-ionic-webview 4.0.1, (and 4 other plugins)
Utility:
cordova-res : not installed
native-run : not installed
System:
NodeJS : v8.12.0 (C:\Program Files\nodejs\node.exe)
npm : 6.4.1
OS : Windows 10