gpt4 book ai didi

vue.js - 使用 paypal API v2 不送货

转载 作者:太空宇宙 更新时间:2023-11-03 16:39:22 28 4
gpt4 key购买 nike

我正在尝试按照文档中的说明禁用传送,但它不起作用。 Screen

文档:https://developer.paypal.com/docs/api/orders/v2/#definition-order_application_context

 createOrder: (data, actions) => {
return actions.order.create({
purchase_units: [
{
description: "global description",
items: [
{
name: "aaa",
quantity: 1,
unit_amount: { currency_code: "EUR", value: 10 }
},
{
name: "bbb",
quantity: 2,
unit_amount: { currency_code: "EUR", value: 10 }
}
],
amount: {
currency_code: "EUR",
value: 30,
breakdown: {
item_total: {
currency_code: "EUR",
value: 30
}
}
},
order_application_context: {
shipping_preference: "NO_SHIPPING"
}
}
]
});

同样的问题:

application_context: {
shipping_preference: "NO_SHIPPING"
}

最佳答案

您必须像这样将 application_context 放在 purchase_units 之外

 createOrder: (data, actions) => {
return actions.order.create({
purchase_units: [
{
description: "global description",
items: [
{
name: "aaa",
quantity: 1,
unit_amount: { currency_code: "EUR", value: 10 }
},
{
name: "bbb",
quantity: 2,
unit_amount: { currency_code: "EUR", value: 10 }
}
],
amount: {
currency_code: "EUR",
value: 30,
breakdown: {
item_total: {
currency_code: "EUR",
value: 30
}
}
},
}
],
application_context: {
shipping_preference: "NO_SHIPPING"
}
});
},

关于vue.js - 使用 paypal API v2 不送货,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58149477/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com