polidog / web-pay-bundle

0.0.2 2016-09-15 15:12 UTC

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