wunderbit/sylius-wunderbit-commerce-plugin

适用于Sylius的Wunderbit Commerce插件。


README

从Sylius平台开始接受比特币支付

安装

  1. 运行composer require wunderbit/sylius-wunderbit-commerce-plugin

  2. 添加我们的Bundle

    1) 如果您使用Symfony 4,请向bundles.php文件中添加新行

     Wunderbit\SyliusWunderbitCommercePlugin\WunderbitSyliusWunderbitCommercePlugin::class => ['all' => true]
    

    2) 如果您使用Symfony 3,请向app/AppKernel.php的$bundles数组中添加新行

     class AppKernel extends Kernel
      {
          // ...
            
          public function registerBundles()
          {
              $bundles = array(
                  // ...
                  new Wunderbit\SyliusWunderbitCommercePlugin\WunderbitSyliusWunderbitCommercePlugin(),
              );
            
              // ...
          }
      }
    
    
  3. 运行以下命令以安装所有资源和yarn

    yarn build

    php bin/console a:i

    php bin/console cache:clear

使用我们的thankYou.html.twig(vendor/wunderbit/sylius-wunderbit-commerce-plugin/src/Resources/views/SyliusShopBundle/Order/thankYou.html.twig),自动跳转到发票页面

用法

使用我们的插件在Sylius Admin中启用新的支付方式,允许您的网店创建Wunderbit Commerce发票。

  1. 首先创建一个新的支付方式,命名为“Wunderbit支付”

  2. 其次,为了开始使用我们的插件,您需要创建新的商户账户并生成API密钥(商户面板 -> 设置 -> API)。

之后,只需复制生成的API密钥并将其粘贴到Wunderbit支付方法的API字段中即可

现在您可以使用我们的服务成功生成加密发票

高级

每种类型的发票都需要特殊额外的参数,您可以通过“capture.wunderbit.action.description”键来覆盖这些参数

1) XML example:

<parameter key="capture.wunderbit.action.description" type="collection">
     <parameter key="Description">Wunderbit Commerce Sylius API</parameter>
     <parameter key="test">test</parameter>
     # Add as many parameters as you want
</parameter>

2) YAML example:

 capture.wunderbit.action.description:
    Description: 'Wunderbit Commerce Sylius API'
    test: 'test'
    # Add as many parameters as you want

此外,我们的bundle使用默认的Symfony路由参数(router.request_context.host 和 router.request_context.scheme),允许生成正确的捕获URL到您的网站。

默认情况下,Symfony将 router.request_context.host 设置为 'localhost',将 router.request_context.scheme 设置为 'http'

将它们覆盖为您的主机名和方案!