Can we integrate Paypal payment gateway with ionic?


#1

I am working in an application which needs payment gateway. I have tried manything to integrate payment gateway. But all was unsuccessful. I tired paypal payment gateway.

https://github.com/paypal/PayPal-Cordova-Plugin which was also failed. I tried the below solution. Not working. Is there any other way to integrate paypal payment gateway with Ionic in Angularjs ?


#2

looks like you are new to whole hybrid app development thing. Paypal’s documentation is pretty straight forward and you just need to make it in angular way.

The best way is to use a website for taking payment if you can’t understand the hybrid app and are pressed for time. call that website on button click in your app and it will open inappbrowser.

On success close inappbrowser, and call an api endpoint via $http and do the rest of the things.


#3

I got Paypal plugin working with Ionic, I followed the angularjs service approach that was explained in a post of this forum.


#4

I followed the way as you mentioned. But the problem is sending data from app to website. I tried to submit form to external link, But since I can send data only in json format sending data to payment gateway was not possible.

I have something link this,

On submitting this form, It should send values to www.example.com/api. Making this happen in angularjs is little tough. I used $http.post to send data. But it sends in json format, Payment gateway is not accepting the values.


#5

Can you share me the post link ?


#6

#7

Thanks, But the problem now is… Sending dynamic values to index.js. It’s not accepting dynamic values


#8

Which dynamic values?


#9

Passing the amount to be paid in paypal.


#10

Of course you can, I guess you did not understand the post.


#11

I get dynamic variable from a html file

<input type="hidden" value="12" id="fare">

in index.js file

under createPayment function

var x = document.GetElementbyId("fare").value;
alert(x);

This is what I did. But I couldn’t get variable fare value in index.js file. It’s not getting the value


#12

Then this is not a PayPal integration issue, it’s basic Angular knowledge.


#13

Yeah… But the problem is, it’s not working


#14

Can you post the link to the post that helped you and/or post detailed instructions


#15

I already did 3 days ago


#16

Thank you support… paypal is working fine now :slight_smile:


#17

dilipwk Can you provide everyone with a working example of your ionic paypal integration


#18

Yeah sure, I will upload it on git and put the link here soon.


#19

Thanks. Looking forward to it


#20

did you forget to post the code example?