FetchResponse   A
last analyzed

Complexity

Total Complexity 8

Size/Duplication

Total Lines 42
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
c 0
b 0
f 0
dl 0
loc 42
ccs 0
cts 27
cp 0
rs 10
wmc 8

7 Methods

Rating   Name   Duplication   Size   Complexity  
A getCurrency() 0 3 1
A isPaid() 0 3 1
A getMessage() 0 3 1
A isSuccessful() 0 3 2
A getTransactionId() 0 3 1
A getAmount() 0 3 1
A getCardNumber() 0 3 1
1
<?php
2
3
/**
4
 * 交易查询
5
 */
6
namespace Omnipay\MyCard\Message;
7
8
9
use Omnipay\Common\Message\AbstractResponse;
10
11
class FetchResponse extends AbstractResponse
12
{
13
14
    public function isSuccessful()
15
    {
16
        return ($this->getData()['PayResult'] == 3) ? true : false;
17
    }
18
19
20
    public function isPaid()
21
    {
22
        return $this->isSuccessful();
23
    }
24
25
26
    public function getTransactionId()
27
    {
28
        return $this->getData()['FacTradeSeq'];
29
    }
30
31
32
    public function getAmount()
33
    {
34
        return $this->getData()['Amount'];
35
    }
36
37
38
    public function getCurrency()
39
    {
40
        return $this->getData()['Currency'];
41
    }
42
43
44
    public function getCardNumber()
45
    {
46
        return $this->getData()['MyCardTradeNo'];
47
    }
48
49
50
    public function getMessage()
51
    {
52
        return $this->getData()['ReturnMsg'];
53
    }
54
55
}