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\SmartPay;
4
5
use Omnipay\Common\AbstractGateway;
6
use Omnipay\SmartPay\Message\CompletePurchaseRequest;
7
use Omnipay\SmartPay\Message\PurchaseRequest;
8
9
/**
10
 * Bank Muscat Payment Gateway
11
 */
12
class Gateway extends AbstractGateway
13
{
14
    /**
15
     * Get name
16
     *
17
     * @return string
18
     */
19
    public function getName()
20
    {
21
        return 'SmartPay';
22
    }
23
24
    /**
25
     * Get default parameters
26
     *
27
     * @return array
28
     */
29
    public function getDefaultParameters()
30
    {
31
        return [];
32
    }
33
34
    public function getMerchantId()
35
    {
36
        return $this->getParameter('merchantId');
37
    }
38
39
    public function setMerchantId($merchantId)
40
    {
41
        return $this->setParameter('merchantId', $merchantId);
42
    }
43
44
    public function getAccessCode()
45
    {
46
        return $this->getParameter('accessCode');
47
    }
48
49
    public function setAccessCode($accessCode)
50
    {
51
        return $this->setParameter('accessCode', $accessCode);
52
    }
53
54
    public function getWorkingKey()
55
    {
56
        return $this->getParameter('workingKey');
57
    }
58
59
    public function setWorkingKey($workingKey)
60
    {
61
        return $this->setParameter('workingKey', $workingKey);
62
    }
63
64
    /**
65
     * Purchase
66
     *
67
     * @param array $parameters Parameters
68
     *
69
     * @return Omnipay\SmartPay\Message\PurchaseRequest
0 ignored issues
show
Bug introduced by
The type Omnipay\SmartPay\Omnipay...Message\PurchaseRequest was not found. Did you mean Omnipay\SmartPay\Message\PurchaseRequest? If so, make sure to prefix the type with \.
Loading history...
70
     */
71
    public function purchase(array $parameters = [])
72
    {
73
        return $this->createRequest(
0 ignored issues
show
Bug Best Practice introduced by
The expression return $this->createRequ...st::class, $parameters) returns the type Omnipay\SmartPay\Message\PurchaseRequest which is incompatible with the documented return type Omnipay\SmartPay\Omnipay...Message\PurchaseRequest.
Loading history...
74
            PurchaseRequest::class,
75
            $parameters
76
        );
77
    }
78
79
    /**
80
     * Complete a purchase process
81
     *
82
     * @param array $parameters
83
     *
84
     * @return Omnipay\SmartPay\Message\CompletePurchaseRequest
0 ignored issues
show
Bug introduced by
The type Omnipay\SmartPay\Omnipay...CompletePurchaseRequest was not found. Did you mean Omnipay\SmartPay\Message\CompletePurchaseRequest? If so, make sure to prefix the type with \.
Loading history...
85
     */
86
    public function completePurchase(array $parameters = array())
87
    {
88
        return $this->createRequest(CompletePurchaseRequest::class, $parameters);
0 ignored issues
show
Bug Best Practice introduced by
The expression return $this->createRequ...st::class, $parameters) returns the type Omnipay\SmartPay\Message\CompletePurchaseRequest which is incompatible with the documented return type Omnipay\SmartPay\Omnipay...CompletePurchaseRequest.
Loading history...
89
    }
90
}
91