【问题标题】:PayPal Adaptive Payments - Product NamePayPal 自适应支付 - 产品名称
【发布时间】:2015-08-03 01:58:26
【问题描述】:

我正在为我的网站使用 paypal 自适应付款。我有很多卖家和不同的产品。当我作为用户尝试从我的网站购买任何产品时,我在 Paypal 表单摘要中看不到产品名称,而是卖家的姓名和姓氏。

请告诉我使用哪个参数来传递产品名称..

这是截图

【问题讨论】:

  • 请展示您的代码示例,显示您传递给 PayPal 的内容(删除任何安全的内容)。

标签: php paypal paypal-adaptive-payments


【解决方案1】:

使用自适应付款,您无法在付款请求本身中发送逐项详细信息。相反,您必须像往常一样拨打 Pay,然后拨打 SetPaymentOptions。这样,您将传递从 Pay 请求中返回的 PayKey,然后您可以设置所有其他详细信息,例如 SetPaymentsOptions 提供的详细信息。

然后你会重定向到 PayPal,它应该会告诉你你在做什么。

【讨论】:

  • 在重定向到 Paypal 之前我已经调用了 SetPaymentOptions 但没有成功。这是我的代码:codeshare.io/Ilvt0
  • 最后我看到您正在设置 $detailsPacket 并将其传递给 SetPaymentOptions 调用,但这看起来不像 SetPaymentOptions 附带的任何参数。我在这里看不到任何实际的逐项详细信息,而且 $detailsPacket 看起来只有常规的支付请求参数。 Here's a raw XML request for SetPaymentOptions。我在您的设置中没有看到任何类似的参数..??
  • 您好!我也有同样的问题。在我设置接收选项以显示逐项项目后,它似乎确实在贝宝网页屏幕上显示了它们。这是我使用的代码。 codeshare.io/Aq1pk 。来自 Paypal API 的响应显示“成功”。我在这里错过了什么吗?
【解决方案2】:

使用自适应付款,您使用 SetPaymentOptions 设置的项目详细信息仅通过嵌入式流程向客户显示。 嵌入式流程对结帐页面使用灯箱或迷你浏览器。

这里有一个关于如何在你的前端页面中实现嵌入流的技术说明,https://developer.paypal.com/docs/classic/adaptive-payments/ht_ap-embeddedPayment-curl-etc/

【讨论】:

    【解决方案3】:

    我也有同样的问题。看起来它只适用于嵌入式支付流程

    Embedded Payment Flow Using Adaptive Payments

        $receiverOptions = new PayPal\Types\AP\ReceiverOptions();
        $setPaymentOptionsRequest->receiverOptions[] = $receiverOptions;
    
        $receiverOptions->description = 'Description';
    
        $invoiceItems = array();
        $item = new PayPal\Types\AP\InvoiceItem();
    
        $item->name = 'Item Name'; 
        $item->price = 10;
        $item->itemPrice = 10;
        $item->itemCount = 1;
    
        $invoiceItems[] = $item;
    
        $receiverOptions->invoiceData = new PayPal\Types\AP\InvoiceData();
        $receiverOptions->invoiceData->item = $invoiceItems;
    
        $receiverId = new PayPal\Types\AP\ReceiverIdentifier(); 
        $receiverId->email = 'email@domain.com';//Change it
        $receiverOptions->receiver = $receiverId;
    
    
        $setPaymentOptionsRequest->payKey = $_POST['payKey'];
    
            $servicePaymentOptions = new PayPal\Service\AdaptivePaymentsService($config);
            try {
                /* wrap API method calls on the service object with a try catch */
                $responsePaymentOptions = $servicePaymentOptions->SetPaymentOptions($setPaymentOptionsRequest);
    
                print_r($responsePaymentOptions); die;
            } catch(Exception $ex) {
                //error
            }
    
            if (isset($responsePaymentOptions) && $responsePaymentOptions->responseEnvelope->ack == "Success")
            {
                //Success
            }
    

    【讨论】:

      猜你喜欢
      • 2018-09-05
      • 2013-07-07
      • 2015-07-19
      • 2021-08-04
      • 2014-10-13
      • 2013-11-10
      • 2013-11-07
      • 2014-01-23
      • 2012-03-21
      相关资源
      最近更新 更多