PayPal and ionic

I am wondering what is the Paypal sdk that is being implemented in cordova?

Is it Mobile sdk ios and android or v.zero sdks?

If its is mobile sdk, I am not sure what is the client id that I need to use in

PayPal.init({
        "PayPalEnvironmentProduction": "YOUR_PRODUCTION_CLIENT_ID",
        "PayPalEnvironmentSandbox": "sandbox client id"
        })

I went to developer portal and created a sandbox id for REST API, I assumed based on their docs that mobile sdk use this. Since I could see only v.zero and REST API setup, no mobile sdk setup options available.

Also I am not sure how to implement single payments as well.
initiatePayment(){

    this.paymentdata = new PayPalPayment("10.00","SGD", "MMS tickets", "MMS sale");

    PayPal.renderSinglePaymentUI(this.paymentdata)
    .then(onSuccess => {
         console.log('OnSuccess Render: ' + JSON.stringify(onSuccess));
         alert('OnSuccess Render: ' + JSON.stringify(onSuccess));
       })
    .catch(onError=> {
       console.log('onError Render: ' + JSON.stringify(onError));
       alert('onError Render: ' + JSON.stringify(onError));
         });
}

I tried this but this gives JSON error on render, not sure what is happening and how to debug.

iā€™m getting some issues too.

This works like charm with ionic-native 2.2.2 thanks to @ihadeed to for doing fixes to ionic-native library.

1 Like

upgrade to recent ionic-native and follow the sample in ionic native site.

1 Like

How to get these credential-
PayPalEnvironmentProduction
PayPalEnvironmentSandbox
in paypal
Please help me for this