繁体   English   中英

PayPal REST API v1 的付款问题

[英]Payment issue with PayPal REST API v1

我已经将 PayPal REST API v1 用于前段时间部署的客户端,并且一直运行良好。

今天,我注意到 API 集成自 2019 年 9 月 16 日以来一直没有工作。

自部署以来代码没有更改,但没有提交通过,尽管 API 仍然成功地从 PayPal 接收访问令牌。

以下是我通过 CURL PHP ( https://api.paypal.com/v1/payments/payment ) 发送到 PayPal 的 POST 数据

{
    "intent": "sale",
    "payer": {
        "payment_method": "paypal"
    },
    "application_context": {
        "brand_name": "[[REDACTED]]",
        "locale": "GB",
        "landing_page": "login",
        "shipping_preference": "NO_SHIPPING",
        "user_action": "user_action=commit"
    },
    "transactions": [{
        "amount": {
            "total": "0.01",
            "currency": "GBP"
        },
        "payee": {
            "email": "[[REDACTED]]"
        },
        "description": "Test donation.",
        "item_list": {
            "items": [{
                "name": "Test donation.",
                "description": "",
                "quantity": "1",
                "price": "0.01",
                "currency": "GBP"
            }]
        },
        "note_to_payee": "",
        "payment_options": {
            "allowed_payment_method": "INSTANT_FUNDING_SOURCE"
        }
    }],
    "redirect_urls": {
        "return_url": "[[REDACTED]]",
        "cancel_url": "[[REDACTED]]"
    }
}

PayPal的回复如下:

{
    "name": "VALIDATION_ERROR",
    "message": "Invalid request - see details",
    "debug_id": "[[REDACTED]]",
    "information_link": "https:\/\/developer.paypal.com\/docs\/api\/payments\/#errors",
    "details": [{
        "field": "application_context.user_action",
        "location": "body",
        "issue": "{InvalidUserAction}"
    }]
}

查看文档,我用于application_context.user_action的值是正确的。 我知道 API 已被弃用,但没有提到 API 不起作用。

原始文档的规范奇怪地重复

如果您现在将其更改为"user_action": "commit"什么?

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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