How to use PayPal-Cordova-Plugin with IONIC

please help me anyone done paypal plugin integration with IONIC.

first follow the installation steps of this example app:

after that in your index.html include this to your scripts (after you loading cordova, before you are loading ionic)
script type=“text/javascript” src=“js/paypal-mobile-js-helper.js”>

After that you can initialize your paypal connecten, if ionic is ready instead of the deviceReady function you should use ionic.Platform.ready(callbackFunction):

    var clientIDs = {
      "PayPalEnvironmentProduction": "YOUR_PRODUCTION_CLIENT_ID",
      "PayPalEnvironmentSandbox": "YOUR_SANDBOX_CLIENT_ID"
    };
    PayPalMobile.init(clientIDs, app.onPayPalMobileInit);

the full functions are here:

the flow is:

  1. init Paypal with your merchant info (initPaymentUI, onPayPalMobileInit, configuration)
  2. add Buttons/links to your dom —> listen and act on click (onPrepareRender)
  3. create Payment and listen to the response via eventlisteners (createPayment, onSuccesfulPayment, onAuthorizationCallback, onUserCanceled)

Thank you for your quick reply.i have problem with this

after this step

cordova plugin add com.paypal.cordova.mobilesdk

include step is correct or wrong? is any sample code with IONIC? i cant understand how to start how to pass values.

Your link to paypal-mobile-js-helper.js in your index.html is wrong, you can’t refer plugins like you did. Installing the plugin should have copied thi file into your platforms under www/js, this is how it is defined in the plugin xml definition.

You should have this:

<script type="text/javascript" src="js/paypal-mobile-js-helper.js"></script>

If the file is missing from your platform, remove the platform and re-add it using cordova.

please could u help me how to create paypal app and steps for IONIC app?

    .constant('shopSettings',{
    
    payPalSandboxId : 'APP-80W284485P5195111', 
payPalProductionId : 'production id here', 
payPalEnv: 'PayPalEnvironmentSandbox', // for testing production for production 
payPalShopName : 'test app', 
payPalMerchantPrivacyPolicyURL : 'url to policy', 
payPalMerchantUserAgreementURL : ' url to user agreement ' });

what is the values for this from paypal? how to proceed this?

I am using Ionic2, and need to integrate PayPal into my app.

My app needs to be able to send and receive payments to/from other PayPal accounts.

Is there a way for a Mobile App (Facilitator) to allow a Payer to make a payment to a Payee?

I have looked at the PayPal API’s, and I can find how to facilitate a Payer to make a payment a Payee, if the Payee is the Facilitator. As then it can register the Payees PayPal client Id. But in my case, the Payee does not supply their PayPal client Id (Facilitator & Payee are separate entities). i.e. The Payee is another PayPal Account.

enter image description here

Thanks