|
1
|
|
|
<?php |
|
2
|
|
|
/** |
|
3
|
|
|
* w-vision |
|
4
|
|
|
* |
|
5
|
|
|
* LICENSE |
|
6
|
|
|
* |
|
7
|
|
|
* This source file is subject to the GNU General Public License version 3 (GPLv3) |
|
8
|
|
|
* For the full copyright and license information, please view the LICENSE.md and gpl-3.0.txt |
|
9
|
|
|
* files that are distributed with this source code. |
|
10
|
|
|
* |
|
11
|
|
|
* @copyright Copyright (c) 2016 Woche-Pass AG (http://www.w-vision.ch) |
|
12
|
|
|
* @license GNU General Public License version 3 (GPLv3) |
|
13
|
|
|
*/ |
|
14
|
|
|
|
|
15
|
|
|
namespace Omnipay\Datatrans\Message; |
|
16
|
|
|
|
|
17
|
|
|
/** |
|
18
|
|
|
* Class TokenizeRequest |
|
19
|
|
|
* |
|
20
|
|
|
* @package Omnipay\Datatrans\Message |
|
21
|
|
|
*/ |
|
22
|
|
|
class TokenizeRequest extends AbstractRedirectRequest |
|
23
|
|
|
{ |
|
24
|
|
|
/** |
|
25
|
|
|
* @var string |
|
26
|
|
|
*/ |
|
27
|
|
|
protected $apiEndpoint = 'upStart.jsp'; |
|
28
|
|
|
|
|
29
|
|
|
/** |
|
30
|
|
|
* @return array |
|
31
|
|
|
*/ |
|
32
|
|
|
public function getData() |
|
33
|
|
|
{ |
|
34
|
|
|
$this->validate('merchantId', 'transactionId', 'sign', 'returnUrl', 'errorUrl', 'cancelUrl'); |
|
35
|
|
|
|
|
36
|
|
|
$data = array( |
|
37
|
|
|
'merchantId' => $this->getMerchantId(), |
|
38
|
|
|
'refno' => $this->getTransactionId(), |
|
39
|
|
|
'amount' => 0, |
|
40
|
|
|
'currency' => $this->getCurrency(), |
|
41
|
|
|
'sign' => $this->getSign(), |
|
42
|
|
|
'useAlias' => 'yes' |
|
43
|
|
|
); |
|
44
|
|
|
|
|
45
|
|
|
$data['successUrl'] = $this->getReturnUrl(); |
|
46
|
|
|
$data['cancelUrl'] = $this->getCancelUrl(); |
|
47
|
|
|
$data['errorUrl'] = $this->getErrorUrl(); |
|
48
|
|
|
$data['cancelUrl'] = $this->getCancelUrl(); |
|
49
|
|
|
|
|
50
|
|
|
return $data; |
|
51
|
|
|
} |
|
52
|
|
|
|
|
53
|
|
|
/** |
|
54
|
|
|
* @param mixed $data |
|
55
|
|
|
* |
|
56
|
|
|
* @return TokenizeRequest |
|
57
|
|
|
*/ |
|
58
|
|
|
public function sendData($data) |
|
59
|
|
|
{ |
|
60
|
|
|
return $this->response = new TokenizeResponse($this, $data); |
|
61
|
|
|
} |
|
62
|
|
|
} |
|
63
|
|
|
|