[PayPal Mobile] Step by step guide / documentation

Forge Component
(6)
Published on 2019-10-19 by Nuno Lopes
6 votes
Published on 2019-10-19 by Nuno Lopes

Hi,

I have installed this module but I can't manage to make it work. To try to find out how to implement it, I have installed the PayPal Mobile Sample App, which give me exactly the same error.

What happens?

  1. From the Paypal Mobile Sample App: I input the client ID / secret in the client actions.
  2. I launch the PayPal Mobile Sample App
  3. I tap on "Simple Payment"
  4. The app gives me a blank error message (red bar at the top - without text)

What am I missing? In the workflow, it is clear that the following step is misfiring, but it is unclear for me where to fix it...


Thank you,

Nicolas

Hi,

And does an error message appear on the service center side?

Cheers

Have you validated if there are any site properties that are configuration variables that need to be adjusted?

Here is the message from the Service Center:


PayPalMobile is not defined

eSpaceVer: Id=438, PubId=0, CompiledWith=11.7.3.5968
RequestUrl: https://ni-ma.outsystemscloud.com/PPSample/moduleservices/log?clientTimeInMillis=1586369590690 (Method: POST)
AppDomain: /LM/W3SVC/13/ROOT/PPSample-404-132308431657509009
FilePath: C:\OutSystems\Sandboxes\UZQHJO010\Platform Server\running\PPSample\
ClientIp: 149.154.216.213
Locale: en-US
DateFormat: yyyy-MM-dd
PID: 59404 ('w3wp', Started='3/24/2020 6:15:36 PM', Priv=589Mb, Virt=2118159Mb)
TID: 124
Thread Name:
.NET: 4.0.30319.42000
Client-Side Log



ReferenceError: PayPalMobile is not defined
    at https://ni-ma.outsystemscloud.com/PPSample/scripts/PaypalMobile.controller.js?AUgzv0V59_ivcJx+pukRAA:2296:1
    at new Promise (<anonymous>)
    at https://ni-ma.outsystemscloud.com/PPSample/scripts/PaypalMobile.controller.js?AUgzv0V59_ivcJx+pukRAA:2290:8
    at Controller.e.safeExecuteJSNode (https://ni-ma.outsystemscloud.com/PPSample/scripts/OutSystems.js?PGHrEBzLHyLxW9cX_pLDCA:11:13778)
    at Controller.e.safeExecuteAsyncJSNode (https://ni-ma.outsystemscloud.com/PPSample/scripts/OutSystems.js?PGHrEBzLHyLxW9cX_pLDCA:11:13965)
    at https://ni-ma.outsystemscloud.com/PPSample/scripts/PaypalMobile.controller.js?AUgzv0V59_ivcJx+pukRAA:2121:19


Where are you trying to run your application? On what device?

And after installing the plugin, did you generate the application again?

Solution

Hi,

You need to run the Native App directly on your device, you cannot use the Chrome Simulator on your computer, nor your mobile browser nor OutSystems Now.

If you haven't done so yet, need to generate a native application for your device after you added your plugin dependency and install the new application package on your device (again if it was already previously installed). The run the updated version of your app directly from your device and it should not complain about Cordova.

This is because you don't have the Paypal Plugin binary libraries on previous versions of your application package (IPA file for iPhone or APK file for Android)


I hope this information helps you,

Thank you

Solution

I'm uploading it to the server & launching it in the browser... I'm still working in dev environment so I'm not sure I can generate the app again?

Nuno Miguel Verdasca wrote:

Hi,

You need to run the Native App directly on your device, you cannot use the Chrome Simulator on your computer, nor your mobile browser nor OutSystems Now.

If you haven't done so yet, need to generate a native application for your device after you added your plugin dependency and install the new application package on your device (again if it was already previously installed). The run the updated version of your app directly from your device and it should not complain about Cordova.

This is because you don't have the Paypal Plugin binary libraries on previous versions of your application package (IPA file for iPhone or APK file for Android)


I hope this information helps you,

Thank you

Did you read my last comment Ni Ma?

Cordova plugins do not run in OutSystems Now, or in a browser. And each time you add a new plugin, you have to generate a new application, as I mentioned in my last answer.

If you have an Android device, in non-productive environments you don't need certificates, just do Generate.


I hope this information helps you.

Regards,
Nuno Miguel Verdasca


Hi,

Your last comment didn't appear when I replied.

So, if I understand well I need to find an android device, generate the APK and test it "live"?

Thank you,

Nicolas

You can also have an iOS device, just generate the certificates. I leave you here how to generate the certificate for iOS: 


Each time you install a plugin in an application, you have to generate a new application for the librarians of that plugin to be part of the application. Regardless of the environment you are in. And from the moment you have cordova plugins in your application you cannot test in a browser since these plugins do not run in a browser. In non-productive environments you do not need certificates to generate an android application (APK), you only need it in a production environment. Unlike iOS that in all environments you need to generate certificates, either productive or non-productive.


Regards,
Nuno Verdasca

Fantastic, thanks a lot for your help.

I'm glad whenever I can help Ni Ma