如何为本地提款配置贝宝智能付款按钮?

时间:2020-03-25 13:45:02

标签: paypal

我想使用PayPal在餐厅网站上付款以本地取货或送货。我的代码似乎可以交付使用,但是我不知道如何使用本地取件。 documentation提到了一个名为shipping_type的属性,可以将其设置为“ PICKUP”,但尚不清楚在何处设置该属性。

当我使用以下JSON对象调用actions.order.create时,PayPal仍会告诉用户选择送货地址:

{
    shipping: {shipping_type: "PICKUP", type: "PICKUP"},
    shipping_type: "PICKUP",
    shipping_option: {type: "PICKUP"},
    "application_context": {
        "payment_method": { "payee_preferred": "IMMEDIATE_PAYMENT_REQUIRED" }
    },
    "purchase_units": [ {
        "shipping": { "option": { "type": "PICKUP" } },
        "shipping_option": { "type": "PICKUP" },
        "application_context": { "payment_method": { "payee_preferred": "IMMEDIATE_PAYMENT_REQUIRED" } },
        "items": [
            { "name": "XXL Hamburger", "unit_amount": { "currency_code": "EUR", "value": "11.50" }, "quantity": 1 },
            { "name": "XXL Rumpsteak", "unit_amount": { "currency_code": "EUR", "value": "24.90" }, "quantity": 1 }
        ],
        "amount": {
            "currency_code": "EUR",
            "value": "36.40",
            "breakdown": { "item_total": { "currency_code": "EUR", "value": "36.40" } }
        }
    } ]
}

有人有可行的例子吗?

顺便说一句:测试我的代码时,尚不清楚IMMEDIATE_PAYMENT_REQUIRED是否在做某事。

1 个答案:

答案 0 :(得分:0)

PayPal仍然告诉用户选择收货地址

要在PayPal交易中没有送货地址,请use

    application_context: {
        shipping_preference: 'NO_SHIPPING'
    }