Nitin Agarwal Nitin Agarwal - 22 days ago 26
AngularJS Question

Integrate Payment Gateway with IONIC

Don't mark question as duplicate or already asked. If know please answer.

I am trying to integrate payumoney payment gateway in my hybrid app. I went through some tutorials and finally reached to plugin cordovaInAppBrowser and using its events, loadstart, loadstop but not able to send and get parameters.Since last One Week I stucked and so finally posting here. Thanks, in advance

Answer

Finally I succeed in integrating the payment gateway in ionic. Its very easy, jsut follow the following steps,

  1. add the cordovaInAppBrowser plugin and Inject the dependency.
  2. make all the fields you get that to send to that Gateway with all validations.
  3. now you needed some 3 files as success.php, failure.php and paymentfile.html.
  4. $cordovaInAppBrowser.open("filename?"+params, '_blank',options)
  5. make note that success and faliure php file are in server and access them through server
  6. get the response in the php file than to controller, based on the response traverse the path and its done.

Most important you need to serialize the data while sending as its should be global and assign it to window object. Also we have to use the cordovaInAppBrowser events loadstop() and all the stuff i had done in this event and later i call the close() function when its done.

Its Done.

Comments