设置自适应支付选项,接收方不能为空

时间:2013-02-16 13:56:57

标签: php paypal paypal-adaptive-payments

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

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
编辑Herehere您有一些参考。也许你看到我没有看到的东西。

1 个答案:

答案 0 :(得分:0)

我遇到了同样的问题,发现您需要为接收方提供有效的电子邮件地址,以便SetPaymentOptions来电成功。

在我的情况下,我使用链式付款,我使用主要接收者的电子邮件。