@@ -8,390 +8,390 @@ |
||
| 8 | 8 | */ |
| 9 | 9 | class Address implements AddressInterface |
| 10 | 10 | { |
| 11 | - /** |
|
| 12 | - * First address line |
|
| 13 | - * |
|
| 14 | - * @var string $line1 |
|
| 15 | - */ |
|
| 16 | - protected $line1; |
|
| 17 | - /** |
|
| 18 | - * Second address line |
|
| 19 | - * |
|
| 20 | - * @var string |
|
| 21 | - */ |
|
| 22 | - protected $line2; |
|
| 23 | - /** |
|
| 24 | - * Address Country |
|
| 25 | - * |
|
| 26 | - * @var string |
|
| 27 | - */ |
|
| 28 | - protected $country; |
|
| 29 | - /** |
|
| 30 | - * Address postal code |
|
| 31 | - * |
|
| 32 | - * @var string |
|
| 33 | - */ |
|
| 34 | - protected $postalCode; |
|
| 35 | - /** |
|
| 36 | - * Address City |
|
| 37 | - * |
|
| 38 | - * @var string |
|
| 39 | - */ |
|
| 40 | - protected $city; |
|
| 41 | - /** |
|
| 42 | - * @var string |
|
| 43 | - */ |
|
| 44 | - protected $countryEnName; |
|
| 45 | - /** |
|
| 46 | - * @var string |
|
| 47 | - */ |
|
| 48 | - protected $countryNativeName; |
|
| 49 | - /** |
|
| 50 | - * @var integer |
|
| 51 | - */ |
|
| 52 | - protected $regionId; |
|
| 53 | - /** |
|
| 54 | - * @var string |
|
| 55 | - */ |
|
| 56 | - protected $regionName; |
|
| 57 | - /** |
|
| 58 | - * @var string |
|
| 59 | - */ |
|
| 60 | - protected $postCode; |
|
| 61 | - /** |
|
| 62 | - * @var string |
|
| 63 | - */ |
|
| 64 | - protected $landline; |
|
| 65 | - /** |
|
| 66 | - * @var string |
|
| 67 | - */ |
|
| 68 | - protected $addressLine1; |
|
| 69 | - /** |
|
| 70 | - * @var string |
|
| 71 | - */ |
|
| 72 | - protected $addressLine2; |
|
| 73 | - /** |
|
| 74 | - * Address State |
|
| 75 | - * |
|
| 76 | - * @var string |
|
| 77 | - */ |
|
| 78 | - protected $state; |
|
| 79 | - |
|
| 80 | - /** |
|
| 81 | - * Address constructor. |
|
| 82 | - * @param array|null $data |
|
| 83 | - */ |
|
| 11 | + /** |
|
| 12 | + * First address line |
|
| 13 | + * |
|
| 14 | + * @var string $line1 |
|
| 15 | + */ |
|
| 16 | + protected $line1; |
|
| 17 | + /** |
|
| 18 | + * Second address line |
|
| 19 | + * |
|
| 20 | + * @var string |
|
| 21 | + */ |
|
| 22 | + protected $line2; |
|
| 23 | + /** |
|
| 24 | + * Address Country |
|
| 25 | + * |
|
| 26 | + * @var string |
|
| 27 | + */ |
|
| 28 | + protected $country; |
|
| 29 | + /** |
|
| 30 | + * Address postal code |
|
| 31 | + * |
|
| 32 | + * @var string |
|
| 33 | + */ |
|
| 34 | + protected $postalCode; |
|
| 35 | + /** |
|
| 36 | + * Address City |
|
| 37 | + * |
|
| 38 | + * @var string |
|
| 39 | + */ |
|
| 40 | + protected $city; |
|
| 41 | + /** |
|
| 42 | + * @var string |
|
| 43 | + */ |
|
| 44 | + protected $countryEnName; |
|
| 45 | + /** |
|
| 46 | + * @var string |
|
| 47 | + */ |
|
| 48 | + protected $countryNativeName; |
|
| 49 | + /** |
|
| 50 | + * @var integer |
|
| 51 | + */ |
|
| 52 | + protected $regionId; |
|
| 53 | + /** |
|
| 54 | + * @var string |
|
| 55 | + */ |
|
| 56 | + protected $regionName; |
|
| 57 | + /** |
|
| 58 | + * @var string |
|
| 59 | + */ |
|
| 60 | + protected $postCode; |
|
| 61 | + /** |
|
| 62 | + * @var string |
|
| 63 | + */ |
|
| 64 | + protected $landline; |
|
| 65 | + /** |
|
| 66 | + * @var string |
|
| 67 | + */ |
|
| 68 | + protected $addressLine1; |
|
| 69 | + /** |
|
| 70 | + * @var string |
|
| 71 | + */ |
|
| 72 | + protected $addressLine2; |
|
| 73 | + /** |
|
| 74 | + * Address State |
|
| 75 | + * |
|
| 76 | + * @var string |
|
| 77 | + */ |
|
| 78 | + protected $state; |
|
| 79 | + |
|
| 80 | + /** |
|
| 81 | + * Address constructor. |
|
| 82 | + * @param array|null $data |
|
| 83 | + */ |
|
| 84 | 84 | public function __construct(?array $data = []) |
| 85 | - { |
|
| 86 | - $this->setAddressLine1($data['address_line1']??null); |
|
| 87 | - $this->setAddressLine2($data['address_line2']??null); |
|
| 88 | - $this->setCity($data['city']??null); |
|
| 89 | - $this->setCountry($data['country']??null); |
|
| 90 | - $this->setCountryEnName($data['country_en_name']??null); |
|
| 91 | - $this->setCountryNativeName($data['country_native_name']??null); |
|
| 92 | - $this->setRegionId($data['region_id']??null); |
|
| 93 | - $this->setRegionName($data['region_name']??null); |
|
| 94 | - $this->setPostCode($data['post_code']??null); |
|
| 95 | - $this->setLandline($data['landline']??null); |
|
| 96 | - $this->setLine1($data['line1']??null); |
|
| 97 | - $this->setLine2($data['line2']??null); |
|
| 98 | - $this->setPostalCode($data['postal_code']??null); |
|
| 99 | - $this->setState($data['state']??null); |
|
| 100 | - } |
|
| 101 | - |
|
| 102 | - /** |
|
| 103 | - * Get $line1 |
|
| 104 | - * |
|
| 105 | - * @return string |
|
| 106 | - */ |
|
| 107 | - public function getLine1(): ?string |
|
| 108 | - { |
|
| 109 | - return $this->line1; |
|
| 110 | - } |
|
| 111 | - |
|
| 112 | - /** |
|
| 113 | - * Set $line1 |
|
| 114 | - * |
|
| 115 | - * @param string $line1 $line1 |
|
| 116 | - * |
|
| 117 | - * @return AddressInterface |
|
| 118 | - */ |
|
| 119 | - public function setLine1(?string $line1): AddressInterface |
|
| 120 | - { |
|
| 121 | - $this->line1 = $line1; |
|
| 122 | - |
|
| 123 | - return $this; |
|
| 124 | - } |
|
| 125 | - |
|
| 126 | - /** |
|
| 127 | - * Get second address line |
|
| 128 | - * |
|
| 129 | - * @return string |
|
| 130 | - */ |
|
| 131 | - public function getLine2(): ?string |
|
| 132 | - { |
|
| 133 | - return $this->line2; |
|
| 134 | - } |
|
| 135 | - |
|
| 136 | - /** |
|
| 137 | - * Set second address line |
|
| 138 | - * |
|
| 139 | - * @param string $line2 Second address line |
|
| 140 | - * |
|
| 141 | - * @return AddressInterface |
|
| 142 | - */ |
|
| 143 | - public function setLine2(?string $line2): AddressInterface |
|
| 144 | - { |
|
| 145 | - $this->line2 = $line2; |
|
| 146 | - |
|
| 147 | - return $this; |
|
| 148 | - } |
|
| 149 | - |
|
| 150 | - /** |
|
| 151 | - * Get address Country |
|
| 152 | - * |
|
| 153 | - * @return string |
|
| 154 | - */ |
|
| 155 | - public function getCountry(): ?string |
|
| 156 | - { |
|
| 157 | - return $this->country; |
|
| 158 | - } |
|
| 159 | - |
|
| 160 | - /** |
|
| 161 | - * Set address Country |
|
| 162 | - * |
|
| 163 | - * @param string $country Address Country |
|
| 164 | - * |
|
| 165 | - * @return AddressInterface |
|
| 166 | - */ |
|
| 167 | - public function setCountry(?string $country): AddressInterface |
|
| 168 | - { |
|
| 169 | - $this->country = $country; |
|
| 170 | - |
|
| 171 | - return $this; |
|
| 172 | - } |
|
| 173 | - |
|
| 174 | - /** |
|
| 175 | - * Get address postal code |
|
| 176 | - * |
|
| 177 | - * @return string |
|
| 178 | - */ |
|
| 179 | - public function getPostalCode(): ?string |
|
| 180 | - { |
|
| 181 | - return $this->postalCode; |
|
| 182 | - } |
|
| 183 | - |
|
| 184 | - /** |
|
| 185 | - * Set address postal code |
|
| 186 | - * |
|
| 187 | - * @param string $postalCode Address postal code |
|
| 188 | - * |
|
| 189 | - * @return AddressInterface |
|
| 190 | - */ |
|
| 191 | - public function setPostalCode(?string $postalCode): AddressInterface |
|
| 192 | - { |
|
| 193 | - $this->postalCode = $postalCode; |
|
| 194 | - |
|
| 195 | - return $this; |
|
| 196 | - } |
|
| 197 | - |
|
| 198 | - /** |
|
| 199 | - * Get address City |
|
| 200 | - * |
|
| 201 | - * @return string |
|
| 202 | - */ |
|
| 203 | - public function getCity(): ?string |
|
| 204 | - { |
|
| 205 | - return $this->city; |
|
| 206 | - } |
|
| 207 | - |
|
| 208 | - /** |
|
| 209 | - * Set address City |
|
| 210 | - * |
|
| 211 | - * @param string $city Address City |
|
| 212 | - * |
|
| 213 | - * @return AddressInterface |
|
| 214 | - */ |
|
| 215 | - public function setCity(?string $city): AddressInterface |
|
| 216 | - { |
|
| 217 | - $this->city = $city; |
|
| 218 | - |
|
| 219 | - return $this; |
|
| 220 | - } |
|
| 221 | - |
|
| 222 | - /** |
|
| 223 | - * @return mixed |
|
| 224 | - */ |
|
| 225 | - public function getCountryEnName():? string |
|
| 226 | - { |
|
| 227 | - return $this->countryEnName; |
|
| 228 | - } |
|
| 229 | - |
|
| 230 | - /** |
|
| 231 | - * @param mixed $countryEnName |
|
| 232 | - * @return AddressInterface |
|
| 233 | - */ |
|
| 234 | - public function setCountryEnName($countryEnName): AddressInterface |
|
| 235 | - { |
|
| 236 | - $this->countryEnName = $countryEnName; |
|
| 237 | - |
|
| 238 | - return $this; |
|
| 239 | - } |
|
| 240 | - |
|
| 241 | - /** |
|
| 242 | - * @return mixed |
|
| 243 | - */ |
|
| 244 | - public function getCountryNativeName():? string |
|
| 245 | - { |
|
| 246 | - return $this->countryNativeName; |
|
| 247 | - } |
|
| 85 | + { |
|
| 86 | + $this->setAddressLine1($data['address_line1']??null); |
|
| 87 | + $this->setAddressLine2($data['address_line2']??null); |
|
| 88 | + $this->setCity($data['city']??null); |
|
| 89 | + $this->setCountry($data['country']??null); |
|
| 90 | + $this->setCountryEnName($data['country_en_name']??null); |
|
| 91 | + $this->setCountryNativeName($data['country_native_name']??null); |
|
| 92 | + $this->setRegionId($data['region_id']??null); |
|
| 93 | + $this->setRegionName($data['region_name']??null); |
|
| 94 | + $this->setPostCode($data['post_code']??null); |
|
| 95 | + $this->setLandline($data['landline']??null); |
|
| 96 | + $this->setLine1($data['line1']??null); |
|
| 97 | + $this->setLine2($data['line2']??null); |
|
| 98 | + $this->setPostalCode($data['postal_code']??null); |
|
| 99 | + $this->setState($data['state']??null); |
|
| 100 | + } |
|
| 101 | + |
|
| 102 | + /** |
|
| 103 | + * Get $line1 |
|
| 104 | + * |
|
| 105 | + * @return string |
|
| 106 | + */ |
|
| 107 | + public function getLine1(): ?string |
|
| 108 | + { |
|
| 109 | + return $this->line1; |
|
| 110 | + } |
|
| 111 | + |
|
| 112 | + /** |
|
| 113 | + * Set $line1 |
|
| 114 | + * |
|
| 115 | + * @param string $line1 $line1 |
|
| 116 | + * |
|
| 117 | + * @return AddressInterface |
|
| 118 | + */ |
|
| 119 | + public function setLine1(?string $line1): AddressInterface |
|
| 120 | + { |
|
| 121 | + $this->line1 = $line1; |
|
| 122 | + |
|
| 123 | + return $this; |
|
| 124 | + } |
|
| 125 | + |
|
| 126 | + /** |
|
| 127 | + * Get second address line |
|
| 128 | + * |
|
| 129 | + * @return string |
|
| 130 | + */ |
|
| 131 | + public function getLine2(): ?string |
|
| 132 | + { |
|
| 133 | + return $this->line2; |
|
| 134 | + } |
|
| 135 | + |
|
| 136 | + /** |
|
| 137 | + * Set second address line |
|
| 138 | + * |
|
| 139 | + * @param string $line2 Second address line |
|
| 140 | + * |
|
| 141 | + * @return AddressInterface |
|
| 142 | + */ |
|
| 143 | + public function setLine2(?string $line2): AddressInterface |
|
| 144 | + { |
|
| 145 | + $this->line2 = $line2; |
|
| 146 | + |
|
| 147 | + return $this; |
|
| 148 | + } |
|
| 149 | + |
|
| 150 | + /** |
|
| 151 | + * Get address Country |
|
| 152 | + * |
|
| 153 | + * @return string |
|
| 154 | + */ |
|
| 155 | + public function getCountry(): ?string |
|
| 156 | + { |
|
| 157 | + return $this->country; |
|
| 158 | + } |
|
| 159 | + |
|
| 160 | + /** |
|
| 161 | + * Set address Country |
|
| 162 | + * |
|
| 163 | + * @param string $country Address Country |
|
| 164 | + * |
|
| 165 | + * @return AddressInterface |
|
| 166 | + */ |
|
| 167 | + public function setCountry(?string $country): AddressInterface |
|
| 168 | + { |
|
| 169 | + $this->country = $country; |
|
| 170 | + |
|
| 171 | + return $this; |
|
| 172 | + } |
|
| 173 | + |
|
| 174 | + /** |
|
| 175 | + * Get address postal code |
|
| 176 | + * |
|
| 177 | + * @return string |
|
| 178 | + */ |
|
| 179 | + public function getPostalCode(): ?string |
|
| 180 | + { |
|
| 181 | + return $this->postalCode; |
|
| 182 | + } |
|
| 183 | + |
|
| 184 | + /** |
|
| 185 | + * Set address postal code |
|
| 186 | + * |
|
| 187 | + * @param string $postalCode Address postal code |
|
| 188 | + * |
|
| 189 | + * @return AddressInterface |
|
| 190 | + */ |
|
| 191 | + public function setPostalCode(?string $postalCode): AddressInterface |
|
| 192 | + { |
|
| 193 | + $this->postalCode = $postalCode; |
|
| 194 | + |
|
| 195 | + return $this; |
|
| 196 | + } |
|
| 197 | + |
|
| 198 | + /** |
|
| 199 | + * Get address City |
|
| 200 | + * |
|
| 201 | + * @return string |
|
| 202 | + */ |
|
| 203 | + public function getCity(): ?string |
|
| 204 | + { |
|
| 205 | + return $this->city; |
|
| 206 | + } |
|
| 207 | + |
|
| 208 | + /** |
|
| 209 | + * Set address City |
|
| 210 | + * |
|
| 211 | + * @param string $city Address City |
|
| 212 | + * |
|
| 213 | + * @return AddressInterface |
|
| 214 | + */ |
|
| 215 | + public function setCity(?string $city): AddressInterface |
|
| 216 | + { |
|
| 217 | + $this->city = $city; |
|
| 218 | + |
|
| 219 | + return $this; |
|
| 220 | + } |
|
| 221 | + |
|
| 222 | + /** |
|
| 223 | + * @return mixed |
|
| 224 | + */ |
|
| 225 | + public function getCountryEnName():? string |
|
| 226 | + { |
|
| 227 | + return $this->countryEnName; |
|
| 228 | + } |
|
| 229 | + |
|
| 230 | + /** |
|
| 231 | + * @param mixed $countryEnName |
|
| 232 | + * @return AddressInterface |
|
| 233 | + */ |
|
| 234 | + public function setCountryEnName($countryEnName): AddressInterface |
|
| 235 | + { |
|
| 236 | + $this->countryEnName = $countryEnName; |
|
| 237 | + |
|
| 238 | + return $this; |
|
| 239 | + } |
|
| 240 | + |
|
| 241 | + /** |
|
| 242 | + * @return mixed |
|
| 243 | + */ |
|
| 244 | + public function getCountryNativeName():? string |
|
| 245 | + { |
|
| 246 | + return $this->countryNativeName; |
|
| 247 | + } |
|
| 248 | 248 | |
| 249 | 249 | /** |
| 250 | 250 | * @param mixed $countryNativeName |
| 251 | 251 | * @return AddressInterface |
| 252 | 252 | */ |
| 253 | - public function setCountryNativeName(?string $countryNativeName): AddressInterface |
|
| 254 | - { |
|
| 255 | - $this->countryNativeName = $countryNativeName; |
|
| 253 | + public function setCountryNativeName(?string $countryNativeName): AddressInterface |
|
| 254 | + { |
|
| 255 | + $this->countryNativeName = $countryNativeName; |
|
| 256 | 256 | |
| 257 | - return $this; |
|
| 258 | - } |
|
| 257 | + return $this; |
|
| 258 | + } |
|
| 259 | 259 | |
| 260 | - /** |
|
| 260 | + /** |
|
| 261 | 261 | * @return int|null |
| 262 | - */ |
|
| 262 | + */ |
|
| 263 | 263 | public function getRegionId():? int |
| 264 | - { |
|
| 265 | - return $this->regionId; |
|
| 266 | - } |
|
| 264 | + { |
|
| 265 | + return $this->regionId; |
|
| 266 | + } |
|
| 267 | 267 | |
| 268 | - /** |
|
| 268 | + /** |
|
| 269 | 269 | * @param int|null $regionId |
| 270 | 270 | * @return AddressInterface |
| 271 | - */ |
|
| 271 | + */ |
|
| 272 | 272 | public function setRegionId(?int $regionId): AddressInterface |
| 273 | - { |
|
| 274 | - $this->regionId = $regionId; |
|
| 275 | - |
|
| 276 | - return $this; |
|
| 277 | - } |
|
| 278 | - |
|
| 279 | - /** |
|
| 280 | - * @return string|null |
|
| 281 | - */ |
|
| 282 | - public function getRegionName():? string |
|
| 283 | - { |
|
| 284 | - return $this->regionName; |
|
| 285 | - } |
|
| 286 | - |
|
| 287 | - /** |
|
| 288 | - * @param string|null $regionName |
|
| 289 | - * @return AddressInterface |
|
| 290 | - */ |
|
| 291 | - public function setRegionName(?string $regionName): AddressInterface |
|
| 292 | - { |
|
| 293 | - $this->regionName = $regionName; |
|
| 294 | - |
|
| 295 | - return $this; |
|
| 296 | - } |
|
| 297 | - |
|
| 298 | - /** |
|
| 299 | - * @return string|null |
|
| 300 | - */ |
|
| 301 | - public function getPostCode():? string |
|
| 302 | - { |
|
| 303 | - return $this->postCode; |
|
| 304 | - } |
|
| 305 | - |
|
| 306 | - /** |
|
| 307 | - * @param string|null $postCode |
|
| 308 | - * @return AddressInterface |
|
| 309 | - */ |
|
| 310 | - public function setPostCode(?string $postCode): AddressInterface |
|
| 311 | - { |
|
| 312 | - $this->postCode = $postCode; |
|
| 313 | - |
|
| 314 | - return $this; |
|
| 315 | - } |
|
| 316 | - |
|
| 317 | - /** |
|
| 318 | - * @return string|null |
|
| 319 | - */ |
|
| 320 | - public function getLandline():? string |
|
| 321 | - { |
|
| 322 | - return $this->landline; |
|
| 323 | - } |
|
| 324 | - |
|
| 325 | - /** |
|
| 326 | - * @param string|null $landline |
|
| 327 | - * @return AddressInterface |
|
| 328 | - */ |
|
| 329 | - public function setLandline(?string $landline): AddressInterface |
|
| 330 | - { |
|
| 331 | - $this->landline = $landline; |
|
| 332 | - |
|
| 333 | - return $this; |
|
| 334 | - } |
|
| 335 | - |
|
| 336 | - /** |
|
| 337 | - * @return string|null |
|
| 338 | - */ |
|
| 339 | - public function getAddressLine1():? string |
|
| 340 | - { |
|
| 341 | - return $this->addressLine1; |
|
| 342 | - } |
|
| 343 | - |
|
| 344 | - /** |
|
| 345 | - * @param string|null $addressLine1 |
|
| 346 | - * @return AddressInterface |
|
| 347 | - */ |
|
| 348 | - public function setAddressLine1(?string $addressLine1): AddressInterface |
|
| 349 | - { |
|
| 350 | - $this->addressLine1 = $addressLine1; |
|
| 351 | - |
|
| 352 | - return $this; |
|
| 353 | - } |
|
| 354 | - |
|
| 355 | - /** |
|
| 356 | - * @return string|null |
|
| 357 | - */ |
|
| 358 | - public function getAddressLine2():? string |
|
| 359 | - { |
|
| 360 | - return $this->addressLine2; |
|
| 361 | - } |
|
| 362 | - |
|
| 363 | - /** |
|
| 364 | - * @param string|null $addressLine2 |
|
| 365 | - * @return AddressInterface |
|
| 366 | - */ |
|
| 367 | - public function setAddressLine2(?string $addressLine2): AddressInterface |
|
| 368 | - { |
|
| 369 | - $this->addressLine2 = $addressLine2; |
|
| 370 | - |
|
| 371 | - return $this; |
|
| 372 | - } |
|
| 373 | - |
|
| 374 | - /** |
|
| 375 | - * Get address State |
|
| 376 | - * |
|
| 377 | - * @return string|null |
|
| 378 | - */ |
|
| 379 | - public function getState(): ?string |
|
| 380 | - { |
|
| 381 | - return $this->state; |
|
| 382 | - } |
|
| 383 | - |
|
| 384 | - /** |
|
| 385 | - * Set address State |
|
| 386 | - * |
|
| 387 | - * @param string|null $state Address State |
|
| 388 | - * |
|
| 389 | - * @return AddressInterface |
|
| 390 | - */ |
|
| 391 | - public function setState(?string $state): AddressInterface |
|
| 392 | - { |
|
| 393 | - $this->state = $state; |
|
| 394 | - |
|
| 395 | - return $this; |
|
| 396 | - } |
|
| 273 | + { |
|
| 274 | + $this->regionId = $regionId; |
|
| 275 | + |
|
| 276 | + return $this; |
|
| 277 | + } |
|
| 278 | + |
|
| 279 | + /** |
|
| 280 | + * @return string|null |
|
| 281 | + */ |
|
| 282 | + public function getRegionName():? string |
|
| 283 | + { |
|
| 284 | + return $this->regionName; |
|
| 285 | + } |
|
| 286 | + |
|
| 287 | + /** |
|
| 288 | + * @param string|null $regionName |
|
| 289 | + * @return AddressInterface |
|
| 290 | + */ |
|
| 291 | + public function setRegionName(?string $regionName): AddressInterface |
|
| 292 | + { |
|
| 293 | + $this->regionName = $regionName; |
|
| 294 | + |
|
| 295 | + return $this; |
|
| 296 | + } |
|
| 297 | + |
|
| 298 | + /** |
|
| 299 | + * @return string|null |
|
| 300 | + */ |
|
| 301 | + public function getPostCode():? string |
|
| 302 | + { |
|
| 303 | + return $this->postCode; |
|
| 304 | + } |
|
| 305 | + |
|
| 306 | + /** |
|
| 307 | + * @param string|null $postCode |
|
| 308 | + * @return AddressInterface |
|
| 309 | + */ |
|
| 310 | + public function setPostCode(?string $postCode): AddressInterface |
|
| 311 | + { |
|
| 312 | + $this->postCode = $postCode; |
|
| 313 | + |
|
| 314 | + return $this; |
|
| 315 | + } |
|
| 316 | + |
|
| 317 | + /** |
|
| 318 | + * @return string|null |
|
| 319 | + */ |
|
| 320 | + public function getLandline():? string |
|
| 321 | + { |
|
| 322 | + return $this->landline; |
|
| 323 | + } |
|
| 324 | + |
|
| 325 | + /** |
|
| 326 | + * @param string|null $landline |
|
| 327 | + * @return AddressInterface |
|
| 328 | + */ |
|
| 329 | + public function setLandline(?string $landline): AddressInterface |
|
| 330 | + { |
|
| 331 | + $this->landline = $landline; |
|
| 332 | + |
|
| 333 | + return $this; |
|
| 334 | + } |
|
| 335 | + |
|
| 336 | + /** |
|
| 337 | + * @return string|null |
|
| 338 | + */ |
|
| 339 | + public function getAddressLine1():? string |
|
| 340 | + { |
|
| 341 | + return $this->addressLine1; |
|
| 342 | + } |
|
| 343 | + |
|
| 344 | + /** |
|
| 345 | + * @param string|null $addressLine1 |
|
| 346 | + * @return AddressInterface |
|
| 347 | + */ |
|
| 348 | + public function setAddressLine1(?string $addressLine1): AddressInterface |
|
| 349 | + { |
|
| 350 | + $this->addressLine1 = $addressLine1; |
|
| 351 | + |
|
| 352 | + return $this; |
|
| 353 | + } |
|
| 354 | + |
|
| 355 | + /** |
|
| 356 | + * @return string|null |
|
| 357 | + */ |
|
| 358 | + public function getAddressLine2():? string |
|
| 359 | + { |
|
| 360 | + return $this->addressLine2; |
|
| 361 | + } |
|
| 362 | + |
|
| 363 | + /** |
|
| 364 | + * @param string|null $addressLine2 |
|
| 365 | + * @return AddressInterface |
|
| 366 | + */ |
|
| 367 | + public function setAddressLine2(?string $addressLine2): AddressInterface |
|
| 368 | + { |
|
| 369 | + $this->addressLine2 = $addressLine2; |
|
| 370 | + |
|
| 371 | + return $this; |
|
| 372 | + } |
|
| 373 | + |
|
| 374 | + /** |
|
| 375 | + * Get address State |
|
| 376 | + * |
|
| 377 | + * @return string|null |
|
| 378 | + */ |
|
| 379 | + public function getState(): ?string |
|
| 380 | + { |
|
| 381 | + return $this->state; |
|
| 382 | + } |
|
| 383 | + |
|
| 384 | + /** |
|
| 385 | + * Set address State |
|
| 386 | + * |
|
| 387 | + * @param string|null $state Address State |
|
| 388 | + * |
|
| 389 | + * @return AddressInterface |
|
| 390 | + */ |
|
| 391 | + public function setState(?string $state): AddressInterface |
|
| 392 | + { |
|
| 393 | + $this->state = $state; |
|
| 394 | + |
|
| 395 | + return $this; |
|
| 396 | + } |
|
| 397 | 397 | } |
@@ -23,15 +23,15 @@ discard block |
||
| 23 | 23 | protected $options = []; |
| 24 | 24 | |
| 25 | 25 | /** |
| 26 | - * CheckoutClientInterface constructor. |
|
| 27 | - * @param ContextInterface $context |
|
| 26 | + * CheckoutClientInterface constructor. |
|
| 27 | + * @param ContextInterface $context |
|
| 28 | 28 | * @param array $options |
| 29 | 29 | */ |
| 30 | 30 | public function __construct(ContextInterface $context, ?array $options = []) |
| 31 | - { |
|
| 32 | - $this->context = $context; |
|
| 31 | + { |
|
| 32 | + $this->context = $context; |
|
| 33 | 33 | $this->options = $options; |
| 34 | - } |
|
| 34 | + } |
|
| 35 | 35 | |
| 36 | 36 | /** |
| 37 | 37 | * @param $customer |
@@ -83,9 +83,9 @@ discard block |
||
| 83 | 83 | } |
| 84 | 84 | |
| 85 | 85 | public function getLastResponse(): ResponseInterface |
| 86 | - { |
|
| 87 | - return $this->lastResponse; |
|
| 88 | - } |
|
| 86 | + { |
|
| 87 | + return $this->lastResponse; |
|
| 88 | + } |
|
| 89 | 89 | |
| 90 | 90 | /** |
| 91 | 91 | * @param ResponseInterface $response |
@@ -55,10 +55,10 @@ discard block |
||
| 55 | 55 | return null; |
| 56 | 56 | } |
| 57 | 57 | |
| 58 | - /** |
|
| 58 | + /** |
|
| 59 | 59 | * Retrieve a paymentInstrument from server and fill the $paymentInstrument Object with response. |
| 60 | - * |
|
| 61 | - */ |
|
| 60 | + * |
|
| 61 | + */ |
|
| 62 | 62 | public function get(): array |
| 63 | 63 | { |
| 64 | 64 | $response = []; |
@@ -70,20 +70,20 @@ discard block |
||
| 70 | 70 | }; |
| 71 | 71 | |
| 72 | 72 | return $response; |
| 73 | - } |
|
| 73 | + } |
|
| 74 | 74 | |
| 75 | - /** |
|
| 75 | + /** |
|
| 76 | 76 | * Delete an paymentInstrument from server. |
| 77 | - * |
|
| 77 | + * |
|
| 78 | 78 | * @param PaymentInstrumentInterface $paymentInstrument |
| 79 | 79 | * @return bool |
| 80 | - */ |
|
| 80 | + */ |
|
| 81 | 81 | public function disable(PaymentInstrumentInterface $paymentInstrument):?bool |
| 82 | 82 | { |
| 83 | 83 | $uri = $this->getEndPoint().'/'.$paymentInstrument->getToken(); |
| 84 | 84 | |
| 85 | 85 | return $this->request('delete', $paymentInstrument, $uri); |
| 86 | - } |
|
| 86 | + } |
|
| 87 | 87 | |
| 88 | 88 | /** |
| 89 | 89 | * @return string |
@@ -93,14 +93,14 @@ discard block |
||
| 93 | 93 | return 'customers/'.$this->customer->getCustomerId().'/payment-instruments'; |
| 94 | 94 | } |
| 95 | 95 | |
| 96 | - /** |
|
| 97 | - * Return last response of client |
|
| 98 | - * @return ResponseInterface |
|
| 99 | - */ |
|
| 96 | + /** |
|
| 97 | + * Return last response of client |
|
| 98 | + * @return ResponseInterface |
|
| 99 | + */ |
|
| 100 | 100 | public function getLastResponse(): ResponseInterface |
| 101 | - { |
|
| 101 | + { |
|
| 102 | 102 | return $this->lastResponse; |
| 103 | - } |
|
| 103 | + } |
|
| 104 | 104 | |
| 105 | 105 | /** |
| 106 | 106 | * @param ResponseInterface $response |
@@ -4,132 +4,132 @@ |
||
| 4 | 4 | |
| 5 | 5 | class Customer implements CustomerInterface |
| 6 | 6 | { |
| 7 | - /** |
|
| 8 | - * Customer SumUp ID |
|
| 9 | - * |
|
| 10 | - * @var string |
|
| 11 | - */ |
|
| 12 | - protected $customerId; |
|
| 13 | - |
|
| 14 | - /** |
|
| 15 | - * Customer Name |
|
| 16 | - * |
|
| 17 | - * @var string |
|
| 18 | - */ |
|
| 19 | - protected $name; |
|
| 20 | - |
|
| 21 | - /** |
|
| 22 | - * Customer phone |
|
| 23 | - * |
|
| 24 | - * @var string |
|
| 25 | - */ |
|
| 26 | - protected $phone; |
|
| 27 | - |
|
| 28 | - /** |
|
| 29 | - * Cusomter address |
|
| 30 | - * |
|
| 31 | - * @var AddressInterface |
|
| 32 | - */ |
|
| 33 | - protected $address; |
|
| 7 | + /** |
|
| 8 | + * Customer SumUp ID |
|
| 9 | + * |
|
| 10 | + * @var string |
|
| 11 | + */ |
|
| 12 | + protected $customerId; |
|
| 13 | + |
|
| 14 | + /** |
|
| 15 | + * Customer Name |
|
| 16 | + * |
|
| 17 | + * @var string |
|
| 18 | + */ |
|
| 19 | + protected $name; |
|
| 20 | + |
|
| 21 | + /** |
|
| 22 | + * Customer phone |
|
| 23 | + * |
|
| 24 | + * @var string |
|
| 25 | + */ |
|
| 26 | + protected $phone; |
|
| 27 | + |
|
| 28 | + /** |
|
| 29 | + * Cusomter address |
|
| 30 | + * |
|
| 31 | + * @var AddressInterface |
|
| 32 | + */ |
|
| 33 | + protected $address; |
|
| 34 | 34 | |
| 35 | 35 | public function __construct(?array $data = []) |
| 36 | - { |
|
| 37 | - $this->setCustomerId($data['customer_id']??null); |
|
| 38 | - $personal_details = $data['personal_details']??$data; |
|
| 39 | - $this->setName($personal_details['name']??null); |
|
| 40 | - $this->setPhone($personal_details['phone']??null); |
|
| 41 | - $this->setAddress(new Address($personal_details['address']??null)); |
|
| 42 | - } |
|
| 43 | - |
|
| 44 | - /** |
|
| 45 | - * Get customer SumUp ID |
|
| 46 | - * |
|
| 47 | - * @return string |
|
| 48 | - */ |
|
| 49 | - public function getCustomerId(): ?string |
|
| 50 | - { |
|
| 51 | - return $this->customerId; |
|
| 52 | - } |
|
| 53 | - |
|
| 54 | - /** |
|
| 55 | - * Set customer SumUp ID |
|
| 56 | - * |
|
| 57 | - * @param string $customerId Customer SumUp ID |
|
| 58 | - * @return CustomerInterface |
|
| 59 | - */ |
|
| 60 | - public function setCustomerId(?string $customerId): CustomerInterface |
|
| 61 | - { |
|
| 62 | - $this->customerId = $customerId; |
|
| 63 | - |
|
| 64 | - return $this; |
|
| 65 | - } |
|
| 66 | - |
|
| 67 | - /** |
|
| 68 | - * Get customer Name |
|
| 69 | - * |
|
| 70 | - * @return string |
|
| 71 | - */ |
|
| 72 | - public function getName(): ?string |
|
| 73 | - { |
|
| 74 | - return $this->name; |
|
| 75 | - } |
|
| 76 | - |
|
| 77 | - /** |
|
| 78 | - * Set customer Name |
|
| 79 | - * |
|
| 36 | + { |
|
| 37 | + $this->setCustomerId($data['customer_id']??null); |
|
| 38 | + $personal_details = $data['personal_details']??$data; |
|
| 39 | + $this->setName($personal_details['name']??null); |
|
| 40 | + $this->setPhone($personal_details['phone']??null); |
|
| 41 | + $this->setAddress(new Address($personal_details['address']??null)); |
|
| 42 | + } |
|
| 43 | + |
|
| 44 | + /** |
|
| 45 | + * Get customer SumUp ID |
|
| 46 | + * |
|
| 47 | + * @return string |
|
| 48 | + */ |
|
| 49 | + public function getCustomerId(): ?string |
|
| 50 | + { |
|
| 51 | + return $this->customerId; |
|
| 52 | + } |
|
| 53 | + |
|
| 54 | + /** |
|
| 55 | + * Set customer SumUp ID |
|
| 56 | + * |
|
| 57 | + * @param string $customerId Customer SumUp ID |
|
| 58 | + * @return CustomerInterface |
|
| 59 | + */ |
|
| 60 | + public function setCustomerId(?string $customerId): CustomerInterface |
|
| 61 | + { |
|
| 62 | + $this->customerId = $customerId; |
|
| 63 | + |
|
| 64 | + return $this; |
|
| 65 | + } |
|
| 66 | + |
|
| 67 | + /** |
|
| 68 | + * Get customer Name |
|
| 69 | + * |
|
| 70 | + * @return string |
|
| 71 | + */ |
|
| 72 | + public function getName(): ?string |
|
| 73 | + { |
|
| 74 | + return $this->name; |
|
| 75 | + } |
|
| 76 | + |
|
| 77 | + /** |
|
| 78 | + * Set customer Name |
|
| 79 | + * |
|
| 80 | 80 | * @param string $name Customer Name |
| 81 | 81 | * @return Customer|CustomerInterface |
| 82 | - */ |
|
| 83 | - public function setName(?string $name): CustomerInterface |
|
| 84 | - { |
|
| 85 | - $this->name = $name; |
|
| 86 | - |
|
| 87 | - return $this; |
|
| 88 | - } |
|
| 89 | - |
|
| 90 | - /** |
|
| 91 | - * Get customer phone |
|
| 92 | - * |
|
| 93 | - * @return string |
|
| 94 | - */ |
|
| 95 | - public function getPhone(): ?string |
|
| 96 | - { |
|
| 97 | - return $this->phone; |
|
| 98 | - } |
|
| 99 | - |
|
| 100 | - /** |
|
| 101 | - * Set customer phone |
|
| 102 | - * |
|
| 82 | + */ |
|
| 83 | + public function setName(?string $name): CustomerInterface |
|
| 84 | + { |
|
| 85 | + $this->name = $name; |
|
| 86 | + |
|
| 87 | + return $this; |
|
| 88 | + } |
|
| 89 | + |
|
| 90 | + /** |
|
| 91 | + * Get customer phone |
|
| 92 | + * |
|
| 93 | + * @return string |
|
| 94 | + */ |
|
| 95 | + public function getPhone(): ?string |
|
| 96 | + { |
|
| 97 | + return $this->phone; |
|
| 98 | + } |
|
| 99 | + |
|
| 100 | + /** |
|
| 101 | + * Set customer phone |
|
| 102 | + * |
|
| 103 | 103 | * @param string $phone Customer phone |
| 104 | 104 | * @return Customer|CustomerInterface |
| 105 | - */ |
|
| 106 | - public function setPhone(?string $phone): CustomerInterface |
|
| 107 | - { |
|
| 108 | - $this->phone = $phone; |
|
| 109 | - |
|
| 110 | - return $this; |
|
| 111 | - } |
|
| 112 | - |
|
| 113 | - /** |
|
| 114 | - * Get cusomter address |
|
| 115 | - * |
|
| 116 | - * @return AddressInterface |
|
| 117 | - */ |
|
| 118 | - public function getAddress(): AddressInterface |
|
| 119 | - { |
|
| 120 | - return $this->address; |
|
| 121 | - } |
|
| 122 | - |
|
| 123 | - /** |
|
| 124 | - * Set cusomter address |
|
| 125 | - * |
|
| 126 | - * @param AddressInterface $address |
|
| 127 | - * @return Customer|CustomerInterface |
|
| 128 | - */ |
|
| 129 | - public function setAddress(AddressInterface $address): CustomerInterface |
|
| 130 | - { |
|
| 131 | - $this->address = $address; |
|
| 132 | - return $this; |
|
| 133 | - } |
|
| 105 | + */ |
|
| 106 | + public function setPhone(?string $phone): CustomerInterface |
|
| 107 | + { |
|
| 108 | + $this->phone = $phone; |
|
| 109 | + |
|
| 110 | + return $this; |
|
| 111 | + } |
|
| 112 | + |
|
| 113 | + /** |
|
| 114 | + * Get cusomter address |
|
| 115 | + * |
|
| 116 | + * @return AddressInterface |
|
| 117 | + */ |
|
| 118 | + public function getAddress(): AddressInterface |
|
| 119 | + { |
|
| 120 | + return $this->address; |
|
| 121 | + } |
|
| 122 | + |
|
| 123 | + /** |
|
| 124 | + * Set cusomter address |
|
| 125 | + * |
|
| 126 | + * @param AddressInterface $address |
|
| 127 | + * @return Customer|CustomerInterface |
|
| 128 | + */ |
|
| 129 | + public function setAddress(AddressInterface $address): CustomerInterface |
|
| 130 | + { |
|
| 131 | + $this->address = $address; |
|
| 132 | + return $this; |
|
| 133 | + } |
|
| 134 | 134 | |
| 135 | 135 | } |
@@ -11,70 +11,70 @@ discard block |
||
| 11 | 11 | |
| 12 | 12 | class Checkout implements CheckoutInterface, PropertyHandlerInterface |
| 13 | 13 | { |
| 14 | - use PropertyHandler; |
|
| 15 | - |
|
| 16 | - const PENDING = 'PENDING'; |
|
| 17 | - const COMPLETED = 'COMPLETED'; |
|
| 18 | - const FAILED = 'FAILED'; |
|
| 19 | - |
|
| 20 | - protected $id; |
|
| 21 | - protected $status; |
|
| 22 | - protected $amount; |
|
| 23 | - protected $feeAmount; |
|
| 24 | - protected $currency; |
|
| 25 | - protected $payToEmail; |
|
| 26 | - protected $payFromEmail; |
|
| 27 | - protected $description; |
|
| 28 | - protected $redirectUrl; |
|
| 29 | - protected $validUntil; |
|
| 30 | - protected $token; |
|
| 31 | - protected $transactionId; |
|
| 32 | - protected $transactionCode; |
|
| 33 | - protected $type; |
|
| 34 | - protected $installments; |
|
| 35 | - |
|
| 36 | - /** |
|
| 37 | - * Checkout reference |
|
| 38 | - * |
|
| 39 | - * @var string |
|
| 40 | - */ |
|
| 41 | - protected $reference; |
|
| 42 | - |
|
| 43 | - /** |
|
| 44 | - * Customer |
|
| 45 | - * |
|
| 46 | - * @var null|Customer |
|
| 47 | - */ |
|
| 48 | - protected $customer; |
|
| 49 | - |
|
| 50 | - /** |
|
| 14 | + use PropertyHandler; |
|
| 15 | + |
|
| 16 | + const PENDING = 'PENDING'; |
|
| 17 | + const COMPLETED = 'COMPLETED'; |
|
| 18 | + const FAILED = 'FAILED'; |
|
| 19 | + |
|
| 20 | + protected $id; |
|
| 21 | + protected $status; |
|
| 22 | + protected $amount; |
|
| 23 | + protected $feeAmount; |
|
| 24 | + protected $currency; |
|
| 25 | + protected $payToEmail; |
|
| 26 | + protected $payFromEmail; |
|
| 27 | + protected $description; |
|
| 28 | + protected $redirectUrl; |
|
| 29 | + protected $validUntil; |
|
| 30 | + protected $token; |
|
| 31 | + protected $transactionId; |
|
| 32 | + protected $transactionCode; |
|
| 33 | + protected $type; |
|
| 34 | + protected $installments; |
|
| 35 | + |
|
| 36 | + /** |
|
| 37 | + * Checkout reference |
|
| 38 | + * |
|
| 39 | + * @var string |
|
| 40 | + */ |
|
| 41 | + protected $reference; |
|
| 42 | + |
|
| 43 | + /** |
|
| 44 | + * Customer |
|
| 45 | + * |
|
| 46 | + * @var null|Customer |
|
| 47 | + */ |
|
| 48 | + protected $customer; |
|
| 49 | + |
|
| 50 | + /** |
|
| 51 | 51 | * PaymentInstrument |
| 52 | - * |
|
| 53 | - * |
|
| 52 | + * |
|
| 53 | + * |
|
| 54 | 54 | * @var null|PaymentInstrument |
| 55 | - */ |
|
| 56 | - protected $card; |
|
| 55 | + */ |
|
| 56 | + protected $card; |
|
| 57 | 57 | |
| 58 | 58 | |
| 59 | - /** |
|
| 60 | - * checkout constructor |
|
| 61 | - * |
|
| 62 | - * @param array $data |
|
| 63 | - */ |
|
| 64 | - public function __construct(array $data = null) { |
|
| 65 | - if ($data !== null) { |
|
| 59 | + /** |
|
| 60 | + * checkout constructor |
|
| 61 | + * |
|
| 62 | + * @param array $data |
|
| 63 | + */ |
|
| 64 | + public function __construct(array $data = null) { |
|
| 65 | + if ($data !== null) { |
|
| 66 | 66 | $this->setAmount($data['amount']??0); |
| 67 | 67 | $this->setPayToEmail($data['pay_to_email']??''); |
| 68 | 68 | $this->setCheckoutReference($data['checkout_reference']??''); |
| 69 | 69 | $this->setCurrency($data['currency']??''); |
| 70 | - $this->setDescription($data['description']??null); |
|
| 71 | - $this->setFeeAmount($data['fee_amount']??null); |
|
| 72 | - $this->setPayFromEmail($data['pay_from_mail']??null); |
|
| 73 | - $this->setId($data['id']??null); |
|
| 74 | - $this->setRedirectUrl($data['redirect_url']??null); |
|
| 75 | - $this->setStatus($data['status']??null); |
|
| 76 | - } |
|
| 77 | - } |
|
| 70 | + $this->setDescription($data['description']??null); |
|
| 71 | + $this->setFeeAmount($data['fee_amount']??null); |
|
| 72 | + $this->setPayFromEmail($data['pay_from_mail']??null); |
|
| 73 | + $this->setId($data['id']??null); |
|
| 74 | + $this->setRedirectUrl($data['redirect_url']??null); |
|
| 75 | + $this->setStatus($data['status']??null); |
|
| 76 | + } |
|
| 77 | + } |
|
| 78 | 78 | |
| 79 | 79 | /** |
| 80 | 80 | * @inheritDoc |
@@ -86,55 +86,55 @@ discard block |
||
| 86 | 86 | return $this; |
| 87 | 87 | } |
| 88 | 88 | |
| 89 | - /** |
|
| 90 | - * @inheritDoc |
|
| 91 | - */ |
|
| 92 | - public function isValid(): bool { |
|
| 93 | - return $this->getReference() !== null |
|
| 94 | - && $this->getAmount() !== null |
|
| 95 | - && $this->getPayToEmail() !== null |
|
| 89 | + /** |
|
| 90 | + * @inheritDoc |
|
| 91 | + */ |
|
| 92 | + public function isValid(): bool { |
|
| 93 | + return $this->getReference() !== null |
|
| 94 | + && $this->getAmount() !== null |
|
| 95 | + && $this->getPayToEmail() !== null |
|
| 96 | 96 | && $this->getAmount() > 0 |
| 97 | - && Currency::isValid($this->getCurrency()); |
|
| 98 | - } |
|
| 97 | + && Currency::isValid($this->getCurrency()); |
|
| 98 | + } |
|
| 99 | 99 | |
| 100 | - /** |
|
| 100 | + /** |
|
| 101 | 101 | * Get checkout reference |
| 102 | 102 | * |
| 103 | 103 | * @return string |
| 104 | - */ |
|
| 104 | + */ |
|
| 105 | 105 | public function getReference(): ?string |
| 106 | 106 | { |
| 107 | 107 | return $this->reference; |
| 108 | - } |
|
| 108 | + } |
|
| 109 | 109 | |
| 110 | - /** |
|
| 110 | + /** |
|
| 111 | 111 | * Set checkout reference |
| 112 | 112 | * |
| 113 | 113 | * @param string $reference Checkout reference |
| 114 | 114 | * |
| 115 | 115 | * @return CheckoutInterface |
| 116 | - */ |
|
| 116 | + */ |
|
| 117 | 117 | public function setReference(?string $reference): CheckoutInterface |
| 118 | 118 | { |
| 119 | 119 | $this->reference = $reference; |
| 120 | 120 | |
| 121 | - return $this; |
|
| 122 | - } |
|
| 121 | + return $this; |
|
| 122 | + } |
|
| 123 | 123 | |
| 124 | - /** |
|
| 125 | - * @inheritDoc |
|
| 126 | - */ |
|
| 127 | - public function getAmount():? float { |
|
| 128 | - return $this->amount; |
|
| 129 | - } |
|
| 124 | + /** |
|
| 125 | + * @inheritDoc |
|
| 126 | + */ |
|
| 127 | + public function getAmount():? float { |
|
| 128 | + return $this->amount; |
|
| 129 | + } |
|
| 130 | 130 | |
| 131 | - /** |
|
| 132 | - * @inheritDoc |
|
| 133 | - */ |
|
| 134 | - public function setAmount(float $amount): CheckoutInterface { |
|
| 135 | - $this->amount = $amount > 0 ? $amount : null; |
|
| 136 | - return $this; |
|
| 137 | - } |
|
| 131 | + /** |
|
| 132 | + * @inheritDoc |
|
| 133 | + */ |
|
| 134 | + public function setAmount(float $amount): CheckoutInterface { |
|
| 135 | + $this->amount = $amount > 0 ? $amount : null; |
|
| 136 | + return $this; |
|
| 137 | + } |
|
| 138 | 138 | |
| 139 | 139 | /** |
| 140 | 140 | * @inheritDoc |
@@ -154,54 +154,54 @@ discard block |
||
| 154 | 154 | return $this; |
| 155 | 155 | } |
| 156 | 156 | |
| 157 | - /** |
|
| 158 | - * @inheritDoc |
|
| 159 | - */ |
|
| 160 | - public function getCurrency():? string { |
|
| 161 | - return $this->currency; |
|
| 162 | - } |
|
| 163 | - |
|
| 164 | - /** |
|
| 165 | - * @inheritDoc |
|
| 166 | - */ |
|
| 167 | - public function setCurrency(?string $currency): CheckoutInterface { |
|
| 168 | - $this->currency = $currency; |
|
| 169 | - return $this; |
|
| 170 | - } |
|
| 171 | - |
|
| 172 | - /** |
|
| 173 | - * @inheritDoc |
|
| 174 | - */ |
|
| 157 | + /** |
|
| 158 | + * @inheritDoc |
|
| 159 | + */ |
|
| 160 | + public function getCurrency():? string { |
|
| 161 | + return $this->currency; |
|
| 162 | + } |
|
| 163 | + |
|
| 164 | + /** |
|
| 165 | + * @inheritDoc |
|
| 166 | + */ |
|
| 167 | + public function setCurrency(?string $currency): CheckoutInterface { |
|
| 168 | + $this->currency = $currency; |
|
| 169 | + return $this; |
|
| 170 | + } |
|
| 171 | + |
|
| 172 | + /** |
|
| 173 | + * @inheritDoc |
|
| 174 | + */ |
|
| 175 | 175 | public function getId():? string |
| 176 | 176 | { |
| 177 | 177 | return $this->id; |
| 178 | - } |
|
| 178 | + } |
|
| 179 | 179 | |
| 180 | - /** |
|
| 181 | - * @inheritDoc |
|
| 182 | - */ |
|
| 180 | + /** |
|
| 181 | + * @inheritDoc |
|
| 182 | + */ |
|
| 183 | 183 | public function setId(?string $id): CheckoutInterface |
| 184 | 184 | { |
| 185 | 185 | $this->id = $id; |
| 186 | - return $this; |
|
| 187 | - } |
|
| 186 | + return $this; |
|
| 187 | + } |
|
| 188 | 188 | |
| 189 | - /** |
|
| 190 | - * @inheritDoc |
|
| 191 | - */ |
|
| 189 | + /** |
|
| 190 | + * @inheritDoc |
|
| 191 | + */ |
|
| 192 | 192 | public function getStatus():? string |
| 193 | 193 | { |
| 194 | 194 | return $this->status; |
| 195 | - } |
|
| 195 | + } |
|
| 196 | 196 | |
| 197 | - /** |
|
| 198 | - * @inheritDoc |
|
| 199 | - */ |
|
| 197 | + /** |
|
| 198 | + * @inheritDoc |
|
| 199 | + */ |
|
| 200 | 200 | public function setStatus(?string $status): CheckoutInterface |
| 201 | 201 | { |
| 202 | 202 | $this->status = $status; |
| 203 | - return $this; |
|
| 204 | - } |
|
| 203 | + return $this; |
|
| 204 | + } |
|
| 205 | 205 | |
| 206 | 206 | /** |
| 207 | 207 | * @inheritDoc |
@@ -211,198 +211,198 @@ discard block |
||
| 211 | 211 | return $this->reference; |
| 212 | 212 | } |
| 213 | 213 | |
| 214 | - /** |
|
| 215 | - * @inheritDoc |
|
| 216 | - */ |
|
| 217 | - public function getDescription():? string { |
|
| 218 | - return $this->description; |
|
| 219 | - } |
|
| 220 | - |
|
| 221 | - /** |
|
| 222 | - * @inheritDoc |
|
| 223 | - */ |
|
| 224 | - public function setDescription(?string $description): CheckoutInterface { |
|
| 225 | - $this->description = $description; |
|
| 226 | - return $this; |
|
| 227 | - } |
|
| 228 | - |
|
| 229 | - /** |
|
| 230 | - * @inheritDoc |
|
| 231 | - */ |
|
| 232 | - public function getFeeAmount():? float { |
|
| 233 | - return $this->feeAmount; |
|
| 234 | - } |
|
| 235 | - |
|
| 236 | - /** |
|
| 237 | - * @inheritDoc |
|
| 238 | - */ |
|
| 239 | - public function setFeeAmount(?float $fee): CheckoutInterface { |
|
| 240 | - $this->feeAmount = $fee; |
|
| 241 | - return $this; |
|
| 242 | - } |
|
| 243 | - |
|
| 244 | - /** |
|
| 245 | - * @inheritDoc |
|
| 246 | - */ |
|
| 247 | - public function getPayFromEmail():? string { |
|
| 248 | - return $this->payFromEmail; |
|
| 249 | - } |
|
| 250 | - |
|
| 251 | - /** |
|
| 252 | - * @inheritDoc |
|
| 253 | - */ |
|
| 254 | - public function setPayFromEmail(?string $email): CheckoutInterface { |
|
| 255 | - $this->payFromEmail = $email; |
|
| 256 | - return $this; |
|
| 257 | - } |
|
| 258 | - |
|
| 259 | - /** |
|
| 260 | - * @inheritDoc |
|
| 261 | - */ |
|
| 262 | - public function getRedirectUrl():? string { |
|
| 263 | - return $this->redirectUrl; |
|
| 264 | - } |
|
| 265 | - |
|
| 266 | - /** |
|
| 267 | - * @inheritDoc |
|
| 268 | - */ |
|
| 269 | - public function setRedirectUrl(?string $url): CheckoutInterface { |
|
| 270 | - $this->redirectUrl = $url; |
|
| 271 | - return $this; |
|
| 272 | - } |
|
| 214 | + /** |
|
| 215 | + * @inheritDoc |
|
| 216 | + */ |
|
| 217 | + public function getDescription():? string { |
|
| 218 | + return $this->description; |
|
| 219 | + } |
|
| 220 | + |
|
| 221 | + /** |
|
| 222 | + * @inheritDoc |
|
| 223 | + */ |
|
| 224 | + public function setDescription(?string $description): CheckoutInterface { |
|
| 225 | + $this->description = $description; |
|
| 226 | + return $this; |
|
| 227 | + } |
|
| 228 | + |
|
| 229 | + /** |
|
| 230 | + * @inheritDoc |
|
| 231 | + */ |
|
| 232 | + public function getFeeAmount():? float { |
|
| 233 | + return $this->feeAmount; |
|
| 234 | + } |
|
| 235 | + |
|
| 236 | + /** |
|
| 237 | + * @inheritDoc |
|
| 238 | + */ |
|
| 239 | + public function setFeeAmount(?float $fee): CheckoutInterface { |
|
| 240 | + $this->feeAmount = $fee; |
|
| 241 | + return $this; |
|
| 242 | + } |
|
| 243 | + |
|
| 244 | + /** |
|
| 245 | + * @inheritDoc |
|
| 246 | + */ |
|
| 247 | + public function getPayFromEmail():? string { |
|
| 248 | + return $this->payFromEmail; |
|
| 249 | + } |
|
| 250 | + |
|
| 251 | + /** |
|
| 252 | + * @inheritDoc |
|
| 253 | + */ |
|
| 254 | + public function setPayFromEmail(?string $email): CheckoutInterface { |
|
| 255 | + $this->payFromEmail = $email; |
|
| 256 | + return $this; |
|
| 257 | + } |
|
| 258 | + |
|
| 259 | + /** |
|
| 260 | + * @inheritDoc |
|
| 261 | + */ |
|
| 262 | + public function getRedirectUrl():? string { |
|
| 263 | + return $this->redirectUrl; |
|
| 264 | + } |
|
| 265 | + |
|
| 266 | + /** |
|
| 267 | + * @inheritDoc |
|
| 268 | + */ |
|
| 269 | + public function setRedirectUrl(?string $url): CheckoutInterface { |
|
| 270 | + $this->redirectUrl = $url; |
|
| 271 | + return $this; |
|
| 272 | + } |
|
| 273 | 273 | |
| 274 | 274 | public function getValidUntil():? string |
| 275 | 275 | { |
| 276 | - return $this->validUntil; |
|
| 277 | - } |
|
| 276 | + return $this->validUntil; |
|
| 277 | + } |
|
| 278 | 278 | |
| 279 | 279 | public function setValidUntil(?string $timestamp): CheckoutInterface |
| 280 | 280 | { |
| 281 | - $this->validUntil = $timestamp; |
|
| 282 | - return $this; |
|
| 283 | - } |
|
| 281 | + $this->validUntil = $timestamp; |
|
| 282 | + return $this; |
|
| 283 | + } |
|
| 284 | 284 | |
| 285 | 285 | public function getTransactionCode():? string |
| 286 | 286 | { |
| 287 | - return $this->transactionCode; |
|
| 288 | - } |
|
| 287 | + return $this->transactionCode; |
|
| 288 | + } |
|
| 289 | 289 | |
| 290 | 290 | public function setTransactionCode(?string $code): CheckoutInterface |
| 291 | 291 | { |
| 292 | - $this->transactionCode = $code; |
|
| 293 | - return $this; |
|
| 294 | - } |
|
| 292 | + $this->transactionCode = $code; |
|
| 293 | + return $this; |
|
| 294 | + } |
|
| 295 | 295 | |
| 296 | 296 | public function getTransactionId():? string |
| 297 | 297 | { |
| 298 | - return $this->transactionId; |
|
| 299 | - } |
|
| 298 | + return $this->transactionId; |
|
| 299 | + } |
|
| 300 | 300 | |
| 301 | 301 | public function setTransactionId(?string $id): CheckoutInterface |
| 302 | 302 | { |
| 303 | - $this->transactionId = $id; |
|
| 304 | - return $this; |
|
| 305 | - } |
|
| 303 | + $this->transactionId = $id; |
|
| 304 | + return $this; |
|
| 305 | + } |
|
| 306 | 306 | |
| 307 | 307 | public function getTransactions():? array |
| 308 | 308 | { |
| 309 | 309 | // return $this->transactions; |
| 310 | - //TODO remember myself whats is it. |
|
| 311 | - return []; |
|
| 312 | - } |
|
| 310 | + //TODO remember myself whats is it. |
|
| 311 | + return []; |
|
| 312 | + } |
|
| 313 | 313 | |
| 314 | 314 | public function setTransactions(?Array $transactions): CheckoutInterface |
| 315 | 315 | { |
| 316 | 316 | // $this->transactions = $transactions; |
| 317 | - //TODO remember myself whats is it. |
|
| 318 | - return $this; |
|
| 319 | - } |
|
| 317 | + //TODO remember myself whats is it. |
|
| 318 | + return $this; |
|
| 319 | + } |
|
| 320 | 320 | |
| 321 | 321 | public function getToken():? string |
| 322 | 322 | { |
| 323 | - return $this->token; |
|
| 324 | - } |
|
| 323 | + return $this->token; |
|
| 324 | + } |
|
| 325 | 325 | |
| 326 | 326 | public function setToken(?string $token): CheckoutInterface |
| 327 | 327 | { |
| 328 | - $this->token = $token; |
|
| 329 | - return $this; |
|
| 330 | - } |
|
| 331 | - |
|
| 332 | - /** |
|
| 333 | - * Get customer |
|
| 334 | - * @return CustomerInterface|null |
|
| 335 | - */ |
|
| 336 | - public function getCustomer(): ?CustomerInterface |
|
| 337 | - { |
|
| 338 | - return $this->customer; |
|
| 339 | - } |
|
| 340 | - |
|
| 341 | - /** |
|
| 342 | - * Set customer |
|
| 343 | - * |
|
| 344 | - * @param null|CustomerInterface $customer Customer |
|
| 345 | - * |
|
| 346 | - * @return CheckoutInterface |
|
| 347 | - */ |
|
| 348 | - public function setCustomer(?CustomerInterface $customer): CheckoutInterface |
|
| 349 | - { |
|
| 350 | - $this->customer = $customer; |
|
| 351 | - |
|
| 352 | - return $this; |
|
| 353 | - } |
|
| 354 | - |
|
| 355 | - /** |
|
| 356 | - * Get card |
|
| 357 | - * |
|
| 328 | + $this->token = $token; |
|
| 329 | + return $this; |
|
| 330 | + } |
|
| 331 | + |
|
| 332 | + /** |
|
| 333 | + * Get customer |
|
| 334 | + * @return CustomerInterface|null |
|
| 335 | + */ |
|
| 336 | + public function getCustomer(): ?CustomerInterface |
|
| 337 | + { |
|
| 338 | + return $this->customer; |
|
| 339 | + } |
|
| 340 | + |
|
| 341 | + /** |
|
| 342 | + * Set customer |
|
| 343 | + * |
|
| 344 | + * @param null|CustomerInterface $customer Customer |
|
| 345 | + * |
|
| 346 | + * @return CheckoutInterface |
|
| 347 | + */ |
|
| 348 | + public function setCustomer(?CustomerInterface $customer): CheckoutInterface |
|
| 349 | + { |
|
| 350 | + $this->customer = $customer; |
|
| 351 | + |
|
| 352 | + return $this; |
|
| 353 | + } |
|
| 354 | + |
|
| 355 | + /** |
|
| 356 | + * Get card |
|
| 357 | + * |
|
| 358 | 358 | * @return null|PaymentInstrumentInterface |
| 359 | - */ |
|
| 359 | + */ |
|
| 360 | 360 | public function getCard(): ?PaymentInstrumentInterface |
| 361 | - { |
|
| 362 | - return $this->card; |
|
| 363 | - } |
|
| 361 | + { |
|
| 362 | + return $this->card; |
|
| 363 | + } |
|
| 364 | 364 | |
| 365 | - /** |
|
| 366 | - * Set card |
|
| 367 | - * |
|
| 365 | + /** |
|
| 366 | + * Set card |
|
| 367 | + * |
|
| 368 | 368 | * @param null|PaymentInstrumentInterface $card |
| 369 | - * |
|
| 370 | - * @return CheckoutInterface |
|
| 371 | - */ |
|
| 369 | + * |
|
| 370 | + * @return CheckoutInterface |
|
| 371 | + */ |
|
| 372 | 372 | public function setCard(?PaymentInstrumentInterface $card): CheckoutInterface |
| 373 | - { |
|
| 374 | - $this->card = $card; |
|
| 375 | - |
|
| 376 | - return $this; |
|
| 377 | - } |
|
| 378 | - |
|
| 379 | - /** |
|
| 380 | - * @return mixed |
|
| 381 | - */ |
|
| 382 | - public function getType():? string |
|
| 383 | - { |
|
| 384 | - return $this->type; |
|
| 385 | - } |
|
| 386 | - |
|
| 387 | - /** |
|
| 388 | - * @param mixed $type |
|
| 389 | - * @return CheckoutInterface |
|
| 390 | - */ |
|
| 391 | - public function setType(?string $type = null): CheckoutInterface |
|
| 392 | - { |
|
| 393 | - $this->type = $type; |
|
| 394 | - |
|
| 395 | - return $this; |
|
| 396 | - } |
|
| 373 | + { |
|
| 374 | + $this->card = $card; |
|
| 375 | + |
|
| 376 | + return $this; |
|
| 377 | + } |
|
| 378 | + |
|
| 379 | + /** |
|
| 380 | + * @return mixed |
|
| 381 | + */ |
|
| 382 | + public function getType():? string |
|
| 383 | + { |
|
| 384 | + return $this->type; |
|
| 385 | + } |
|
| 386 | + |
|
| 387 | + /** |
|
| 388 | + * @param mixed $type |
|
| 389 | + * @return CheckoutInterface |
|
| 390 | + */ |
|
| 391 | + public function setType(?string $type = null): CheckoutInterface |
|
| 392 | + { |
|
| 393 | + $this->type = $type; |
|
| 394 | + |
|
| 395 | + return $this; |
|
| 396 | + } |
|
| 397 | 397 | |
| 398 | 398 | public function getInstallments(): string |
| 399 | 399 | { |
| 400 | 400 | return $this->installments; |
| 401 | 401 | } |
| 402 | 402 | |
| 403 | - public function setInstallments(?string $installments): CheckoutInterface{ |
|
| 404 | - $this->installments = $installments; |
|
| 405 | - return $this; |
|
| 406 | - } |
|
| 403 | + public function setInstallments(?string $installments): CheckoutInterface{ |
|
| 404 | + $this->installments = $installments; |
|
| 405 | + return $this; |
|
| 406 | + } |
|
| 407 | 407 | |
| 408 | 408 | } |
@@ -10,208 +10,208 @@ |
||
| 10 | 10 | */ |
| 11 | 11 | interface CheckoutInterface |
| 12 | 12 | { |
| 13 | - /** |
|
| 14 | - * @return null|string |
|
| 15 | - */ |
|
| 13 | + /** |
|
| 14 | + * @return null|string |
|
| 15 | + */ |
|
| 16 | 16 | public function getId(): ?string; |
| 17 | 17 | |
| 18 | - /** |
|
| 19 | - * @param string $id |
|
| 20 | - * @return CheckoutInterface |
|
| 21 | - */ |
|
| 18 | + /** |
|
| 19 | + * @param string $id |
|
| 20 | + * @return CheckoutInterface |
|
| 21 | + */ |
|
| 22 | 22 | public function setId(string $id): self; |
| 23 | 23 | |
| 24 | - /** |
|
| 25 | - * @return null|string |
|
| 26 | - */ |
|
| 24 | + /** |
|
| 25 | + * @return null|string |
|
| 26 | + */ |
|
| 27 | 27 | public function getStatus(): ?string; |
| 28 | 28 | |
| 29 | - /** |
|
| 30 | - * @param string $status |
|
| 31 | - * @return CheckoutInterface |
|
| 32 | - */ |
|
| 29 | + /** |
|
| 30 | + * @param string $status |
|
| 31 | + * @return CheckoutInterface |
|
| 32 | + */ |
|
| 33 | 33 | public function setStatus(string $status): self; |
| 34 | 34 | |
| 35 | 35 | |
| 36 | - /** |
|
| 37 | - * @param float $amount |
|
| 38 | - * @return CheckoutInterface |
|
| 39 | - */ |
|
| 36 | + /** |
|
| 37 | + * @param float $amount |
|
| 38 | + * @return CheckoutInterface |
|
| 39 | + */ |
|
| 40 | 40 | public function setAmount(float $amount): self; |
| 41 | 41 | |
| 42 | - /** |
|
| 43 | - * @return float |
|
| 44 | - */ |
|
| 42 | + /** |
|
| 43 | + * @return float |
|
| 44 | + */ |
|
| 45 | 45 | public function getAmount():? float; |
| 46 | 46 | |
| 47 | - /** |
|
| 48 | - * @return float|null |
|
| 49 | - */ |
|
| 47 | + /** |
|
| 48 | + * @return float|null |
|
| 49 | + */ |
|
| 50 | 50 | public function getFeeAmount():? float; |
| 51 | 51 | |
| 52 | - /** |
|
| 53 | - * @param float $amount |
|
| 54 | - * @return CheckoutInterface |
|
| 55 | - */ |
|
| 52 | + /** |
|
| 53 | + * @param float $amount |
|
| 54 | + * @return CheckoutInterface |
|
| 55 | + */ |
|
| 56 | 56 | public function setFeeAmount(float $amount): self; |
| 57 | 57 | |
| 58 | - /** |
|
| 59 | - * @return null|string |
|
| 60 | - */ |
|
| 58 | + /** |
|
| 59 | + * @return null|string |
|
| 60 | + */ |
|
| 61 | 61 | public function getCurrency(): ?string; |
| 62 | 62 | |
| 63 | - /** |
|
| 64 | - * @param string $currency |
|
| 65 | - * @return CheckoutInterface |
|
| 66 | - */ |
|
| 63 | + /** |
|
| 64 | + * @param string $currency |
|
| 65 | + * @return CheckoutInterface |
|
| 66 | + */ |
|
| 67 | 67 | public function setCurrency(string $currency): self; |
| 68 | 68 | |
| 69 | - /** |
|
| 70 | - * @return CustomerInterface|null |
|
| 71 | - */ |
|
| 69 | + /** |
|
| 70 | + * @return CustomerInterface|null |
|
| 71 | + */ |
|
| 72 | 72 | public function getCustomer(): ?CustomerInterface; |
| 73 | 73 | |
| 74 | - /** |
|
| 75 | - * @param CustomerInterface $customer |
|
| 76 | - * @return CheckoutInterface |
|
| 77 | - */ |
|
| 74 | + /** |
|
| 75 | + * @param CustomerInterface $customer |
|
| 76 | + * @return CheckoutInterface |
|
| 77 | + */ |
|
| 78 | 78 | public function setCustomer(CustomerInterface $customer): self; |
| 79 | 79 | |
| 80 | - /** |
|
| 80 | + /** |
|
| 81 | 81 | * @return PaymentInstrumentInterface|null |
| 82 | - */ |
|
| 82 | + */ |
|
| 83 | 83 | public function getCard(): ?PaymentInstrumentInterface; |
| 84 | 84 | |
| 85 | - /** |
|
| 85 | + /** |
|
| 86 | 86 | * @param PaymentInstrumentInterface $card |
| 87 | - * @return CheckoutInterface |
|
| 88 | - */ |
|
| 87 | + * @return CheckoutInterface |
|
| 88 | + */ |
|
| 89 | 89 | public function setCard(PaymentInstrumentInterface $card): self; |
| 90 | 90 | |
| 91 | - /** |
|
| 92 | - * @return null|string |
|
| 93 | - */ |
|
| 91 | + /** |
|
| 92 | + * @return null|string |
|
| 93 | + */ |
|
| 94 | 94 | public function getPayToEmail(): ?string; |
| 95 | 95 | |
| 96 | - /** |
|
| 97 | - * @param string $email |
|
| 98 | - * @return CheckoutInterface |
|
| 99 | - */ |
|
| 96 | + /** |
|
| 97 | + * @param string $email |
|
| 98 | + * @return CheckoutInterface |
|
| 99 | + */ |
|
| 100 | 100 | public function setPayToEmail(string $email): self; |
| 101 | 101 | |
| 102 | - /** |
|
| 103 | - * @return null|string |
|
| 104 | - */ |
|
| 102 | + /** |
|
| 103 | + * @return null|string |
|
| 104 | + */ |
|
| 105 | 105 | public function getPayFromEmail(): ?string; |
| 106 | 106 | |
| 107 | - /** |
|
| 108 | - * @param string $email |
|
| 109 | - * @return CheckoutInterface |
|
| 110 | - */ |
|
| 107 | + /** |
|
| 108 | + * @param string $email |
|
| 109 | + * @return CheckoutInterface |
|
| 110 | + */ |
|
| 111 | 111 | public function setPayFromEmail(string $email): self; |
| 112 | 112 | |
| 113 | - /** |
|
| 114 | - * @return null|string |
|
| 115 | - */ |
|
| 113 | + /** |
|
| 114 | + * @return null|string |
|
| 115 | + */ |
|
| 116 | 116 | public function getReference(): ?string; |
| 117 | 117 | |
| 118 | - /** |
|
| 119 | - * @param string $reference |
|
| 120 | - * @return CheckoutInterface |
|
| 121 | - */ |
|
| 118 | + /** |
|
| 119 | + * @param string $reference |
|
| 120 | + * @return CheckoutInterface |
|
| 121 | + */ |
|
| 122 | 122 | public function setReference(string $reference): self; |
| 123 | 123 | |
| 124 | - /** |
|
| 125 | - * @return null|string |
|
| 126 | - */ |
|
| 124 | + /** |
|
| 125 | + * @return null|string |
|
| 126 | + */ |
|
| 127 | 127 | public function getDescription(): ?string; |
| 128 | 128 | |
| 129 | - /** |
|
| 130 | - * @param string $description |
|
| 131 | - * @return CheckoutInterface |
|
| 132 | - */ |
|
| 129 | + /** |
|
| 130 | + * @param string $description |
|
| 131 | + * @return CheckoutInterface |
|
| 132 | + */ |
|
| 133 | 133 | public function setDescription(string $description): self; |
| 134 | 134 | |
| 135 | - /** |
|
| 136 | - * @return null|string |
|
| 137 | - */ |
|
| 135 | + /** |
|
| 136 | + * @return null|string |
|
| 137 | + */ |
|
| 138 | 138 | public function getRedirectUrl(): ?string; |
| 139 | 139 | |
| 140 | - /** |
|
| 141 | - * @param string $url |
|
| 142 | - * @return CheckoutInterface |
|
| 143 | - */ |
|
| 140 | + /** |
|
| 141 | + * @param string $url |
|
| 142 | + * @return CheckoutInterface |
|
| 143 | + */ |
|
| 144 | 144 | public function setRedirectUrl(string $url): self; |
| 145 | 145 | |
| 146 | - /** |
|
| 147 | - * @return string |
|
| 148 | - */ |
|
| 146 | + /** |
|
| 147 | + * @return string |
|
| 148 | + */ |
|
| 149 | 149 | public function getValidUntil():? string; |
| 150 | 150 | |
| 151 | - /** |
|
| 152 | - * @param string $timestamp |
|
| 153 | - * @return CheckoutInterface |
|
| 154 | - */ |
|
| 151 | + /** |
|
| 152 | + * @param string $timestamp |
|
| 153 | + * @return CheckoutInterface |
|
| 154 | + */ |
|
| 155 | 155 | public function setValidUntil(string $timestamp): self; |
| 156 | 156 | |
| 157 | - /** |
|
| 158 | - * @return null|string |
|
| 159 | - */ |
|
| 157 | + /** |
|
| 158 | + * @return null|string |
|
| 159 | + */ |
|
| 160 | 160 | public function getTransactionCode(): ?string; |
| 161 | 161 | |
| 162 | - /** |
|
| 163 | - * @param string $code |
|
| 164 | - * @return CheckoutInterface |
|
| 165 | - */ |
|
| 162 | + /** |
|
| 163 | + * @param string $code |
|
| 164 | + * @return CheckoutInterface |
|
| 165 | + */ |
|
| 166 | 166 | public function setTransactionCode(string $code): self; |
| 167 | 167 | |
| 168 | - /** |
|
| 169 | - * @return null|string |
|
| 170 | - */ |
|
| 168 | + /** |
|
| 169 | + * @return null|string |
|
| 170 | + */ |
|
| 171 | 171 | public function getTransactionId(): ?string; |
| 172 | 172 | |
| 173 | - /** |
|
| 174 | - * @param string $id |
|
| 175 | - * @return CheckoutInterface |
|
| 176 | - */ |
|
| 173 | + /** |
|
| 174 | + * @param string $id |
|
| 175 | + * @return CheckoutInterface |
|
| 176 | + */ |
|
| 177 | 177 | public function setTransactionId(string $id): self; |
| 178 | 178 | |
| 179 | - /** |
|
| 180 | - * @return array|null |
|
| 181 | - */ |
|
| 179 | + /** |
|
| 180 | + * @return array|null |
|
| 181 | + */ |
|
| 182 | 182 | public function getTransactions(): ?array; |
| 183 | 183 | |
| 184 | - /** |
|
| 185 | - * @param array $transactions |
|
| 186 | - * @return CheckoutInterface |
|
| 187 | - */ |
|
| 184 | + /** |
|
| 185 | + * @param array $transactions |
|
| 186 | + * @return CheckoutInterface |
|
| 187 | + */ |
|
| 188 | 188 | public function setTransactions(array $transactions): self; |
| 189 | 189 | |
| 190 | - /** |
|
| 191 | - * @return null|string |
|
| 192 | - */ |
|
| 190 | + /** |
|
| 191 | + * @return null|string |
|
| 192 | + */ |
|
| 193 | 193 | public function getToken(): ?string; |
| 194 | 194 | |
| 195 | - /** |
|
| 196 | - * @param string $token |
|
| 197 | - * @return CheckoutInterface |
|
| 198 | - */ |
|
| 195 | + /** |
|
| 196 | + * @param string $token |
|
| 197 | + * @return CheckoutInterface |
|
| 198 | + */ |
|
| 199 | 199 | public function setToken(string $token): self; |
| 200 | 200 | |
| 201 | - /** |
|
| 201 | + /** |
|
| 202 | 202 | * @return bool |
| 203 | - */ |
|
| 203 | + */ |
|
| 204 | 204 | public function isValid(): bool; |
| 205 | 205 | |
| 206 | - /** |
|
| 207 | - * @param string|null $type |
|
| 208 | - * @return CheckoutInterface |
|
| 209 | - */ |
|
| 206 | + /** |
|
| 207 | + * @param string|null $type |
|
| 208 | + * @return CheckoutInterface |
|
| 209 | + */ |
|
| 210 | 210 | public function setType(string $type = null): self; |
| 211 | 211 | |
| 212 | - /** |
|
| 213 | - * @return null|string |
|
| 214 | - */ |
|
| 212 | + /** |
|
| 213 | + * @return null|string |
|
| 214 | + */ |
|
| 215 | 215 | public function getType():? string; |
| 216 | 216 | |
| 217 | 217 | public function setInstallments(?string $installments):? self; |
@@ -11,48 +11,48 @@ |
||
| 11 | 11 | |
| 12 | 12 | trait PropertyHandler |
| 13 | 13 | { |
| 14 | - /** |
|
| 15 | - * @param array $data |
|
| 16 | - */ |
|
| 14 | + /** |
|
| 15 | + * @param array $data |
|
| 16 | + */ |
|
| 17 | 17 | public function fillProperties(array $data): void |
| 18 | - { |
|
| 19 | - foreach ($data as $p => $v) |
|
| 20 | - { |
|
| 21 | - $this->fillProperty($p, $v); |
|
| 22 | - } |
|
| 23 | - } |
|
| 18 | + { |
|
| 19 | + foreach ($data as $p => $v) |
|
| 20 | + { |
|
| 21 | + $this->fillProperty($p, $v); |
|
| 22 | + } |
|
| 23 | + } |
|
| 24 | 24 | |
| 25 | - /** |
|
| 26 | - * @param string $property |
|
| 27 | - * @param mixed $value |
|
| 28 | - */ |
|
| 25 | + /** |
|
| 26 | + * @param string $property |
|
| 27 | + * @param mixed $value |
|
| 28 | + */ |
|
| 29 | 29 | public function fillProperty(string $property, $value): void |
| 30 | - { |
|
| 31 | - $property = lcfirst(str_replace('_', '', ucwords($property, '_'))); |
|
| 32 | - if(property_exists(__CLASS__, $property)) |
|
| 33 | - { |
|
| 34 | - $method = sprintf('set%s', ucfirst($property)); |
|
| 35 | - $this->{$method}($value); |
|
| 36 | - } |
|
| 37 | - } |
|
| 30 | + { |
|
| 31 | + $property = lcfirst(str_replace('_', '', ucwords($property, '_'))); |
|
| 32 | + if(property_exists(__CLASS__, $property)) |
|
| 33 | + { |
|
| 34 | + $method = sprintf('set%s', ucfirst($property)); |
|
| 35 | + $this->{$method}($value); |
|
| 36 | + } |
|
| 37 | + } |
|
| 38 | 38 | |
| 39 | - /** |
|
| 40 | - * @return array |
|
| 41 | - */ |
|
| 39 | + /** |
|
| 40 | + * @return array |
|
| 41 | + */ |
|
| 42 | 42 | public function getPropertyArray(): array |
| 43 | - { |
|
| 44 | - $reflection = new \ReflectionClass(__CLASS__); |
|
| 45 | - $properties = $reflection->getProperties(\ReflectionProperty::IS_PROTECTED); |
|
| 46 | - $data = []; |
|
| 47 | - foreach($properties as $property){ |
|
| 48 | - $prop_name = $property->getName(); |
|
| 49 | - $method = sprintf('get%s', ucfirst($prop_name)); |
|
| 50 | - $form_name = strtolower(preg_replace('/[A-Z]/', '_$0', $prop_name)); |
|
| 51 | - if($reflection->hasMethod($method)){ |
|
| 52 | - $data[$form_name] = $this->{$method}(); |
|
| 53 | - } |
|
| 54 | - } |
|
| 55 | - return $data; |
|
| 56 | - } |
|
| 43 | + { |
|
| 44 | + $reflection = new \ReflectionClass(__CLASS__); |
|
| 45 | + $properties = $reflection->getProperties(\ReflectionProperty::IS_PROTECTED); |
|
| 46 | + $data = []; |
|
| 47 | + foreach($properties as $property){ |
|
| 48 | + $prop_name = $property->getName(); |
|
| 49 | + $method = sprintf('get%s', ucfirst($prop_name)); |
|
| 50 | + $form_name = strtolower(preg_replace('/[A-Z]/', '_$0', $prop_name)); |
|
| 51 | + if($reflection->hasMethod($method)){ |
|
| 52 | + $data[$form_name] = $this->{$method}(); |
|
| 53 | + } |
|
| 54 | + } |
|
| 55 | + return $data; |
|
| 56 | + } |
|
| 57 | 57 | |
| 58 | 58 | } |