CreateTransactionResponse   A
last analyzed

Complexity

Total Complexity 5

Size/Duplication

Total Lines 25
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 2
Bugs 0 Features 1
Metric Value
eloc 5
c 2
b 0
f 1
dl 0
loc 25
ccs 7
cts 7
cp 1
rs 10
wmc 5

3 Methods

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