| Total Complexity | 5 |
| Total Lines | 51 |
| Duplicated Lines | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 10 | class CompletePurchaseResponse extends AbstractResponse |
||
| 11 | { |
||
| 12 | /** |
||
| 13 | * Is the response pending? |
||
| 14 | * |
||
| 15 | * @return boolean |
||
| 16 | */ |
||
| 17 | public function isPending() |
||
| 18 | { |
||
| 19 | return $this->data->createdPaymentOutput->payment->statusOutput->statusCategory == 'PENDING_PAYMENT'; |
||
| 20 | } |
||
| 21 | |||
| 22 | /** |
||
| 23 | * Is the response successful? |
||
| 24 | * |
||
| 25 | * @return boolean |
||
| 26 | */ |
||
| 27 | public function isSuccessful() |
||
| 28 | { |
||
| 29 | return $this->data->createdPaymentOutput->paymentStatusCategory == 'SUCCESSFUL'; |
||
| 30 | } |
||
| 31 | |||
| 32 | /** |
||
| 33 | * Get the authorisation code if available. |
||
| 34 | * |
||
| 35 | * @return null|string |
||
| 36 | */ |
||
| 37 | public function getTransactionReference() |
||
| 40 | } |
||
| 41 | |||
| 42 | /** |
||
| 43 | * Get the merchant response message if available. |
||
| 44 | * |
||
| 45 | * @return null|string |
||
| 46 | */ |
||
| 47 | public function getMessage() |
||
| 48 | { |
||
| 49 | return $this->data->createdPaymentOutput->payment->status; |
||
| 50 | } |
||
| 51 | |||
| 52 | /** |
||
| 53 | * Get the card reference (payment token) if available |
||
| 54 | * |
||
| 55 | * @return null|string |
||
| 56 | */ |
||
| 57 | public function getCardReference() |
||
| 61 | } |
||
| 62 | } |
||
| 63 |