darvinstudio/darvin-payment-bundle

此基于Omnipay的包为Symfony应用程序提供基本支付逻辑。

安装: 528

依赖项: 0

建议者: 0

安全: 0

星级: 3

关注者: 4

分支: 4

公开问题: 0

类型:symfony-bundle

6.2.1 2021-07-23 13:57 UTC

This package is auto-updated.

Last update: 2024-09-23 21:02:58 UTC


README

此基于Omnipay的包为Symfony应用程序提供基本支付逻辑。

特性

  • 创建支付
  • 在购买前批准支付
  • 标准购买和预先授权购买
  • 退款或取消支付
  • 发送每个支付状态变更的通知电子邮件
  • 在日志和事件实体中记录每个操作
  • 提供将收据添加到支付的接口

支付状态

使用Symfony Workflow组件来管理支付状态。

支付状态变化的方案

Scheme of payment state changes

安装

    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) }}