RestGateway   A
last analyzed

Complexity

Total Complexity 11

Size/Duplication

Total Lines 64
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 11
lcom 1
cbo 1
dl 0
loc 64
ccs 25
cts 25
cp 1
rs 10
c 0
b 0
f 0

11 Methods

Rating   Name   Duplication   Size   Complexity  
A getName() 0 4 1
A getApiKey() 0 4 1
A setApiKey() 0 4 1
A getKey() 0 4 1
A setKey() 0 4 1
A authorize() 0 4 1
A completeAuthorize() 0 4 1
A capture() 0 4 1
A void() 0 4 1
A refund() 0 4 1
A getDefaultParameters() 0 8 1
1
<?php
2
3
namespace Omnipay\ZipPay;
4
5
use Omnipay\Common\AbstractGateway;
6
use Omnipay\ZipPay\Message\RestAuthorizeRequest;
7
use Omnipay\ZipPay\Message\RestCompleteAuthorizeRequest;
8
use Omnipay\ZipPay\Message\RestCaptureRequest;
9
use Omnipay\ZipPay\Message\RestCancelRequest;
10
use Omnipay\ZipPay\Message\RestRefundRequest;
11
12
/**
13
 * ZipPay Gateway
14
 */
15
class RestGateway extends AbstractGateway
16
{
17 3
    public function getName()
18
    {
19 3
        return 'ZipPay Rest';
20
    }
21
22 98
    public function getDefaultParameters()
23
    {
24
        return array(
25 98
            'apiKey' => '',
26 36
            'key' => '',
27 36
            'testMode' => true,
28 36
        );
29
    }
30
31 3
    public function getApiKey()
32
    {
33 3
        return $this->getParameter('apiKey');
34
    }
35
36 18
    public function setApiKey($value)
37
    {
38 18
        return $this->setParameter('apiKey', $value);
39
    }
40
41 3
    public function getKey()
42
    {
43 3
        return $this->getParameter('key');
44
    }
45
46 18
    public function setKey($value)
47
    {
48 18
        return $this->setParameter('key', $value);
49
    }
50
51
    /**
52
     * @return Message\RestAuthorizeRequest
53
     */
54 12
    public function authorize(array $parameters = array())
55
    {
56 12
        return $this->createRequest(RestAuthorizeRequest::class, $parameters);
57
    }
58
59 12
    public function completeAuthorize(array $options = array())
60
    {
61 12
        return $this->createRequest(RestCompleteAuthorizeRequest::class, $options);
62
    }
63
64 12
    public function capture(array $options = array())
65
    {
66 12
        return $this->createRequest(RestCaptureRequest::class, $options);
67
    }
68
69 12
    public function void(array $options = array())
70
    {
71 12
        return $this->createRequest(RestCancelRequest::class, $options);
72
    }
73
74 12
    public function refund(array $options = array())
75
    {
76 12
        return $this->createRequest(RestRefundRequest::class, $options);
77
    }
78
}
79