Completed
Branch webservice-support (1bfa77)
by John
02:37
created

RedirectGateway   A

Complexity

Total Complexity 12

Size/Duplication

Total Lines 68
Duplicated Lines 0 %

Coupling/Cohesion

Components 2
Dependencies 1

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 12
lcom 2
cbo 1
dl 0
loc 68
ccs 29
cts 29
cp 1
rs 10
c 0
b 0
f 0

12 Methods

Rating   Name   Duplication   Size   Complexity  
A getName() 0 4 1
A getDefaultParameters() 0 10 1
A getMerchantId() 0 4 1
A setMerchantId() 0 4 1
A getMerchantName() 0 4 1
A setMerchantName() 0 4 1
A getTerminalId() 0 4 1
A setTerminalId() 0 4 1
A getHmacKey() 0 4 1
A setHmacKey() 0 4 1
A purchase() 0 4 1
A completePurchase() 0 4 1
1
<?php
2
3
namespace Omnipay\Redsys;
4
5
use Omnipay\Common\AbstractGateway;
6
use Omnipay\Redsys\Message\CompletePurchaseRequest;
7
use Omnipay\Redsys\Message\PurchaseRequest;
8
9
/**
10
 * Redsys Redirect Gateway
11
 *
12
 * @link http://www.redsys.es/
13
 */
14
class RedirectGateway extends AbstractGateway
15
{
16 1
    public function getName()
17
    {
18 1
        return 'Redsys Redirect';
19
    }
20
21 30
    public function getDefaultParameters()
22
    {
23
        return array(
24 30
            'merchantId' => '',
25 30
            'merchantName' => '',
26 30
            'terminalId' => '',
27 30
            'hmacKey' => '',
28 30
            'testMode' => false,
29 30
        );
30
    }
31
32 1
    public function getMerchantId()
33
    {
34 1
        return $this->getParameter('merchantId');
35
    }
36
37 3
    public function setMerchantId($value)
38
    {
39 3
        return $this->setParameter('merchantId', $value);
40
    }
41
42 1
    public function getMerchantName()
43
    {
44 1
        return $this->getParameter('merchantName');
45
    }
46
47 3
    public function setMerchantName($value)
48
    {
49 3
        return $this->setParameter('merchantName', $value);
50
    }
51
52 1
    public function getTerminalId()
53
    {
54 1
        return $this->getParameter('terminalId');
55
    }
56
57 3
    public function setTerminalId($value)
58
    {
59 3
        return $this->setParameter('terminalId', $value);
60
    }
61
62 1
    public function getHmacKey()
63
    {
64 1
        return $this->getParameter('hmacKey');
65
    }
66
67 3
    public function setHmacKey($value)
68
    {
69 3
        return $this->setParameter('hmacKey', $value);
70
    }
71
72 3
    public function purchase(array $parameters = array())
73
    {
74 3
        return $this->createRequest('\Omnipay\Redsys\Message\PurchaseRequest', $parameters);
75
    }
76
77 5
    public function completePurchase(array $parameters = array())
78
    {
79 5
        return $this->createRequest('\Omnipay\Redsys\Message\CompletePurchaseRequest', $parameters);
80
    }
81
}
82