Passed
Push — main ( f60e44...b1b5d7 )
by
unknown
08:37
created

Gateway   A

Complexity

Total Complexity 9

Size/Duplication

Total Lines 77
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 9
eloc 16
c 1
b 0
f 0
dl 0
loc 77
rs 10

9 Methods

Rating   Name   Duplication   Size   Complexity  
A setApiKey() 0 3 1
A getName() 0 3 1
A completePurchase() 0 5 1
A acceptNotification() 0 5 1
A setApiUsername() 0 3 1
A getApiKey() 0 3 1
A purchase() 0 5 1
A getApiUsername() 0 3 1
A getDefaultParameters() 0 3 1
1
<?php
2
3
namespace Omnipay\WindcaveHpp;
4
5
use Omnipay\Common\AbstractGateway;
6
use Omnipay\WindcaveHpp\Message\AcceptNotification;
7
use Omnipay\WindcaveHpp\Message\CompletePurchaseRequest;
8
use Omnipay\WindcaveHpp\Message\PurchaseRequest;
9
10
/**
11
 * Windcave HPP Payment Gateway
12
 */
13
class Gateway extends AbstractGateway
14
{
15
    /**
16
     * Get name
17
     *
18
     * @return string
19
     */
20
    public function getName()
21
    {
22
        return 'Windcave Hpp';
23
    }
24
25
    /**
26
     * Get default parameters
27
     *
28
     * @return array
29
     */
30
    public function getDefaultParameters()
31
    {
32
        return [];
33
    }
34
35
    public function setApiUsername($value)
36
    {
37
        return $this->setParameter('apiUsername', $value);
38
    }
39
40
    public function getApiUsername()
41
    {
42
        return $this->getParameter('apiUsername');
43
    }
44
45
    public function setApiKey($value)
46
    {
47
        return $this->setParameter('apiKey', $value);
48
    }
49
50
    public function getApiKey()
51
    {
52
        return $this->getParameter('apiKey');
53
    }
54
55
    /**
56
     * Purchase
57
     *
58
     * @param array $parameters Parameters
59
     *
60
     * @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...
61
     */
62
    public function purchase(array $parameters = [])
63
    {
64
        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...
65
            PurchaseRequest::class,
66
            $parameters
67
        );
68
    }
69
70
    /**
71
     * Complete a purchase process
72
     *
73
     * @param array $parameters
74
     *
75
     * @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...
76
     */
77
    public function completePurchase(array $parameters = array())
78
    {
79
        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\Mess...CompletePurchaseRequest which is incompatible with the documented return type Omnipay\WindcaveHpp\Omni...CompletePurchaseRequest.
Loading history...
80
            CompletePurchaseRequest::class,
81
            $parameters
82
        );
83
    }
84
85
    public function acceptNotification(array $parameters = [])
86
    {
87
        return $this->createRequest(
88
            AcceptNotification::class,
89
            $parameters
90
        );
91
    }
92
}
93