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

getTransactionReference()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 2
Bugs 0 Features 0
Metric Value
cc 1
eloc 1
c 2
b 0
f 0
nc 1
nop 0
dl 0
loc 3
ccs 2
cts 2
cp 1
crap 1
rs 10
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