Ionic payment
gateway provides a payment transaction by the transfer of information between
mobile application and the acquiring bank.
Below are
the steps followed to integrate bank payment gateway with ionic3 application:-
Step1:- Install the Cordova and Ionic Native plugins
$ ionic
cordova plugin add cordova-plugin-inappbrowser
$ npm
install –save @ionic-native/in-app-browser
Step2:- Get
the hash key (provides added security to the payment) from server
Step3:-Create
html page in WWW folder(redirect.html). This html page should contain an empty
form with an id. We use this html page to submit to the payment gateway.
Step4:-From
form, load string to html tags, it should be in the format of how we submit to
the payment gateway.
Step5:-Import inappbrowser to app.module.ts
import { InAppBrowser } from '@ionic-native/in-app-browser';
and include it
in @NgModule’s providers array.
Step6:-Import
inappbrowser in checkout page and add this in constructor.
constructor(public navCtrl: NavController,private iab: InAppBrowser)
Step7:-Create
and show inappbrowser using create
method
create(url,
target,options);
this.browser = this.iab.create( "redirect.html", "_blank", "EnableViewPortScale=yes,closebuttoncaption=Done"
);
here we are
using HTML page created in step3(redirect.html) as the url, which opens the URL
in a new inappbrowser instance.
Step8:-Call executeScript with the string created
as in Step4.This executeScript
injects Javascript code into the inappbrowser window(this is available only
when the target is set to ‘_blank’). executeScript() method injects JavaScript
in childview.
Step9:-
When the executeScript() is called then the events will be fired and
inappbrowser gives response to its parent. The events which are fired are,
loadstart- this is fired when the inappbrowser starts to
load a URL.
loadstop- this event gets fired when the inappbrowser
finished loading a URL.
loaderror- fired when the inappbrowser encounters an error
loading a URL.
exit-this event is fired when the inappbrowser window is
closed.
Then check
for the URL success or failure of loadstop
event in the browser parent.
this.browser.on("loadstop").subscribe(
(event) => {
//this.close_event = true;
console.log(event);
if(event.url.includes(“Successful")){
//write the code here
this.browser.close();
}
else if(event.url.includes("failure")){
//your code here
this.browser.close();
}
},
(err) => {
console.log("InAppBrowser Loadstop Event
Error: " + err);
}
);
If the payment succeeds or fails close the
browser with command close().
this.browser.close();
Step10:-Reading
response from gateway should be handled at server, status can be stored in the localstorage of the application.
Step11:-Redirect
the application as required.
High Risk Gateways provide a best High Risk Merchant Account in India We offer a High Risk Merchant Account at affordable range. High Risk Gateways has been served many genuine business of Merchant Account in India in the past few years.
ReplyDelete
ReplyDeleteePay Global Offers MLM Merchant Account with specialized business and requires the special merchant account . We support the high-risk industries by providing offshore payment solutions.
Helpful blog to learn about Payment integration in Ionic 3. It's working fine.
ReplyDeleteCome with your suggestions or ideas in Ionic, A leading Mobile App Development Company in Calgary specially called as Devolve can definitly help you to build your next Ionic project.
This comment has been removed by the author.
ReplyDeleteGreat explanation about Ionic 3 Payment gateway integration.
ReplyDeleteAfter reading this, I'm damn sure, anyone can do payment gateway integration easily in Ionic 3.
Jeevitha from Way2Smile (Trusted Mobile App Development Company in Chennai).
Being a renowned and reliable ecommerce payment solution provider for merchants, we offer scalable and tailor-made ecommerce payment solutions with short settlement period and competitive rates. We are also proud of providing 24/7 customer service and technical support for years.
ReplyDeletePaymentAsia
PaymentAsia
Will you please share the source code ?
ReplyDeleteWeb customers locate the Online Payments framework profoundly useful. They can buy various types of products online to encourage their necessities and wants.
ReplyDeleteVery good article . wow, awesome post. Really thank you! Great
ReplyDeletephotoshoot in andaman
wow what a amazing content its very informative and effective, thanks for sharing.
ReplyDeleteapp developers in chennai,
App development company in chennai,
software development company in chennai
Very usefil blog. Thanks for sharing content. Keep share more like this.
ReplyDeleteMobile app development company in chennai
Mobile Application Development companies in chennai
Android development companies in chennai
Mobile app development company chennai
Web Design Company in Chennai
App development company in chennai
mobile app developers in chennai
website development company in chennai
Fantastic article. Thanks for sharing. Keep share much more.
ReplyDeletecouple friendly hotels in yercaud
yercaud residency
hotel in yercaud tamil nadu
hotels in yercaud for family