| Conditions | 2 |
| Paths | 2 |
| Total Lines | 21 |
| Code Lines | 11 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 14 |
| 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 ($this->api->isSandbox() === true) { |
|
| 24 | 1 | $details->replace( |
|
| 25 | 1 | $this->api->parseResponse( |
|
| 26 | 1 | $this->api->generateTestingResponse((array) $details) |
|
| 27 | 1 | ) |
|
| 28 | 1 | ); |
|
| 29 | |||
| 30 | 1 | return; |
|
| 31 | } |
||
| 32 | |||
| 33 | 1 | throw new HttpPostRedirect( |
|
| 34 | 1 | $this->api->getApiEndpoint('capture'), |
|
| 35 | 1 | $this->api->createTransaction((array) $details) |
|
| 36 | 1 | ); |
|
| 37 | } |
||
| 38 | |||
| 49 |