1 | <?php |
||
23 | abstract class XmlRequest extends AbstractRequest |
||
24 | { |
||
25 | /** |
||
26 | * The XML API Endpoint Base URL |
||
27 | * |
||
28 | * @var string |
||
29 | */ |
||
30 | protected $apiBaseProdUrl = 'https://payment.datatrans.biz/upp/jsp'; |
||
31 | /** |
||
32 | * The XML API Endpoint Base URL |
||
33 | * |
||
34 | * @var string |
||
35 | */ |
||
36 | protected $apiBaseTestUrl = 'https://pilot.datatrans.biz/upp/jsp'; |
||
37 | |||
38 | /** |
||
39 | * defines the endpoint for a specific api |
||
40 | * |
||
41 | * @var string |
||
42 | */ |
||
43 | protected $apiEndpoint = null; |
||
44 | |||
45 | /** |
||
46 | * @var string |
||
47 | */ |
||
48 | protected $serviceName = null; |
||
49 | |||
50 | /** |
||
51 | * @var int |
||
52 | */ |
||
53 | protected $serviceVersion = null; |
||
54 | |||
55 | /** |
||
56 | * @param $requestChild |
||
57 | * @return mixed |
||
58 | */ |
||
59 | protected function prepareRequestXml($requestChild) |
||
77 | |||
78 | /** |
||
79 | * Generate XML for request |
||
80 | * |
||
81 | * @return \SimpleXMLElement |
||
82 | */ |
||
83 | protected function getRequestXml() |
||
103 | |||
104 | /** |
||
105 | * @return string |
||
106 | */ |
||
107 | public function getServiceName() |
||
111 | |||
112 | /** |
||
113 | * @return int |
||
114 | */ |
||
115 | public function getServiceVersion() |
||
119 | |||
120 | /** |
||
121 | * Get HTTP Method. |
||
122 | * |
||
123 | * This is nearly always POST but can be over-ridden in sub classes. |
||
124 | * |
||
125 | * @return string |
||
126 | */ |
||
127 | protected function getHttpMethod() |
||
131 | |||
132 | /** |
||
133 | * @param mixed $data |
||
134 | * @return XmlResponse |
||
135 | * |
||
136 | * @throws InvalidResponseException |
||
137 | */ |
||
138 | public function sendData($data) |
||
178 | |||
179 | /** |
||
180 | * @param $data |
||
181 | * |
||
182 | * @return XmlResponse |
||
183 | */ |
||
184 | protected function createResponse($data) |
||
188 | |||
189 | /** |
||
190 | * @return string |
||
191 | */ |
||
192 | protected function getEndpoint() |
||
197 | |||
198 | /** |
||
199 | * @return string |
||
200 | */ |
||
201 | public function getApiBaseProdUrl() |
||
205 | |||
206 | /** |
||
207 | * @return string |
||
208 | */ |
||
209 | public function getApiBaseTestUrl() |
||
213 | |||
214 | /** |
||
215 | * @return string |
||
216 | */ |
||
217 | public function getApiEndpoint() |
||
221 | } |
||
222 |