|
1
|
|
|
<?php |
|
2
|
|
|
/** |
|
3
|
|
|
* For PayPal ECS the request type genericpayment ist mandatory |
|
4
|
|
|
* |
|
5
|
|
|
* NOTICE OF LICENSE |
|
6
|
|
|
* |
|
7
|
|
|
* This source file is subject to the GNU General Public License (GPL 3) |
|
8
|
|
|
* that is bundled with this package in the file LICENSE.txt |
|
9
|
|
|
* |
|
10
|
|
|
* DISCLAIMER |
|
11
|
|
|
* |
|
12
|
|
|
* Do not edit or add to this file if you wish to upgrade Payone to newer |
|
13
|
|
|
* versions in the future. If you wish to customize Payone for your |
|
14
|
|
|
* needs please refer to http://www.payone.de for more information. |
|
15
|
|
|
|
|
16
|
|
|
* @category Payone |
|
17
|
|
|
* @package Payone_Api |
|
18
|
|
|
* @subpackage Request |
|
19
|
|
|
* @author Ronny Schröder |
|
20
|
|
|
* @license <http://www.gnu.org/licenses/> GNU General Public License (GPL 3) |
|
21
|
|
|
*/ |
|
22
|
|
|
class Payone_Api_Request_Genericpayment extends Payone_Api_Request_Abstract |
|
|
|
|
|
|
23
|
|
|
{ |
|
24
|
|
|
|
|
25
|
|
|
/** |
|
26
|
|
|
* Sub account ID |
|
27
|
|
|
* |
|
28
|
|
|
* @var int |
|
29
|
|
|
*/ |
|
30
|
|
|
protected $aid = NULL; |
|
31
|
|
|
|
|
32
|
|
|
/** |
|
33
|
|
|
* @var string |
|
34
|
|
|
*/ |
|
35
|
|
|
protected $clearingtype = NULL; |
|
36
|
|
|
|
|
37
|
|
|
/** |
|
38
|
|
|
* Total amount (in smallest currency unit! e.g. cent) |
|
39
|
|
|
* |
|
40
|
|
|
* @var int |
|
41
|
|
|
*/ |
|
42
|
|
|
protected $amount = NULL; |
|
43
|
|
|
|
|
44
|
|
|
/** |
|
45
|
|
|
* Currency (ISO-4217) |
|
46
|
|
|
* |
|
47
|
|
|
* @var string |
|
48
|
|
|
*/ |
|
49
|
|
|
protected $currency = NULL; |
|
50
|
|
|
|
|
51
|
|
|
/** |
|
52
|
|
|
* dynamic text for debit and creditcard payments |
|
53
|
|
|
* |
|
54
|
|
|
* @var string |
|
55
|
|
|
*/ |
|
56
|
|
|
protected $narrative_text = NULL; |
|
57
|
|
|
|
|
58
|
|
|
/** |
|
59
|
|
|
* @var Payone_Api_Request_Parameter_Authorization_DeliveryData |
|
60
|
|
|
*/ |
|
61
|
|
|
protected $deliveryData = null; |
|
62
|
|
|
|
|
63
|
|
|
/** |
|
64
|
|
|
* @var string |
|
65
|
|
|
*/ |
|
66
|
|
|
protected $financingtype = NULL; |
|
67
|
|
|
|
|
68
|
|
|
/** |
|
69
|
|
|
* With the first genericpayment the workorderid will be generated from the |
|
70
|
|
|
* PAYONE platform and will be sent to you in the response. The ID is unique. |
|
71
|
|
|
* The returned workorderid is mandatory for the following requests of |
|
72
|
|
|
* PayPal Express Checkout. |
|
73
|
|
|
* |
|
74
|
|
|
* @var string |
|
75
|
|
|
*/ |
|
76
|
|
|
protected $workorderid = NULL; |
|
77
|
|
|
|
|
78
|
|
|
/** |
|
79
|
|
|
* Wallet provider PPE: PayPal Express |
|
80
|
|
|
* @var Payone_Api_Request_Parameter_Authorization_PaymentMethod_Wallet |
|
81
|
|
|
*/ |
|
82
|
|
|
protected $wallet = null; |
|
83
|
|
|
|
|
84
|
|
|
/** |
|
85
|
|
|
* @var Payone_Api_Request_Parameter_Authorization_PaymentMethod_RatePay |
|
86
|
|
|
*/ |
|
87
|
|
|
protected $ratePay = null; |
|
88
|
|
|
|
|
89
|
|
|
/** |
|
90
|
|
|
* Mandatory for PayPal ECS: |
|
91
|
|
|
* 1. action=setexpresscheckout |
|
92
|
|
|
* 2. action=getexpresscheckoutdetails |
|
93
|
|
|
* |
|
94
|
|
|
* @var Payone_Api_Request_Parameter_Paydata_Paydata |
|
95
|
|
|
*/ |
|
96
|
|
|
protected $paydata = NULL; |
|
97
|
|
|
|
|
98
|
|
|
protected $company = null; |
|
99
|
|
|
protected $firstname = null; |
|
100
|
|
|
protected $lastname = null; |
|
101
|
|
|
protected $street = null; |
|
102
|
|
|
protected $zip = null; |
|
103
|
|
|
protected $city = null; |
|
104
|
|
|
protected $country = null; |
|
105
|
|
|
|
|
106
|
|
|
protected $api_version = null; |
|
107
|
|
|
protected $birthday = null; |
|
108
|
|
|
protected $email = null; |
|
109
|
|
|
protected $ip = null; |
|
110
|
|
|
protected $language = null; |
|
111
|
|
|
protected $telephonenumber = null; |
|
112
|
|
|
|
|
113
|
|
|
/** |
|
114
|
|
|
* @param array $data |
|
115
|
|
|
*/ |
|
116
|
|
|
public function __construct(array $data = array()) |
|
117
|
|
|
{ |
|
118
|
|
|
$this->request = Payone_Api_Enum_RequestType::GENERICPAYMENT; |
|
119
|
|
|
parent::__construct($data); |
|
120
|
|
|
} |
|
121
|
|
|
|
|
122
|
|
|
|
|
123
|
|
|
/** |
|
124
|
|
|
* @param int $aid |
|
125
|
|
|
*/ |
|
126
|
|
|
public function setAid($aid) |
|
127
|
|
|
{ |
|
128
|
|
|
$this->aid = $aid; |
|
129
|
|
|
} |
|
130
|
|
|
|
|
131
|
|
|
/** |
|
132
|
|
|
* @return int |
|
133
|
|
|
*/ |
|
134
|
|
|
public function getAid() |
|
135
|
|
|
{ |
|
136
|
|
|
return $this->aid; |
|
137
|
|
|
} |
|
138
|
|
|
|
|
139
|
|
|
/** |
|
140
|
|
|
* @param int $amount |
|
141
|
|
|
*/ |
|
142
|
|
|
public function setAmount($amount) |
|
143
|
|
|
{ |
|
144
|
|
|
$this->amount = $amount; |
|
145
|
|
|
} |
|
146
|
|
|
|
|
147
|
|
|
/** |
|
148
|
|
|
* @return int |
|
149
|
|
|
*/ |
|
150
|
|
|
public function getAmount() |
|
151
|
|
|
{ |
|
152
|
|
|
return $this->amount; |
|
153
|
|
|
} |
|
154
|
|
|
|
|
155
|
|
|
/** |
|
156
|
|
|
* @param string $clearingtype |
|
157
|
|
|
*/ |
|
158
|
|
|
public function setClearingtype($clearingtype) |
|
159
|
|
|
{ |
|
160
|
|
|
$this->clearingtype = $clearingtype; |
|
161
|
|
|
} |
|
162
|
|
|
|
|
163
|
|
|
/** |
|
164
|
|
|
* @return string |
|
165
|
|
|
*/ |
|
166
|
|
|
public function getClearingtype() |
|
167
|
|
|
{ |
|
168
|
|
|
return $this->clearingtype; |
|
169
|
|
|
} |
|
170
|
|
|
|
|
171
|
|
|
/** |
|
172
|
|
|
* @param string $financingtype |
|
173
|
|
|
*/ |
|
174
|
|
|
public function setFinancingType($financingtype) |
|
175
|
|
|
{ |
|
176
|
|
|
$this->financingtype = $financingtype; |
|
177
|
|
|
} |
|
178
|
|
|
|
|
179
|
|
|
/** |
|
180
|
|
|
* @return string |
|
181
|
|
|
*/ |
|
182
|
|
|
public function getFinancingType() |
|
183
|
|
|
{ |
|
184
|
|
|
return $this->financingtype; |
|
185
|
|
|
} |
|
186
|
|
|
|
|
187
|
|
|
/** |
|
188
|
|
|
* @param string $currency |
|
189
|
|
|
*/ |
|
190
|
|
|
public function setCurrency($currency) |
|
191
|
|
|
{ |
|
192
|
|
|
$this->currency = $currency; |
|
193
|
|
|
} |
|
194
|
|
|
|
|
195
|
|
|
/** |
|
196
|
|
|
* @return string |
|
197
|
|
|
*/ |
|
198
|
|
|
public function getCurrency() |
|
199
|
|
|
{ |
|
200
|
|
|
return $this->currency; |
|
201
|
|
|
} |
|
202
|
|
|
|
|
203
|
|
|
/** |
|
204
|
|
|
* @param string $narrative_text |
|
205
|
|
|
*/ |
|
206
|
|
|
public function setNarrativeText($narrative_text) |
|
207
|
|
|
{ |
|
208
|
|
|
$this->narrative_text = $narrative_text; |
|
209
|
|
|
} |
|
210
|
|
|
|
|
211
|
|
|
/** |
|
212
|
|
|
* @return string |
|
213
|
|
|
*/ |
|
214
|
|
|
public function getNarrativeText() |
|
215
|
|
|
{ |
|
216
|
|
|
return $this->narrative_text; |
|
217
|
|
|
} |
|
218
|
|
|
|
|
219
|
|
|
/** |
|
220
|
|
|
* @param Payone_Api_Request_Parameter_Authorization_DeliveryData $deliveryData |
|
221
|
|
|
*/ |
|
222
|
|
|
public function setDeliveryData(Payone_Api_Request_Parameter_Authorization_DeliveryData $deliveryData) |
|
223
|
|
|
{ |
|
224
|
|
|
$this->deliveryData = $deliveryData; |
|
225
|
|
|
} |
|
226
|
|
|
|
|
227
|
|
|
/** |
|
228
|
|
|
* @return Payone_Api_Request_Parameter_Authorization_DeliveryData |
|
229
|
|
|
*/ |
|
230
|
|
|
public function getDeliveryData() |
|
231
|
|
|
{ |
|
232
|
|
|
return $this->deliveryData; |
|
233
|
|
|
} |
|
234
|
|
|
|
|
235
|
|
|
/** |
|
236
|
|
|
* |
|
237
|
|
|
* @return string |
|
238
|
|
|
*/ |
|
239
|
|
|
function getWorkorderId() |
|
|
|
|
|
|
240
|
|
|
{ |
|
241
|
|
|
return $this->workorderid; |
|
242
|
|
|
} |
|
243
|
|
|
|
|
244
|
|
|
/** |
|
245
|
|
|
* |
|
246
|
|
|
* @param string $workorderid |
|
247
|
|
|
*/ |
|
248
|
|
|
function setWorkorderId($workorderid) |
|
|
|
|
|
|
249
|
|
|
{ |
|
250
|
|
|
$this->workorderid = $workorderid; |
|
251
|
|
|
} |
|
252
|
|
|
|
|
253
|
|
|
/** |
|
254
|
|
|
* @return Payone_Api_Request_Parameter_Authorization_PaymentMethod_RatePay |
|
255
|
|
|
*/ |
|
256
|
|
|
function getRatePay() |
|
|
|
|
|
|
257
|
|
|
{ |
|
258
|
|
|
return $this->ratePay; |
|
259
|
|
|
} |
|
260
|
|
|
|
|
261
|
|
|
/** |
|
262
|
|
|
* @param Payone_Api_Request_Parameter_Authorization_PaymentMethod_RatePay $ratePay |
|
263
|
|
|
*/ |
|
264
|
|
|
function setRatePay(Payone_Api_Request_Parameter_Authorization_PaymentMethod_RatePay $ratePay) |
|
|
|
|
|
|
265
|
|
|
{ |
|
266
|
|
|
$this->ratePay = $ratePay; |
|
267
|
|
|
} |
|
268
|
|
|
|
|
269
|
|
|
/** |
|
270
|
|
|
* |
|
271
|
|
|
* @return Payone_Api_Request_Parameter_Authorization_PaymentMethod_Wallet |
|
272
|
|
|
*/ |
|
273
|
|
|
function getWallet() |
|
|
|
|
|
|
274
|
|
|
{ |
|
275
|
|
|
return $this->wallet; |
|
276
|
|
|
} |
|
277
|
|
|
|
|
278
|
|
|
/** |
|
279
|
|
|
* |
|
280
|
|
|
* @param Payone_Api_Request_Parameter_Authorization_PaymentMethod_Wallet $wallet |
|
281
|
|
|
*/ |
|
282
|
|
|
function setWallet(Payone_Api_Request_Parameter_Authorization_PaymentMethod_Wallet $wallet) |
|
|
|
|
|
|
283
|
|
|
{ |
|
284
|
|
|
$this->wallet = $wallet; |
|
285
|
|
|
} |
|
286
|
|
|
|
|
287
|
|
|
/** |
|
288
|
|
|
* @param Payone_Api_Request_Parameter_Paydata_Paydata $paydata |
|
289
|
|
|
*/ |
|
290
|
|
|
public function setPaydata($paydata) |
|
291
|
|
|
{ |
|
292
|
|
|
$this->paydata = $paydata; |
|
293
|
|
|
} |
|
294
|
|
|
|
|
295
|
|
|
/** |
|
296
|
|
|
* |
|
297
|
|
|
* @return Payone_Api_Request_Parameter_Paydata_Paydata |
|
298
|
|
|
*/ |
|
299
|
|
|
public function getPaydata() |
|
300
|
|
|
{ |
|
301
|
|
|
return $this->paydata; |
|
302
|
|
|
} |
|
303
|
|
|
|
|
304
|
|
|
public function setCompany($company) |
|
305
|
|
|
{ |
|
306
|
|
|
$this->company = $company; |
|
307
|
|
|
} |
|
308
|
|
|
|
|
309
|
|
|
public function getCompany() |
|
310
|
|
|
{ |
|
311
|
|
|
return $this->company; |
|
312
|
|
|
} |
|
313
|
|
|
|
|
314
|
|
|
public function setFirstname($firstname) |
|
315
|
|
|
{ |
|
316
|
|
|
$this->firstname = $firstname; |
|
317
|
|
|
} |
|
318
|
|
|
|
|
319
|
|
|
public function getFirstname() |
|
320
|
|
|
{ |
|
321
|
|
|
return $this->firstname; |
|
322
|
|
|
} |
|
323
|
|
|
|
|
324
|
|
|
public function setLastname($lastname) |
|
325
|
|
|
{ |
|
326
|
|
|
$this->lastname = $lastname; |
|
327
|
|
|
} |
|
328
|
|
|
|
|
329
|
|
|
public function getLastname() |
|
330
|
|
|
{ |
|
331
|
|
|
return $this->lastname; |
|
332
|
|
|
} |
|
333
|
|
|
|
|
334
|
|
|
public function setStreet($street) |
|
335
|
|
|
{ |
|
336
|
|
|
$this->street = $street; |
|
337
|
|
|
} |
|
338
|
|
|
|
|
339
|
|
|
public function getStreet() |
|
340
|
|
|
{ |
|
341
|
|
|
return $this->street; |
|
342
|
|
|
} |
|
343
|
|
|
|
|
344
|
|
|
public function setZip($zip) |
|
345
|
|
|
{ |
|
346
|
|
|
$this->zip = $zip; |
|
347
|
|
|
} |
|
348
|
|
|
|
|
349
|
|
|
public function getZip() |
|
350
|
|
|
{ |
|
351
|
|
|
return $this->zip; |
|
352
|
|
|
} |
|
353
|
|
|
|
|
354
|
|
|
public function setCity($city) |
|
355
|
|
|
{ |
|
356
|
|
|
$this->city = $city; |
|
357
|
|
|
} |
|
358
|
|
|
|
|
359
|
|
|
public function getCity() |
|
360
|
|
|
{ |
|
361
|
|
|
return $this->city; |
|
362
|
|
|
} |
|
363
|
|
|
|
|
364
|
|
|
public function setCountry($country) |
|
365
|
|
|
{ |
|
366
|
|
|
$this->country = $country; |
|
367
|
|
|
} |
|
368
|
|
|
|
|
369
|
|
|
public function getCountry() |
|
370
|
|
|
{ |
|
371
|
|
|
return $this->country; |
|
372
|
|
|
} |
|
373
|
|
|
|
|
374
|
|
|
public function setApiVersion($api_version) |
|
375
|
|
|
{ |
|
376
|
|
|
$this->api_version = $api_version; |
|
377
|
|
|
} |
|
378
|
|
|
|
|
379
|
|
|
public function getApiVersion() |
|
380
|
|
|
{ |
|
381
|
|
|
return $this->api_version; |
|
382
|
|
|
} |
|
383
|
|
|
|
|
384
|
|
|
public function setBirthday($birthday) |
|
385
|
|
|
{ |
|
386
|
|
|
$this->birthday = $birthday; |
|
387
|
|
|
} |
|
388
|
|
|
|
|
389
|
|
|
public function getBirthday() |
|
390
|
|
|
{ |
|
391
|
|
|
return $this->birthday; |
|
392
|
|
|
} |
|
393
|
|
|
|
|
394
|
|
|
public function setEmail($email) |
|
395
|
|
|
{ |
|
396
|
|
|
$this->email = $email; |
|
397
|
|
|
} |
|
398
|
|
|
|
|
399
|
|
|
public function getEmail() |
|
400
|
|
|
{ |
|
401
|
|
|
return $this->email; |
|
402
|
|
|
} |
|
403
|
|
|
|
|
404
|
|
|
public function setIp($ip) |
|
405
|
|
|
{ |
|
406
|
|
|
$this->ip = $ip; |
|
407
|
|
|
} |
|
408
|
|
|
|
|
409
|
|
|
public function getIp() |
|
410
|
|
|
{ |
|
411
|
|
|
return $this->ip; |
|
412
|
|
|
} |
|
413
|
|
|
|
|
414
|
|
|
public function setLanguage($language) |
|
415
|
|
|
{ |
|
416
|
|
|
$this->language = $language; |
|
417
|
|
|
} |
|
418
|
|
|
|
|
419
|
|
|
public function getLanguage() |
|
420
|
|
|
{ |
|
421
|
|
|
return $this->language; |
|
422
|
|
|
} |
|
423
|
|
|
|
|
424
|
|
|
public function setTelephonenumber($telephonenumber) |
|
425
|
|
|
{ |
|
426
|
|
|
$this->telephonenumber = $telephonenumber; |
|
427
|
|
|
} |
|
428
|
|
|
|
|
429
|
|
|
public function getTelephonenumber() |
|
430
|
|
|
{ |
|
431
|
|
|
return $this->telephonenumber; |
|
432
|
|
|
} |
|
433
|
|
|
|
|
434
|
|
|
} |
|
435
|
|
|
|
You can fix this by adding a namespace to your class:
When choosing a vendor namespace, try to pick something that is not too generic to avoid conflicts with other libraries.