vue.js - VueStrorefront + vsf-payment-paypal 中的 update_client_config_error 错误
问题描述
我是 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)
知道如何解决这个问题吗?请帮忙。
解决方案
我正在处理 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 一无所知,所以我无能为力。但希望这会帮助你..!祝你好运
推荐阅读
- java - 如何解决这种拒绝服务问题的可能性?
- javascript - 如何将我从 API 获取的数据插入到离子卡中?
- linux - 如何使用 PERL 将多个 *.tgz 文件提取到多个目录?
- django - 自定义注册表单中的 Django allauth 访问请求
- database - 是否可以只替换文件中的特定行而不重写整个文件
- java - 是否可以编写和加载您自己版本的核心 Java 类?
- powershell - 在每个文件夹中创建一个子文件夹然后将所有文件和文件夹移动到该子文件夹中的代码是什么?
- opencv - 运行使用 cmake 构建的 exe 时出错
- codeigniter-3 - 我想上传两张图片,但只插入一张图片
- c++ - (C++)如何修改/使用数据结构,以便我们可以一次又一次地使用它们?