【问题标题】:update_client_config_error error in VueStrorefront + vsf-payment-paypalVueStrorefront + vsf-payment-paypal 中的 update_client_config_error 错误
【发布时间】:2019-12-21 12:25:14
【问题描述】:
我是 Vue Storefront 的初学者。我正在尝试将 Paypal 集成到 Vue Storefront。我已按照所有步骤阅读此包 (vsf-payment-paypal)。但是我被这个错误困住了两天,
update_client_config_error
Uncaught TypeError: Cannot read property \'find\' of undefined at VueComponent.grandTotal (http://localhost:3000/dist/vsf-checkout.js:1446:25)
知道如何解决这个问题吗?请帮忙。
【问题讨论】:
标签:
vue.js
vuejs2
vue-storefront
【解决方案1】:
我正在处理 NodeJS 中的 Hours 问题,我能够解决它,问题出在您的 Json 上,而不是在 PayPal 配置中。
let order;
try
{
order = await client.execute(request);
let response = {
statusCode: '200',
body: JSON.stringify({ orderID: order.result.id }),
headers: {
'Content-Type': 'application/json',
}
};
return JSON.stringify({ orderID: order.result.id });
}
catch (err)
{
console.error(err);
let response = {
statusCode: '500',
body: JSON.stringify({ error: 'Something Went Wrong While Creating Order..!' }),
headers: {
'Content-Type': 'application/json',
}
};
return response;
}
这就是我在 nodejs 服务器端修改回报的方式
正文:JSON.stringify({ orderID: order.result.id })
这是我的创建订单功能
createOrder: function() {
return fetch('http://localhost:3000/PayPal/Pay', {
method: 'post',
headers: {
'content-type': 'application/json'
}
}).then(function(res) {
return res.json();
}).then(function(data) {
console.log("data.orderID" +data);
return data.orderID; // Use the same key name for order ID on the client and server
});
}
}).render('#paypal-button-container')});
对不起,我对 Vue 一无所知,所以我无能为力。但希望这会帮助你..!祝你好运