Passed
Push — main ( 007e00...f82f47 )
by
unknown
09:50
created

Gateway::setApiKey()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 1
c 0
b 0
f 0
dl 0
loc 3
rs 10
cc 1
nc 1
nop 1
1
<?php
2
3
namespace Omnipay\WindcaveHpp;
4
5
use Omnipay\Common\AbstractGateway;
6
use Omnipay\WindcaveHpp\Message\CompletePurchaseRequest;
7
use Omnipay\WindcaveHpp\Message\PurchaseRequest;
8
9
/**
10
 * Windcave HPP Payment Gateway
11
 */
12
class Gateway extends AbstractGateway
13
{
14
    /**
15
     * Get name
16
     *
17
     * @return string
18
     */
19
    public function getName()
20
    {
21
        return 'Windcave HPP';
22
    }
23
24
    /**
25
     * Get default parameters
26
     *
27
     * @return array
28
     */
29
    public function getDefaultParameters()
30
    {
31
        return [];
32
    }
33
34
    public function setApiUsername($value)
35
    {
36
        return $this->setParameter('apiUsername', $value);
37
    }
38
39
    public function getApiUsername()
40
    {
41
        return $this->getParameter('apiUsername');
42
    }
43
44
    public function setApiKey($value)
45
    {
46
        return $this->setParameter('apiKey', $value);
47
    }
48
49
    public function getApiKey()
50
    {
51
        return $this->getParameter('apiKey');
52
    }
53
54
    /**
55
     * Purchase
56
     *
57
     * @param array $parameters Parameters
58
     *
59
     * @return Omnipay\WindcaveHpp\Message\PurchaseRequest
0 ignored issues
show
Bug introduced by
The type Omnipay\WindcaveHpp\Omni...Message\PurchaseRequest was not found. Did you mean Omnipay\WindcaveHpp\Message\PurchaseRequest? If so, make sure to prefix the type with \.
Loading history...
60
     */
61
    public function purchase(array $parameters = [])
62
    {
63
        return $this->createRequest(
0 ignored issues
show
Bug Best Practice introduced by
The expression return $this->createRequ...st::class, $parameters) returns the type Omnipay\WindcaveHpp\Message\PurchaseRequest which is incompatible with the documented return type Omnipay\WindcaveHpp\Omni...Message\PurchaseRequest.
Loading history...
64
            PurchaseRequest::class,
65
            $parameters
66
        );
67
    }
68
69
    /**
70
     * Complete a purchase process
71
     *
72
     * @param array $parameters
73
     *
74
     * @return Omnipay\WindcaveHpp\Message\CompletePurchaseRequest
0 ignored issues
show
Bug introduced by
The type Omnipay\WindcaveHpp\Omni...CompletePurchaseRequest was not found. Did you mean Omnipay\WindcaveHpp\Mess...CompletePurchaseRequest? If so, make sure to prefix the type with \.
Loading history...
75
     */
76
    public function completePurchase(array $parameters = array())
77
    {
78
        return $this->createRequest(CompletePurchaseRequest::class, $parameters);
0 ignored issues
show
Bug Best Practice introduced by
The expression return $this->createRequ...st::class, $parameters) returns the type Omnipay\WindcaveHpp\Mess...CompletePurchaseRequest which is incompatible with the documented return type Omnipay\WindcaveHpp\Omni...CompletePurchaseRequest.
Loading history...
79
    }
80
}
81