Completed
Push — master ( 3e6656...a43425 )
by Andrii
10s
created

Gateway::getSecretKey()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 0
1
<?php
2
3
/*
4
 * RoboKassa driver for Omnipay PHP payment library
5
 *
6
 * @link      https://github.com/hiqdev/omnipay-robokassa
7
 * @package   omnipay-robokassa
8
 * @license   MIT
9
 * @copyright Copyright (c) 2015-2016, HiQDev (http://hiqdev.com/)
10
 */
11
12
namespace Omnipay\RoboKassa;
13
14
use Omnipay\Common\AbstractGateway;
15
16
/**
17
  * Gateway for ePayService.
18
  */
19
class Gateway extends AbstractGateway
20
{
21
    /**
22
      * {@inheritdoc}
23
      */
24
    public function getName()
25
    {
26
        return 'RoboKassa';
27
    }
28
29
    public function getAssetDir()
30
    {
31
        return dirname(__DIR__) . '/assets';
32
    }
33
34
    /**
35
      * {@inheritdoc}
36
      */
37
    public function getDefaultParameters()
38
    {
39
        return [
40
            'purse' => '',
41
            'secretKey'     => '',
42
            'testMode'      => false,
43
        ];
44
    }
45
46
    /**
47
      * Get the unified purse.
48
      *
49
      * @return string merchant purse
50
      */
51
    public function getPurse()
52
    {
53
        return $this->getParameter('purse');
54
    }
55
56
    /**
57
     * Set the unified purse.
58
     *
59
     * @param string $purse merchant purse
0 ignored issues
show
Bug introduced by
There is no parameter named $purse. Was it maybe removed?

This check looks for PHPDoc comments describing methods or function parameters that do not exist on the corresponding method or function.

Consider the following example. The parameter $italy is not defined by the method finale(...).

/**
 * @param array $germany
 * @param array $island
 * @param array $italy
 */
function finale($germany, $island) {
    return "2:1";
}

The most likely cause is that the parameter was removed, but the annotation was not.

Loading history...
60
     *
61
     * @return self
62
     */
63
    public function setPurse($value)
64
    {
65
        return $this->setParameter('purse', $value);
66
    }
67
68
    /**
69
     * Get the unified secret key.
70
     *
71
     * @return string secret key
72
     */
73
    public function getSecretKey()
74
    {
75
        return $this->getParameter('secretKey');
76
    }
77
78
    /**
79
     * Set the unified secret key.
80
     *
81
     * @param string $value secret key
82
     *
83
     * @return self
84
     */
85
    public function setSecretKey($value)
86
    {
87
        return $this->setParameter('secretKey', $value);
88
    }
89
90
    /**
91
     * @param array $parameters
92
     *
93
     * @return \Omnipay\ePayService\Message\PurchaseRequest
94
     */
95
    public function purchase(array $parameters = [])
96
    {
97
        return $this->createRequest('\Omnipay\RoboKassa\Message\PurchaseRequest', $parameters);
98
    }
99
100
    /**
101
     * @param array $parameters
102
     *
103
     * @return \Omnipay\ePayService\Message\CompletePurchaseRequest
104
     */
105
    public function completePurchase(array $parameters = [])
106
    {
107
        return $this->createRequest('\Omnipay\RoboKassa\Message\CompletePurchaseRequest', $parameters);
108
    }
109
}
110