1 | <?php |
||
20 | class PurchaseService |
||
21 | { |
||
22 | /** |
||
23 | * @var OrderService |
||
24 | */ |
||
25 | protected $orderService; |
||
26 | |||
27 | /** |
||
28 | * @var PaymentService |
||
29 | */ |
||
30 | protected $paymentService; |
||
31 | |||
32 | /** |
||
33 | * @var GatewayAdapter |
||
34 | */ |
||
35 | protected $adapter; |
||
36 | |||
37 | /** |
||
38 | * @var EntityManager |
||
39 | */ |
||
40 | protected $entityManager; |
||
41 | |||
42 | /** |
||
43 | * @var EventDispatcherInterface |
||
44 | */ |
||
45 | protected $dispatcher; |
||
46 | |||
47 | /** |
||
48 | * Construct. |
||
49 | * |
||
50 | * @param OrderService $orderService |
||
51 | * @param PaymentService $paymentService |
||
52 | * @param GatewayAdapter $adapter |
||
53 | * @param EntityManager $entityManager |
||
54 | * @param EventDispatcherInterface $dispatcher |
||
55 | */ |
||
56 | public function __construct( |
||
69 | |||
70 | /** |
||
71 | * Starts the purchase process. |
||
72 | * |
||
73 | * @param array $items |
||
74 | */ |
||
75 | public function startPurchase(array $items = array(), $currency = null) |
||
87 | |||
88 | /** |
||
89 | * Finishes purchase process. |
||
90 | * |
||
91 | * @param array $items |
||
92 | * |
||
93 | * @return OderInterface $order |
||
94 | */ |
||
95 | public function finishPurchase(array $items = array()) |
||
103 | |||
104 | private function completePurchase(OrderInterface $order) |
||
115 | |||
116 | private function activateOrderItems(OrderInterface $order) |
||
126 | } |
||
127 |