1 | <?php |
||
23 | class PaymentProcessor extends Object |
||
24 | { |
||
25 | /** |
||
26 | * @config |
||
27 | * @var string |
||
28 | */ |
||
29 | private static $currency = 'EUR'; |
||
|
|||
30 | |||
31 | /** |
||
32 | * @var Reservation |
||
33 | */ |
||
34 | protected $reservation; |
||
35 | |||
36 | /** |
||
37 | * @var Payment |
||
38 | */ |
||
39 | protected $payment; |
||
40 | |||
41 | /** |
||
42 | * @var array |
||
43 | */ |
||
44 | protected $gatewayData = array( |
||
45 | 'transactionId' => null, |
||
46 | 'firstName' => null, |
||
47 | 'lastName' => null, |
||
48 | 'email' => null, |
||
49 | 'company' => null, |
||
50 | 'billingAddress1' => null, |
||
51 | 'billingAddress2' => null, |
||
52 | 'billingCity' => null, |
||
53 | 'billingPostcode' => null, |
||
54 | 'billingState' => null, |
||
55 | 'billingCountry' => null, |
||
56 | 'billingPhone' => null, |
||
57 | 'shippingAddress1' => null, |
||
58 | 'shippingAddress2' => null, |
||
59 | 'shippingCity' => null, |
||
60 | 'shippingPostcode' => null, |
||
61 | 'shippingState' => null, |
||
62 | 'shippingCountry' => null, |
||
63 | 'shippingPhone' => null, |
||
64 | 'description' => null |
||
65 | ); |
||
66 | |||
67 | /** |
||
68 | * PaymentProcessor constructor. |
||
69 | * |
||
70 | * @param Reservation $reservation |
||
71 | */ |
||
72 | public function __construct(Reservation $reservation) |
||
86 | |||
87 | /** |
||
88 | * Create a payment trough the given payment gateway |
||
89 | * |
||
90 | * @param string $gateway |
||
91 | * |
||
92 | * @return Payment |
||
93 | */ |
||
94 | public function createPayment($gateway) |
||
117 | |||
118 | /** |
||
119 | * Create the service factory |
||
120 | * Catch any exceptions that might occur |
||
121 | * |
||
122 | * @return null|ServiceResponse |
||
123 | */ |
||
124 | public function createServiceFactory() |
||
139 | |||
140 | /** |
||
141 | * Set and merges the gateway data |
||
142 | * |
||
143 | * @param array $data |
||
144 | */ |
||
145 | public function setGatewayData($data = array()) |
||
149 | |||
150 | /** |
||
151 | * Get the gateway data |
||
152 | * |
||
153 | * @return array |
||
154 | */ |
||
155 | public function getGateWayData() |
||
159 | |||
160 | /** |
||
161 | * Get the reservation |
||
162 | * |
||
163 | * @return Reservation |
||
164 | */ |
||
165 | public function getReservation() |
||
169 | } |
||
170 |
This check marks private properties in classes that are never used. Those properties can be removed.