Completed
Pull Request — master (#5)
by
unknown
03:33
created

PurchaseRequest::setUseAlias()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 4
ccs 0
cts 0
cp 0
rs 10
cc 1
eloc 2
nc 1
nop 1
crap 2
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\Message;
16
17
class PurchaseRequest extends AbstractRedirectRequest
18
{
19
    /**
20
     * @var array
21 1
     */
22
    protected $optionalParams = array(
23
        'useAlias',
24
        'uppReturnMaskedCC'
25
    );
26
27
    /**
28
     * @return array
29
     */
30
    public function getData()
31
    {
32
        $data = parent::getData();
33
34
        //set customer details if set
35
        if (($customerDetails = $this->getParameter('uppCustomerDetails')) && is_array($customerDetails)){
36
            $data['uppCustomerDetails'] = 'yes';
37
            foreach ($customerDetails as $key => $value){
38
                $data[$key] = $value;
39
            }
40
        }
41
42
        return $data;
43
    }
44
45
    /**
46
      * @param $value
47
      * @return \Omnipay\Common\Message\AbstractRequest
48
      */
49
    public function setUppReturnMaskedCC($value)
50
    {
51
        return $this->setParameter('uppReturnMaskedCC', $value);
52
    }
53
54
    /**
55
     * @param $value
56
     * @return \Omnipay\Common\Message\AbstractRequest
57
     */
58
    public function setUseAlias($value)
59
    {
60
        return $this->setParameter('useAlias', $value);
61
    }
62
63
    /**
64
     * @param $value
65
     * @return \Omnipay\Common\Message\AbstractRequest
66
     */
67
    public function setUppCustomerDetails($value)
68
    {
69
        return $this->setParameter('uppCustomerDetails', $value);
70
    }
71
}
72