首页 > 解决方案 > 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)

知道如何解决这个问题吗?请帮忙。

标签: vue.jsvuejs2vue-storefront

解决方案


我正在处理 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 一无所知,所以我无能为力。但希望这会帮助你..!祝你好运


推荐阅读