|
1
|
|
|
<?php |
|
2
|
|
|
/** |
|
3
|
|
|
* amadeus-ws-client |
|
4
|
|
|
* |
|
5
|
|
|
* Copyright 2015 Amadeus Benelux NV |
|
6
|
|
|
* |
|
7
|
|
|
* Licensed under the Apache License, Version 2.0 (the "License"); |
|
8
|
|
|
* you may not use this file except in compliance with the License. |
|
9
|
|
|
* You may obtain a copy of the License at |
|
10
|
|
|
* |
|
11
|
|
|
* http://www.apache.org/licenses/LICENSE-2.0 |
|
12
|
|
|
* |
|
13
|
|
|
* Unless required by applicable law or agreed to in writing, software |
|
14
|
|
|
* distributed under the License is distributed on an "AS IS" BASIS, |
|
15
|
|
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
|
16
|
|
|
* See the License for the specific language governing permissions and |
|
17
|
|
|
* limitations under the License. |
|
18
|
|
|
* |
|
19
|
|
|
* @package Amadeus |
|
20
|
|
|
* @license https://opensource.org/licenses/Apache-2.0 Apache 2.0 |
|
21
|
|
|
*/ |
|
22
|
|
|
|
|
23
|
|
|
namespace Amadeus\Client\Struct\Fop; |
|
24
|
|
|
|
|
25
|
|
|
use Amadeus\Client\RequestOptions\Fop\FraudScreeningOptions; |
|
26
|
|
|
use Amadeus\Client\Struct\WsMessageUtility; |
|
27
|
|
|
|
|
28
|
|
|
/** |
|
29
|
|
|
* FraudScreeningData |
|
30
|
|
|
* |
|
31
|
|
|
* @package Amadeus\Client\Struct\Fop |
|
32
|
|
|
* @author Dieter Devlieghere <[email protected]> |
|
33
|
|
|
*/ |
|
34
|
|
|
class FraudScreeningData extends WsMessageUtility |
|
35
|
|
|
{ |
|
36
|
|
|
/** |
|
37
|
|
|
* @var FraudScreening |
|
38
|
|
|
*/ |
|
39
|
|
|
public $fraudScreening; |
|
40
|
|
|
|
|
41
|
|
|
/** |
|
42
|
|
|
* @var IpAdress |
|
43
|
|
|
*/ |
|
44
|
|
|
public $ipAdress; |
|
45
|
|
|
|
|
46
|
|
|
/** |
|
47
|
|
|
* @var MerchantUrl |
|
48
|
|
|
*/ |
|
49
|
|
|
public $merchantURL; |
|
50
|
|
|
|
|
51
|
|
|
/** |
|
52
|
|
|
* @var PayerPhoneOrEmail[] |
|
53
|
|
|
*/ |
|
54
|
|
|
public $payerPhoneOrEmail = []; |
|
55
|
|
|
|
|
56
|
|
|
/** |
|
57
|
|
|
* @var ShopperSession |
|
58
|
|
|
*/ |
|
59
|
|
|
public $shopperSession; |
|
60
|
|
|
|
|
61
|
|
|
/** |
|
62
|
|
|
* @var PayerName |
|
63
|
|
|
*/ |
|
64
|
|
|
public $payerName; |
|
65
|
|
|
|
|
66
|
|
|
/** |
|
67
|
|
|
* @var PayerDateOfBirth |
|
68
|
|
|
*/ |
|
69
|
|
|
public $payerDateOfBirth; |
|
70
|
|
|
|
|
71
|
|
|
/** |
|
72
|
|
|
* @var BillingAddress |
|
73
|
|
|
*/ |
|
74
|
|
|
public $billingAddress; |
|
75
|
|
|
|
|
76
|
|
|
/** |
|
77
|
|
|
* @var FormOfIdDetails[] |
|
78
|
|
|
*/ |
|
79
|
|
|
public $formOfIdDetails = []; |
|
80
|
|
|
|
|
81
|
|
|
/** |
|
82
|
|
|
* @var TravelShopper |
|
83
|
|
|
*/ |
|
84
|
|
|
public $travelShopper; |
|
85
|
|
|
|
|
86
|
|
|
/** |
|
87
|
|
|
* @var ShopperDetails |
|
88
|
|
|
*/ |
|
89
|
|
|
public $shopperDetails; |
|
90
|
|
|
|
|
91
|
|
|
/** |
|
92
|
|
|
* @var SecurityCode[] |
|
93
|
|
|
*/ |
|
94
|
|
|
public $securityCode = []; |
|
95
|
|
|
|
|
96
|
|
|
/** |
|
97
|
|
|
* FraudScreeningData constructor. |
|
98
|
|
|
* |
|
99
|
|
|
* @param FraudScreeningOptions $options |
|
100
|
|
|
*/ |
|
101
|
|
|
public function __construct(FraudScreeningOptions $options) |
|
102
|
|
|
{ |
|
103
|
|
|
$this->fraudScreening = new FraudScreening($options->doFraudScreening); |
|
104
|
|
|
|
|
105
|
|
|
if (!empty($options->ipAddress)) { |
|
106
|
|
|
$this->ipAdress = new IpAdress($options->ipAddress); |
|
107
|
|
|
} |
|
108
|
|
|
|
|
109
|
|
|
if (!empty($options->phone)) { |
|
110
|
|
|
$this->payerPhoneOrEmail[] = new PayerPhoneOrEmail(PayerPhoneOrEmail::TYPE_PHONE, $options->phone); |
|
111
|
|
|
} |
|
112
|
|
|
|
|
113
|
|
|
if (!empty($options->email)) { |
|
114
|
|
|
$this->payerPhoneOrEmail[] = new PayerPhoneOrEmail(PayerPhoneOrEmail::TYPE_EMAIL, $options->email); |
|
115
|
|
|
} |
|
116
|
|
|
|
|
117
|
|
|
if ($this->checkAnyNotEmpty($options->firstName, $options->lastName)) { |
|
118
|
|
|
$this->payerName = new PayerName($options->lastName, $options->firstName); |
|
119
|
|
|
} |
|
120
|
|
|
|
|
121
|
|
|
if ($options->dateOfBirth instanceof \DateTime) { |
|
122
|
|
|
$this->payerDateOfBirth = new PayerDateOfBirth($options->dateOfBirth); |
|
123
|
|
|
} |
|
124
|
|
|
|
|
125
|
|
|
if ($this->checkAnyNotEmpty($options->idDocumentNr, $options->idDocumentType)) { |
|
126
|
|
|
$this->formOfIdDetails[] = new FormOfIdDetails($options->idDocumentNr, $options->idDocumentType); |
|
127
|
|
|
} |
|
128
|
|
|
|
|
129
|
|
|
if (!empty($options->billingAddress)) { |
|
130
|
|
|
$this->billingAddress = new BillingAddress( |
|
131
|
|
|
$options->billingAddress->addressLines, |
|
132
|
|
|
$options->billingAddress->city, |
|
133
|
|
|
$options->billingAddress->zipCode, |
|
134
|
|
|
$options->billingAddress->countryCode |
|
135
|
|
|
); |
|
136
|
|
|
} |
|
137
|
|
|
} |
|
138
|
|
|
} |
|
139
|
|
|
|