Conditions | 6 |
Paths | 6 |
Total Lines | 15 |
Code Lines | 13 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
18 | public function createProcessor($transactionType) |
||
19 | { |
||
20 | switch ($transactionType) { |
||
21 | case TransactionType::SALE: |
||
22 | return new SaleResponseProcessor($this->configuration); |
||
23 | case TransactionType::REFUND: |
||
24 | return new RefundResponseProcessor($this->configuration); |
||
25 | case TransactionType::CANCEL: |
||
26 | return new CancelResponseProcessor($this->configuration); |
||
27 | case TransactionType::PRE_AUTHORIZATION: |
||
28 | return new PreAuthorizationResponseProcessor($this->configuration); |
||
29 | case TransactionType::POST_AUTHORIZATION: |
||
30 | return new PostAuthorizationResponseProcessor($this->configuration); |
||
31 | default: |
||
32 | throw new InvalidArgumentException('Bad transaction type: ' . $transactionType); |
||
33 | } |
||
36 |