0

我现在正在尝试设置 Magento Venia Storefront 并将其连接到我的 Magento 2.3。我已经参考了以下网站:https ://magento.github.io/pwa-studio/venia-pwa-concept/setup/

  1. 到目前为止,我已经启动并运行了 Magento 2.3 后端。我从他们的官方 git 存储库中获取了一个克隆:( https://github.com/magento/pwa-studio.git )
  2. 我已经完成yarn install并安装了所需的软件包。
  3. 在此之后,文档建议我使用 buildpack 生成 SSL 证书,其命令为: yarn buildpack create-custom-origin packages/venia-concept

执行此操作后,我现在收到以下错误:

yarn run v1.21.1
$ buildpack create-custom-origin packages/venia-concept
  ⓧ  Missing required environment variables:
     MAGENTO_BACKEND_URL: Connect to an instance of Magento 2.3 by specifying its public domain name. (eg. "https://master-7rqtwti-mfwmkrjfqvbjk.us-4.magentosite.cloud/")
     CHECKOUT_BRAINTREE_TOKEN: Specify a Braintree API token to direct the Venia storefront to communicate with your Braintree instance. You can find this value in Braintree's
     Control Panel under Settings > API Keys > Tokenization Keys. (eg. "sandbox_8yrzsvtm_s2bg8fs563crhqzk")
  ⓧ  Error: Missing required environment variables:
     MAGENTO_BACKEND_URL: Connect to an instance of Magento 2.3 by specifying its public domain name. (eg. "https://master-7rqtwti-mfwmkrjfqvbjk.us-4.magentosite.cloud/")
     CHECKOUT_BRAINTREE_TOKEN: Specify a Braintree API token to direct the Venia storefront to communicate with your Braintree instance. You can find this value in Braintree's
     Control Panel under Settings > API Keys > Tokenization Keys. (eg. "sandbox_8yrzsvtm_s2bg8fs563crhqzk")
  ⓧ  Error: Error: Missing required environment variables:
     MAGENTO_BACKEND_URL: Connect to an instance of Magento 2.3 by specifying its public domain name. (eg. "https://master-7rqtwti-mfwmkrjfqvbjk.us-4.magentosite.cloud/")
     CHECKOUT_BRAINTREE_TOKEN: Specify a Braintree API token to direct the Venia storefront to communicate with your Braintree instance. You can find this value in Braintree's
     Control Panel under Settings > API Keys > Tokenization Keys. (eg. "sandbox_8yrzsvtm_s2bg8fs563crhqzk")
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

至于第一点,我找不到关于如何在设置 Venia 店面时配置 Braintree 的适当文档。第二点,我现在在本地运行我的 Magento 2.3,我的管理面板只在 Http 上运行。

任何帮助表示赞赏,在此先感谢您!

4

1 回答 1

1

首先创建您的 .env 文件,如果它不是使用以下命令构建的。

MAGENTO_BACKEND_URL="https://magento.local" yarn buildpack create-env-file packages/venia-concept

现在您可以在 packages/venia-concept/.env 中找到 .env 文件,您可以在其中将 MAGENTO_BACKEND_URL 设置为您的 magento url。

如果您将浏览 .env 文件,那么您会看到有一个字段 CHECKOUT_BRAINTREE_TOKEN=token 被注释掉了。取消注释并将 Braintree 令牌放入其中。

对于braintree 令牌,创建沙盒帐户, https://www.braintreepayments.com/sandbox?_ga=1.114967554.428334232.1579331999然后复制您在创建帐户后获得的令牌(私钥)。

希望能帮助到你 !!

于 2020-01-18T07:34:59.110 回答