How to integrate Paypal Cordova Plugin in IONIC Framework

Hi Guys,

I want to integrate Paypal Cordova Plugin https://github.com/paypal/PayPal-Cordova-Plugin with IONIC Framework.

I already run below command inside ionic app.
cordova plugin add https://github.com/paypal/PayPal-Cordova-Plugin

After this step should i need to follow below steps also ?

  1. Run cordova platform add ios or/and cordova platform add android.
  2. For iOS, open the Xcode project in the platforms/ios folder and add the PayPalMobile folder from step 1.
  3. For Android, copy the libs folder from step 2 to the libs folder in platforms/android.
  4. Run cordova build to build the projects for all of the platforms.

Please help me regarding this…

Thanks

3 Likes

Not really a question or issue with ionic…

You may have better luck getting help if you ask this on Stackoverflow

Thanks for the reply…Please browse this link https://github.com/paypal/PayPal-Cordova-Plugin.
You can see i need to replace www/js/index.js file inside Cordova Structure…

But IONIC is having js/app.js file.where i need to replace this functionality and which file i need to add inside IONIC framework…

Thanks

Hi nirav12, have you solved ?
I have the same problem.

Thanks

Yes. I am able to integrate paypal in my app without installing paypal cordova plugin.

You can use Inappbrowser (http://cordova.apache.org/docs/en/3.0.0/cordova_inappbrowser_inappbrowser.md.html)
instead of paypal cordova plugin.

We used paypal adaptive payment so integrating adaptive payment with inappbrowser you can use below link.

https://developer.paypal.com/docs/classic/adaptive-payments/ht_ap-embeddedPayment-curl-etc/#mini-b

Thanks.

3 Likes

thanks, you have an example?
How you are using callback functions?

I really need some help here. Does anybody implemented Paypal

Hi Nirav,
How you pass invoice data (collection of items to inapp browser)

Regards,
Suhas

1 Like

How you solved @suhaschitade? And what is the problem with paypal/PayPal-Cordova-Plugin?

Hi

ive implemented the plugin in a current app. Whats the problem ? . How can I help you

Hi danicomas,
When I was integrating paypal plugin there was no support available for invoice data.
However recently I have received notification from paypal plugin team that they have introduced feature of invoice data in plugin.

So take latest of plugin and integrate with app. Its cool

Regards,
Suhas

1 Like

Nice @suhaschitade ! Thanks

Please, anybody can help me? I’m trying to integrate Paypal Cordova with no luck.
I’ve linked inside my index.html the index.js and paypal-mobile-js-helper.js.

I’ve tried to load using:
PayPalApp.initPaymentUI();
or execute directly:
PayPalMobile.renderSinglePaymentUI(app.createPayment(), app.onSuccesfulPayment,
app.onUserCanceled);

But I always get this error:
ReferenceError: PayPalApp is not defined

@urbiwan
Please can you post a pastebin of your code for everyone ?
Thank’s

Here is the code

http://pastebin.com/RHJCm8kH

Pastebin no longer available.

Added a gist

Hi, I’m pretty new to angular. How do you pass in the shopSettings object?

shopSettings is a constant
see http://twofuckingdevelopers.com/2014/06/angularjs-best-practices-001-constants/
for further informations

Hi! Excuse me, I’m newbie in angular and ionic, how you connect paypal plagin? I made instructions, copy your code, but i got an error: PayPalMobile is not defined in browser’s console. I’ve connected paypal helper via < script src="…/…/plugins/com.paypal.cordova.mobilesdk/www/paypal-mobile-js-helper.js"></ script> , but it seems, like i missed smth else. can you help me?