RedirectGateway::purchase()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 1
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
ccs 1
cts 1
cp 1
cc 1
nc 1
nop 1
crap 1
1
<?php
2
3
namespace Omnipay\BPOINT;
4
5
use Omnipay\Common\AbstractGateway;
6
use Omnipay\BPOINT\Message\CompletePurchaseRequest;
7
use Omnipay\BPOINT\Message\PurchaseRequest;
8
use Omnipay\BPOINT\Message\WebhookNotification;
9
10
/**
11
 * BPOINT Redirect Gateway
12
 *
13
 * @link https://www.bpoint.com.au/developers/v3/
14
 */
15
class RedirectGateway extends AbstractGateway
16 1
{
17
    public function getName()
18 1
    {
19
        return 'BPOINT Redirect';
20
    }
21 31
22
    public function getDefaultParameters()
23
    {
24 31
        return array(
25
            'username' => '',
26
            'password' => '',
27
            'merchantNumber' => '',
28
            'merchantShortName' => '',
29
            'testMode' => false,
30
        );
31
    }
32 1
33
    public function getUsername()
34 1
    {
35
        return $this->getParameter('username');
36
    }
37 3
38
    public function setUsername($value)
39 3
    {
40
        return $this->setParameter('username', $value);
41
    }
42 1
43
    public function getPassword()
44 1
    {
45
        return $this->getParameter('password');
46
    }
47 3
48
    public function setPassword($value)
49 3
    {
50
        return $this->setParameter('password', $value);
51
    }
52 1
53
    public function getMerchantNumber()
54 1
    {
55
        return $this->getParameter('merchantNumber');
56
    }
57 3
58
    public function setMerchantNumber($value)
59 3
    {
60
        return $this->setParameter('merchantNumber', $value);
61
    }
62 1
63
    public function getMerchantShortName()
64 1
    {
65
        return $this->getParameter('merchantShortName');
66
    }
67 3
68
    public function setMerchantShortName($value)
69 3
    {
70
        return $this->setParameter('merchantShortName', $value);
71
    }
72 4
73
    public function purchase(array $parameters = array())
74 4
    {
75
        return $this->createRequest('\Omnipay\BPOINT\Message\PurchaseRequest', $parameters);
76
    }
77 5
78
    public function completePurchase(array $parameters = array())
79 5
    {
80
        return $this->createRequest('\Omnipay\BPOINT\Message\CompletePurchaseRequest', $parameters);
81
    }
82
83
    public function acceptNotification()
84
    {
85
        return $this->createRequest('\Omnipay\BPOINT\Message\WebhookNotification', array());
86
    }
87
}
88