Question

I have implemented the paypal sdk for parallel payment, when a user login to pay it shows a dropdown at the top showing all the receivers payment saperately. I want to remove the dropdown as its necessary in my app that paypal must show total payment instead of showing all the receivers payment individually(in red rectangle), I searched a lot for that but didn't find any solution can anybody suggest me for that.I am attaching screenshot so that it would be better to understand. below is the screenshot how paypal showing all the recievers amount.enter image description here

and below is that screenshot that how I want the total amount in my app enter image description here

below is the code that how I am doing parallel payment

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;
 }
Was it helpful?

Solution

It seems there is no way to do so (from what I've seen in the docs). If you want to prevent showing all the receivers, you can use Chained Payments instead of Parallel Payments.

OTHER TIPS

Try this

receiver2.setIsPrimary(true);

You can set its true so you can show only one email on screen.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top