Integrate the PayPal PLUS Payment wall in Nativescript


#1

Hi,

I want to integrate PayPay PLUS into my mobile application. My idea so far: simply using this official document:

My Idea:
No SDK, no nothing except the provided APIs. I do not need additional payment methods except for those included by PPP, thats why I decided to use it.

This leads me to two questions:

First Question (main Question):
Is it possible to import a given JS-Library (in my case it would be https://www.paypalobjects.com/webstatic/ppplus/ppplus.min.js from this .pdf file chapter 8.1 - “Integrating the payment wall”) into the NativeScript Application?

The text tells me the following:

  1. Include JS library:
 <script src="https://www.paypalobjects.com/webstatic/ppplus/ppplus.min.js"
    type="text/javascript"></script>
  1. Define a placeholder DIV:

<div id="ppplus"> </div>

  1. Render Payment wall:
    <script type="application/javascript">
     var ppp = PAYPAL.apps.PPP({
     "approvalUrl": "'.$approval_url.'",
     "placeholder": "ppplus",
     "mode": "sandbox",
    "country": "DE"
     });
    </script>

Since I cannot use the script-Tag in xml, my workaround would be to import this (if possible) like an usual module.

What I tried:

import * as "https://www.paypalobjects.com/webstatic/ppplus/ppplus.min.js"

but he can’t find the given module (which seems kinda obvious, since it is no installed module itself). Is there any other way to do this?