Gateway   A
last analyzed

Complexity

Total Complexity 12

Size/Duplication

Total Lines 63
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 2
Bugs 1 Features 0
Metric Value
eloc 15
c 2
b 1
f 0
dl 0
loc 63
ccs 24
cts 24
cp 1
rs 10
wmc 12

12 Methods

Rating   Name   Duplication   Size   Complexity  
A setMerchantId() 0 3 1
A capture() 0 3 1
A refund() 0 3 1
A authorize() 0 3 1
A getMerchantId() 0 3 1
A purchase() 0 3 1
A getDefaultParameters() 0 5 1
A setMerchantKey() 0 3 1
A deleteCard() 0 3 1
A getMerchantKey() 0 3 1
A createCard() 0 3 1
A getName() 0 3 1
1
<?php
2
3
namespace Omnipay\Moneris;
4
5
use Omnipay\Common\AbstractGateway;
6
7
/**
8
 * Moneris Gateway.
9
 *
10
 * @link https://esqa.moneris.com/mpg/reports/transaction/index.php
11
 * @link https://developer.moneris.com/en/Documentation/NA/E-Commerce%20Solutions/API/
12
 */
13
class Gateway extends AbstractGateway
14
{
15 3
    public function getName()
16
    {
17 3
        return 'Moneris';
18
    }
19
20 105
    public function getDefaultParameters()
21
    {
22
        return [
23 105
            'merchantId'  => '',
24
            'merchantKey' => '',
25
        ];
26
    }
27
28 3
    public function getMerchantId()
29
    {
30 3
        return $this->getParameter('merchantId');
31
    }
32
33 21
    public function setMerchantId($value)
34
    {
35 21
        return $this->setParameter('merchantId', $value);
36
    }
37
38 3
    public function getMerchantKey()
39
    {
40 3
        return $this->getParameter('merchantKey');
41
    }
42
43 21
    public function setMerchantKey($value)
44
    {
45 21
        return $this->setParameter('merchantKey', $value);
46
    }
47
48 12
    public function createCard(array $parameters = [])
49
    {
50 12
        return $this->createRequest('\Omnipay\Moneris\Message\CreateCardRequest', $parameters);
51
    }
52
53 12
    public function deleteCard(array $parameters = [])
54
    {
55 12
        return $this->createRequest('\Omnipay\Moneris\Message\DeleteCardRequest', $parameters);
56
    }
57
58 12
    public function purchase(array $parameters = [])
59
    {
60 12
        return $this->createRequest('\Omnipay\Moneris\Message\PurchaseRequest', $parameters);
61
    }
62
63 15
    public function refund(array $parameters = [])
64
    {
65 15
        return $this->createRequest('\Omnipay\Moneris\Message\RefundRequest', $parameters);
66
    }
67
68 12
    public function authorize(array $parameters = [])
69
    {
70 12
        return $this->createRequest('\Omnipay\Moneris\Message\AuthorizeRequest', $parameters);
71
    }
72
73 12
    public function capture(array $parameters = [])
74
    {
75 12
        return $this->createRequest('\Omnipay\Moneris\Message\CaptureRequest', $parameters);
76
    }
77
}
78