Can we integrate Paypal payment gateway with ionic?

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 ?

1 Like

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.

1 Like

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

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.

Can you share me the post link ?

2 Likes

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

Which dynamic values?

Passing the amount to be paid in paypal.

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

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

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

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

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

I already did 3 days ago

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

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

1 Like

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

1 Like

Thanks. Looking forward to it

did you forget to post the code example?