darvinstudio / darvin-payment-bundle
This Omnipay-based bundle provides basic payment logic for Symfony applications.
Installs: 530
Dependents: 0
Suggesters: 0
Security: 0
Stars: 3
Watchers: 4
Forks: 4
Open Issues: 0
Type:symfony-bundle
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
This Omnipay-based bundle provides basic payment logic for Symfony applications.
Features:
- creating payment
- approving payment before purchase
- standard purchase and purchase with pre-authorise
- refund or canceling payment
- the sending notify emails of every changed payment state
- logging every actions in log and Event entity
- provides the interface for the adding receipt to payment
Payment states
To manage payment state used Symfony Workflow Component.
Scheme of payment state changes:
Installation
composer require darvinstudio/darvin-payment-bundle
How to create Payment
/** @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' );
How to get payment's link in twig
{{ payment_purchase_urls(payment) }}
How to get all available payment's links for order
{{ payment_purchase_widget(order) }}