我正在尝试按照文档中的说明禁用传送,但它不起作用。 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"
}
});
},
我是一名优秀的程序员,十分优秀!