PHP Class Sonata\Component\Payment\PaymentHandler

Responsible for interactions between PaymentController & Model
Author: Hugo Briand ([email protected])
Inheritance: implements Sonata\Component\Payment\PaymentHandlerInterface
Show file Open project: sonata-project/ecommerce Class Usage Examples

Protected Properties

Property Type Description
$eventDispatcher Symfony\Component\EventDispatcher\EventDispatcherInterface
$notificationBackend Sonata\NotificationBundle\Backend\BackendInterface
$orderManager Sonata\Component\Order\OrderManagerInterface
$paymentSelector Sonata\Component\Payment\PaymentSelectorInterface
$referenceGenerator Sonata\Component\Generator\ReferenceInterface
$transactionManager TransactionManagerInterface

Public Methods

Method Description
__construct ( Sonata\Component\Order\OrderManagerInterface $orderManager, Sonata\Component\Payment\PaymentSelectorInterface $paymentSelector, Sonata\Component\Generator\ReferenceInterface $referenceGenerator, TransactionManagerInterface $transactionManager, Sonata\NotificationBundle\Backend\BackendInterface $notificationBackend, Symfony\Component\EventDispatcher\EventDispatcherInterface $eventDispatcher ) Constructor.
getPaymentCallbackResponse ( Request $request )
getSendbankOrder ( Sonata\Component\Basket\BasketInterface $basket )
handleConfirmation ( Request $request )
handleError ( Request $request, Sonata\Component\Basket\BasketInterface $basket )

Protected Methods

Method Description
createTransaction ( Request $request ) : Sonata\Component\Payment\TransactionInterface
getEventDispatcher ( ) : Symfony\Component\EventDispatcher\EventDispatcherInterface
getPayment ( $code ) : Sonata\Component\Payment\PaymentInterface
getValidOrder ( Sonata\Component\Payment\TransactionInterface $transaction ) : Sonata\Component\Order\OrderInterface Retrieves the order matching $transaction and adds it to $transaction.

Method Details

__construct() public method

Constructor.
public __construct ( Sonata\Component\Order\OrderManagerInterface $orderManager, Sonata\Component\Payment\PaymentSelectorInterface $paymentSelector, Sonata\Component\Generator\ReferenceInterface $referenceGenerator, TransactionManagerInterface $transactionManager, Sonata\NotificationBundle\Backend\BackendInterface $notificationBackend, Symfony\Component\EventDispatcher\EventDispatcherInterface $eventDispatcher )
$orderManager Sonata\Component\Order\OrderManagerInterface
$paymentSelector Sonata\Component\Payment\PaymentSelectorInterface
$referenceGenerator Sonata\Component\Generator\ReferenceInterface
$transactionManager TransactionManagerInterface
$notificationBackend Sonata\NotificationBundle\Backend\BackendInterface
$eventDispatcher Symfony\Component\EventDispatcher\EventDispatcherInterface

createTransaction() protected method

protected createTransaction ( Request $request ) : Sonata\Component\Payment\TransactionInterface
$request Symfony\Component\HttpFoundation\Request
return Sonata\Component\Payment\TransactionInterface

getEventDispatcher() protected method

protected getEventDispatcher ( ) : Symfony\Component\EventDispatcher\EventDispatcherInterface
return Symfony\Component\EventDispatcher\EventDispatcherInterface

getPayment() protected method

protected getPayment ( $code ) : Sonata\Component\Payment\PaymentInterface
$code
return Sonata\Component\Payment\PaymentInterface

getPaymentCallbackResponse() public method

public getPaymentCallbackResponse ( Request $request )
$request Symfony\Component\HttpFoundation\Request

getSendbankOrder() public method

public getSendbankOrder ( Sonata\Component\Basket\BasketInterface $basket )
$basket Sonata\Component\Basket\BasketInterface

getValidOrder() protected method

Retrieves the order matching $transaction and adds it to $transaction.
protected getValidOrder ( Sonata\Component\Payment\TransactionInterface $transaction ) : Sonata\Component\Order\OrderInterface
$transaction Sonata\Component\Payment\TransactionInterface The request's transaction (will be linked to the order in the process)
return Sonata\Component\Order\OrderInterface

handleConfirmation() public method

public handleConfirmation ( Request $request )
$request Symfony\Component\HttpFoundation\Request

handleError() public method

public handleError ( Request $request, Sonata\Component\Basket\BasketInterface $basket )
$request Symfony\Component\HttpFoundation\Request
$basket Sonata\Component\Basket\BasketInterface

Property Details

$eventDispatcher protected property

protected EventDispatcherInterface,Symfony\Component\EventDispatcher $eventDispatcher
return Symfony\Component\EventDispatcher\EventDispatcherInterface

$notificationBackend protected property

protected BackendInterface,Sonata\NotificationBundle\Backend $notificationBackend
return Sonata\NotificationBundle\Backend\BackendInterface

$orderManager protected property

protected OrderManagerInterface,Sonata\Component\Order $orderManager
return Sonata\Component\Order\OrderManagerInterface

$paymentSelector protected property

protected PaymentSelectorInterface,Sonata\Component\Payment $paymentSelector
return Sonata\Component\Payment\PaymentSelectorInterface

$referenceGenerator protected property

protected ReferenceInterface,Sonata\Component\Generator $referenceGenerator
return Sonata\Component\Generator\ReferenceInterface

$transactionManager protected property

protected TransactionManagerInterface $transactionManager
return TransactionManagerInterface