Gateway::getMerchantId()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 1
c 1
b 0
f 0
nc 1
nop 0
dl 0
loc 3
rs 10
1
<?php
2
3
namespace Omnipay\Worldline;
4
5
use Omnipay\Common\AbstractGateway;
6
use Omnipay\Worldline\Message\CompletePurchaseRequest;
7
use Omnipay\Worldline\Message\PurchaseRequest;
8
9
/**
10
 * Worldline Hosted Checkout Gateway
11
 *
12
 * @link http://www..worldline-solutions.com/
13
 *
14
 * @see https://docs.direct.worldline-solutions.com/en/api-reference#tag/HostedCheckout
15
 */
16
class Gateway extends AbstractGateway
17
{
18
    public function getName()
19
    {
20
        return 'Worldline';
21
    }
22
23
    public function getDefaultParameters()
24
    {
25
        return array(
26
            'apiKey'     => '',
27
            'apiSecret'  => '',
28
            'merchantId' => '',
29
            'testMode'   => false,
30
        );
31
    }
32
33
    public function getApiKey()
34
    {
35
        return $this->getParameter('apiKey');
36
    }
37
38
    public function setApiKey($value)
39
    {
40
        return $this->setParameter('apiKey', $value);
41
    }
42
43
    public function getApiSecret()
44
    {
45
        return $this->getParameter('apiSecret');
46
    }
47
48
    public function setApiSecret($value)
49
    {
50
        return $this->setParameter('apiSecret', $value);
51
    }
52
53
    public function getMerchantId()
54
    {
55
        return $this->getParameter('merchantId');
56
    }
57
58
    public function setMerchantId($value)
59
    {
60
        return $this->setParameter('merchantId', $value);
61
    }
62
63
    public function purchase(array $parameters = [])
64
    {
65
        return $this->createRequest(PurchaseRequest::class, $parameters);
66
    }
67
68
    public function completePurchase(array $parameters = [])
69
    {
70
        return $this->createRequest(CompletePurchaseRequest::class, $parameters);
71
    }
72
}
73