Completed
Pull Request — master (#13)
by
unknown
16:15 queued 12:45
created

Gateway::getDefaultParameters()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 7

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 7
ccs 3
cts 3
cp 1
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
crap 1
1
<?php
2
3
namespace Omnipay\Paysera;
4
5
use Omnipay\Common\AbstractGateway;
6
use Omnipay\Paysera\Message\PurchaseRequest;
7
use Omnipay\Paysera\Message\AcceptNotificationRequest;
8
9
class Gateway extends AbstractGateway
10
{
11
    /**
12
     * Version of API.
13
     */
14
    const VERSION = '1.6';
15
16
    /**
17
     * {@inheritdoc}
18
     */
19 1
    public function getName()
20
    {
21 1
        return 'Paysera';
22
    }
23
24
    /**
25
     * {@inheritdoc}
26
     */
27 20
    public function getDefaultParameters()
28
    {
29
        return [
30 20
            'testMode' => true,
31 20
            'version' => self::VERSION,
32
        ];
33
    }
34
35
    /**
36
     * Get the Project ID.
37
     *
38
     * @return string
39
     */
40 1
    public function getProjectId()
41
    {
42 1
        return $this->getParameter('projectId');
43
    }
44
45
    /**
46
     * Set the Project ID.
47
     *
48
     * @param  string  $value
49
     * @return $this
50
     */
51 20
    public function setProjectId($value)
52
    {
53 20
        return $this->setParameter('projectId', $value);
54
    }
55
56
    /**
57
     * Get the password.
58
     *
59
     * @return string
60
     */
61 1
    public function getPassword()
62
    {
63 1
        return $this->getParameter('password');
64
    }
65
66
    /**
67
     * Set the password.
68
     *
69
     * @param  string  $value
70
     * @return $this
71
     */
72 20
    public function setPassword($value)
73
    {
74 20
        return $this->setParameter('password', $value);
75
    }
76
77
    /**
78
     * Get the API version.
79
     *
80
     * @return string
81
     */
82 1
    public function getVersion()
83
    {
84 1
        return $this->getParameter('version');
85
    }
86
87
    /**
88
     * Set the API version.
89
     *
90
     * @param  string  $value
91
     * @return $this
92
     */
93 2
    public function setVersion($value)
94
    {
95 2
        return $this->setParameter('version', $value);
96
    }
97
98
    /**
99
     * {@inheritdoc}
100
     */
101 3
    public function purchase(array $options = [])
102
    {
103 3
        return $this->createRequest(PurchaseRequest::class, $options);
104
    }
105
106
    /**
107
     * {@inheritdoc}
108
     */
109 1
    public function acceptNotification(array $options = [])
110
    {
111 1
        return $this->createRequest(AcceptNotificationRequest::class, $options);
112
    }
113
}
114