Conditions | 2 |
Paths | 2 |
Total Lines | 18 |
Code Lines | 10 |
Lines | 0 |
Ratio | 0 % |
Tests | 12 |
CRAP Score | 2 |
Changes | 0 |
1 | <?php |
||
17 | 2 | public function execute($request) |
|
18 | { |
||
19 | 2 | RequestNotSupportedException::assertSupports($this, $request); |
|
20 | |||
21 | 2 | $details = ArrayObject::ensureArrayObject($request->getModel()); |
|
22 | |||
23 | 2 | if (empty($details['order_amount']) === true) { |
|
24 | 1 | throw new HttpPostRedirect( |
|
25 | 1 | $this->api->getApiEndpoint('cvs'), |
|
26 | 1 | $this->api->createCvsMapTransaction((array) $details) |
|
27 | 1 | ); |
|
28 | } |
||
29 | |||
30 | 1 | throw new HttpPostRedirect( |
|
31 | 1 | $this->api->getApiEndpoint('capture'), |
|
32 | 1 | $this->api->createTransaction((array) $details) |
|
33 | 1 | ); |
|
34 | } |
||
35 | |||
46 |