[英]Getting error when reloading the Commerce.js Checkout page (react tutorial)
[英]how to create extra field when capturing checkout in commerce js
我在我的网站上使用 commerce js,我想创建一个额外的字段来从用户那里获取电话号码,但 commerce js 没有任何关于 extra_field 的文档。 谁能告诉我如何添加它
我还在 commerce js 仪表板中创建了额外的字段
这是我的订单数据 object
const orderData = {
line_items: checkoutToken.line_items,
customer: {
firstname: shippingData.firstName,
lastname: shippingData.lastName,
email: shippingData.email,
},
shipping: {
name: "International",
street: shippingData.address1,
town_city: shippingData.city,
county_state: shippingData.shippingSubdivision,
postal_zip_code: shippingData.zip,
country: shippingData.shippingCountry,
},
fulfillment: { shipping_method: shippingData.shippingOption },
payment: {
gateway: "stripe",
stripe: {
payment_method_id: paymentMethod.id,
},
},
extra_fields: {
contact: shippingData.contact,//its not working
}
};
捕获订单时,提供 extra_fields object,每个额外字段 ID 作为键和您要使用的值。
extra_fields: { [extraFieldId]: '你的自定义字段值' }
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.