Gateway   A
last analyzed

Complexity

Total Complexity 11

Size/Duplication

Total Lines 59
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 15
c 1
b 0
f 0
dl 0
loc 59
rs 10
wmc 11

11 Methods

Rating   Name   Duplication   Size   Complexity  
A getName() 0 3 1
A getMerchantId() 0 3 1
A getPassword() 0 3 1
A capture() 0 3 1
A completePurchase() 0 3 1
A setPassword() 0 3 1
A getDefaultParameters() 0 6 1
A refund() 0 3 1
A setMerchantId() 0 3 1
A void() 0 3 1
A purchase() 0 3 1
1
<?php
2
3
namespace Empatix\OmnipaySwedbank;
4
5
use Omnipay\Common\AbstractGateway;
6
7
class Gateway extends AbstractGateway
8
{
9
    public function getName()
10
    {
11
        return 'Swedbank Payments';
12
    }
13
14
    public function getDefaultParameters()
15
    {
16
        return [
17
            'merchantId' => '',
18
            'password' => '',
19
            'testMode' => false,
20
        ];
21
    }
22
23
    public function getMerchantId()
24
    {
25
        return $this->getParameter('merchantId');
26
    }
27
28
    public function setMerchantId($value)
29
    {
30
        return $this->setParameter('merchantId', $value);
31
    }
32
33
    public function getPassword()
34
    {
35
        return $this->getParameter('password');
36
    }
37
38
    public function setPassword($value)
39
    {
40
        return $this->setParameter('password', $value);
41
    }
42
43
    public function purchase(array $parameters = array())
44
    {
45
        return $this->createRequest('Empatix\OmnipaySwedbank\Messages\PurchaseRequest', $parameters);
46
    }
47
48
    public function capture(array $parameters = array())
49
    {
50
        return $this->createRequest('Empatix\OmnipaySwedbank\Messages\CaptureRequest', $parameters);
51
    }
52
53
    public function completePurchase(array $parameters = array())
54
    {
55
        return $this->createRequest('Empatix\OmnipaySwedbank\Messages\CompletePurchaseRequest', $parameters);
56
    }
57
58
    public function void(array $parameters = array())
59
    {
60
        return $this->createRequest('Empatix\OmnipaySwedbank\Messages\AnnulRequest', $parameters);
61
    }
62
63
    public function refund(array $parameters = array())
64
    {
65
        return $this->createRequest('Empatix\OmnipaySwedbank\Messages\ReversalRequest', $parameters);
66
    }
67
}
68