PHP Class Elcodi\Bridge\PaymentSuiteBridgeBundle\Services\PaymentBridge

Inheritance: implements PaymentSuite\PaymentCoreBundle\Services\Interfaces\PaymentBridgeInterface
Afficher le fichier Open project: elcodi/bamboo

Méthodes publiques

Méthode 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 méthode

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 méthode

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

getAmount() public méthode

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
Résultat integer

getCurrency() public méthode

Get the currency in which the order is paid
public getCurrency ( ) : string
Résultat string

getExtraData() public méthode

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
Résultat array

getOrder() public méthode

Return order
public getOrder ( ) : Object
Résultat Object order

getOrderId() public méthode

Return order identifier value
public getOrderId ( ) : integer
Résultat integer

isOrderPaid() public méthode

Get extra data
public isOrderPaid ( ) : array
Résultat array

setOrder() public méthode

Set order to OrderWrapper
public setOrder ( $order )