Completed
Push — master ( 3d8f66...15d5e9 )
by Andrii
02:06
created

Gateway::setSecret()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 1
Metric Value
c 1
b 0
f 1
dl 0
loc 4
ccs 2
cts 2
cp 1
rs 10
cc 1
eloc 2
nc 1
nop 1
crap 1
1
<?php
2
3
/*
4
 * eCoin driver for Omnipay PHP payment library
5
 *
6
 * @link      https://github.com/hiqdev/omnipay-ecoin
7
 * @package   omnipay-ecoin
8
 * @license   MIT
9
 * @copyright Copyright (c) 2015-2016, HiQDev (http://hiqdev.com/)
10
 */
11
12
namespace Omnipay\eCoin;
13
14
use Omnipay\Common\AbstractGateway;
15
16
/**
17
 * Gateway for eCoin.
18
 */
19
class Gateway extends AbstractGateway
20
{
21
    /**
22
     * {@inheritdoc}
23
     */
24 1
    public function getName()
25
    {
26 1
        return 'eCoin';
27
    }
28
29
    /**
30
     * {@inheritdoc}
31
     */
32 29
    public function getDefaultParameters()
33
    {
34
        return [
35 29
            'purse'     => '',
36 29
            'secret'    => '',
37 29
            'testMode'  => false,
38 29
        ];
39
    }
40
41
    /**
42
     * Get the unified purse.
43
     *
44
     * @return string merchant purse
45
     */
46 2
    public function getPurse()
47
    {
48 2
        return $this->getParameter('purse');
49
    }
50
51
    /**
52
     * Set the unified purse.
53
     *
54
     * @param string $value merchant purse
55
     *
56
     * @return self
57
     */
58 29
    public function setPurse($value)
59
    {
60 29
        return $this->setParameter('purse', $value);
61
    }
62
63
    /**
64
     * Get the unified secret key.
65
     *
66
     * @return string secret key
67
     */
68 2
    public function getSecret()
69
    {
70 2
        return $this->getParameter('secret');
71
    }
72
73
    /**
74
     * Set the unified secret key.
75
     *
76
     * @param string $value secret key
77
     *
78
     * @return self
79
     */
80 29
    public function setSecret($value)
81
    {
82 29
        return $this->setParameter('secret', $value);
83
    }
84
85
    /**
86
     * @param array $parameters
87
     *
88
     * @return \Omnipay\eCoin\Message\PurchaseRequest
89
     */
90 3
    public function purchase(array $parameters = [])
91
    {
92 3
        return $this->createRequest('\Omnipay\eCoin\Message\PurchaseRequest', $parameters);
93
    }
94
95
    /**
96
     * @param array $parameters
97
     *
98
     * @return \Omnipay\eCoin\Message\CompletePurchaseRequest
99
     */
100 3
    public function completePurchase(array $parameters = [])
101
    {
102 3
        return $this->createRequest('\Omnipay\eCoin\Message\CompletePurchaseRequest', $parameters);
103
    }
104
}
105