1 | <?php |
||
19 | class CartFinisher extends BaseObject |
||
20 | { |
||
21 | /** |
||
22 | * @var ShoppingCart |
||
23 | */ |
||
24 | public $cart; |
||
25 | |||
26 | /** |
||
27 | * @var string|null |
||
28 | */ |
||
29 | public $exchangeFromCurrency; |
||
30 | |||
31 | /** |
||
32 | * @var PurchaseStrategyInterface[] |
||
33 | */ |
||
34 | protected $purchasers = []; |
||
35 | |||
36 | /** |
||
37 | * @var AbstractPurchase[] array of successful purchases |
||
38 | */ |
||
39 | protected $_success = []; |
||
40 | |||
41 | /** |
||
42 | * @var ErrorPurchaseException[] array of failed purchases |
||
43 | */ |
||
44 | protected $_error = []; |
||
45 | |||
46 | /** |
||
47 | * @var PendingPurchaseException[] array of purchases that are pending |
||
48 | */ |
||
49 | protected $_pending = []; |
||
50 | |||
51 | /** |
||
52 | * Getter for array of successful purchases. |
||
53 | * @return AbstractPurchase[] |
||
54 | */ |
||
55 | public function getSuccess() |
||
59 | |||
60 | /** |
||
61 | * Getter for array of failed purchases. |
||
62 | * @return ErrorPurchaseException[] |
||
63 | */ |
||
64 | public function getError() |
||
68 | |||
69 | /** |
||
70 | * Getter for array of failed purchases. |
||
71 | * @return PendingPurchaseException[] |
||
72 | */ |
||
73 | public function getPending() |
||
77 | |||
78 | /** |
||
79 | * Runs the purchase. |
||
80 | * Purchases the positions in the [[cart]]. |
||
81 | */ |
||
82 | public function run() |
||
106 | |||
107 | protected function ensureCanBeFinished() |
||
130 | |||
131 | protected function createPurchasers() |
||
143 | |||
144 | /** |
||
145 | * @param string $positionClass |
||
146 | * @param string $purchaserClass |
||
147 | * @return PurchaseStrategyInterface |
||
148 | */ |
||
149 | protected function getPurchaser($positionClass, $purchaserClass) |
||
157 | |||
158 | private function exchangeMoney(): void |
||
170 | } |
||
171 |