| Conditions | 6 |
| Paths | 7 |
| Total Lines | 29 |
| Code Lines | 15 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 16 |
| CRAP Score | 6 |
| Changes | 1 | ||
| Bugs | 1 | Features | 0 |
| 1 | <?php |
||
| 17 | 5 | public function execute($request) |
|
| 18 | { |
||
| 19 | 5 | RequestNotSupportedException::assertSupports($this, $request); |
|
| 20 | |||
| 21 | 5 | $details = ArrayObject::ensureArrayObject($request->getModel()); |
|
| 22 | |||
| 23 | 5 | if (isset($details['RC']) === false) { |
|
| 24 | 1 | $request->markNew(); |
|
| 25 | |||
| 26 | 1 | return; |
|
| 27 | } |
||
| 28 | |||
| 29 | 4 | if ($details['RC'] === '00') { |
|
| 30 | 3 | if (isset($details['RRN']) === true) { |
|
| 31 | // TXNAMOUNT 單筆查詢 |
||
| 32 | 2 | isset($details['MACD']) === true || isset($details['TXNAMOUNT']) === true |
|
| 33 | 2 | ? $request->markCaptured() |
|
| 34 | 2 | : $request->markCanceled(); |
|
| 35 | |||
| 36 | 2 | return; |
|
| 37 | } |
||
| 38 | |||
| 39 | 1 | $request->markRefunded(); |
|
| 40 | |||
| 41 | 1 | return; |
|
| 42 | } |
||
| 43 | |||
| 44 | 1 | $request->markFailed(); |
|
| 45 | 1 | } |
|
| 46 | |||
| 57 |