gpt4 book ai didi

android - (ANDROID PAYPAL SDK) 如何在PayPalPayment方法中添加PayPalReceiverDetails?

转载 作者:太空宇宙 更新时间:2023-11-03 16:11:01 24 4
gpt4 key购买 nike

如何在 PayPalPayment 对象中添加 PayPalReceiverDetails 对象

因为 PayPalPayment 中没有方法 `getReceivers().add(PayPalReceiverDetails),

这是我的代码:

PayPalPayment payPalPayment = new PayPalPayment();
payPalPayment.setCurrencyType("USD");
payPalPayment.setRecipient("example-merchant-1@paypal.com");
payPalPayment.setSubtotal(new BigDecimal("1.00"));
payPalPayment.setPaymentType(PayPal.PAYMENT_TYPE_GOODS);
PayPalInvoiceData invoiceData = new PayPalInvoiceData();
invoiceData.setTax(new BigDecimal("0.00"));
invoiceData.setShipping(new BigDecimal("0.00"));
PayPalInvoiceItem invoiceItem = new PayPalInvoiceItem();
invoiceItem.setName("Samsung Gallexy S4 toy");
invoiceItem.setID("87238");
invoiceItem.setTotalPrice(new BigDecimal("1.00"));
invoiceItem.setUnitPrice(new BigDecimal("1.00"));
invoiceItem.setQuantity(1);
invoiceData.getInvoiceItems().add(invoiceItem);
payPalPayment.setInvoiceData(invoiceData);
payPalPayment.setMerchantName("The Store");
payPalPayment.setDescription("Pay Pal Example");
payPalPayment.setCustomID("1212121212");
payPalPayment.setIpnUrl("http://www.Test.com/ipn");
payPalPayment.setMemo("Test MEMO");
Intent chckoutIntent = PayPal.getInstance().checkout(payPalPayment, MainActivity.this,new ResultDelegate());
startActivityForResult(chckoutIntent, requestCode);

最佳答案

我用一个 Receiver 创建了这个。

    PayPalPayment newPayment = new PayPalPayment();
newPayment.setSubtotal(new BigDecimal(1));
newPayment.setCurrencyType("USD");
newPayment.setRecipient("validPaypalEmailaccount");
newPayment.setMerchantName("My Company");
Intent paypalIntent = PayPal.getInstance().checkout ( newPayment , PaypalDetailImplementation.this , adjustclass , new ResultDelegate()) ;

startActivityForResult(paypalIntent,request );

关于android - (ANDROID PAYPAL SDK) 如何在PayPalPayment方法中添加PayPalReceiverDetails?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15948207/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com