paypay并行支付是不是将邮件发送到android sdk中的接收者?

Posted

技术标签:

【中文标题】paypay并行支付是不是将邮件发送到android sdk中的接收者?【英文标题】:Does paypay parallel payment sends mail to receiver in android sdk?paypay并行支付是否将邮件发送到android sdk中的接收者? 【发布时间】:2014-04-27 06:45:37 【问题描述】:

我已经集成了 paypal sdk 以进行并行支付,我做了所有事情并向两个不同的收款人付款。当我付款时,我收到了成功的付款信息,并且我收到了 PayKey,我的问题是我没有在我附加到两个收件人的任何其他电子邮件上收到付款邮件。 贝宝是否在并行付款中向接收方发送邮件,或者我必须在我的代码中做一些额外的事情。 下面是我使用的代码

private PayPalAdvancedPayment exampleParallelPayment() 
  // Create the PayPalAdvancedPayment.
  PayPalAdvancedPayment payment = new PayPalAdvancedPayment();
  // Sets the currency type for this payment.
  payment.setCurrencyType("USD");
  // Sets the Instant Payment Notification url. This url will be hit by
  // the PayPal server upon completion of the payment.
  payment.setIpnUrl("http://www.exampleapp.com/ipn");
  // Sets the memo. This memo will be part of the notification sent by
  // PayPal to the necessary parties.
  payment.setMemo("This sure is a swell memo for a parallel payment.");

  // Create the PayPalReceiverDetails. You must have at least one of these
  // to make an advanced payment and you should have
  // more than one for a Parallel or Chained payment.
  PayPalReceiverDetails receiver1 = new PayPalReceiverDetails();
  // Sets the recipient for the PayPalReceiverDetails. This can also be a
  // phone number.
  receiver1.setRecipient("manishkh92@gmail.com");
//  receiver1.setRecipient("example-merchant-2@paypal.com");
  // Sets the subtotal of the payment for this receiver, not including tax
  // and shipping amounts.
  receiver1.setSubtotal(new BigDecimal("13.50"));
  // Sets the primary flag for this receiver. This is defaulted to false.
  // No receiver can be a primary for a parallel payment.
  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);

  // PayPalInvoiceData can contain tax and shipping amounts. It also
  // contains an ArrayList of PayPalInvoiceItem which can
  // be filled out. These are not required for any transaction.
  PayPalInvoiceData invoice1 = new PayPalInvoiceData();
  // Sets the tax amount.
  invoice1.setTax(new BigDecimal("2.20"));
  // Sets the shipping amount.
  invoice1.setShipping(BigDecimal.ZERO);

  // PayPalInvoiceItem has several parameters available to it. None of
  // these parameters is required.
  PayPalInvoiceItem item1 = new PayPalInvoiceItem();
  // Sets the name of the item.
  item1.setName("Laser Show");
  // Sets the ID. This is any ID that you would like to have associated
  // with the item.
  item1.setID("4211");
  // Sets the total price which should be (quantity * unit price). The
  // total prices of all PayPalInvoiceItem should add up
  // to less than or equal the subtotal of the payment.
  item1.setTotalPrice(new BigDecimal("7.30"));
  // Sets the unit price.
  item1.setUnitPrice(new BigDecimal("7.30"));
  // Sets the quantity.
  item1.setQuantity(1);
  // Add the PayPalInvoiceItem to the PayPalInvoiceData. Alternatively,
  // you can create an ArrayList<PayPalInvoiceItem>
  // and pass it to the PayPalInvoiceData function setInvoiceItems().
  invoice1.getInvoiceItems().add(item1);

  // Create and add another PayPalInvoiceItem to add to the
  // PayPalInvoiceData.
  PayPalInvoiceItem item2 = new PayPalInvoiceItem();
  item2.setName("Fog Machine");
  item2.setID("6325");
  item2.setTotalPrice(new BigDecimal("4.80"));
  item2.setUnitPrice(new BigDecimal("1.20"));
  item2.setQuantity(4);
  invoice1.getInvoiceItems().add(item2);

  // Create and add another PayPalInvoiceItem to add to the
  // PayPalInvoiceData.
  PayPalInvoiceItem item3 = new PayPalInvoiceItem();
  item3.setName("Fog Liquid");
  item3.setID("2196");
  item3.setTotalPrice(new BigDecimal("1.40"));
  item3.setUnitPrice(new BigDecimal("0.20"));
  item3.setQuantity(7);
  invoice1.getInvoiceItems().add(item3);

  // Sets the PayPalReceiverDetails invoice data.
  receiver1.setInvoiceData(invoice1);
  // Sets the merchant name. This is the name of your Application or
  // Company.
  receiver1.setMerchantName("Laser Shop");
  // Sets the description of the payment.
  receiver1.setDescription("The first of two party guys");
  // Sets the Custom ID. This is any ID that you would like to have
  // associated with the PayPalReceiverDetails.
  receiver1.setCustomID("001813");
  // Add the receiver to the payment. Alternatively, you can create an
  // ArrayList<PayPalReceiverOptions>
  // and pass it to the PayPalAdvancedPayment function setReceivers().
  payment.getReceivers().add(receiver1);

  // Create another receiver for the parallel payment
  PayPalReceiverDetails receiver2 = new PayPalReceiverDetails();
  receiver2.setRecipient("kumawat.rahul10@gmail.com");
  receiver2.setSubtotal(new BigDecimal("16.00"));
  receiver2.setIsPrimary(false);
  receiver2.setPaymentType(PayPal.PAYMENT_TYPE_GOODS);

  // PayPalInvoiceData can contain tax and shipping amounts. It also
  // contains an ArrayList of PayPalInvoiceItem which can
  // be filled out. These are not required for any transaction.
  PayPalInvoiceData invoice2 = new PayPalInvoiceData();
  // Sets the tax amount.
  invoice2.setTax(new BigDecimal("3.40"));
  // Sets the shipping amount.
  invoice2.setShipping(new BigDecimal("5.15"));

  // PayPalInvoiceItem has several parameters available to it. None of
  // these parameters is required.
  PayPalInvoiceItem item4 = new PayPalInvoiceItem();
  // Sets the name of the item.
  item4.setName("Beverages");
  // Sets the ID. This is any ID that you would like to have associated
  // with the item.
  item4.setID("7254");
  // Sets the total price which should be (quantity * unit price). The
  // total prices of all PayPalInvoiceItem should add up
  // to less than or equal the subtotal of the payment.
  item4.setTotalPrice(new BigDecimal("11.00"));
  // Sets the unit price.
  item4.setUnitPrice(new BigDecimal("1.00"));
  // Sets the quantity.
  item4.setQuantity(11);
  // Add the PayPalInvoiceItem to the PayPalInvoiceData. Alternatively,
  // you can create an ArrayList<PayPalInvoiceItem>
  // and pass it to the PayPalInvoiceData function setInvoiceItems().
  invoice2.getInvoiceItems().add(item4);

  // Create and add another PayPalInvoiceItem to add to the
  // PayPalInvoiceData.
  PayPalInvoiceItem item5 = new PayPalInvoiceItem();
  item5.setName("Refreshments");
  item5.setID("1288");
  item5.setTotalPrice(new BigDecimal("5.00"));
  item5.setUnitPrice(new BigDecimal("1.25"));
  item5.setQuantity(4);
  invoice2.getInvoiceItems().add(item5);

  // Sets the PayPalReceiverDetails invoice data.
  receiver2.setInvoiceData(invoice2);
  // Sets the merchant name. This is the name of your Application or
  // Company.
  receiver2.setMerchantName("Drinks & Refreshments");
  // Sets the description of the payment.
  receiver2.setDescription("The second of two party guys");
  // Sets the Custom ID. This is any ID that you would like to have
  // associated with the PayPalReceiverDetails.
  receiver2.setCustomID("001768");
  payment.getReceivers().add(receiver2);

  return payment;
 

【问题讨论】:

PayPalAdvancedPayment 没有得到我的 sdk。你能知道你使用的是哪个版本的 sdk。 【参考方案1】:

您是否在沙盒中工作?如果是这样,它将不会发送实际的电子邮件。相反,您可以查看 developer.paypal.com 帐户中沙盒配置文件下的通知链接。通常会发送的任何电子邮件都应显示在每个单独的帐户中。

【讨论】:

PayPalAdvancedPayment 没有得到我的 sdk。你能知道你使用的是哪个版本的 sdk。

以上是关于paypay并行支付是不是将邮件发送到android sdk中的接收者?的主要内容,如果未能解决你的问题,请参考以下文章

PayPal 并行支付 IPN

发送电子邮件,当支付宝付款时

消息队列应用场景

为什么要使用MQ消息中间件?它解决了什么问题?

payjs可靠吗?

消息队列使用的四种场景介绍(准载)