PHP Class Elcodi\Bridge\PaymentSuiteBridgeBundle\Services\PaymentBridge

Inheritance: implements PaymentSuite\PaymentCoreBundle\Services\Interfaces\PaymentBridgeInterface
Show file Open project: elcodi/bamboo

Public Methods

Method Description
__construct ( Elcodi\Component\Cart\Repository\OrderRepository $orderRepository, Elcodi\Component\Cart\Wrapper\CartWrapper $cartWrapper, Elcodi\Component\Currency\Services\CurrencyConverter $currencyConverter, Elcodi\Component\Product\NameResolver\Interfaces\PurchasableNameResolverInterface $purchasableNameResolver )
findOrder ( integer $orderId ) : Object Given an id, find Order
getAmount ( ) : integer Get total order amount.
getCurrency ( ) : string Get the currency in which the order is paid
getExtraData ( ) : array Get extra data
getOrder ( ) : Object Return order
getOrderId ( ) : integer Return order identifier value
isOrderPaid ( ) : array Get extra data
setOrder ( $order ) Set order to OrderWrapper

Method Details

__construct() public method

public __construct ( Elcodi\Component\Cart\Repository\OrderRepository $orderRepository, Elcodi\Component\Cart\Wrapper\CartWrapper $cartWrapper, Elcodi\Component\Currency\Services\CurrencyConverter $currencyConverter, Elcodi\Component\Product\NameResolver\Interfaces\PurchasableNameResolverInterface $purchasableNameResolver )
$orderRepository Elcodi\Component\Cart\Repository\OrderRepository Order repository
$cartWrapper Elcodi\Component\Cart\Wrapper\CartWrapper Cart wrapper
$currencyConverter Elcodi\Component\Currency\Services\CurrencyConverter Currency converter
$purchasableNameResolver Elcodi\Component\Product\NameResolver\Interfaces\PurchasableNameResolverInterface Purchasable name resolver

findOrder() public method

Given an id, find Order
public findOrder ( integer $orderId ) : Object
$orderId integer Order id
return Object order

getAmount() public method

Money value-object amounts are stored as integers, representing CENTS, so we have to divide by 100 since PaymentBridgeInterface expects a decimal value
public getAmount ( ) : integer
return integer

getCurrency() public method

Get the currency in which the order is paid
public getCurrency ( ) : string
return string

getExtraData() public method

Returns the order lines as array in the following form [ 1 => [ 'item' => 'Item 1', 'amount' => 1234, 'currency_code' => 'EUR ], 2 => [ 'item_name' => 'Item 2', 'item_amount' => 2345, 'item_currency_code' => 'EUR ], ]
public getExtraData ( ) : array
return array

getOrder() public method

Return order
public getOrder ( ) : Object
return Object order

getOrderId() public method

Return order identifier value
public getOrderId ( ) : integer
return integer

isOrderPaid() public method

Get extra data
public isOrderPaid ( ) : array
return array

setOrder() public method

Set order to OrderWrapper
public setOrder ( $order )