Gateway   A
last analyzed

Complexity

Total Complexity 12

Size/Duplication

Total Lines 75
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
c 0
b 0
f 0
dl 0
loc 75
ccs 0
cts 49
cp 0
rs 10
wmc 12

12 Methods

Rating   Name   Duplication   Size   Complexity  
A setTradeType() 0 3 1
A getAppId() 0 3 1
A setAppId() 0 3 1
A getAppKey() 0 3 1
A fetchTransaction() 0 3 1
A setAppKey() 0 3 1
A getDefaultParameters() 0 4 1
A acceptNotification() 0 3 1
A purchase() 0 3 1
A getName() 0 3 1
A compareTransaction() 0 3 1
A getTradeType() 0 3 1
1
<?php
2
3
namespace Omnipay\MyCard;
4
5
6
use Omnipay\Common\AbstractGateway;
7
use Omnipay\MyCard\Message\CompareTransaction;
8
9
class Gateway extends AbstractGateway
10
{
11
12
13
    public function getName()
14
    {
15
        return 'MyCard';
16
    }
17
18
19
    public function getDefaultParameters()
20
    {
21
        return [
22
            'TradeType' => '2',     //1:Android SDK (手遊適用) 2:WEB
23
        ];
24
    }
25
26
27
    public function getAppId()
28
    {
29
        return $this->getParameter('appId');
30
    }
31
32
33
    public function setAppId($value)
34
    {
35
        return $this->setParameter('appId', $value);
36
    }
37
38
39
    public function getAppKey()
40
    {
41
        return $this->getParameter('appKey');
42
    }
43
44
45
    public function setAppKey($value)
46
    {
47
        return $this->setParameter('appKey', $value);
48
    }
49
50
51
    public function getTradeType()
52
    {
53
        return $this->getParameter('tradeType');
54
    }
55
56
57
    public function setTradeType($value)
58
    {
59
        return $this->setParameter('tradeType', $value);
60
    }
61
62
63
    public function purchase(array $parameters = array())
64
    {
65
        return $this->createRequest('\Omnipay\MyCard\Message\PurchaseRequest', $parameters);
66
    }
67
68
69
    public function acceptNotification(array $parameters = array())
70
    {
71
        return $this->createRequest('\Omnipay\MyCard\Message\NotificationRequest', $parameters);
72
    }
73
74
75
    public function fetchTransaction(array $parameters = array())
76
    {
77
        return $this->createRequest('\Omnipay\MyCard\Message\FetchRequest', $parameters);
78
    }
79
80
81
    public function compareTransaction()
82
    {
83
        return new CompareTransaction();
84
    }
85
86
}