Paypal Integration in ionic framework


#1

Hi , All
I was working on an integration of Paypal in my new ionic framework app , Followed instructions as per the github link https://github.com/paypal/paypal-cordova-plugin#your-app-integration,But i am getting the error that
ReferenceError: PayPalMobile is not defined,
It would be great if some one can help me to resolve this issue.

Thanks in advance


#2

do you added the plugin correctly to your project?

cordova plugin add com.paypal.cordova.mobilesdk

#3

yes I added the plugin through command prompt correctly,
ionic plugin add com.paypal.cordova.mobilesdk,, Then I got a folder named

  • com.paypal.cordova.mobilesdk

under plugin , and inside that folder i got 2 js files
1 .cdv-plugin-paypal-mobile-sdk
2. paypal-mobile-js-helper,
As per the this link , I referenced helper js file in index.html file after cordova.js import,But the problem is when i tried to use PayPalMobile i got the error ‘PayPalMobile is undefined

Below the code snippet.

ionic.Platform.ready(function () {

                        var clientIDs = {
                            "PayPalEnvironmentProduction": shopSettings.payPalProductionId,
                            "PayPalEnvironmentSandbox": shopSettings.payPalSandboxId
                        };
                        PayPalMobile.init(clientIDs, onPayPalMobileInit);
                    });

Thanks…


#4

Thanks much for the replay,I am happy to let you know that the paypal integration is worked fine for me.Cheers to the spectators…


#5

your solution or what was the problem?


#6

I have called RenderSingleUI before initiating PayPalMobile
Thanks


#7

Hi, im having the same problem. Can i know whether i need to follow the github steps and include the index.js? Currently i’m referring to this sample, but no luck.
http://blog.mastersoftwaresolutions.com/ionic-paypal-integration/


#8

HI, I suggest you to refer this [link] (https://github.com/paypal/PayPal-Cordova-Plugin), It is pretty simple…And also you can use this factory

Please let me know if some other bottleneck happens again…

Thanks…


#9

Hey! I am having the same issue, can you post your code?
Because my app do not loading PaypalMobile properly and shows that that is undefined( same as yours issue).
Thanks))


#10

Hi, PaypalMobile will be undefined when debugging in browser , Did you debug in mobile devices, Better to debug in android emulators.I suggest you to use ADB Plugin of chrome to debug along with emulator.

Thanks…


#11

Hi. Thank you for your reply!
I am tetsting on ionic view and ripple emulator and it even with these emulators not working. Can I launch ADB from pc not using the mobile device?
Regards!!


#12

My big mistake was that my PayPalEnvironment wasn’t PayPalEnvironmentNoNetwork.
Thank you very match!!


#13

yes , you can use ADB plugin in chrome in pc along with emulator,No need of mobile device to debug, but you must add the crosswalk plugin to your app to debug,after that you can debug while running in emulator,Just right click on ‘ADB plugin’ and click inspect.Just put breakpoints , don’t forget to delete the plugin when you are going to production…

Thanks


#14

Hi, I am getting Same issue. Please give any suggestion.


#15

hi boss. Are you got the solution!!! please help me http://stackoverflow.com/questions/42337063/paypal-integration-with-ionic-framework-not-working


#16

I’m out for a while man . Really sorry can’t access my laptop. On a leave

Thanks
Ahammad Ali


#17

Thank you boss for replying. If you access your laptop please help me.


#18

Hello Ahammad Ali

I have Follow All these instruction from this link https://github.com/paypal/PayPal-Cordova-Plugin but i have error
Uncaught ReferenceError: module is not defined at cdv-plugin-paypal-mobile-sdk.js:146

Please Please help me out this problem