polidog / web-pay-bundle
0.0.2
2016-09-15 15:12 UTC
Requires
- php: >= 5.4.0
- symfony/config: ~3.0|~2.3
- symfony/dependency-injection: ~3.0|~2.3
- symfony/event-dispatcher: ~3.0|~2.3
- symfony/framework-bundle: ~3.0|~2.3
- symfony/http-kernel: ~3.0|~2.3
- webpay/webpay: ~2.2
Requires (Dev)
- phpunit/phpunit: ^5.4
This package is auto-updated.
Last update: 2024-09-21 20:41:12 UTC
README
一个用于包含webpay-php的Symfony Bundle
要求
PHP 5.4+
安装
$ composer require polidog/web-pay-bundl
并在您的应用程序内核中添加一个Polidog\WepPayBundle\PolidogWebPayBundle
实例。
$ vim app/AppKernel.php
...
public function registerBundles()
{
$bundles = [
// ...
new Polidog\WebPayBundle\PolidogWebPayBundle(),
];
// ...
}
并参数设置。
polidog_web_pay:
public_api_key: "your pubic api key"
secret_api_key: "your secret api key"
使用
控制器的基本API调用。
<?php
class DefaultController extends Controller
{
/**
* @Route("/api/test", name="homepage")
*/
public function indexAction()
{
// ...
$charges = $this->get('polidog_web_pay.web_pay_api')->charge->all(['count' => 1]);
// ...
}
}
API文档WebPay 文档
许可
MIT