php - 自适应支付设置选项,receiver不能为null

标签 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你有一些引用。也许您看到了我没有看到的东西。

最佳答案

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

在我的例子中,我使用的是链式支付,我使用的是主要收款人的电子邮件。

关于php - 自适应支付设置选项,receiver不能为null,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14911058/

相关文章:

paypal - 有没有一种方法可以使客户从 paypal 购买东西自动化?

PHP - Paypal 自适应支付(延迟链式支​​付)

php - PayPal Express Checkout 项目名称和编号

php - 在 PHP 脚本中加载 Zend Framework 及其应用程序

php - JSON Ajax PHP MYSQL - 多条记录到 JSON

php - 在 PHP 中插入表格

php - 如何使当前页面具有不同的样式(PHP?page href)?

php - 我没有让 Paypal 交易变量正确返回?

paypal - 使用 Express Checkout 发送账单地址

php - PayPal 的 paymentExecStatus 值