vue模块给模块传参_Vue店面的Paypal支付模块

东门越
2023-12-01

vue模块给模块传参

Vue店面PayPal付款扩展 (Vue Storefront PayPal Payment Extension)

PayPal Payment module for vue-storefront, by Develo Design.

适用于Vue店面的PayPal付款模块,由Develo Design设计。

安装: (Installation:)

By hand (preferer):

手工(首选):

$ git clone[email protected]:develodesign/vsf-payment-paypal.git ./vue-storefront/src/modules/paypal

Or as dependency. Add the extension to your Vue Storefront package.json using:

或作为依赖。 使用以下命令将扩展添加到您的Vue Storefront package.json中:

$ npm install vsf-payment-paypal --save

Add the following also to your config/local.json need set paypal.env to sandbox or production.

将以下内容也添加到您的config/local.json需要将paypal.env设置为sandboxproduction

"paypal": {
  "env": "sandbox",
  "endpoint": {
    "create": "http://localhost:8080/api/ext/payment-paypal/create",
    "execute": "http://localhost:8080/api/ext/payment-paypal/execute"
  }
}

And enable cart sync with server (for corrected totals calculation by getters):

并启用与服务器的购物车同步(用于由吸气剂校正的总计计算):

"cart": {
  ...
  "synchronize": true,
  "synchronize_totals": true
}

Integrate the Paypal Button to Order Review component in theme folder:

将Paypal按钮集成到主题文件夹中的Order Review组件:

cp ./src/modules/paypal/components/core/blocks/Checkout/OrderReview.vue ./src/themes/default/components/core/blocks/Checkout/OrderReview.vue

Registration the Paypal module. Go to ./src/modules/index.ts

注册贝宝模块。 转到./src/modules/index.ts

...
import { GoogleAnalytics } from './google-analytics';
import { Paypal } from './paypal';

export const registerModules: VueStorefrontModule[] = [
  ...
  GoogleAnalytics,
  Paypal
]

PayPal支付API扩展 (PayPal payment API extension)

Install additional extension for vue-storefront-api:

vue-storefront-api安装其他扩展名:

$ mkdir -p ../vue-storefront-api/src/api/extensions/payment-paypal
$ cp -f ./api-ext/index.js ../vue-storefront-api/src/api/extensions/payment-paypal/

Go to api config ./vue-storefront-api/config/local.json and register the Paypal Api extension:

转到api config ./vue-storefront-api/config/local.json并注册Paypal Api扩展名:

"registeredExtensions": [
    ...
    "payment-paypal"
]

And add the paypal settings to extensions key:

并将paypal设置添加到extensions密钥:

"extensions": {
    "mailchimp": {
      ...
    },
    "paypal": {
      "api": "https://api.sandbox.paypal.com",
      "client": "",
      "secret": ""
    }
  }

Magento2集成 (Magento2 integration)

This API extension execute payment to PayPal gateway. It use develodesign/m2-paypal-payment The custom Paypal payment method for Magento2 composer module so you have to install it in your Magento instance.

该API扩展执行向PayPal网关的付款。 它使用develodesign/m2-paypal-payment Magento2作曲者模块的自定义Paypal付款方法,因此您必须将其安装在Magento实例中。

客制化 (Customization)

Also we can use paypal.style option for more customizable PayPal button view. For more info PayPal.

我们也可以使用paypal.style选项来实现更多可定制的PayPal按钮视图。 有关更多信息,请使用PayPal

"paypal": {
  ...
  "style": {
    "size": "small",
    "color": "gold",
    "shape": "pill"
  }
}

翻译自: https://vuejsexamples.com/paypal-payment-module-for-vue-storefront-2/

vue模块给模块传参

 类似资料: