1 | <?php |
||
24 | class ActionDecider implements ActionDeciderInterface |
||
25 | { |
||
26 | /** @var PaymentsApiClientInterface */ |
||
27 | protected $api; |
||
28 | |||
29 | /** |
||
30 | * AbstractActionDecider constructor. |
||
31 | * |
||
32 | * @param PaymentsApiClientInterface $api |
||
33 | */ |
||
34 | public function __construct(PaymentsApiClientInterface $api) |
||
38 | |||
39 | /** |
||
40 | * {@inheritDoc} |
||
41 | * @SuppressWarnings(PHPMD.BooleanArgumentFlag) |
||
42 | */ |
||
43 | public function isActionAllowed($paymentId, $transactionAction, $throwException = true) |
||
52 | |||
53 | /** |
||
54 | * Check if the cancel action for the transaction is allowed |
||
55 | * |
||
56 | * @param string $paymentId |
||
57 | * @param bool $throwException |
||
58 | * |
||
59 | * @return bool |
||
60 | * |
||
61 | * @throws \Exception when $throwException is true and target action is not allowed |
||
62 | * @SuppressWarnings(PHPMD.BooleanArgumentFlag) |
||
63 | */ |
||
64 | public function isCancelAllowed($paymentId, $throwException = true) |
||
68 | |||
69 | /** |
||
70 | * Check if the refund action for the transaction is allowed |
||
71 | * |
||
72 | * @param string $paymentId |
||
73 | * @param bool $throwException |
||
74 | * |
||
75 | * @return bool |
||
76 | * |
||
77 | * @throws \Exception when $throwException is true and target action is not allowed |
||
78 | * @SuppressWarnings(PHPMD.BooleanArgumentFlag) |
||
79 | */ |
||
80 | public function isRefundAllowed($paymentId, $throwException = true) |
||
84 | |||
85 | /** |
||
86 | * Check if the shipping goods action for the transaction is allowed |
||
87 | * |
||
88 | * @param string $paymentId |
||
89 | * @param bool $throwException |
||
90 | * |
||
91 | * @return bool |
||
92 | * |
||
93 | * @throws \Exception when $throwException is true and target action is not allowed |
||
94 | * @SuppressWarnings(PHPMD.BooleanArgumentFlag) |
||
95 | */ |
||
96 | public function isShippingAllowed($paymentId, $throwException = true) |
||
100 | |||
101 | /** |
||
102 | * @param string $paymentId |
||
103 | * @return string[] |
||
104 | */ |
||
105 | protected function getEnabledActions($paymentId) |
||
123 | |||
124 | /** |
||
125 | * @param string $action |
||
126 | * @return string |
||
127 | */ |
||
128 | protected function getPolyfillAction($action) |
||
136 | |||
137 | /** |
||
138 | * @param string|null $transactionAction |
||
139 | * @param string|null $paymentId |
||
140 | * @throws \Exception |
||
141 | */ |
||
142 | protected function assertArguments($transactionAction, $paymentId) |
||
148 | |||
149 | /** |
||
150 | * @param bool $throwException |
||
151 | * @param string $transactionAction |
||
152 | * @param string $paymentId |
||
153 | * @return bool |
||
154 | * @throws ActionNotAllowedException |
||
155 | */ |
||
156 | protected function assertFound($throwException, $transactionAction, $paymentId) |
||
170 | } |
||
171 |
This class constant has been deprecated. The supplier of the class has supplied an explanatory message.
The explanatory message should give you some clue as to whether and when the constant will be removed from the class and what other constant to use instead.