简体   繁体   中英

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.

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 . 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.

Then you would redirect to PayPal after that, and it should show you what you're after.

With Adaptive Payments, the item details you set with SetPaymentOptions are only displayed to the customer via Embedded flow. 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/

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
        }

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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