sergiotropea / nexi-bundle
Nexi支付系统
dev-master
2020-04-29 15:12 UTC
Requires
- php: ^5.3.3 || ^7.0
- symfony/framework-bundle: ~2.7|~3.3|~4.0|~5.0
- twig/twig: ~1.26|~2.0
Requires (Dev)
- phpunit/phpunit: ^4.8.35|^5.4.3|^6.0
- symfony/phpunit-bridge: ~2.7|~3.3|~4.0
This package is not auto-updated.
Last update: 2024-10-02 21:27:07 UTC
README
包含Nexi支付系统的Bundle,你可以找到服务和路由设置,可用于按钮 - 响应 - 取消 - 提交。
你可以覆盖DefaultController来提高和扩展新的功能。
以下Bundle结构
- 控制器
- DefaltController.php
- 实体
- Nexi.php
- 资源
- 视图
- 默认
- abort.html.twig
- index.html.twig
- response.html.twig
- 默认
- 视图
安装
步骤 1: 下载Bundle
打开命令行,进入你的项目目录,并执行以下命令以下载此Bundle的最新稳定版本
$ composer require sergiotropea/nexi-bundle dev-master
此命令需要你全局安装Composer,请参阅Composer文档的安装章节。
步骤 2: 启用Bundle
然后,通过将其添加到项目中的app/AppKernel.php
文件中注册的Bundle列表来启用Bundle
<?php // app/AppKernel.php // ... class AppKernel extends Kernel { public function registerBundles() { $bundles = array( // ... new SergioTropea\NexiBundle\SergioTropeaNexiBundle(), ); // ... } // ... }
步骤 3: 路由
将任何路由的前缀插入到路由文件中
// app/config/routing.yml // ... nexi: resource: "@SergioTropeaNexiBundle/Resources/config/routing.yml"
步骤 4: 配置
将任何路由的前缀插入到路由文件中
// app/config/config.yml // ... sergio_tropea_nexi: environment: test #test or production url: <url_base> alias: <alias> key: <key>
步骤 4: 如何生成URL
将任何路由的前缀插入到路由文件中
// src/AppBundle/Controller/DefaultController.php // ... $nexiService = $this->get('sergio_tropea_nexi.nexi'); //Mandatory $nexi = new Nexi(); $nexi->setCodTrans("TEST_".time()); $nexi->setDivisa("EUR"); $nexi->setImporto(1200); //Optional dump($nexiService->generateUrl($nexi));