Gateway   A
last analyzed

Complexity

Total Complexity 13

Size/Duplication

Total Lines 155
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 13
lcom 1
cbo 1
dl 0
loc 155
ccs 26
cts 26
cp 1
rs 10
c 0
b 0
f 0

13 Methods

Rating   Name   Duplication   Size   Complexity  
A getName() 0 4 1
A getIntegrationKey() 0 4 1
A setIntegrationKey() 0 4 1
A authorize() 0 4 1
A capture() 0 4 1
A refund() 0 4 1
A fetchTransaction() 0 4 1
A purchase() 0 4 1
A createCard() 0 4 1
A getDefaultParameters() 0 7 1
A cancel() 0 4 1
A cancelRefund() 0 4 1
A paymentPage() 0 4 1
1
<?php
2
3
namespace Omnipay\Ebanx;
4
5
use Omnipay\Common\AbstractGateway;
6
7
/**
8
 * Ebanx Gateway
9
 */
10
class Gateway extends AbstractGateway
11
{
12 3
    public function getName()
13
    {
14 3
        return 'Ebanx';
15
    }
16
17
    /**
18
     * Get the gateway parameters.
19
     *
20
     * @return array
21
     */
22 90
    public function getDefaultParameters()
23
    {
24
        return array(
25 90
            'integration_key' => '',
26
            'test_mode' => false,
27
        );
28
    }
29
30
    /**
31
     * Get the gateway Integration Key.
32
     *
33
     * Authentication is by means of a single secret API key set as
34
     * the integrationKey parameter when creating the gateway object.
35
     *
36
     * @return string
37
     */
38 3
    public function getIntegrationKey()
39
    {
40 3
        return $this->getParameter('integration_key');
41
    }
42
43
    /**
44
     * Set Integration key
45
     *
46
     * @param  string $value
47
     * @return Gateway provides a fluent interface.
48
     */
49 18
    public function setIntegrationKey($value)
50
    {
51 18
        return $this->setParameter('integration_key', $value);
52
    }
53
54
55
    /**
56
     * Authorize Request.
57
     *
58
     * @param array $parameters
59
     *
60
     * @return \Omnipay\Ebanx\Message\AuthorizeRequest
61
     */
62 9
    public function authorize(array $parameters = array())
63
    {
64 9
        return $this->createRequest('\Omnipay\Ebanx\Message\AuthorizeRequest', $parameters);
65
    }
66
67
68
    /**
69
     * Capture Request.
70
     *
71
     * @param array $parameters
72
     *
73
     * @return \Omnipay\Ebanx\Message\CaptureRequest
74
     */
75 9
    public function capture(array $parameters = array())
76
    {
77 9
        return $this->createRequest('\Omnipay\Ebanx\Message\CaptureRequest', $parameters);
78
    }
79
80
    /**
81
     * Cancel Request.
82
     *
83
     * @param array $parameters
84
     *
85
     * @return \Omnipay\Ebanx\Message\CancelRequest
86
     */
87 3
    public function cancel(array $parameters = array())
88
    {
89 3
        return $this->createRequest('\Omnipay\Ebanx\Message\CancelRequest', $parameters);
90
    }
91
92
    /**
93
     * Refund Request.
94
     *
95
     * @param array $parameters
96
     *
97
     * @return \Omnipay\Ebanx\Message\RefundRequest
98
     */
99 9
    public function refund(array $parameters = array())
100
    {
101 9
        return $this->createRequest('\Omnipay\Ebanx\Message\RefundRequest', $parameters);
102
    }
103
104
    /**
105
     * Cancel Refund Request.
106
     *
107
     * @param array $parameters
108
     *
109
     * @return \Omnipay\Ebanx\Message\CancelRefundRequest
110
     */
111 3
    public function cancelRefund(array $parameters = array())
112
    {
113 3
        return $this->createRequest('\Omnipay\Ebanx\Message\CancelRefundRequest', $parameters);
114
    }
115
116
    /**
117
     * Fetch Transaction Request.
118
     *
119
     * @param array $parameters
120
     *
121
     * @return \Omnipay\Ebanx\Message\FetchTransactionRequest
122
     */
123 3
    public function fetchTransaction(array $parameters = array())
124
    {
125 3
        return $this->createRequest('\Omnipay\Ebanx\Message\FetchTransactionRequest', $parameters);
126
    }
127
128
    /**
129
     * Purchase Request.
130
     *
131
     * @param array $parameters
132
     *
133
     * @return \Omnipay\Ebanx\Message\PurchaseRequest
134
     */
135 9
    public function purchase(array $parameters = array())
136
    {
137 9
        return $this->createRequest('\Omnipay\Ebanx\Message\PurchaseRequest', $parameters);
138
    }
139
140
141
    /**
142
     * Payment Page Request.
143
     *
144
     * @param array $parameters
145
     *
146
     * @return \Omnipay\Ebanx\Message\PaymentPageRequest
147
     */
148 3
    public function paymentPage(array $parameters = array())
149
    {
150 3
        return $this->createRequest('\Omnipay\Ebanx\Message\PaymentPageRequest', $parameters);
151
    }
152
153
    /**
154
     * Create Card Request.
155
     *
156
     * @param array $parameters
157
     *
158
     * @return \Omnipay\Ebanx\Message\CreateCardRequest
159
     */
160 9
    public function createCard(array $parameters = array())
161
    {
162 9
        return $this->createRequest('\Omnipay\Ebanx\Message\CreateCardRequest', $parameters);
163
    }
164
}
165