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 |
||
| 9 | class Payment |
||
| 10 | { |
||
| 11 | /** |
||
| 12 | * @var string |
||
| 13 | */ |
||
| 14 | protected $apiKey; |
||
| 15 | |||
| 16 | /** |
||
| 17 | * @var string |
||
| 18 | */ |
||
| 19 | protected $merchant; |
||
| 20 | |||
| 21 | /** |
||
| 22 | * @var int |
||
| 23 | */ |
||
| 24 | protected $orderId; |
||
| 25 | |||
| 26 | /** |
||
| 27 | * @var string |
||
| 28 | */ |
||
| 29 | protected $sessionId; |
||
| 30 | |||
| 31 | /** |
||
| 32 | * @var string |
||
| 33 | */ |
||
| 34 | protected $currencySymbol; |
||
| 35 | |||
| 36 | /** |
||
| 37 | * @var Money |
||
| 38 | */ |
||
| 39 | protected $totalAmount; |
||
| 40 | |||
| 41 | /** |
||
| 42 | * @var string |
||
| 43 | */ |
||
| 44 | protected $callBackUrl; |
||
| 45 | |||
| 46 | /** |
||
| 47 | * @var string |
||
| 48 | */ |
||
| 49 | protected $fullCallBackOkUrl; |
||
| 50 | |||
| 51 | /** |
||
| 52 | * @var string |
||
| 53 | */ |
||
| 54 | protected $callBackOkUrl; |
||
| 55 | |||
| 56 | /** |
||
| 57 | * @var string |
||
| 58 | */ |
||
| 59 | protected $callBackServerUrl; |
||
| 60 | |||
| 61 | /** |
||
| 62 | * @var int |
||
| 63 | */ |
||
| 64 | protected $languageId; |
||
| 65 | |||
| 66 | /** |
||
| 67 | * @var bool |
||
| 68 | */ |
||
| 69 | protected $testMode; |
||
| 70 | |||
| 71 | /** |
||
| 72 | * @var int |
||
| 73 | */ |
||
| 74 | protected $paymentGatewayCurrencyCode; |
||
| 75 | |||
| 76 | /** |
||
| 77 | * @var int |
||
| 78 | */ |
||
| 79 | protected $cardTypeId; |
||
| 80 | |||
| 81 | /** |
||
| 82 | * @var string |
||
| 83 | */ |
||
| 84 | protected $customerRekvNr; |
||
| 85 | |||
| 86 | /** |
||
| 87 | * @var string |
||
| 88 | */ |
||
| 89 | protected $customerName; |
||
| 90 | |||
| 91 | /** |
||
| 92 | * @var string |
||
| 93 | */ |
||
| 94 | protected $customerCompany; |
||
| 95 | |||
| 96 | /** |
||
| 97 | * @var string |
||
| 98 | */ |
||
| 99 | protected $customerAddress; |
||
| 100 | |||
| 101 | /** |
||
| 102 | * @var string |
||
| 103 | */ |
||
| 104 | protected $customerAddress2; |
||
| 105 | |||
| 106 | /** |
||
| 107 | * @var string |
||
| 108 | */ |
||
| 109 | protected $customerZipCode; |
||
| 110 | |||
| 111 | /** |
||
| 112 | * @var string |
||
| 113 | */ |
||
| 114 | protected $customerCity; |
||
| 115 | |||
| 116 | /** |
||
| 117 | * @var int |
||
| 118 | */ |
||
| 119 | protected $customerCountryId; |
||
| 120 | |||
| 121 | /** |
||
| 122 | * @var string |
||
| 123 | */ |
||
| 124 | protected $customerCountry; |
||
| 125 | |||
| 126 | /** |
||
| 127 | * This is the ISO 3166 country code |
||
| 128 | * |
||
| 129 | * @var string |
||
| 130 | */ |
||
| 131 | protected $customerCountryCode; |
||
| 132 | |||
| 133 | /** |
||
| 134 | * @var string |
||
| 135 | */ |
||
| 136 | protected $customerPhone; |
||
| 137 | |||
| 138 | /** |
||
| 139 | * @var string |
||
| 140 | */ |
||
| 141 | protected $customerFax; |
||
| 142 | |||
| 143 | /** |
||
| 144 | * @var string |
||
| 145 | */ |
||
| 146 | protected $customerEmail; |
||
| 147 | |||
| 148 | /** |
||
| 149 | * @var string |
||
| 150 | */ |
||
| 151 | protected $customerNote; |
||
| 152 | |||
| 153 | /** |
||
| 154 | * @var string |
||
| 155 | */ |
||
| 156 | protected $customerCvrnr; |
||
| 157 | |||
| 158 | /** |
||
| 159 | * @var int |
||
| 160 | */ |
||
| 161 | protected $customerCustTypeId; |
||
| 162 | |||
| 163 | /** |
||
| 164 | * @var string |
||
| 165 | */ |
||
| 166 | protected $customerEan; |
||
| 167 | |||
| 168 | /** |
||
| 169 | * @var string |
||
| 170 | */ |
||
| 171 | protected $customerRes1; |
||
| 172 | |||
| 173 | /** |
||
| 174 | * @var string |
||
| 175 | */ |
||
| 176 | protected $customerRes2; |
||
| 177 | |||
| 178 | /** |
||
| 179 | * @var string |
||
| 180 | */ |
||
| 181 | protected $customerRes3; |
||
| 182 | |||
| 183 | /** |
||
| 184 | * @var string |
||
| 185 | */ |
||
| 186 | protected $customerRes4; |
||
| 187 | |||
| 188 | /** |
||
| 189 | * @var string |
||
| 190 | */ |
||
| 191 | protected $customerRes5; |
||
| 192 | |||
| 193 | /** |
||
| 194 | * @var string |
||
| 195 | */ |
||
| 196 | protected $customerIp; |
||
| 197 | |||
| 198 | /** |
||
| 199 | * @var string |
||
| 200 | */ |
||
| 201 | protected $deliveryName; |
||
| 202 | |||
| 203 | /** |
||
| 204 | * @var string |
||
| 205 | */ |
||
| 206 | protected $deliveryCompany; |
||
| 207 | |||
| 208 | /** |
||
| 209 | * @var string |
||
| 210 | */ |
||
| 211 | protected $deliveryAddress; |
||
| 212 | |||
| 213 | /** |
||
| 214 | * @var string |
||
| 215 | */ |
||
| 216 | protected $deliveryAddress2; |
||
| 217 | |||
| 218 | /** |
||
| 219 | * @var string |
||
| 220 | */ |
||
| 221 | protected $deliveryZipCode; |
||
| 222 | |||
| 223 | /** |
||
| 224 | * @var string |
||
| 225 | */ |
||
| 226 | protected $deliveryCity; |
||
| 227 | |||
| 228 | /** |
||
| 229 | * @var int |
||
| 230 | */ |
||
| 231 | protected $deliveryCountryID; |
||
| 232 | |||
| 233 | /** |
||
| 234 | * @var string |
||
| 235 | */ |
||
| 236 | protected $deliveryCountry; |
||
| 237 | |||
| 238 | /** |
||
| 239 | * This is the ISO 3166 country code |
||
| 240 | * |
||
| 241 | * @var string |
||
| 242 | */ |
||
| 243 | protected $deliveryCountryCode; |
||
| 244 | |||
| 245 | /** |
||
| 246 | * @var string |
||
| 247 | */ |
||
| 248 | protected $deliveryPhone; |
||
| 249 | |||
| 250 | /** |
||
| 251 | * @var string |
||
| 252 | */ |
||
| 253 | protected $deliveryFax; |
||
| 254 | |||
| 255 | /** |
||
| 256 | * @var string |
||
| 257 | */ |
||
| 258 | protected $deliveryEmail; |
||
| 259 | |||
| 260 | /** |
||
| 261 | * @var string |
||
| 262 | */ |
||
| 263 | protected $deliveryEan; |
||
| 264 | |||
| 265 | /** |
||
| 266 | * @var string |
||
| 267 | */ |
||
| 268 | protected $shippingMethod; |
||
| 269 | |||
| 270 | /** |
||
| 271 | * @var int |
||
| 272 | */ |
||
| 273 | protected $shippingMethodId; |
||
| 274 | |||
| 275 | /** |
||
| 276 | * @var Money |
||
| 277 | */ |
||
| 278 | protected $shippingFee; |
||
| 279 | |||
| 280 | /** |
||
| 281 | * @var string |
||
| 282 | */ |
||
| 283 | protected $paymentMethod; |
||
| 284 | |||
| 285 | /** |
||
| 286 | * @var int |
||
| 287 | */ |
||
| 288 | protected $paymentMethodId; |
||
| 289 | |||
| 290 | /** |
||
| 291 | * @var Money |
||
| 292 | */ |
||
| 293 | protected $paymentFee; |
||
| 294 | |||
| 295 | /** |
||
| 296 | * @var string |
||
| 297 | */ |
||
| 298 | protected $loadBalancerRealIp; |
||
| 299 | |||
| 300 | /** |
||
| 301 | * @var string |
||
| 302 | */ |
||
| 303 | protected $referrer; |
||
| 304 | |||
| 305 | /** |
||
| 306 | * @var PaymentLine[] |
||
| 307 | */ |
||
| 308 | protected $paymentLines; |
||
| 309 | |||
| 310 | 21 | public function __construct() |
|
| 314 | |||
| 315 | 6 | public static function createFromRequest(ServerRequestInterface $request) : Payment |
|
| 321 | |||
| 322 | 6 | public function populateFromRequest(ServerRequestInterface $request) |
|
| 414 | |||
| 415 | 3 | public static function createPaymentLine(string $productNumber, string $name, int $quantity, Money $price, int $vat) |
|
| 419 | |||
| 420 | /** |
||
| 421 | * Takes strings like |
||
| 422 | * - 1.000,50 |
||
| 423 | * - 1,000.50 |
||
| 424 | * - 1000.50 |
||
| 425 | * - 1000,50. |
||
| 426 | * |
||
| 427 | * and returns 100050 |
||
| 428 | * |
||
| 429 | * @param string $str |
||
| 430 | * @param string $propertyPath |
||
| 431 | * |
||
| 432 | * @return int |
||
| 433 | */ |
||
| 434 | 9 | public static function priceStringToInt(string $str, string $propertyPath = '') : int |
|
| 447 | |||
| 448 | /** |
||
| 449 | * @return string |
||
| 450 | */ |
||
| 451 | 6 | public function getApiKey(): ?string |
|
| 455 | |||
| 456 | /** |
||
| 457 | * @param string $apiKey |
||
| 458 | * |
||
| 459 | * @return Payment |
||
| 460 | */ |
||
| 461 | 9 | public function setApiKey(string $apiKey): self |
|
| 467 | |||
| 468 | /** |
||
| 469 | * @return string |
||
| 470 | */ |
||
| 471 | 3 | public function getMerchant(): ?string |
|
| 475 | |||
| 476 | /** |
||
| 477 | * @param string $merchant |
||
| 478 | * |
||
| 479 | * @return Payment |
||
| 480 | */ |
||
| 481 | 6 | public function setMerchant(string $merchant): self |
|
| 487 | |||
| 488 | /** |
||
| 489 | * @return int |
||
| 490 | */ |
||
| 491 | 9 | public function getOrderId(): ?int |
|
| 495 | |||
| 496 | /** |
||
| 497 | * @param int $orderId |
||
| 498 | * |
||
| 499 | * @return Payment |
||
| 500 | */ |
||
| 501 | 12 | public function setOrderId(int $orderId): self |
|
| 507 | |||
| 508 | /** |
||
| 509 | * @return string |
||
| 510 | */ |
||
| 511 | 3 | public function getSessionId(): ?string |
|
| 515 | |||
| 516 | /** |
||
| 517 | * @param string $sessionId |
||
| 518 | * |
||
| 519 | * @return Payment |
||
| 520 | */ |
||
| 521 | 6 | public function setSessionId(string $sessionId): self |
|
| 527 | |||
| 528 | /** |
||
| 529 | * @return string |
||
| 530 | */ |
||
| 531 | 6 | public function getCurrencySymbol(): ?string |
|
| 535 | |||
| 536 | /** |
||
| 537 | * @param string $currencySymbol |
||
| 538 | * |
||
| 539 | * @return Payment |
||
| 540 | */ |
||
| 541 | 9 | public function setCurrencySymbol(string $currencySymbol): self |
|
| 556 | |||
| 557 | /** |
||
| 558 | * @return Money |
||
| 559 | */ |
||
| 560 | 9 | public function getTotalAmount(): ?Money |
|
| 564 | |||
| 565 | /** |
||
| 566 | * @param Money $totalAmount |
||
| 567 | * |
||
| 568 | * @return Payment |
||
| 569 | */ |
||
| 570 | 6 | public function setTotalAmount(Money $totalAmount): self |
|
| 576 | |||
| 577 | /** |
||
| 578 | * @return string |
||
| 579 | */ |
||
| 580 | 3 | public function getCallBackUrl(): ?string |
|
| 584 | |||
| 585 | /** |
||
| 586 | * @param string $callBackUrl |
||
| 587 | * |
||
| 588 | * @return Payment |
||
| 589 | */ |
||
| 590 | 6 | public function setCallBackUrl(string $callBackUrl): self |
|
| 596 | |||
| 597 | /** |
||
| 598 | * @return string |
||
| 599 | */ |
||
| 600 | 3 | public function getFullCallBackOkUrl(): ?string |
|
| 604 | |||
| 605 | /** |
||
| 606 | * @param string $fullCallBackOkUrl |
||
| 607 | * |
||
| 608 | * @return Payment |
||
| 609 | */ |
||
| 610 | 6 | public function setFullCallBackOkUrl(string $fullCallBackOkUrl): self |
|
| 616 | |||
| 617 | /** |
||
| 618 | * @return string |
||
| 619 | */ |
||
| 620 | 3 | public function getCallBackOkUrl(): ?string |
|
| 624 | |||
| 625 | /** |
||
| 626 | * @param string $callBackOkUrl |
||
| 627 | * |
||
| 628 | * @return Payment |
||
| 629 | */ |
||
| 630 | 6 | public function setCallBackOkUrl(string $callBackOkUrl): self |
|
| 636 | |||
| 637 | /** |
||
| 638 | * @return string |
||
| 639 | */ |
||
| 640 | 3 | public function getCallBackServerUrl(): ?string |
|
| 644 | |||
| 645 | /** |
||
| 646 | * @param string $callBackServerUrl |
||
| 647 | * |
||
| 648 | * @return Payment |
||
| 649 | */ |
||
| 650 | 6 | public function setCallBackServerUrl(string $callBackServerUrl): self |
|
| 656 | |||
| 657 | /** |
||
| 658 | * @return int |
||
| 659 | */ |
||
| 660 | 3 | public function getLanguageId(): ?int |
|
| 664 | |||
| 665 | /** |
||
| 666 | * @param int $languageId |
||
| 667 | * |
||
| 668 | * @return Payment |
||
| 669 | */ |
||
| 670 | 6 | public function setLanguageId(int $languageId): self |
|
| 676 | |||
| 677 | /** |
||
| 678 | * @return bool |
||
| 679 | */ |
||
| 680 | 3 | public function isTestMode(): ?bool |
|
| 684 | |||
| 685 | /** |
||
| 686 | * @param bool $testMode |
||
| 687 | * |
||
| 688 | * @return Payment |
||
| 689 | */ |
||
| 690 | 6 | public function setTestMode(bool $testMode): self |
|
| 696 | |||
| 697 | /** |
||
| 698 | * @return int |
||
| 699 | */ |
||
| 700 | 9 | public function getPaymentGatewayCurrencyCode() |
|
| 704 | |||
| 705 | /** |
||
| 706 | * @param int $paymentGatewayCurrencyCode |
||
| 707 | * |
||
| 708 | * @return Payment |
||
| 709 | */ |
||
| 710 | 12 | public function setPaymentGatewayCurrencyCode(int $paymentGatewayCurrencyCode): self |
|
| 716 | |||
| 717 | /** |
||
| 718 | * @return int |
||
| 719 | */ |
||
| 720 | 3 | public function getCardTypeId() |
|
| 724 | |||
| 725 | /** |
||
| 726 | * @param int $cardTypeId |
||
| 727 | * |
||
| 728 | * @return Payment |
||
| 729 | */ |
||
| 730 | 6 | public function setCardTypeId(int $cardTypeId): self |
|
| 736 | |||
| 737 | /** |
||
| 738 | * @return string |
||
| 739 | */ |
||
| 740 | 3 | public function getCustomerRekvNr(): ?string |
|
| 744 | |||
| 745 | /** |
||
| 746 | * @param string $customerRekvNr |
||
| 747 | * |
||
| 748 | * @return Payment |
||
| 749 | */ |
||
| 750 | 6 | public function setCustomerRekvNr(string $customerRekvNr): self |
|
| 756 | |||
| 757 | /** |
||
| 758 | * @return string |
||
| 759 | */ |
||
| 760 | 3 | public function getCustomerName(): ?string |
|
| 764 | |||
| 765 | /** |
||
| 766 | * @param string $customerName |
||
| 767 | * |
||
| 768 | * @return Payment |
||
| 769 | */ |
||
| 770 | 6 | public function setCustomerName(string $customerName): self |
|
| 776 | |||
| 777 | /** |
||
| 778 | * @return string |
||
| 779 | */ |
||
| 780 | 3 | public function getCustomerCompany(): ?string |
|
| 784 | |||
| 785 | /** |
||
| 786 | * @param string $customerCompany |
||
| 787 | * |
||
| 788 | * @return Payment |
||
| 789 | */ |
||
| 790 | 6 | public function setCustomerCompany(string $customerCompany): self |
|
| 796 | |||
| 797 | /** |
||
| 798 | * @return string |
||
| 799 | */ |
||
| 800 | 3 | public function getCustomerAddress(): ?string |
|
| 804 | |||
| 805 | /** |
||
| 806 | * @param string $customerAddress |
||
| 807 | * |
||
| 808 | * @return Payment |
||
| 809 | */ |
||
| 810 | 6 | public function setCustomerAddress(string $customerAddress): self |
|
| 816 | |||
| 817 | /** |
||
| 818 | * @return string |
||
| 819 | */ |
||
| 820 | 3 | public function getCustomerAddress2(): ?string |
|
| 824 | |||
| 825 | /** |
||
| 826 | * @param string $customerAddress2 |
||
| 827 | * |
||
| 828 | * @return Payment |
||
| 829 | */ |
||
| 830 | 6 | public function setCustomerAddress2(string $customerAddress2): self |
|
| 836 | |||
| 837 | /** |
||
| 838 | * @return string |
||
| 839 | */ |
||
| 840 | 3 | public function getCustomerZipCode(): ?string |
|
| 844 | |||
| 845 | /** |
||
| 846 | * @param string $customerZipCode |
||
| 847 | * |
||
| 848 | * @return Payment |
||
| 849 | */ |
||
| 850 | 6 | public function setCustomerZipCode(string $customerZipCode): self |
|
| 856 | |||
| 857 | /** |
||
| 858 | * @return string |
||
| 859 | */ |
||
| 860 | 3 | public function getCustomerCity(): ?string |
|
| 864 | |||
| 865 | /** |
||
| 866 | * @param string $customerCity |
||
| 867 | * |
||
| 868 | * @return Payment |
||
| 869 | */ |
||
| 870 | 6 | public function setCustomerCity(string $customerCity): self |
|
| 876 | |||
| 877 | /** |
||
| 878 | * @return int |
||
| 879 | */ |
||
| 880 | 3 | public function getCustomerCountryId() |
|
| 884 | |||
| 885 | /** |
||
| 886 | * @param int $customerCountryId |
||
| 887 | * |
||
| 888 | * @return Payment |
||
| 889 | */ |
||
| 890 | 6 | public function setCustomerCountryId(int $customerCountryId): self |
|
| 896 | |||
| 897 | /** |
||
| 898 | * @return string |
||
| 899 | */ |
||
| 900 | 3 | public function getCustomerCountry(): ?string |
|
| 904 | |||
| 905 | /** |
||
| 906 | * @param string $customerCountry |
||
| 907 | * |
||
| 908 | * @return Payment |
||
| 909 | */ |
||
| 910 | 6 | public function setCustomerCountry(string $customerCountry): self |
|
| 916 | |||
| 917 | /** |
||
| 918 | * @return string |
||
| 919 | */ |
||
| 920 | 3 | public function getCustomerCountryCode(): ?string |
|
| 924 | |||
| 925 | /** |
||
| 926 | * @param string $customerCountryCode |
||
| 927 | * @return Payment |
||
| 928 | */ |
||
| 929 | 6 | public function setCustomerCountryCode(string $customerCountryCode): self |
|
| 934 | |||
| 935 | /** |
||
| 936 | * @return string |
||
| 937 | */ |
||
| 938 | 3 | public function getCustomerPhone(): ?string |
|
| 942 | |||
| 943 | /** |
||
| 944 | * @param string $customerPhone |
||
| 945 | * |
||
| 946 | * @return Payment |
||
| 947 | */ |
||
| 948 | 6 | public function setCustomerPhone(string $customerPhone): self |
|
| 954 | |||
| 955 | /** |
||
| 956 | * @return string |
||
| 957 | */ |
||
| 958 | 3 | public function getCustomerFax(): ?string |
|
| 962 | |||
| 963 | /** |
||
| 964 | * @param string $customerFax |
||
| 965 | * |
||
| 966 | * @return Payment |
||
| 967 | */ |
||
| 968 | 6 | public function setCustomerFax(string $customerFax): self |
|
| 974 | |||
| 975 | /** |
||
| 976 | * @return string |
||
| 977 | */ |
||
| 978 | 3 | public function getCustomerEmail(): ?string |
|
| 982 | |||
| 983 | /** |
||
| 984 | * @param string $customerEmail |
||
| 985 | * |
||
| 986 | * @return Payment |
||
| 987 | */ |
||
| 988 | 6 | public function setCustomerEmail(string $customerEmail): self |
|
| 994 | |||
| 995 | /** |
||
| 996 | * @return string |
||
| 997 | */ |
||
| 998 | 3 | public function getCustomerNote(): ?string |
|
| 1002 | |||
| 1003 | /** |
||
| 1004 | * @param string $customerNote |
||
| 1005 | * |
||
| 1006 | * @return Payment |
||
| 1007 | */ |
||
| 1008 | 6 | public function setCustomerNote(string $customerNote): self |
|
| 1014 | |||
| 1015 | /** |
||
| 1016 | * @return string |
||
| 1017 | */ |
||
| 1018 | 3 | public function getCustomerCvrnr(): ?string |
|
| 1022 | |||
| 1023 | /** |
||
| 1024 | * @param string $customerCvrnr |
||
| 1025 | * |
||
| 1026 | * @return Payment |
||
| 1027 | */ |
||
| 1028 | 6 | public function setCustomerCvrnr(string $customerCvrnr): self |
|
| 1034 | |||
| 1035 | /** |
||
| 1036 | * @return int |
||
| 1037 | */ |
||
| 1038 | 3 | public function getCustomerCustTypeId(): ?int |
|
| 1042 | |||
| 1043 | /** |
||
| 1044 | * @param int $customerCustTypeId |
||
| 1045 | * |
||
| 1046 | * @return Payment |
||
| 1047 | */ |
||
| 1048 | 6 | public function setCustomerCustTypeId(int $customerCustTypeId): self |
|
| 1054 | |||
| 1055 | /** |
||
| 1056 | * @return string |
||
| 1057 | */ |
||
| 1058 | 3 | public function getCustomerEan(): ?string |
|
| 1062 | |||
| 1063 | /** |
||
| 1064 | * @param string $customerEan |
||
| 1065 | * |
||
| 1066 | * @return Payment |
||
| 1067 | */ |
||
| 1068 | 6 | public function setCustomerEan(string $customerEan): self |
|
| 1074 | |||
| 1075 | /** |
||
| 1076 | * @return string |
||
| 1077 | */ |
||
| 1078 | 3 | public function getCustomerRes1(): ?string |
|
| 1082 | |||
| 1083 | /** |
||
| 1084 | * @param string $customerRes1 |
||
| 1085 | * |
||
| 1086 | * @return Payment |
||
| 1087 | */ |
||
| 1088 | 6 | public function setCustomerRes1(string $customerRes1): self |
|
| 1094 | |||
| 1095 | /** |
||
| 1096 | * @return string |
||
| 1097 | */ |
||
| 1098 | 3 | public function getCustomerRes2(): ?string |
|
| 1102 | |||
| 1103 | /** |
||
| 1104 | * @param string $customerRes2 |
||
| 1105 | * |
||
| 1106 | * @return Payment |
||
| 1107 | */ |
||
| 1108 | 6 | public function setCustomerRes2(string $customerRes2): self |
|
| 1114 | |||
| 1115 | /** |
||
| 1116 | * @return string |
||
| 1117 | */ |
||
| 1118 | 3 | public function getCustomerRes3(): ?string |
|
| 1122 | |||
| 1123 | /** |
||
| 1124 | * @param string $customerRes3 |
||
| 1125 | * |
||
| 1126 | * @return Payment |
||
| 1127 | */ |
||
| 1128 | 6 | public function setCustomerRes3(string $customerRes3): self |
|
| 1134 | |||
| 1135 | /** |
||
| 1136 | * @return string |
||
| 1137 | */ |
||
| 1138 | 3 | public function getCustomerRes4(): ?string |
|
| 1142 | |||
| 1143 | /** |
||
| 1144 | * @param string $customerRes4 |
||
| 1145 | * |
||
| 1146 | * @return Payment |
||
| 1147 | */ |
||
| 1148 | 6 | public function setCustomerRes4(string $customerRes4): self |
|
| 1154 | |||
| 1155 | /** |
||
| 1156 | * @return string |
||
| 1157 | */ |
||
| 1158 | 3 | public function getCustomerRes5(): ?string |
|
| 1162 | |||
| 1163 | /** |
||
| 1164 | * @param string $customerRes5 |
||
| 1165 | * |
||
| 1166 | * @return Payment |
||
| 1167 | */ |
||
| 1168 | 6 | public function setCustomerRes5(string $customerRes5): self |
|
| 1174 | |||
| 1175 | /** |
||
| 1176 | * @return string |
||
| 1177 | */ |
||
| 1178 | 3 | public function getCustomerIp(): ?string |
|
| 1182 | |||
| 1183 | /** |
||
| 1184 | * @param string $customerIp |
||
| 1185 | * |
||
| 1186 | * @return Payment |
||
| 1187 | */ |
||
| 1188 | 6 | public function setCustomerIp(string $customerIp): self |
|
| 1194 | |||
| 1195 | /** |
||
| 1196 | * @return string |
||
| 1197 | */ |
||
| 1198 | 3 | public function getDeliveryName(): ?string |
|
| 1202 | |||
| 1203 | /** |
||
| 1204 | * @param string $deliveryName |
||
| 1205 | * |
||
| 1206 | * @return Payment |
||
| 1207 | */ |
||
| 1208 | 6 | public function setDeliveryName(string $deliveryName): self |
|
| 1214 | |||
| 1215 | /** |
||
| 1216 | * @return string |
||
| 1217 | */ |
||
| 1218 | 3 | public function getDeliveryCompany(): ?string |
|
| 1222 | |||
| 1223 | /** |
||
| 1224 | * @param string $deliveryCompany |
||
| 1225 | * |
||
| 1226 | * @return Payment |
||
| 1227 | */ |
||
| 1228 | 6 | public function setDeliveryCompany(string $deliveryCompany): self |
|
| 1234 | |||
| 1235 | /** |
||
| 1236 | * @return string |
||
| 1237 | */ |
||
| 1238 | 3 | public function getDeliveryAddress(): ?string |
|
| 1242 | |||
| 1243 | /** |
||
| 1244 | * @param string $deliveryAddress |
||
| 1245 | * |
||
| 1246 | * @return Payment |
||
| 1247 | */ |
||
| 1248 | 6 | public function setDeliveryAddress(string $deliveryAddress): self |
|
| 1254 | |||
| 1255 | /** |
||
| 1256 | * @return string |
||
| 1257 | */ |
||
| 1258 | 3 | public function getDeliveryAddress2(): ?string |
|
| 1262 | |||
| 1263 | /** |
||
| 1264 | * @param string $deliveryAddress2 |
||
| 1265 | * |
||
| 1266 | * @return Payment |
||
| 1267 | */ |
||
| 1268 | 6 | public function setDeliveryAddress2(string $deliveryAddress2): self |
|
| 1274 | |||
| 1275 | /** |
||
| 1276 | * @return string |
||
| 1277 | */ |
||
| 1278 | 3 | public function getDeliveryZipCode(): ?string |
|
| 1282 | |||
| 1283 | /** |
||
| 1284 | * @param string $deliveryZipCode |
||
| 1285 | * |
||
| 1286 | * @return Payment |
||
| 1287 | */ |
||
| 1288 | 6 | public function setDeliveryZipCode(string $deliveryZipCode): self |
|
| 1294 | |||
| 1295 | /** |
||
| 1296 | * @return string |
||
| 1297 | */ |
||
| 1298 | 3 | public function getDeliveryCity(): ?string |
|
| 1302 | |||
| 1303 | /** |
||
| 1304 | * @param string $deliveryCity |
||
| 1305 | * |
||
| 1306 | * @return Payment |
||
| 1307 | */ |
||
| 1308 | 6 | public function setDeliveryCity(string $deliveryCity): self |
|
| 1314 | |||
| 1315 | /** |
||
| 1316 | * @return int |
||
| 1317 | */ |
||
| 1318 | 3 | public function getDeliveryCountryID() |
|
| 1322 | |||
| 1323 | /** |
||
| 1324 | * @param int $deliveryCountryID |
||
| 1325 | * |
||
| 1326 | * @return Payment |
||
| 1327 | */ |
||
| 1328 | 6 | public function setDeliveryCountryID(int $deliveryCountryID): self |
|
| 1334 | |||
| 1335 | /** |
||
| 1336 | * @return string |
||
| 1337 | */ |
||
| 1338 | 3 | public function getDeliveryCountry(): ?string |
|
| 1342 | |||
| 1343 | /** |
||
| 1344 | * @param string $deliveryCountry |
||
| 1345 | * |
||
| 1346 | * @return Payment |
||
| 1347 | */ |
||
| 1348 | 6 | public function setDeliveryCountry(string $deliveryCountry): self |
|
| 1354 | |||
| 1355 | /** |
||
| 1356 | * @return string |
||
| 1357 | */ |
||
| 1358 | 3 | public function getDeliveryCountryCode(): ?string |
|
| 1362 | |||
| 1363 | /** |
||
| 1364 | * @param string $deliveryCountryCode |
||
| 1365 | * @return Payment |
||
| 1366 | */ |
||
| 1367 | 6 | public function setDeliveryCountryCode(string $deliveryCountryCode) |
|
| 1372 | |||
| 1373 | /** |
||
| 1374 | * @return string |
||
| 1375 | */ |
||
| 1376 | 3 | public function getDeliveryPhone(): ?string |
|
| 1380 | |||
| 1381 | /** |
||
| 1382 | * @param string $deliveryPhone |
||
| 1383 | * |
||
| 1384 | * @return Payment |
||
| 1385 | */ |
||
| 1386 | 6 | public function setDeliveryPhone(string $deliveryPhone): self |
|
| 1392 | |||
| 1393 | /** |
||
| 1394 | * @return string |
||
| 1395 | */ |
||
| 1396 | 3 | public function getDeliveryFax(): ?string |
|
| 1400 | |||
| 1401 | /** |
||
| 1402 | * @param string $deliveryFax |
||
| 1403 | * |
||
| 1404 | * @return Payment |
||
| 1405 | */ |
||
| 1406 | 6 | public function setDeliveryFax(string $deliveryFax): self |
|
| 1412 | |||
| 1413 | /** |
||
| 1414 | * @return string |
||
| 1415 | */ |
||
| 1416 | 3 | public function getDeliveryEmail(): ?string |
|
| 1420 | |||
| 1421 | /** |
||
| 1422 | * @param string $deliveryEmail |
||
| 1423 | * |
||
| 1424 | * @return Payment |
||
| 1425 | */ |
||
| 1426 | 6 | public function setDeliveryEmail(string $deliveryEmail): self |
|
| 1432 | |||
| 1433 | /** |
||
| 1434 | * @return string |
||
| 1435 | */ |
||
| 1436 | 3 | public function getDeliveryEan(): ?string |
|
| 1440 | |||
| 1441 | /** |
||
| 1442 | * @param string $deliveryEan |
||
| 1443 | * |
||
| 1444 | * @return Payment |
||
| 1445 | */ |
||
| 1446 | 6 | public function setDeliveryEan(string $deliveryEan): self |
|
| 1452 | |||
| 1453 | /** |
||
| 1454 | * @return string |
||
| 1455 | */ |
||
| 1456 | 3 | public function getShippingMethod(): ?string |
|
| 1460 | |||
| 1461 | /** |
||
| 1462 | * @param string $shippingMethod |
||
| 1463 | * |
||
| 1464 | * @return Payment |
||
| 1465 | */ |
||
| 1466 | 6 | public function setShippingMethod(string $shippingMethod): self |
|
| 1472 | |||
| 1473 | /** |
||
| 1474 | * @return int |
||
| 1475 | */ |
||
| 1476 | 3 | public function getShippingMethodId(): ?int |
|
| 1480 | |||
| 1481 | /** |
||
| 1482 | * @param int $shippingMethodId |
||
| 1483 | * @return Payment |
||
| 1484 | */ |
||
| 1485 | 6 | public function setShippingMethodId(int $shippingMethodId) : self |
|
| 1490 | |||
| 1491 | /** |
||
| 1492 | * @return Money |
||
| 1493 | */ |
||
| 1494 | 3 | public function getShippingFee(): ?Money |
|
| 1498 | |||
| 1499 | /** |
||
| 1500 | * @param Money $shippingFee |
||
| 1501 | * |
||
| 1502 | * @return Payment |
||
| 1503 | */ |
||
| 1504 | 3 | public function setShippingFee(Money $shippingFee): self |
|
| 1510 | |||
| 1511 | /** |
||
| 1512 | * @return string |
||
| 1513 | */ |
||
| 1514 | 3 | public function getPaymentMethod(): ?string |
|
| 1518 | |||
| 1519 | /** |
||
| 1520 | * @param string $paymentMethod |
||
| 1521 | * |
||
| 1522 | * @return Payment |
||
| 1523 | */ |
||
| 1524 | 6 | public function setPaymentMethod(string $paymentMethod): self |
|
| 1530 | |||
| 1531 | /** |
||
| 1532 | * @return int |
||
| 1533 | */ |
||
| 1534 | 3 | public function getPaymentMethodId(): ?int |
|
| 1538 | |||
| 1539 | /** |
||
| 1540 | * @param int $paymentMethodId |
||
| 1541 | * @return Payment |
||
| 1542 | */ |
||
| 1543 | 6 | public function setPaymentMethodId(int $paymentMethodId) : self |
|
| 1548 | |||
| 1549 | /** |
||
| 1550 | * @return Money |
||
| 1551 | */ |
||
| 1552 | 3 | public function getPaymentFee(): ?Money |
|
| 1556 | |||
| 1557 | /** |
||
| 1558 | * @param Money $paymentFee |
||
| 1559 | * |
||
| 1560 | * @return Payment |
||
| 1561 | */ |
||
| 1562 | 3 | public function setPaymentFee(Money $paymentFee): self |
|
| 1568 | |||
| 1569 | /** |
||
| 1570 | * @return string |
||
| 1571 | */ |
||
| 1572 | 3 | public function getLoadBalancerRealIp(): ?string |
|
| 1576 | |||
| 1577 | /** |
||
| 1578 | * @param string $loadBalancerRealIp |
||
| 1579 | * |
||
| 1580 | * @return Payment |
||
| 1581 | */ |
||
| 1582 | 6 | public function setLoadBalancerRealIp(string $loadBalancerRealIp): self |
|
| 1588 | |||
| 1589 | /** |
||
| 1590 | * @return string |
||
| 1591 | */ |
||
| 1592 | 3 | public function getReferrer(): ?string |
|
| 1596 | |||
| 1597 | /** |
||
| 1598 | * @param string $referrer |
||
| 1599 | * |
||
| 1600 | * @return Payment |
||
| 1601 | */ |
||
| 1602 | 6 | public function setReferrer(string $referrer): self |
|
| 1608 | |||
| 1609 | /** |
||
| 1610 | * @return PaymentLine[]|iterable |
||
| 1611 | */ |
||
| 1612 | 6 | public function getPaymentLines(): iterable |
|
| 1616 | |||
| 1617 | /** |
||
| 1618 | * @param PaymentLine[]|iterable $paymentLines |
||
| 1619 | * |
||
| 1620 | * @return Payment |
||
| 1621 | */ |
||
| 1622 | 3 | public function setPaymentLines(iterable $paymentLines): self |
|
| 1628 | |||
| 1629 | /** |
||
| 1630 | * @param PaymentLine $paymentLine |
||
| 1631 | * |
||
| 1632 | * @return Payment |
||
| 1633 | */ |
||
| 1634 | 3 | public function addPaymentLine(PaymentLine $paymentLine): self |
|
| 1641 | |||
| 1642 | /** |
||
| 1643 | * Returns the default currency for this payment |
||
| 1644 | * |
||
| 1645 | * @return null|string |
||
| 1646 | */ |
||
| 1647 | 6 | protected function getCurrency() : ?string |
|
| 1651 | |||
| 1652 | /** |
||
| 1653 | * A helper method for creating a Money object from a float based on the shared currency |
||
| 1654 | * |
||
| 1655 | * @param int $amount |
||
| 1656 | * @return Money|null |
||
| 1657 | */ |
||
| 1658 | 6 | protected function createMoney(int $amount = 0) : ?Money |
|
| 1666 | |||
| 1667 | /** |
||
| 1668 | * A helper method for creating a Money object from a float based on the shared currency |
||
| 1669 | * |
||
| 1670 | * The float can be any format, i.e. 1.50 or 1,50 |
||
| 1671 | * |
||
| 1672 | * @param string $amount |
||
| 1673 | * @return Money|null |
||
| 1674 | */ |
||
| 1675 | 6 | protected function createMoneyFromFloat(string $amount = '0.00') : ?Money |
|
| 1680 | } |
||
| 1681 |
Unless you are absolutely sure that the expression can never be null because of other conditions, we strongly recommend to add an additional type check to your code: