Passed
Push — master ( 6e840b...d8ec44 )
by Kiet
01:39
created

TransactionStatusResponse   A

Complexity

Total Complexity 5

Size/Duplication

Total Lines 24
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 6
Bugs 0 Features 1
Metric Value
wmc 5
eloc 4
c 6
b 0
f 1
dl 0
loc 24
ccs 6
cts 6
cp 1
rs 10

3 Methods

Rating   Name   Duplication   Size   Complexity  
A isSuccessful() 0 3 2
A isCancelled() 0 3 2
A getTransactionReference() 0 3 1
1
<?php
2
3
namespace Omnipay\IcepayPayments\Message;
4
5
/**
6
 * The response after getting the transaction status at Icepay.
7
 */
8
class TransactionStatusResponse extends AbstractResponse
9
{
10
    /**
11
     * {@inheritdoc}
12
     */
13 2
    public function isSuccessful(): bool
14
    {
15 2
        return isset($this->data['statusCode']) && $this->data['statusCode'] === 200;
16
    }
17
18
    /**
19
     * {@inheritdoc}
20
     */
21 1
    public function isCancelled(): bool
22
    {
23 1
        return parent::isCancelled() || $this->data['statusCode'] === self::RESPONSE_STATUS_CANCELLED;
24
    }
25
26
    /**
27
     * {@inheritdoc}
28
     */
29 1
    public function getTransactionReference(): ?string
30
    {
31 1
        return $this->request->getTransactionReference();
32
    }
33
}
34