您好,我是从事大型商业活动的新手。 现在,我正在使用checkout sdk更新单页签出。到目前为止,一切正常,我正在遵循git hub的实施说明。但是问题是更新客户的送货地址后,需要选择送货选项。我正在使用这种语法
const saddress = {
address1: $('#shippingaddress').val(),
address2: "",
city: $('#shippingcity').val(),
company: "",
country: $('#shippingcountry').val(),
countryCode: "AU",
customFields: [],
email: $('#email').val(),
firstName: $('#shippingfname').val(),
lastName:$('#shippinglname').val(),
phone: $('#shippingphone').val(),
postalCode: $('#shippingzip').val(),
stateOrProvince: $('#shippingProvince').val(),
stateOrProvinceCode: $('#shippingProvince').val(),
};
const updateaddress = await
service.updateShippingAddress(saddress);
完成此操作后,该函数将返回所有送货地址详细信息以及该地址中可用的ID列和送货选项。但是问题在于该函数返回选项以及送货地址详细信息,但在该列表中未找到ID列。这就是为什么我要发送选择送货方式的账单地址ID,这是我的代码
const newState = await service.selectShippingOption(billing_ID, Shippingoption_ID);
之后,我要直接付款,我的代码是
const payment = await service.loadPaymentMethods();
let paymentmethod=payment.data.getPaymentMethods();
在此功能中,我将获取所有付款选项的详细信息,然后我要付款,我的代码是
wait service.initializePayment({ methodId: 'testgateway' });
const payment = {
methodId: 'testgateway',
paymentData: {
ccExpiry: { month: 10, year: 20 },
ccName: 'BigCommerce',
ccNumber: '4111111111111111',
ccType: 'visa',
ccCvv: 123,
},
};
完成此功能后,此函数返回错误
Error: "Your order is missing a shipping method. Please return to the
shopping cart and checkout again."