【问题标题】:PayPal Orders API payment to a third party payeePayPal Orders API 向第三方收款人付款
【发布时间】:2020-03-22 14:53:30
【问题描述】:

我想方便向商家的 PayPal 帐户汇款。我在 PayPal 沙盒中创建了一个额外的企业帐户。我已作为收款人使用此帐户进行了订单调用。但是当我收到订单时(在付款人批准后),收款人仍然是我的演员帐户。我需要在沙箱中进行一些特殊配置吗?在生产中,预期收款人是否需要给我特殊权限?

Array
(
    [intent] => AUTHORIZE
    [application_context] => Array
        (
            [return_url] => http://example.com/cart/PP_Payment.php?success=true
            [cancel_url] => http://example.com/cart/PP_Payment.php?success=false
            [brand_name] => Company X
        )

    [payee] => Array
        (
            [email_address] => sb-u4hosest4@business.example.com
        )

    [inovoice_id] => 1-GD2U-70E7-4Y
    [items] => Array
        (
            [0] => Array
                (
                    [quantity] => 1
                    [name] => Rabenhorst Klostergarten BIO Mini
                    [unit_amount] => Array
                        (
                            [currency_code] => EUR
                            [value] => 1.04
                        )

                    [sku] => 97899
                )

            [1] => Array
                (
                    [quantity] => 1
                    [name] => Lupinen Filet
                    [unit_amount] => Array
                        (
                            [currency_code] => EUR
                            [value] => 3.87
                        )

                    [sku] => 66911
                )

            [2] => Array
                (
                    [quantity] => 1
                    [name] => Kühltasche/-akku
                    [unit_amount] => Array
                        (
                            [currency_code] => EUR
                            [value] => 6
                        )

                    [sku] => P002
                )

        )

    [purchase_units] => Array
        (
            [0] => Array
                (
                    [amount] => Array
                        (
                            [currency_code] => EUR
                            [value] => 15.86
                            [breakdown] => Array
                                (
                                    [item_total] => Array
                                        (
                                            [currency_code] => EUR
                                            [value] => 10.91
                                        )

                                    [shipping] => Array
                                        (
                                            [currency_code] => EUR
                                            [value] => 4.95
                                        )

                                )

                        )

                )

        )

)

结果:##########

Array
(
    [id] => 5KPxxxx
    [links] => Array
        (
            [0] => Array
                (
                    [href] => https://api.sandbox.paypal.com/v2/checkout/orders/5KPxxxx
                    [rel] => self
                    [method] => GET
                )

            [1] => Array
                (
                    [href] => https://www.sandbox.paypal.com/checkoutnow?token=5KPxxxx
                    [rel] => approve
                    [method] => GET
                )

            [2] => Array
                (
                    [href] => https://api.sandbox.paypal.com/v2/checkout/orders/5KPxxxx
                    [rel] => update
                    [method] => PATCH
                )

            [3] => Array
                (
                    [href] => https://api.sandbox.paypal.com/v2/checkout/orders/5KPxxxx/authorize
                    [rel] => authorize
                    [method] => POST
                )

        )

    [status] => CREATED
)

但是当我收到订单时,收款人是我而不是选定的第三方

Array
(
    [id] => 5KPxxxx
    [intent] => AUTHORIZE
    [purchase_units] => Array
        (
            [0] => Array
                (
                    [reference_id] => default
                    [amount] => Array
                        (
                            [currency_code] => EUR
                            [value] => 15.86
                            [breakdown] => Array
                                (
                                    [item_total] => Array
                                        (
                                            [currency_code] => EUR
                                            [value] => 10.91
                                        )

                                    [shipping] => Array
                                        (
                                            [currency_code] => EUR
                                            [value] => 4.95
                                        )

                                )

                        )

                    [payee] => Array
                        (
                            [email_address] => mike@www.org
                            [merchant_id] => FXXX
                            [display_data] => Array
                                (
                                    [brand_name] => Company X
                                )

                        )

                    [shipping] => Array
                        (
                            [name] => Array
                                (
                                    [full_name] => test buyer
                                )

                            [address] => Array
                                (
                                    [address_line_1] => ESpachstr. 1
                                    [admin_area_2] => Freiburg
                                    [admin_area_1] => Empty
                                    [postal_code] => 79111
                                    [country_code] => DE
                                )

                        )

                )

        )

    [payer] => Array
        (
            [name] => Array
                (
                    [given_name] => test
                    [surname] => buyer
                )

            [email_address] => mt-buyer@w3xxx.org
            [payer_id] => 4xxx
            [address] => Array
                (
                    [country_code] => DE
                )

        )

    [create_time] => 2020-03-22T09:32:48Z
    [links] => Array
        (
            [0] => Array
                (
                    [href] => https://api.sandbox.paypal.com/v2/checkout/orders/5KPxxxx
                    [rel] => self
                    [method] => GET
                )

            [1] => Array
                (
                    [href] => https://api.sandbox.paypal.com/v2/checkout/orders/5KPxxxx/authorize
                    [rel] => authorize
                    [method] => POST
                )

        )

    [status] => APPROVED
)

【问题讨论】:

    标签: api paypal


    【解决方案1】:
     [payee] => Array
            (
                [email_address] => sb-u4hosest4@business.example.com
            )
    

    此收款人将被忽略,因为它不在 purchase_units 对象中。

    请参阅the documentation 中的示例。


    虽然您可以肯定地执行 intent:CAPTURE,但另一个考虑因素是在没有权限的情况下可能不支持 intent:AUTHORIZE(以及后来的捕获)。

    【讨论】:

      猜你喜欢
      • 2019-01-28
      • 2013-08-29
      • 2021-08-08
      • 2021-03-16
      • 2020-03-10
      • 2015-12-25
      • 1970-01-01
      • 2013-06-25
      • 1970-01-01
      相关资源
      最近更新 更多