AbstractDatatransGateway::setMerchantId()   A
last analyzed

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 0
Metric Value
dl 0
loc 4
ccs 2
cts 2
cp 1
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 1
crap 1
1
<?php
2
/**
3
 * w-vision
4
 *
5
 * LICENSE
6
 *
7
 * This source file is subject to the MIT License
8
 * For the full copyright and license information, please view the LICENSE.md
9
 * file that are distributed with this source code.
10
 *
11
 * @copyright  Copyright (c) 2016 Woche-Pass AG (http://www.w-vision.ch)
12
 * @license    MIT License
13
 */
14
15
namespace Omnipay\Datatrans;
16
17
use Omnipay\Common\AbstractGateway;
18
use Omnipay\Datatrans\Message\TokenizeRequest;
19
20
/**
21
 * Datatrans Gateway
22
 *
23
 * @TODO: add optional fields
24
 */
25
abstract class AbstractDatatransGateway extends AbstractGateway
26
{
27
    /**
28
     * @return array
29
     */
30 66
    public function getDefaultParameters()
31
    {
32
        return array(
33
            // general params
34 66
            'merchantId'        => '',
35 66
            'sign'              => '',
36
            'testMode'          => true
37 66
        );
38
    }
39
40
    /**
41
     * @param $value
42
     * @return $this
43
     */
44 66
    public function setMerchantId($value)
45
    {
46 66
        return $this->setParameter('merchantId', $value);
47
    }
48
49
    /**
50
     * get the merchant id
51
     *
52
     * @return string
53
     */
54 2
    public function getMerchantId()
55
    {
56 2
        return  $this->getParameter('merchantId');
57
    }
58
59
    /**
60
     * @param $value
61
     * @return $this
62
     */
63 66
    public function setSign($value)
64
    {
65 66
        return $this->setParameter('sign', $value);
66
    }
67
68
    /**
69
     * @return string
70
     */
71 2
    public function getSign()
72
    {
73 2
        return $this->getParameter('sign');
74
    }
75
76
    /**
77
     * @param array $options
78
     *
79
     * @return TokenizeRequest
80
     */
81 4
    public function createCard(array $options = array())
82
    {
83 4
        return $this->createRequest('\Omnipay\Datatrans\Message\TokenizeRequest', $options);
84
    }
85
}
86