Gateway::completePurchase()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 3
c 1
b 0
f 0
dl 0
loc 4
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
10
/**
11
 * Windcave HPP Payment Gateway
12
 */
13
class Gateway extends AbstractGateway {
14
    /**
15
     * Get name
16
     *
17
     * @return string
18
     */
19
    public function getName() {
20
        return 'Windcave Hpp';
21
    }
22
23
    /**
24
     * Get default parameters
25
     *
26
     * @return array
27
     */
28
    public function getDefaultParameters() {
29
        return [];
30
    }
31
32
    public function setApiUsername($value) {
33
        return $this->setParameter('apiUsername', $value);
34
    }
35
36
    public function getApiUsername() {
37
        return $this->getParameter('apiUsername');
38
    }
39
40
    public function setApiKey($value) {
41
        return $this->setParameter('apiKey', $value);
42
    }
43
44
    public function getApiKey() {
45
        return $this->getParameter('apiKey');
46
    }
47
48
    /**
49
     * Purchase
50
     *
51
     * @param array $parameters Parameters
52
     *
53
     * @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...
54
     */
55
    public function purchase(array $parameters = []) {
56
        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...
57
            PurchaseRequest::class,
58
            $parameters
59
        );
60
    }
61
62
    /**
63
     * Complete a purchase process
64
     *
65
     * @param array $parameters
66
     *
67
     * @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...
68
     */
69
    public function completePurchase(array $parameters = []) {
70
        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...
71
            CompletePurchaseRequest::class,
72
            $parameters
73
        );
74
    }
75
76
    public function acceptNotification(array $parameters = []) {
77
        return $this->createRequest(
78
            AcceptNotification::class,
79
            $parameters
80
        )->send();
81
    }
82
}
83