|
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
|
|
|
*/ |
|
22
|
|
|
protected $optionalParams = array( |
|
23
|
|
|
'useAlias', |
|
24
|
|
|
'uppReturnMaskedCC', |
|
25
|
|
|
'uppRememberMe' |
|
26
|
|
|
); |
|
27
|
|
|
|
|
28
|
|
|
/** |
|
29
|
|
|
* @return array |
|
30
|
|
|
*/ |
|
31
|
2 |
|
public function getData() |
|
32
|
|
|
{ |
|
33
|
2 |
|
$data = parent::getData(); |
|
34
|
|
|
|
|
35
|
|
|
//set customer details if set |
|
36
|
2 |
|
if (($customerDetails = $this->getParameter('uppCustomerDetails')) && is_array($customerDetails)) { |
|
37
|
|
|
$data['uppCustomerDetails'] = 'yes'; |
|
38
|
|
|
foreach ($customerDetails as $key => $value) { |
|
39
|
|
|
$data[$key] = $value; |
|
40
|
|
|
} |
|
41
|
|
|
} |
|
42
|
|
|
|
|
43
|
2 |
|
return $data; |
|
44
|
|
|
} |
|
45
|
|
|
|
|
46
|
|
|
/** |
|
47
|
|
|
* @param $value |
|
48
|
|
|
* @return \Omnipay\Common\Message\AbstractRequest |
|
49
|
|
|
*/ |
|
50
|
1 |
|
public function setUppReturnMaskedCC($value) |
|
51
|
|
|
{ |
|
52
|
1 |
|
return $this->setParameter('uppReturnMaskedCC', $value); |
|
53
|
|
|
} |
|
54
|
|
|
|
|
55
|
|
|
/** |
|
56
|
|
|
* @param $value |
|
57
|
|
|
* @return \Omnipay\Common\Message\AbstractRequest |
|
58
|
|
|
*/ |
|
59
|
1 |
|
public function setUseAlias($value) |
|
60
|
|
|
{ |
|
61
|
1 |
|
return $this->setParameter('useAlias', $value); |
|
62
|
|
|
} |
|
63
|
|
|
|
|
64
|
|
|
/** |
|
65
|
|
|
* @param $value |
|
66
|
|
|
* @return \Omnipay\Common\Message\AbstractRequest |
|
67
|
|
|
*/ |
|
68
|
|
|
public function setUppCustomerDetails($value) |
|
69
|
|
|
{ |
|
70
|
|
|
return $this->setParameter('uppCustomerDetails', $value); |
|
71
|
|
|
} |
|
72
|
|
|
|
|
73
|
|
|
/** |
|
74
|
|
|
* @param $value |
|
75
|
|
|
* @return \Omnipay\Common\Message\AbstractRequest |
|
76
|
|
|
*/ |
|
77
|
|
|
public function setUppRememberMe($value) |
|
78
|
|
|
{ |
|
79
|
|
|
return $this->setParameter('uppRememberMe', $value); |
|
80
|
|
|
} |
|
81
|
|
|
} |
|
82
|
|
|
|