prolix/payum-bundle

为symfony2提供丰富的支付解决方案。Paypal, payex, authorize.net, be2bill, omnipay, 定期付款,即时通知等更多功能。

安装: 59

依赖者: 0

建议者: 0

安全: 0

星星: 0

关注者: 3

分支: 142

类型:symfony-bundle

2.2.2 2017-06-27 06:05 UTC

README

Gitter Build Status Total Downloads Latest Stable Version

该包将payum集成到symfony框架中。它已经支持+35个网关。提供良好的配置层,安全捕获控制器,存储集成以及许多其他功能。

Sylius电子商务平台基于此包构建其支付解决方案。

资源

示例

配置

payum:
    storages:
        Payum\Core\Model\Payment:
            filesystem:
                storage_dir: %kernel.root_dir%/Resources/payments
                id_property: number

    security:
        token_storage:
            Payum\Core\Model\Token:
                filesystem:
                    storage_dir: %kernel.root_dir%/Resources/gateways
                    id_property: hash
                
    gateways:
        offline:
            factory: offline

购买

<?php
use Payum\Core\Model\Payment;
use Payum\Core\Reply\HttpRedirect;
use Payum\Core\Reply\HttpResponse;
use Payum\Core\Request\Capture;

$payment = new Payment;
$payment->setNumber(uniqid());
$payment->setCurrencyCode('EUR');
$payment->setTotalAmount(123); // 1.23 EUR
$payment->setDescription('A description');
$payment->setClientId('anId');
$payment->setClientEmail('foo@example.com');

$gateway = $this->get('payum')->getGateway('offline');
$gateway->execute(new Capture($payment));

获取状态

<?php
use Payum\Core\Request\GetHumanStatus;

$gateway->execute($status = new GetHumanStatus($payment));

echo $status->getValue();

其他操作。

<?php
use Payum\Core\Request\Authorize;
use Payum\Core\Request\Cancel;
use Payum\Core\Request\Refund;

$gateway->execute(new Authorize($payment));

$gateway->execute(new Refund($payment));

$gateway->execute(new Cancel($payment));

贡献

PayumBundle是一个开源、社区驱动的项目。非常欢迎pull请求。

喜欢它吗?传播一下!

githubpackagist上关注PayumBundle。

捐赠

Click here to lend your support to: Your private payment processing server. Setup it once and rule them all and make a donation at pledgie.com !

许可证

该包根据MIT许可证发布。