我已经实现了paypal sdk用于并行支付,当用户登录支付它时,会在顶部显示一个下拉列表,显示所有接收者付款。我想在我的应用程序中移除下拉列表,因为paypal必须显示总付款而不是单独显示所有接收者付款(红色矩形),我搜索了很多但是没有找到任何解决方案任何人都可以建议我我正在附上截图,以便更好地理解。 下面是paypal显示所有接收者金额的截图。
以下是我想要的应用程序总金额截图
下面是我如何进行并行付款的代码
private PayPalAdvancedPayment exampleParallelPayment() {
float totalAmount = GlobalConfiguration.amountToPay;
float receiver_one_amount = 0;
float receiver_two_amount = 0;
if (totalAmount < 10) {
receiver_one_amount = (float) (totalAmount * 50) / 100;
receiver_two_amount = totalAmount - receiver_one_amount;
}
PayPalAdvancedPayment payment = new PayPalAdvancedPayment();
payment.setCurrencyType("USD");
payment.setIpnUrl("http://www.bella.com/ipn");
payment.setMemo("This sure is a swell memo for a parallel payment.");
// Create first receiver for the parallel payment
PayPalReceiverDetails receiver1 = new PayPalReceiverDetails();
receiver1.setRecipient("sellertest@ninehertz.com");
receiver1.setSubtotal(new BigDecimal("" + receiver_two_amount));
receiver1.setIsPrimary(false);
// Sets the payment type. This can be PAYMENT_TYPE_GOODS,
// PAYMENT_TYPE_SERVICE, PAYMENT_TYPE_PERSONAL, or PAYMENT_TYPE_NONE.
receiver1.setPaymentType(PayPal.PAYMENT_TYPE_GOODS);
payment.getReceivers().add(receiver1);
// Create second receiver for the parallel payment
PayPalReceiverDetails receiver2 = new PayPalReceiverDetails();
receiver2.setRecipient("manish.agrawal@ninehertzindia.com");
receiver2.setSubtotal(new BigDecimal("" + receiver_one_amount));
receiver2.setIsPrimary(false);
receiver2.setPaymentType(PayPal.PAYMENT_TYPE_GOODS);
payment.getReceivers().add(receiver2);
return payment;
}
答案 0 :(得分:1)
似乎没有办法这样做(根据我在文档中看到的内容)。如果您想阻止显示所有接收者,您可以使用链式支付而不是并行支付。
答案 1 :(得分:0)
试试这个
receiver2.setIsPrimary(true);
您可以将其设置为true,这样您就可以在屏幕上只显示一封电子邮件。