Passed
Pull Request — main (#5)
by Leith
03:40
created

Gateway::completeCreateCard()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 3
c 0
b 0
f 0
dl 0
loc 5
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\AcceptNotification;
7
use Omnipay\WindcaveHpp\Message\CompletePurchaseRequest;
8
use Omnipay\WindcaveHpp\Message\PurchaseRequest;
9
use Omnipay\WindcaveHpp\Message\RefundRequest;
10
11
/**
12
 * Windcave HPP Payment Gateway
13
 */
14
class Gateway extends AbstractGateway
15
{
16
    /**
17
     * Get name
18
     *
19
     * @return string
20
     */
21
    public function getName()
22
    {
23
        return 'Windcave Hpp';
24
    }
25
26
    /**
27
     * Get default parameters
28
     *
29
     * @return array
30
     */
31
    public function getDefaultParameters()
32
    {
33
        return [];
34
    }
35
36
    public function setApiUsername($value)
37
    {
38
        return $this->setParameter('apiUsername', $value);
39
    }
40
41
    public function getApiUsername()
42
    {
43
        return $this->getParameter('apiUsername');
44
    }
45
46
    public function setApiKey($value)
47
    {
48
        return $this->setParameter('apiKey', $value);
49
    }
50
51
    public function getApiKey()
52
    {
53
        return $this->getParameter('apiKey');
54
    }
55
56
    /**
57
     * Purchase
58
     *
59
     * @param array $parameters Parameters
60
     *
61
     * @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...
62
     */
63
    public function purchase(array $parameters = [])
64
    {
65
        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...
66
            PurchaseRequest::class,
67
            $parameters
68
        );
69
    }
70
71
    /**
72
     * Complete a purchase process
73
     *
74
     * @param array $parameters
75
     *
76
     * @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...
77
     */
78
    public function completePurchase(array $parameters = [])
79
    {
80
        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...
81
            CompletePurchaseRequest::class,
82
            $parameters
83
        );
84
    }
85
86
    public function acceptNotification(array $parameters = [])
87
    {
88
        return $this->createRequest(
89
            AcceptNotification::class,
90
            $parameters
91
        )->send();
92
    }
93
94
    /**
95
     * Refund
96
     *
97
     * @param array $parameters Parameters
98
     *
99
     * @return Omnipay\WindcaveHpp\Message\RefundRequest
0 ignored issues
show
Bug introduced by
The type Omnipay\WindcaveHpp\Omni...p\Message\RefundRequest was not found. Did you mean Omnipay\WindcaveHpp\Message\RefundRequest? If so, make sure to prefix the type with \.
Loading history...
100
     */
101
    public function refund(array $parameters = [])
102
    {
103
        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\RefundRequest which is incompatible with the documented return type Omnipay\WindcaveHpp\Omni...p\Message\RefundRequest.
Loading history...
104
            RefundRequest::class,
105
            $parameters
106
        );
107
    }
108
}
109