darvinstudio / darvin-payment-bundle
此基于Omnipay的包为Symfony应用程序提供基本支付逻辑。
6.2.1
2021-07-23 13:57 UTC
Requires
- php: >=7.2
- ext-json: *
- darvinstudio/darvin-utils-bundle: *
- doctrine/orm: *
- fresh/doctrine-enum-bundle: ^6||^7
- league/omnipay: ^3
- ramsey/uuid: ^3||^4
- symfony/validator: *
- symfony/workflow: *
- twig/twig: *
Suggests
- darvinstudio/darvin-admin-bundle: Allow admin CRUD operations
- darvinstudio/darvin-config-bundle: Allow admin email notifications
- darvinstudio/omnipay-sberbank: Needed to support Sberbank payment
- darvinstudio/omnipay-telr: Needed to support Telr payment
- monolog/monolog: Allows more advanced logging of the application flow
- smdmphd/omnipay-yookassa: Needed to support YooKassa payment
README
此基于Omnipay的包为Symfony应用程序提供基本支付逻辑。
特性
- 创建支付
- 在购买前批准支付
- 标准购买和预先授权购买
- 退款或取消支付
- 发送每个支付状态变更的通知电子邮件
- 在日志和事件实体中记录每个操作
- 提供将收据添加到支付的接口
支付状态
使用Symfony Workflow组件来管理支付状态。
支付状态变化的方案
安装
composer require darvinstudio/darvin-payment-bundle
如何创建支付
/** @var $paymentFactory \Darvin\PaymentBundle\Payment\Factory\PaymentFactoryInterface */ $payment = $paymentFactory->createPayment( new PaidOrder( (string)$order->getId(), get_class($order), (string)$order->getNumber() ), $order->getPrice(), new Client( (string)$user->getId(), get_class($user), $user->getEmail() ), 'USD' );
如何在Twig中获取支付链接
{{ payment_purchase_urls(payment) }}
如何获取订单中所有可用的支付链接
{{ payment_purchase_widget(order) }}