Passed
Pull Request — master (#20)
by Kiet
02:29
created

RefundResponse::isSuccessful()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

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 0
cts 3
cp 0
crap 2
rs 10
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Omnipay\IcepayPayments\Message;
6
7
/**
8
 * Do note: refunds implementation has not been tested.
9
 */
10
class RefundResponse extends AbstractResponse
11
{
12
    /**
13
     * {@inheritdoc}
14
     */
15
    public function isSuccessful(): bool
16
    {
17
        return $this->getTransactionStatus() === self::TRANSACTION_STATUS_COMPLETED;
18
    }
19
20
    /**
21
     * {@inheritdoc}
22
     */
23
    public function isCancelled(): bool
24
    {
25
        return $this->getTransactionStatus() === self::TRANSACTION_STATUS_CANCELLED;
26
    }
27
28
    /**
29
     * {@inheritdoc}
30
     */
31
    protected function getTransactionStatus(): ?string
32
    {
33
        return $this->data['refundStatusCode'] ?? null;
34
    }
35
}
36