FetchResponse::isSuccessful()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 6

Importance

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