Paypal REST Api payment_term 格式

标签 paypal

我正在尝试使用 Paypal REST API 在发票上设置付款条款的日期。

它说的格式是这样的

Date on which invoice payment is due. It must be always a future date. Date format yyyy-MM-dd z, as defined in ISO8601.

我如何使用 PHP 创建这个日期,我已经尝试了很多变体,但我似乎无法让它工作。是“z”让我感到震惊。

非常感谢。

利亚姆

发送的数据

{
    "number":"2",
    "merchant_info":{
        "email":"xxx@xxx.com",
        "business_name":"xxx",
        "phone":{
            "country_code":34,
            "national_number":"969696969"
        },
        "address":{
            "line1":"xxx",
            "city":"xxxx",
            "state":"xxxx",
            "postal_code":"xxxx",
            "country_code":"ES"
        }
    },
    "billing_info":[
        {
            "email":"xxxx@xxx.com",
            "first_name":"xxx",
            "address":{
                "line1":"xxx",
                "city":"xxx",
                "state":"xxx",
                "postal_code":"xxx ",
                "country_code":"ES"
            }
        }
    ],
    "shipping_info":{
        "first_name":"xxx@xxx.com",
        "address":{
            "line1":"xxx xxx xxx",
            "city":"xxx",
            "state":"xxx",
            "postal_code":"xxx ",
            "country_code":"ES"
        }
    },
    "items":[
        {
            "name":"www ",
            "quantity":"1",
            "description":"www",
            "unit_price":{
                "currency":"EUR",
                "value":"11.66"
            }
        },
        {
            "name":"www",
            "quantity":"1",
            "description":"www",
            "unit_price":{
                "currency":"EUR",
                "value":"4.67"
            }
        },
        {
            "name":"www",
            "quantity":"1",
            "description":"www",
            "unit_price":{
                "currency":"EUR",
                "value":"3.11"
            }
        }
    ],
    "note":"Payment is to made with 7 Days",
    "payment_term":{
        "due_date":"2015-02-10 z"
    },
    "merchant_preferences":{
        "return_url":"http:\/\/google.co.uk",
        "cancel_url":"http:\/\/google.co.uk"
    }
}

收到的响应是错误 400。

{
    "name":"VALIDATION_ERROR",
    "message":"Invalid request - see details.",
    "debug_id":"8344d1d69459e",
    "details":[
        {
            "field":"payment_term",
            "issue":"either term type or, due date is required."
        },
        {
            "field":"payment_term.due_date",
            "issue":"only date value with 'yyyy-MM-dd z' format is allowed."
        }
    ]
}    

为了便于阅读,EdSF 在下面正确地回答了这个问题

使用

date('Y-m-d e');

最佳答案

为了便于阅读,EdSF 正确回答了这个问题

使用

date('Y-m-d e');

关于 Paypal REST Api payment_term 格式,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28427985/

相关文章:

paypal - PayPal 'cancel' 工作流程中的用户没有 'Donate' 选项

paypal - 如何将网站中的用户名链接到 PayPal 信息电子邮件?

python - Django 在外出进行 paypal 付款时保持登录丢失

javascript - 如何制作类似 Paypal 的星巴克小部件?

variables - Paypal ipn/购物车变量

php - 保护 PayPal 捐赠表格免受 XSS - CodeIgniter

javascript - 基本 PayPal Checkout 按钮在 Firefox 中给出 500 内部服务器错误

ruby-on-rails - 如何使用 Rails Invoice SDK 插入 X-PAYPAL header ?

php - 实现 Payum/Laravel 循环支付

php - IPN 验证 ipnSimulator 无效