I use ion 2
I had a problem sending multiple items to PayPalPayment. I tried this code below, which works fine without elements,
let payment = new PayPalPayment('3.33', 'USD', 'Description', 'sale'); PayPal.renderSinglePaymentUI(payment).then(() => { //response ... });
but it does not work if I put elements in it
let payment = new PayPalPayment('3.33', 'USD', 'Description', 'sale'); let items: PayPalItem[]; /** cart = [ { name: 'pen', qty: 12, price: '2.00'}, { name: 'pencil', qty: 2, price: '1.00' }, { name: 'box', qty: 1, price: '20.00' } ]; */ cart.forEach(x => { items.push(new PayPalItem(x.name, x.qty, x.price, "USD")); }); payment.items = items; PayPal.renderSinglePaymentUI(payment).then(() => { //response ... });
java cordova-plugins ionic-framework ionic2 paypal
Abdul rafay
source share