8
我使用的離子2離子2貝寶插件
我有問題發送多個項目PayPalPayment我曾經嘗試這樣做下面的代碼它的工作沒有物品罰款,
let payment = new PayPalPayment('3.33', 'USD', 'Description', 'sale');
PayPal.renderSinglePaymentUI(payment).then(() => {
//response ...
});
,但它不是運作良好,如果我把物品放在裏面
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文件有多個項目數組 –