1

这是我设置付款选项的请求对象。

SetPaymentOptionsRequest Object
(
    [requestEnvelope] => RequestEnvelope Object
        (
            [detailLevel] => 
            [errorLanguage] => en_US
        )

    [payKey] => AP-0MG8529097707340X
    [initiatingEntity] => 
    [displayOptions] => 
    [shippingAddressId] => 
    [senderOptions] => 
    [receiverOptions] => Array
        (
            [0] => ReceiverOptions Object
                (
                    [description] => 
                    [customId] => 
                    [invoiceData] => InvoiceData Object
                        (
                            [item] => Array
                                (
                                    [0] => InvoiceItem Object
                                        (
                                            [name] => my Item
                                            [identifier] => 1
                                            [price] => 138
                                            [itemPrice] => 69
                                            [itemCount] => 2
                                        )

                                )

                            [totalTax] => 
                            [totalShipping] => 
                        )

                    [receiver] => ReceiverIdentifier Object
                        (
                            [email] => test@test.com
                            [phone] => 
                        )

                    [referrerCode] => 
                )

        )

)

我按照 sdk 示例进行操作,但收到此错误响应

SetPaymentOptionsResponse Object
(
    [responseEnvelope] => ResponseEnvelope Object
        (
            [timestamp] => 2013-02-16T05:38:38.298-08:00
            [ack] => Failure
            [correlationId] => f17a8e24e1375
            [build] => 4992011
        )

    [error] => Array
        (
            [0] => ErrorData Object
                (
                    [errorId] => 580022
                    [domain] => PLATFORM
                    [subdomain] => Application
                    [severity] => Error
                    [category] => Application
                    [message] => Invalid request parameter: receiverOption.receiver(0).email
                    [exceptionId] => 
                    [parameter] => Array
                        (
                            [0] => ErrorParameter Object
                                (
                                    [name] => 
                                    [value] => receiverOption.receiver(0).email
                                )

                            [1] => ErrorParameter Object
                                (
                                    [name] => 
                                    [value] => test@test.com
                                )

                        )

                )

        )

)

如果我不设置电子邮件,错误将变为Invalid request parameter: receiver cannot be null
Edit : Here and here you have some reference。也许你看到了我没有看到的东西。

4

2 回答 2

0

我遇到了同样的问题,发现您需要为接收者提供一个有效的电子邮件地址SetPaymentOptions才能成功。

就我而言,我使用的是链式付款,并且我使用主要接收者的电子邮件。

于 2013-02-27T16:24:48.373 回答
0

我有同样的问题。尝试使用命名空间实例化 Receiver 类

$receiver[0] = new PayPal\Types\AP\Receiver();

它对我有用。

于 2015-09-19T21:00:14.263 回答