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\Datatrans\Message\TokenizeRequest; |
18
|
|
|
|
19
|
|
|
/** |
20
|
|
|
* Datatrans Gateway |
21
|
|
|
* |
22
|
|
|
* @TODO: add optional fields |
23
|
|
|
*/ |
24
|
|
|
class XmlGateway extends AbstractDatatransGateway |
25
|
|
|
{ |
26
|
|
|
/** |
27
|
|
|
* @return string |
28
|
|
|
*/ |
29
|
1 |
|
public function getName() |
30
|
|
|
{ |
31
|
1 |
|
return 'Datatrans XML'; |
32
|
|
|
} |
33
|
|
|
|
34
|
|
|
/** |
35
|
|
|
* @param array $options |
36
|
|
|
* @return Message\XmlAuthorizationRequest |
37
|
|
|
*/ |
38
|
3 |
|
public function purchase(array $options = array()) |
39
|
|
|
{ |
40
|
3 |
|
return $this->authorize($options); |
41
|
|
|
} |
42
|
|
|
|
43
|
|
|
/** |
44
|
|
|
* @param array $options |
45
|
|
|
* @return \Omnipay\Datatrans\Message\XmlAuthorizationRequest |
46
|
|
|
*/ |
47
|
6 |
|
public function authorize(array $options = array()) |
48
|
|
|
{ |
49
|
6 |
|
return $this->createRequest('\Omnipay\Datatrans\Message\XmlAuthorizationRequest', $options); |
50
|
|
|
} |
51
|
|
|
|
52
|
|
|
/** |
53
|
|
|
* @param array $options |
54
|
|
|
* @return \Omnipay\Datatrans\Message\XmlSettlementRequest |
55
|
|
|
*/ |
56
|
1 |
|
public function settlementDebit(array $options = array()) |
57
|
|
|
{ |
58
|
1 |
|
return $this->createRequest('\Omnipay\Datatrans\Message\XmlSettlementRequest', $options); |
59
|
|
|
} |
60
|
|
|
|
61
|
|
|
/** |
62
|
|
|
* @param array $options |
63
|
|
|
* @return \Omnipay\Datatrans\Message\XmlSettlementRequest |
64
|
|
|
*/ |
65
|
4 |
|
public function settlementCredit(array $options = array()) |
66
|
|
|
{ |
67
|
4 |
|
return $this->createRequest('\Omnipay\Datatrans\Message\XmlSettlementCreditRequest', $options); |
68
|
|
|
} |
69
|
|
|
|
70
|
|
|
/** |
71
|
|
|
* @param array $options |
72
|
|
|
* @return \Omnipay\Datatrans\Message\XmlSettlementRequest |
73
|
|
|
*/ |
74
|
3 |
|
public function void(array $options = array()) |
75
|
|
|
{ |
76
|
3 |
|
return $this->createRequest('\Omnipay\Datatrans\Message\XmlCancelRequest', $options); |
77
|
|
|
} |
78
|
|
|
|
79
|
|
|
/** |
80
|
|
|
* @param array $options |
81
|
|
|
* @return \Omnipay\Datatrans\Message\XmlStatusRequest |
82
|
|
|
*/ |
83
|
2 |
|
public function status(array $options = array()) |
84
|
|
|
{ |
85
|
2 |
|
return $this->createRequest('\Omnipay\Datatrans\Message\XmlStatusRequest', $options); |
86
|
|
|
} |
87
|
|
|
} |
88
|
|
|
|