PHP Class Sonata\Tests\Component\Basket\Payment

Inheritance: extends Sonata\Component\Payment\BasePayment
Show file Open project: sonata-project/ecommerce

Public Methods

Method Description
applyTransactionId ( Sonata\Component\Payment\TransactionInterface $transaction ) return the transaction id from the bank.
callbank ( Sonata\Component\Order\OrderInterface $order ) : Response Send information to the bank, this method should handle everything when called.
encodeString ( string $value ) : string encode value for the bank.
getName ( )
getOrderReference ( Sonata\Component\Payment\TransactionInterface $transaction ) : string return the order reference from the transaction.
getPrice ( )
getVatRate ( )
handleError ( Sonata\Component\Payment\TransactionInterface $transaction ) : Response Method called when an error occurs.
isAddableProduct ( Sonata\Component\Basket\BasketInterface $basket, Sonata\Component\Product\ProductInterface $product ) return true if the product can be added to the basket.
isAddressRequired ( )
isBasketValid ( Sonata\Component\Basket\BasketInterface $basket ) : boolean return true is the basket is valid for the current bank gateway.
isCallbackValid ( Sonata\Component\Payment\TransactionInterface $transaction ) : boolean
isRequestValid ( Sonata\Component\Payment\TransactionInterface $transaction ) : boolean Test if the request variables are valid for the current request.
sendConfirmationReceipt ( Sonata\Component\Payment\TransactionInterface $transaction ) : Response,,Symfony\Component\HttpFoundation Send post back confirmation to the bank when the bank callback the site.

Method Details

applyTransactionId() public method

return the transaction id from the bank.
public applyTransactionId ( Sonata\Component\Payment\TransactionInterface $transaction )
$transaction Sonata\Component\Payment\TransactionInterface

callbank() public method

Send information to the bank, this method should handle everything when called.
public callbank ( Sonata\Component\Order\OrderInterface $order ) : Response
$order Sonata\Component\Order\OrderInterface
return Symfony\Component\HttpFoundation\Response

encodeString() public method

encode value for the bank.
public encodeString ( string $value ) : string
$value string
return string the encoded value

getName() public method

public getName ( )

getOrderReference() public method

return the order reference from the transaction.
public getOrderReference ( Sonata\Component\Payment\TransactionInterface $transaction ) : string
$transaction Sonata\Component\Payment\TransactionInterface
return string

getPrice() public method

public getPrice ( )

getVatRate() public method

public getVatRate ( )

handleError() public method

Method called when an error occurs.
public handleError ( Sonata\Component\Payment\TransactionInterface $transaction ) : Response
$transaction Sonata\Component\Payment\TransactionInterface
return Symfony\Component\HttpFoundation\Response

isAddableProduct() public method

return true if the product can be added to the basket.
public isAddableProduct ( Sonata\Component\Basket\BasketInterface $basket, Sonata\Component\Product\ProductInterface $product )
$basket Sonata\Component\Basket\BasketInterface
$product Sonata\Component\Product\ProductInterface

isAddressRequired() public method

public isAddressRequired ( )

isBasketValid() public method

return true is the basket is valid for the current bank gateway.
public isBasketValid ( Sonata\Component\Basket\BasketInterface $basket ) : boolean
$basket Sonata\Component\Basket\BasketInterface
return boolean

isCallbackValid() public method

public isCallbackValid ( Sonata\Component\Payment\TransactionInterface $transaction ) : boolean
$transaction Sonata\Component\Payment\TransactionInterface
return boolean true if callback ok else false

isRequestValid() public method

WARNING : this methods does not check if the callback is valid
public isRequestValid ( Sonata\Component\Payment\TransactionInterface $transaction ) : boolean
$transaction Sonata\Component\Payment\TransactionInterface
return boolean true if all parameter are ok

sendConfirmationReceipt() public method

Send post back confirmation to the bank when the bank callback the site.
public sendConfirmationReceipt ( Sonata\Component\Payment\TransactionInterface $transaction ) : Response,,Symfony\Component\HttpFoundation
$transaction Sonata\Component\Payment\TransactionInterface
return Response,,Symfony\Component\HttpFoundation