简体   繁体   English

贝宝自适应支付-产品名称

[英]PayPal Adaptive Payments - Product Name

I am using paypal adaptive payments for my website. 我正在为我的网站使用贝宝自适应支付。 I have many sellers and different products. 我有很多卖家和不同的产品。 when I am as a user try to buy any product from my website then I can't see product name in Paypal form summary instead there is the name and surname of the seller. 当我作为用户尝试从我的网站上购买任何产品时,我在Paypal表单摘要中看不到产品名称,而是有卖方的名称和姓氏。

Let me know please which parameter is being used to Pass product name .. 请让我知道用于传递产品名称的参数。

Here is the screenshot 这是屏幕截图

在此处输入图片说明

With Adaptive Payments you can't send itemized details in the Pay request itself. 使用自适应付款,您无法在“付款”请求本身中发送逐项明细。 Instead, you have to call Pay like usual, but then follow that up with a call to SetPaymentOptions . 取而代之的是,您必须像往常一样调用Pay,然后再调用SetPaymentOptions With that you'll pass in the PayKey you get back from the Pay request, and then you can setup all the additional details like itemized info that SetPaymentsOptions provides. 这样,您将传递PayKey,从Pay请求中取回,然后可以设置所有其他详细信息,例如SetPaymentsOptions提供的逐项信息。

Then you would redirect to PayPal after that, and it should show you what you're after. 然后,您将在此之后重定向到PayPal,它应显示您要处理的内容。

With Adaptive Payments, the item details you set with SetPaymentOptions are only displayed to the customer via Embedded flow. 使用自适应付款时,您通过SetPaymentOptions设置的商品详细信息仅通过嵌入式流程显示给客户。 The Embedded flow uses either a lightbox or a minibrowser for the checkout pages. 嵌入式流程对结帐页面使用灯箱或微型浏览器。

Here's a technical instruction on how to implement the embedded flow in your front-end page, https://developer.paypal.com/docs/classic/adaptive-payments/ht_ap-embeddedPayment-curl-etc/ 这是有关如何在前端页面中实现嵌入式流程的技术说明, 网址为https://developer.paypal.com/docs/classic/adaptive-payments/ht_ap-embeddedPayment-curl-etc/

I am having the same issue. 我有同样的问题。 It looks like it works only in an Embedded Payment Flow . 看起来它仅在嵌入式付款流程中有效

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
        }

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM