Complex classes like Payment often do a lot of different things. To break such a class down, we need to identify a cohesive component within that class. A common approach to find such a component is to look for fields/methods that share the same prefixes, or suffixes. You can also have a look at the cohesion graph to spot any un-connected, or weakly-connected components.
Once you have determined the fields that belong together, you can apply the Extract Class refactoring. If the component makes sense as a sub-class, Extract Subclass is also a candidate, and is often faster.
While breaking up the class, it is a good idea to analyze how other classes use Payment, and based on these observations, apply Extract Interface, too.
| 1 | <?php |
||
| 23 | class Payment extends BasePayment |
||
| 24 | { |
||
| 25 | /** |
||
| 26 | * @var int |
||
| 27 | * |
||
| 28 | * @ORM\Id |
||
| 29 | * @ORM\Column(name="id", type="integer") |
||
| 30 | * @ORM\GeneratedValue(strategy="AUTO") |
||
| 31 | */ |
||
| 32 | protected $id; |
||
| 33 | |||
| 34 | /** |
||
| 35 | * @Assert\NotBlank() |
||
| 36 | * @Assert\Length(max="191") |
||
| 37 | * |
||
| 38 | * @ORM\Column(type="string", length=191) |
||
| 39 | */ |
||
| 40 | protected $apiKey; |
||
| 41 | |||
| 42 | /** |
||
| 43 | * @Assert\NotBlank() |
||
| 44 | * @Assert\Length(max="191") |
||
| 45 | * |
||
| 46 | * @ORM\Column(type="string", length=191) |
||
| 47 | */ |
||
| 48 | protected $merchant; |
||
| 49 | |||
| 50 | /** |
||
| 51 | * @ORM\Column(type="integer") |
||
| 52 | */ |
||
| 53 | protected $orderId; |
||
| 54 | |||
| 55 | /** |
||
| 56 | * @ORM\Column(type="text") |
||
| 57 | */ |
||
| 58 | protected $sessionId; |
||
| 59 | |||
| 60 | /** |
||
| 61 | * @Assert\NotBlank() |
||
| 62 | * @Assert\Length(max="191") |
||
| 63 | * |
||
| 64 | * @ORM\Column(type="string", length=191) |
||
| 65 | */ |
||
| 66 | protected $currencySymbol; |
||
| 67 | |||
| 68 | /** |
||
| 69 | * @Assert\NotBlank() |
||
| 70 | * |
||
| 71 | * @ORM\Column(type="integer") |
||
| 72 | */ |
||
| 73 | protected $totalAmountAmount; |
||
| 74 | |||
| 75 | /** |
||
| 76 | * @Assert\NotBlank() |
||
| 77 | * @Assert\Length(max="191") |
||
| 78 | * |
||
| 79 | * @ORM\Column(type="string", length=191) |
||
| 80 | */ |
||
| 81 | protected $callBackUrl; |
||
| 82 | |||
| 83 | /** |
||
| 84 | * @Assert\NotBlank() |
||
| 85 | * @Assert\Length(max="191") |
||
| 86 | * |
||
| 87 | * @ORM\Column(type="string", length=191) |
||
| 88 | */ |
||
| 89 | protected $fullCallBackOkUrl; |
||
| 90 | |||
| 91 | /** |
||
| 92 | * @Assert\NotBlank() |
||
| 93 | * @Assert\Length(max="191") |
||
| 94 | * |
||
| 95 | * @ORM\Column(type="string", length=191) |
||
| 96 | */ |
||
| 97 | protected $callBackOkUrl; |
||
| 98 | |||
| 99 | /** |
||
| 100 | * @Assert\NotBlank() |
||
| 101 | * @Assert\Length(max="191") |
||
| 102 | * |
||
| 103 | * @ORM\Column(type="string", length=191) |
||
| 104 | */ |
||
| 105 | protected $callBackServerUrl; |
||
| 106 | |||
| 107 | /** |
||
| 108 | * @Assert\NotBlank() |
||
| 109 | * |
||
| 110 | * @ORM\Column(type="integer") |
||
| 111 | */ |
||
| 112 | protected $languageId; |
||
| 113 | |||
| 114 | /** |
||
| 115 | * @Assert\NotBlank() |
||
| 116 | * @Assert\Length(max="191") |
||
| 117 | * |
||
| 118 | * @ORM\Column(type="string", length=191) |
||
| 119 | */ |
||
| 120 | protected $testMode; |
||
| 121 | |||
| 122 | /** |
||
| 123 | * @Assert\NotBlank() |
||
| 124 | * |
||
| 125 | * @ORM\Column(type="integer") |
||
| 126 | */ |
||
| 127 | protected $paymentGatewayCurrencyCode; |
||
| 128 | |||
| 129 | /** |
||
| 130 | * @Assert\NotBlank() |
||
| 131 | * |
||
| 132 | * @ORM\Column(type="integer") |
||
| 133 | */ |
||
| 134 | protected $cardTypeId; |
||
| 135 | |||
| 136 | /** |
||
| 137 | * @Assert\NotBlank() |
||
| 138 | * @Assert\Length(max="191") |
||
| 139 | * |
||
| 140 | * @ORM\Column(type="string", length=191) |
||
| 141 | */ |
||
| 142 | protected $customerRekvNr; |
||
| 143 | |||
| 144 | /** |
||
| 145 | * @Assert\NotBlank() |
||
| 146 | * @Assert\Length(max="191") |
||
| 147 | * |
||
| 148 | * @ORM\Column(type="string", length=191) |
||
| 149 | */ |
||
| 150 | protected $customerName; |
||
| 151 | |||
| 152 | /** |
||
| 153 | * @ORM\Column(type="string", nullable=true) |
||
| 154 | */ |
||
| 155 | protected $customerCompany; |
||
| 156 | |||
| 157 | /** |
||
| 158 | * @Assert\NotBlank() |
||
| 159 | * @Assert\Length(max="191") |
||
| 160 | * |
||
| 161 | * @ORM\Column(type="string", length=191) |
||
| 162 | */ |
||
| 163 | protected $customerAddress; |
||
| 164 | |||
| 165 | /** |
||
| 166 | * @ORM\Column(type="string", nullable=true) |
||
| 167 | */ |
||
| 168 | protected $customerAddress2; |
||
| 169 | |||
| 170 | /** |
||
| 171 | * @Assert\NotBlank() |
||
| 172 | * @Assert\Length(max="191") |
||
| 173 | * |
||
| 174 | * @ORM\Column(type="string", length=191) |
||
| 175 | */ |
||
| 176 | protected $customerZipCode; |
||
| 177 | |||
| 178 | /** |
||
| 179 | * @Assert\NotBlank() |
||
| 180 | * @Assert\Length(max="191") |
||
| 181 | * |
||
| 182 | * @ORM\Column(type="string", length=191) |
||
| 183 | */ |
||
| 184 | protected $customerCity; |
||
| 185 | |||
| 186 | /** |
||
| 187 | * @Assert\NotBlank() |
||
| 188 | * |
||
| 189 | * @ORM\Column(type="integer") |
||
| 190 | */ |
||
| 191 | protected $customerCountryId; |
||
| 192 | |||
| 193 | /** |
||
| 194 | * @Assert\NotBlank() |
||
| 195 | * @Assert\Length(max="191") |
||
| 196 | * |
||
| 197 | * @ORM\Column(type="string", length=191) |
||
| 198 | */ |
||
| 199 | protected $customerCountry; |
||
| 200 | |||
| 201 | /** |
||
| 202 | * @Assert\NotBlank() |
||
| 203 | * @Assert\Length(max="191") |
||
| 204 | * |
||
| 205 | * @ORM\Column(type="string", length=191) |
||
| 206 | */ |
||
| 207 | protected $customerPhone; |
||
| 208 | |||
| 209 | /** |
||
| 210 | * @ORM\Column(type="string", nullable=true) |
||
| 211 | */ |
||
| 212 | protected $customerFax; |
||
| 213 | |||
| 214 | /** |
||
| 215 | * @Assert\NotBlank() |
||
| 216 | * @Assert\Length(max="191") |
||
| 217 | * |
||
| 218 | * @ORM\Column(type="string", length=191) |
||
| 219 | */ |
||
| 220 | protected $customerEmail; |
||
| 221 | |||
| 222 | /** |
||
| 223 | * @ORM\Column(type="text", nullable=true) |
||
| 224 | */ |
||
| 225 | protected $customerNote; |
||
| 226 | |||
| 227 | /** |
||
| 228 | * @ORM\Column(type="string", nullable=true, length=191) |
||
| 229 | */ |
||
| 230 | protected $customerCvrnr; |
||
| 231 | |||
| 232 | /** |
||
| 233 | * @Assert\NotBlank() |
||
| 234 | * |
||
| 235 | * @ORM\Column(type="integer") |
||
| 236 | */ |
||
| 237 | protected $customerCustTypeId; |
||
| 238 | |||
| 239 | /** |
||
| 240 | * @ORM\Column(type="string", nullable=true, length=191) |
||
| 241 | */ |
||
| 242 | protected $customerEan; |
||
| 243 | |||
| 244 | /** |
||
| 245 | * @ORM\Column(type="string", nullable=true, length=191) |
||
| 246 | */ |
||
| 247 | protected $customerRes1; |
||
| 248 | |||
| 249 | /** |
||
| 250 | * @ORM\Column(type="string", nullable=true, length=191) |
||
| 251 | */ |
||
| 252 | protected $customerRes2; |
||
| 253 | |||
| 254 | /** |
||
| 255 | * @ORM\Column(type="string", nullable=true, length=191) |
||
| 256 | */ |
||
| 257 | protected $customerRes3; |
||
| 258 | |||
| 259 | /** |
||
| 260 | * @ORM\Column(type="string", nullable=true, length=191) |
||
| 261 | */ |
||
| 262 | protected $customerRes4; |
||
| 263 | |||
| 264 | /** |
||
| 265 | * @ORM\Column(type="string", nullable=true, length=191) |
||
| 266 | */ |
||
| 267 | protected $customerRes5; |
||
| 268 | |||
| 269 | /** |
||
| 270 | * @Assert\NotBlank() |
||
| 271 | * @Assert\Length(max="191") |
||
| 272 | * |
||
| 273 | * @ORM\Column(type="string", length=191) |
||
| 274 | */ |
||
| 275 | protected $customerIp; |
||
| 276 | |||
| 277 | /** |
||
| 278 | * @ORM\Column(type="string", nullable=true, length=191) |
||
| 279 | */ |
||
| 280 | protected $deliveryName; |
||
| 281 | |||
| 282 | /** |
||
| 283 | * @ORM\Column(type="string", nullable=true, length=191) |
||
| 284 | */ |
||
| 285 | protected $deliveryCompany; |
||
| 286 | |||
| 287 | /** |
||
| 288 | * @ORM\Column(type="string", nullable=true, length=191) |
||
| 289 | */ |
||
| 290 | protected $deliveryAddress; |
||
| 291 | |||
| 292 | /** |
||
| 293 | * @ORM\Column(type="string", nullable=true, length=191) |
||
| 294 | */ |
||
| 295 | protected $deliveryAddress2; |
||
| 296 | |||
| 297 | /** |
||
| 298 | * @ORM\Column(type="string", nullable=true, length=191) |
||
| 299 | */ |
||
| 300 | protected $deliveryZipCode; |
||
| 301 | |||
| 302 | /** |
||
| 303 | * @ORM\Column(type="string", nullable=true, length=191) |
||
| 304 | */ |
||
| 305 | protected $deliveryCity; |
||
| 306 | |||
| 307 | /** |
||
| 308 | * @ORM\Column(type="integer", nullable=true) |
||
| 309 | */ |
||
| 310 | protected $deliveryCountryID; |
||
| 311 | |||
| 312 | /** |
||
| 313 | * @ORM\Column(type="string", nullable=true, length=191) |
||
| 314 | */ |
||
| 315 | protected $deliveryCountry; |
||
| 316 | |||
| 317 | /** |
||
| 318 | * @ORM\Column(type="string", nullable=true, length=191) |
||
| 319 | */ |
||
| 320 | protected $deliveryPhone; |
||
| 321 | |||
| 322 | /** |
||
| 323 | * @ORM\Column(type="string", nullable=true, length=191) |
||
| 324 | */ |
||
| 325 | protected $deliveryFax; |
||
| 326 | |||
| 327 | /** |
||
| 328 | * @ORM\Column(type="string", nullable=true, length=191) |
||
| 329 | */ |
||
| 330 | protected $deliveryEmail; |
||
| 331 | |||
| 332 | /** |
||
| 333 | * @ORM\Column(type="string", nullable=true, length=191) |
||
| 334 | */ |
||
| 335 | protected $deliveryEan; |
||
| 336 | |||
| 337 | /** |
||
| 338 | * @Assert\NotBlank() |
||
| 339 | * @Assert\Length(max="191") |
||
| 340 | * |
||
| 341 | * @ORM\Column(type="string", length=191) |
||
| 342 | */ |
||
| 343 | protected $shippingMethod; |
||
| 344 | |||
| 345 | /** |
||
| 346 | * @Assert\NotBlank() |
||
| 347 | * |
||
| 348 | * @ORM\Column(type="integer") |
||
| 349 | */ |
||
| 350 | protected $shippingFeeAmount; |
||
| 351 | |||
| 352 | /** |
||
| 353 | * @Assert\NotBlank() |
||
| 354 | * @Assert\Length(max="191") |
||
| 355 | * |
||
| 356 | * @ORM\Column(type="string", length=191) |
||
| 357 | */ |
||
| 358 | protected $paymentMethod; |
||
| 359 | |||
| 360 | /** |
||
| 361 | * @Assert\NotBlank() |
||
| 362 | * |
||
| 363 | * @ORM\Column(type="integer") |
||
| 364 | */ |
||
| 365 | protected $paymentFeeAmount; |
||
| 366 | |||
| 367 | /** |
||
| 368 | * @ORM\Column(type="string", nullable=true, length=191) |
||
| 369 | */ |
||
| 370 | protected $loadBalancerRealIp; |
||
| 371 | |||
| 372 | /** |
||
| 373 | * @var string |
||
| 374 | * |
||
| 375 | * @ORM\Column(type="string", nullable=true, length=191) |
||
| 376 | */ |
||
| 377 | protected $referrer; |
||
| 378 | |||
| 379 | /** |
||
| 380 | * @ORM\OneToMany(targetEntity="PaymentLine", mappedBy="payment", cascade={"persist", "remove"}, fetch="EAGER") |
||
| 381 | */ |
||
| 382 | protected $paymentLines; |
||
| 383 | |||
| 384 | /********************************** |
||
| 385 | * Properties specific to Altapay * |
||
| 386 | *********************************/ |
||
| 387 | |||
| 388 | /** |
||
| 389 | * @var string|null |
||
| 390 | * |
||
| 391 | * @ORM\Column(type="string", nullable=true, unique=true, length=191) |
||
| 392 | */ |
||
| 393 | protected $altapayId; |
||
| 394 | |||
| 395 | /** |
||
| 396 | * @var string|null |
||
| 397 | * |
||
| 398 | * @ORM\Column(type="string", nullable=true, length=191) |
||
| 399 | */ |
||
| 400 | protected $cardStatus; |
||
| 401 | |||
| 402 | /** |
||
| 403 | * @var string|null |
||
| 404 | * |
||
| 405 | * @ORM\Column(type="string", nullable=true, length=191) |
||
| 406 | */ |
||
| 407 | protected $creditCardToken; |
||
| 408 | |||
| 409 | /** |
||
| 410 | * @var string|null |
||
| 411 | * |
||
| 412 | * @ORM\Column(type="string", nullable=true, length=191) |
||
| 413 | */ |
||
| 414 | protected $creditCardMaskedPan; |
||
| 415 | |||
| 416 | /** |
||
| 417 | * @var string|null |
||
| 418 | * |
||
| 419 | * @ORM\Column(type="string", nullable=true, length=191) |
||
| 420 | */ |
||
| 421 | protected $threeDSecureResult; |
||
| 422 | |||
| 423 | /** |
||
| 424 | * @var string|null |
||
| 425 | * |
||
| 426 | * @ORM\Column(type="string", nullable=true, length=191) |
||
| 427 | */ |
||
| 428 | protected $liableForChargeback; |
||
| 429 | |||
| 430 | /** |
||
| 431 | * @var string|null |
||
| 432 | * |
||
| 433 | * @ORM\Column(type="string", nullable=true, length=191) |
||
| 434 | */ |
||
| 435 | protected $blacklistToken; |
||
| 436 | |||
| 437 | /** |
||
| 438 | * @var string|null |
||
| 439 | * |
||
| 440 | * @ORM\Column(type="string", nullable=true, length=191) |
||
| 441 | */ |
||
| 442 | protected $shop; |
||
| 443 | |||
| 444 | /** |
||
| 445 | * @var string|null |
||
| 446 | * |
||
| 447 | * @ORM\Column(type="string", nullable=true, length=191) |
||
| 448 | */ |
||
| 449 | protected $terminal; |
||
| 450 | |||
| 451 | /** |
||
| 452 | * @var string|null |
||
| 453 | * |
||
| 454 | * @ORM\Column(type="string", nullable=true, length=191) |
||
| 455 | */ |
||
| 456 | protected $transactionStatus; |
||
| 457 | |||
| 458 | /** |
||
| 459 | * @var string|null |
||
| 460 | * |
||
| 461 | * @ORM\Column(type="string", nullable=true, length=191) |
||
| 462 | */ |
||
| 463 | protected $reasonCode; |
||
| 464 | |||
| 465 | /** |
||
| 466 | * @var int|null |
||
| 467 | * |
||
| 468 | * @ORM\Column(type="integer", nullable=true) |
||
| 469 | */ |
||
| 470 | protected $merchantCurrency; |
||
| 471 | |||
| 472 | /** |
||
| 473 | * @var string|null |
||
| 474 | * |
||
| 475 | * @ORM\Column(type="string", nullable=true, length=191) |
||
| 476 | */ |
||
| 477 | protected $merchantCurrencyAlpha; |
||
| 478 | |||
| 479 | /** |
||
| 480 | * @var int|null |
||
| 481 | * |
||
| 482 | * @ORM\Column(type="integer", nullable=true) |
||
| 483 | */ |
||
| 484 | protected $cardHolderCurrency; |
||
| 485 | |||
| 486 | /** |
||
| 487 | * @var string|null |
||
| 488 | * |
||
| 489 | * @ORM\Column(type="string", nullable=true, length=191) |
||
| 490 | */ |
||
| 491 | protected $cardHolderCurrencyAlpha; |
||
| 492 | |||
| 493 | /** |
||
| 494 | * @var int|null |
||
| 495 | * |
||
| 496 | * @ORM\Column(type="integer") |
||
| 497 | */ |
||
| 498 | protected $reservedAmount; |
||
| 499 | |||
| 500 | /** |
||
| 501 | * @var int|null |
||
| 502 | * |
||
| 503 | * @ORM\Column(type="integer") |
||
| 504 | */ |
||
| 505 | protected $capturedAmount; |
||
| 506 | |||
| 507 | /** |
||
| 508 | * @var int|null |
||
| 509 | * |
||
| 510 | * @ORM\Column(type="integer") |
||
| 511 | */ |
||
| 512 | protected $refundedAmount; |
||
| 513 | |||
| 514 | /** |
||
| 515 | * @var int|null |
||
| 516 | * |
||
| 517 | * @ORM\Column(type="integer") |
||
| 518 | */ |
||
| 519 | protected $recurringDefaultAmount; |
||
| 520 | |||
| 521 | /** |
||
| 522 | * @var \DateTime|null |
||
| 523 | * |
||
| 524 | * @ORM\Column(type="datetime", nullable=true) |
||
| 525 | */ |
||
| 526 | protected $createdDate; |
||
| 527 | |||
| 528 | /** |
||
| 529 | * @var \DateTime|null |
||
| 530 | * |
||
| 531 | * @ORM\Column(type="datetime", nullable=true) |
||
| 532 | */ |
||
| 533 | protected $updatedDate; |
||
| 534 | |||
| 535 | /** |
||
| 536 | * @var string|null |
||
| 537 | * |
||
| 538 | * @ORM\Column(type="string", nullable=true, length=191) |
||
| 539 | */ |
||
| 540 | protected $paymentNature; |
||
| 541 | |||
| 542 | /** |
||
| 543 | * @var bool|null |
||
| 544 | * |
||
| 545 | * @ORM\Column(type="boolean", nullable=true) |
||
| 546 | */ |
||
| 547 | protected $supportsRefunds; |
||
| 548 | |||
| 549 | /** |
||
| 550 | * @var bool|null |
||
| 551 | * |
||
| 552 | * @ORM\Column(type="boolean", nullable=true) |
||
| 553 | */ |
||
| 554 | protected $supportsRelease; |
||
| 555 | |||
| 556 | /** |
||
| 557 | * @var bool|null |
||
| 558 | * |
||
| 559 | * @ORM\Column(type="boolean", nullable=true) |
||
| 560 | */ |
||
| 561 | protected $supportsMultipleCaptures; |
||
| 562 | |||
| 563 | /** |
||
| 564 | * @var bool|null |
||
| 565 | * |
||
| 566 | * @ORM\Column(type="boolean", nullable=true) |
||
| 567 | */ |
||
| 568 | protected $supportsMultipleRefunds; |
||
| 569 | |||
| 570 | /** |
||
| 571 | * @var float|null |
||
| 572 | * |
||
| 573 | * @ORM\Column(type="float", nullable=true) |
||
| 574 | */ |
||
| 575 | protected $fraudRiskScore; |
||
| 576 | |||
| 577 | /** |
||
| 578 | * @var string|null |
||
| 579 | * |
||
| 580 | * @ORM\Column(type="string", nullable=true, length=191) |
||
| 581 | */ |
||
| 582 | protected $fraudExplanation; |
||
| 583 | |||
| 584 | public function __construct() |
||
| 594 | |||
| 595 | public static function createPaymentLine(string $productNumber, string $name, int $quantity, Money $price, int $vat) |
||
| 599 | |||
| 600 | /** |
||
| 601 | * Returns true if the payment can be captured. |
||
| 602 | * |
||
| 603 | * @return bool |
||
| 604 | */ |
||
| 605 | public function isCaptureable(): bool |
||
| 617 | |||
| 618 | /** |
||
| 619 | * Returns true if the payment can be refunded. |
||
| 620 | * |
||
| 621 | * @return bool |
||
| 622 | */ |
||
| 623 | public function isRefundable(): bool |
||
| 635 | |||
| 636 | /** |
||
| 637 | * @return Money |
||
| 638 | */ |
||
| 639 | public function refundableAmount() |
||
| 645 | |||
| 646 | /** |
||
| 647 | * @return Money |
||
| 648 | */ |
||
| 649 | public function capturableAmount(): Money |
||
| 656 | |||
| 657 | // @todo create type hints for getters and setters |
||
| 658 | |||
| 659 | public function setTotalAmount(Money $totalAmount): BasePayment |
||
| 667 | |||
| 668 | public function getTotalAmount(): ?Money |
||
| 672 | |||
| 673 | public function setShippingFee(Money $shippingFee): BasePayment |
||
| 681 | |||
| 682 | public function getShippingFee(): ?Money |
||
| 686 | |||
| 687 | public function setPaymentFee(Money $paymentFee): BasePayment |
||
| 695 | |||
| 696 | public function getPaymentFee(): ?Money |
||
| 700 | |||
| 701 | /** |
||
| 702 | * @return int |
||
| 703 | */ |
||
| 704 | public function getId(): ?int |
||
| 708 | |||
| 709 | /** |
||
| 710 | * @param int $id |
||
| 711 | * |
||
| 712 | * @return Payment |
||
| 713 | */ |
||
| 714 | public function setId(int $id): self |
||
| 720 | |||
| 721 | /** |
||
| 722 | * @return null|string |
||
| 723 | */ |
||
| 724 | public function getAltapayId() |
||
| 728 | |||
| 729 | /** |
||
| 730 | * @param null|string $altapayId |
||
| 731 | * |
||
| 732 | * @return Payment |
||
| 733 | */ |
||
| 734 | public function setAltapayId($altapayId) |
||
| 740 | |||
| 741 | /** |
||
| 742 | * @return null|string |
||
| 743 | */ |
||
| 744 | public function getCardStatus() |
||
| 748 | |||
| 749 | /** |
||
| 750 | * @param null|string $cardStatus |
||
| 751 | * |
||
| 752 | * @return Payment |
||
| 753 | */ |
||
| 754 | public function setCardStatus($cardStatus) |
||
| 760 | |||
| 761 | /** |
||
| 762 | * @return null|string |
||
| 763 | */ |
||
| 764 | public function getCreditCardToken() |
||
| 768 | |||
| 769 | /** |
||
| 770 | * @param null|string $creditCardToken |
||
| 771 | * |
||
| 772 | * @return Payment |
||
| 773 | */ |
||
| 774 | public function setCreditCardToken($creditCardToken) |
||
| 780 | |||
| 781 | /** |
||
| 782 | * @return null|string |
||
| 783 | */ |
||
| 784 | public function getCreditCardMaskedPan() |
||
| 788 | |||
| 789 | /** |
||
| 790 | * @param null|string $creditCardMaskedPan |
||
| 791 | * |
||
| 792 | * @return Payment |
||
| 793 | */ |
||
| 794 | public function setCreditCardMaskedPan($creditCardMaskedPan) |
||
| 800 | |||
| 801 | /** |
||
| 802 | * @return null|string |
||
| 803 | */ |
||
| 804 | public function getThreeDSecureResult() |
||
| 808 | |||
| 809 | /** |
||
| 810 | * @param null|string $threeDSecureResult |
||
| 811 | * |
||
| 812 | * @return Payment |
||
| 813 | */ |
||
| 814 | public function setThreeDSecureResult($threeDSecureResult) |
||
| 820 | |||
| 821 | /** |
||
| 822 | * @return null|string |
||
| 823 | */ |
||
| 824 | public function getLiableForChargeback() |
||
| 828 | |||
| 829 | /** |
||
| 830 | * @param null|string $liableForChargeback |
||
| 831 | * |
||
| 832 | * @return Payment |
||
| 833 | */ |
||
| 834 | public function setLiableForChargeback($liableForChargeback) |
||
| 840 | |||
| 841 | /** |
||
| 842 | * @return null|string |
||
| 843 | */ |
||
| 844 | public function getBlacklistToken() |
||
| 848 | |||
| 849 | /** |
||
| 850 | * @param null|string $blacklistToken |
||
| 851 | * |
||
| 852 | * @return Payment |
||
| 853 | */ |
||
| 854 | public function setBlacklistToken($blacklistToken) |
||
| 860 | |||
| 861 | /** |
||
| 862 | * @return null|string |
||
| 863 | */ |
||
| 864 | public function getShop() |
||
| 868 | |||
| 869 | /** |
||
| 870 | * @param null|string $shop |
||
| 871 | * |
||
| 872 | * @return Payment |
||
| 873 | */ |
||
| 874 | public function setShop($shop) |
||
| 880 | |||
| 881 | /** |
||
| 882 | * @return null|string |
||
| 883 | */ |
||
| 884 | public function getTerminal() |
||
| 888 | |||
| 889 | /** |
||
| 890 | * @param null|string $terminal |
||
| 891 | * |
||
| 892 | * @return Payment |
||
| 893 | */ |
||
| 894 | public function setTerminal($terminal) |
||
| 900 | |||
| 901 | /** |
||
| 902 | * @return null|string |
||
| 903 | */ |
||
| 904 | public function getTransactionStatus() |
||
| 908 | |||
| 909 | /** |
||
| 910 | * @param null|string $transactionStatus |
||
| 911 | * |
||
| 912 | * @return Payment |
||
| 913 | */ |
||
| 914 | public function setTransactionStatus($transactionStatus) |
||
| 920 | |||
| 921 | /** |
||
| 922 | * @return null|string |
||
| 923 | */ |
||
| 924 | public function getReasonCode() |
||
| 928 | |||
| 929 | /** |
||
| 930 | * @param null|string $reasonCode |
||
| 931 | * |
||
| 932 | * @return Payment |
||
| 933 | */ |
||
| 934 | public function setReasonCode($reasonCode) |
||
| 940 | |||
| 941 | /** |
||
| 942 | * @return int|null |
||
| 943 | */ |
||
| 944 | public function getMerchantCurrency() |
||
| 948 | |||
| 949 | /** |
||
| 950 | * @param int|null $merchantCurrency |
||
| 951 | * |
||
| 952 | * @return Payment |
||
| 953 | */ |
||
| 954 | public function setMerchantCurrency($merchantCurrency) |
||
| 960 | |||
| 961 | /** |
||
| 962 | * @return null|string |
||
| 963 | */ |
||
| 964 | public function getMerchantCurrencyAlpha() |
||
| 968 | |||
| 969 | /** |
||
| 970 | * @param null|string $merchantCurrencyAlpha |
||
| 971 | * |
||
| 972 | * @return Payment |
||
| 973 | */ |
||
| 974 | public function setMerchantCurrencyAlpha($merchantCurrencyAlpha) |
||
| 980 | |||
| 981 | /** |
||
| 982 | * @return int|null |
||
| 983 | */ |
||
| 984 | public function getCardHolderCurrency() |
||
| 988 | |||
| 989 | /** |
||
| 990 | * @param int|null $cardHolderCurrency |
||
| 991 | * |
||
| 992 | * @return Payment |
||
| 993 | */ |
||
| 994 | public function setCardHolderCurrency($cardHolderCurrency) |
||
| 1000 | |||
| 1001 | /** |
||
| 1002 | * @return null|string |
||
| 1003 | */ |
||
| 1004 | public function getCardHolderCurrencyAlpha() |
||
| 1008 | |||
| 1009 | /** |
||
| 1010 | * @param null|string $cardHolderCurrencyAlpha |
||
| 1011 | * |
||
| 1012 | * @return Payment |
||
| 1013 | */ |
||
| 1014 | public function setCardHolderCurrencyAlpha($cardHolderCurrencyAlpha) |
||
| 1020 | |||
| 1021 | /** |
||
| 1022 | * @return Money|null |
||
| 1023 | */ |
||
| 1024 | public function getReservedAmount(): ?Money |
||
| 1028 | |||
| 1029 | /** |
||
| 1030 | * @param Money $reservedAmount |
||
| 1031 | * |
||
| 1032 | * @return Payment |
||
| 1033 | */ |
||
| 1034 | public function setReservedAmount(Money $reservedAmount) |
||
| 1040 | |||
| 1041 | /** |
||
| 1042 | * @return Money|null |
||
| 1043 | */ |
||
| 1044 | public function getCapturedAmount(): ?Money |
||
| 1048 | |||
| 1049 | /** |
||
| 1050 | * @param Money $capturedAmount |
||
| 1051 | * |
||
| 1052 | * @return Payment |
||
| 1053 | */ |
||
| 1054 | public function setCapturedAmount(Money $capturedAmount) |
||
| 1060 | |||
| 1061 | /** |
||
| 1062 | * @return Money|null |
||
| 1063 | */ |
||
| 1064 | public function getRefundedAmount(): ?Money |
||
| 1068 | |||
| 1069 | /** |
||
| 1070 | * @param Money $refundedAmount |
||
| 1071 | * |
||
| 1072 | * @return Payment |
||
| 1073 | */ |
||
| 1074 | public function setRefundedAmount(Money $refundedAmount) |
||
| 1080 | |||
| 1081 | /** |
||
| 1082 | * @return Money|null |
||
| 1083 | */ |
||
| 1084 | public function getRecurringDefaultAmount(): ?Money |
||
| 1088 | |||
| 1089 | /** |
||
| 1090 | * @param Money $recurringDefaultAmount |
||
| 1091 | * |
||
| 1092 | * @return Payment |
||
| 1093 | */ |
||
| 1094 | public function setRecurringDefaultAmount(Money $recurringDefaultAmount) |
||
| 1100 | |||
| 1101 | /** |
||
| 1102 | * @return \DateTime|null |
||
| 1103 | */ |
||
| 1104 | public function getCreatedDate() |
||
| 1108 | |||
| 1109 | /** |
||
| 1110 | * @param \DateTimeInterface|null $createdDate |
||
| 1111 | * |
||
| 1112 | * @return Payment |
||
| 1113 | */ |
||
| 1114 | public function setCreatedDate($createdDate) |
||
| 1120 | |||
| 1121 | /** |
||
| 1122 | * @return \DateTime|null |
||
| 1123 | */ |
||
| 1124 | public function getUpdatedDate() |
||
| 1128 | |||
| 1129 | /** |
||
| 1130 | * @param \DateTimeInterface|null $updatedDate |
||
| 1131 | * |
||
| 1132 | * @return Payment |
||
| 1133 | */ |
||
| 1134 | public function setUpdatedDate($updatedDate) |
||
| 1140 | |||
| 1141 | /** |
||
| 1142 | * @return null|string |
||
| 1143 | */ |
||
| 1144 | public function getPaymentNature() |
||
| 1148 | |||
| 1149 | /** |
||
| 1150 | * @param null|string $paymentNature |
||
| 1151 | * |
||
| 1152 | * @return Payment |
||
| 1153 | */ |
||
| 1154 | public function setPaymentNature($paymentNature) |
||
| 1160 | |||
| 1161 | /** |
||
| 1162 | * @return bool|null |
||
| 1163 | */ |
||
| 1164 | public function getSupportsRefunds() |
||
| 1168 | |||
| 1169 | /** |
||
| 1170 | * @param bool|null $supportsRefunds |
||
| 1171 | * |
||
| 1172 | * @return Payment |
||
| 1173 | */ |
||
| 1174 | public function setSupportsRefunds($supportsRefunds) |
||
| 1180 | |||
| 1181 | /** |
||
| 1182 | * @return bool|null |
||
| 1183 | */ |
||
| 1184 | public function getSupportsRelease() |
||
| 1188 | |||
| 1189 | /** |
||
| 1190 | * @param bool|null $supportsRelease |
||
| 1191 | * |
||
| 1192 | * @return Payment |
||
| 1193 | */ |
||
| 1194 | public function setSupportsRelease($supportsRelease) |
||
| 1200 | |||
| 1201 | /** |
||
| 1202 | * @return bool|null |
||
| 1203 | */ |
||
| 1204 | public function getSupportsMultipleCaptures() |
||
| 1208 | |||
| 1209 | /** |
||
| 1210 | * @param bool|null $supportsMultipleCaptures |
||
| 1211 | * |
||
| 1212 | * @return Payment |
||
| 1213 | */ |
||
| 1214 | public function setSupportsMultipleCaptures($supportsMultipleCaptures) |
||
| 1220 | |||
| 1221 | /** |
||
| 1222 | * @return bool|null |
||
| 1223 | */ |
||
| 1224 | public function getSupportsMultipleRefunds() |
||
| 1228 | |||
| 1229 | /** |
||
| 1230 | * @param bool|null $supportsMultipleRefunds |
||
| 1231 | * |
||
| 1232 | * @return Payment |
||
| 1233 | */ |
||
| 1234 | public function setSupportsMultipleRefunds($supportsMultipleRefunds) |
||
| 1240 | |||
| 1241 | /** |
||
| 1242 | * @return float|null |
||
| 1243 | */ |
||
| 1244 | public function getFraudRiskScore() |
||
| 1248 | |||
| 1249 | /** |
||
| 1250 | * @param float|null $fraudRiskScore |
||
| 1251 | * |
||
| 1252 | * @return Payment |
||
| 1253 | */ |
||
| 1254 | public function setFraudRiskScore($fraudRiskScore) |
||
| 1260 | |||
| 1261 | /** |
||
| 1262 | * @return null|string |
||
| 1263 | */ |
||
| 1264 | public function getFraudExplanation() |
||
| 1268 | |||
| 1269 | /** |
||
| 1270 | * @param null|string $fraudExplanation |
||
| 1271 | * |
||
| 1272 | * @return Payment |
||
| 1273 | */ |
||
| 1274 | public function setFraudExplanation($fraudExplanation) |
||
| 1280 | |||
| 1281 | /** |
||
| 1282 | * {@inheritdoc} |
||
| 1283 | */ |
||
| 1284 | protected function getCurrency(): ?string |
||
| 1296 | } |
||
| 1297 |
If an expression can have both
false, andnullas possible values. It is generally a good practice to always use strict comparison to clearly distinguish between those two values.