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 639-2 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 | * @var string |
||
| 240 | */ |
||
| 241 | protected $deliveryPhone; |
||
| 242 | |||
| 243 | /** |
||
| 244 | * @var string |
||
| 245 | */ |
||
| 246 | protected $deliveryFax; |
||
| 247 | |||
| 248 | /** |
||
| 249 | * @var string |
||
| 250 | */ |
||
| 251 | protected $deliveryEmail; |
||
| 252 | |||
| 253 | /** |
||
| 254 | * @var string |
||
| 255 | */ |
||
| 256 | protected $deliveryEan; |
||
| 257 | |||
| 258 | /** |
||
| 259 | * @var string |
||
| 260 | */ |
||
| 261 | protected $shippingMethod; |
||
| 262 | |||
| 263 | /** |
||
| 264 | * @var int |
||
| 265 | */ |
||
| 266 | protected $shippingMethodId; |
||
| 267 | |||
| 268 | /** |
||
| 269 | * @var Money |
||
| 270 | */ |
||
| 271 | protected $shippingFee; |
||
| 272 | |||
| 273 | /** |
||
| 274 | * @var string |
||
| 275 | */ |
||
| 276 | protected $paymentMethod; |
||
| 277 | |||
| 278 | /** |
||
| 279 | * @var int |
||
| 280 | */ |
||
| 281 | protected $paymentMethodId; |
||
| 282 | |||
| 283 | /** |
||
| 284 | * @var Money |
||
| 285 | */ |
||
| 286 | protected $paymentFee; |
||
| 287 | |||
| 288 | /** |
||
| 289 | * @var string |
||
| 290 | */ |
||
| 291 | protected $loadBalancerRealIp; |
||
| 292 | |||
| 293 | /** |
||
| 294 | * @var string |
||
| 295 | */ |
||
| 296 | protected $referrer; |
||
| 297 | |||
| 298 | /** |
||
| 299 | * @var PaymentLine[] |
||
| 300 | */ |
||
| 301 | protected $paymentLines; |
||
| 302 | |||
| 303 | 18 | public function __construct() |
|
| 307 | |||
| 308 | 6 | public static function createFromRequest(ServerRequestInterface $request) : Payment |
|
| 314 | |||
| 315 | 6 | public function populateFromRequest(ServerRequestInterface $request) |
|
| 406 | |||
| 407 | 3 | public static function createPaymentLine(string $productNumber, string $name, int $quantity, Money $price, int $vat) |
|
| 411 | |||
| 412 | /** |
||
| 413 | * Takes strings like |
||
| 414 | * - 1.000,50 |
||
| 415 | * - 1,000.50 |
||
| 416 | * - 1000.50 |
||
| 417 | * - 1000,50. |
||
| 418 | * |
||
| 419 | * and returns 100050 |
||
| 420 | * |
||
| 421 | * @param string $str |
||
| 422 | * @param string $propertyPath |
||
| 423 | * |
||
| 424 | * @return int |
||
| 425 | */ |
||
| 426 | 9 | public static function priceStringToInt(string $str, string $propertyPath = '') : int |
|
| 439 | |||
| 440 | /** |
||
| 441 | * @return string |
||
| 442 | */ |
||
| 443 | 6 | public function getApiKey(): ?string |
|
| 447 | |||
| 448 | /** |
||
| 449 | * @param string $apiKey |
||
| 450 | * |
||
| 451 | * @return Payment |
||
| 452 | */ |
||
| 453 | 9 | public function setApiKey(string $apiKey): self |
|
| 459 | |||
| 460 | /** |
||
| 461 | * @return string |
||
| 462 | */ |
||
| 463 | 3 | public function getMerchant(): ?string |
|
| 467 | |||
| 468 | /** |
||
| 469 | * @param string $merchant |
||
| 470 | * |
||
| 471 | * @return Payment |
||
| 472 | */ |
||
| 473 | 6 | public function setMerchant(string $merchant): self |
|
| 479 | |||
| 480 | /** |
||
| 481 | * @return int |
||
| 482 | */ |
||
| 483 | 9 | public function getOrderId(): ?int |
|
| 487 | |||
| 488 | /** |
||
| 489 | * @param int $orderId |
||
| 490 | * |
||
| 491 | * @return Payment |
||
| 492 | */ |
||
| 493 | 12 | public function setOrderId(int $orderId): self |
|
| 499 | |||
| 500 | /** |
||
| 501 | * @return string |
||
| 502 | */ |
||
| 503 | 3 | public function getSessionId(): ?string |
|
| 507 | |||
| 508 | /** |
||
| 509 | * @param string $sessionId |
||
| 510 | * |
||
| 511 | * @return Payment |
||
| 512 | */ |
||
| 513 | 6 | public function setSessionId(string $sessionId): self |
|
| 519 | |||
| 520 | /** |
||
| 521 | * @return string |
||
| 522 | */ |
||
| 523 | 3 | public function getCurrencySymbol(): ?string |
|
| 527 | |||
| 528 | /** |
||
| 529 | * @param string $currencySymbol |
||
| 530 | * |
||
| 531 | * @return Payment |
||
| 532 | */ |
||
| 533 | 6 | public function setCurrencySymbol(string $currencySymbol): self |
|
| 539 | |||
| 540 | /** |
||
| 541 | * @return Money |
||
| 542 | */ |
||
| 543 | 9 | public function getTotalAmount(): ?Money |
|
| 547 | |||
| 548 | /** |
||
| 549 | * @param Money $totalAmount |
||
| 550 | * |
||
| 551 | * @return Payment |
||
| 552 | */ |
||
| 553 | 6 | public function setTotalAmount(Money $totalAmount): self |
|
| 559 | |||
| 560 | /** |
||
| 561 | * @return string |
||
| 562 | */ |
||
| 563 | 3 | public function getCallBackUrl(): ?string |
|
| 567 | |||
| 568 | /** |
||
| 569 | * @param string $callBackUrl |
||
| 570 | * |
||
| 571 | * @return Payment |
||
| 572 | */ |
||
| 573 | 6 | public function setCallBackUrl(string $callBackUrl): self |
|
| 579 | |||
| 580 | /** |
||
| 581 | * @return string |
||
| 582 | */ |
||
| 583 | 3 | public function getFullCallBackOkUrl(): ?string |
|
| 587 | |||
| 588 | /** |
||
| 589 | * @param string $fullCallBackOkUrl |
||
| 590 | * |
||
| 591 | * @return Payment |
||
| 592 | */ |
||
| 593 | 6 | public function setFullCallBackOkUrl(string $fullCallBackOkUrl): self |
|
| 599 | |||
| 600 | /** |
||
| 601 | * @return string |
||
| 602 | */ |
||
| 603 | 3 | public function getCallBackOkUrl(): ?string |
|
| 607 | |||
| 608 | /** |
||
| 609 | * @param string $callBackOkUrl |
||
| 610 | * |
||
| 611 | * @return Payment |
||
| 612 | */ |
||
| 613 | 6 | public function setCallBackOkUrl(string $callBackOkUrl): self |
|
| 619 | |||
| 620 | /** |
||
| 621 | * @return string |
||
| 622 | */ |
||
| 623 | 3 | public function getCallBackServerUrl(): ?string |
|
| 627 | |||
| 628 | /** |
||
| 629 | * @param string $callBackServerUrl |
||
| 630 | * |
||
| 631 | * @return Payment |
||
| 632 | */ |
||
| 633 | 6 | public function setCallBackServerUrl(string $callBackServerUrl): self |
|
| 639 | |||
| 640 | /** |
||
| 641 | * @return int |
||
| 642 | */ |
||
| 643 | 3 | public function getLanguageId(): ?int |
|
| 647 | |||
| 648 | /** |
||
| 649 | * @param int $languageId |
||
| 650 | * |
||
| 651 | * @return Payment |
||
| 652 | */ |
||
| 653 | 6 | public function setLanguageId(int $languageId): self |
|
| 659 | |||
| 660 | /** |
||
| 661 | * @return bool |
||
| 662 | */ |
||
| 663 | 3 | public function isTestMode(): ?bool |
|
| 667 | |||
| 668 | /** |
||
| 669 | * @param bool $testMode |
||
| 670 | * |
||
| 671 | * @return Payment |
||
| 672 | */ |
||
| 673 | 6 | public function setTestMode(bool $testMode): self |
|
| 679 | |||
| 680 | /** |
||
| 681 | * @return int |
||
| 682 | */ |
||
| 683 | 9 | public function getPaymentGatewayCurrencyCode() |
|
| 687 | |||
| 688 | /** |
||
| 689 | * @param int $paymentGatewayCurrencyCode |
||
| 690 | * |
||
| 691 | * @return Payment |
||
| 692 | */ |
||
| 693 | 12 | public function setPaymentGatewayCurrencyCode(int $paymentGatewayCurrencyCode): self |
|
| 699 | |||
| 700 | /** |
||
| 701 | * @return int |
||
| 702 | */ |
||
| 703 | 3 | public function getCardTypeId() |
|
| 707 | |||
| 708 | /** |
||
| 709 | * @param int $cardTypeId |
||
| 710 | * |
||
| 711 | * @return Payment |
||
| 712 | */ |
||
| 713 | 6 | public function setCardTypeId(int $cardTypeId): self |
|
| 719 | |||
| 720 | /** |
||
| 721 | * @return string |
||
| 722 | */ |
||
| 723 | 3 | public function getCustomerRekvNr(): ?string |
|
| 727 | |||
| 728 | /** |
||
| 729 | * @param string $customerRekvNr |
||
| 730 | * |
||
| 731 | * @return Payment |
||
| 732 | */ |
||
| 733 | 6 | public function setCustomerRekvNr(string $customerRekvNr): self |
|
| 739 | |||
| 740 | /** |
||
| 741 | * @return string |
||
| 742 | */ |
||
| 743 | 3 | public function getCustomerName(): ?string |
|
| 747 | |||
| 748 | /** |
||
| 749 | * @param string $customerName |
||
| 750 | * |
||
| 751 | * @return Payment |
||
| 752 | */ |
||
| 753 | 6 | public function setCustomerName(string $customerName): self |
|
| 759 | |||
| 760 | /** |
||
| 761 | * @return string |
||
| 762 | */ |
||
| 763 | 3 | public function getCustomerCompany(): ?string |
|
| 767 | |||
| 768 | /** |
||
| 769 | * @param string $customerCompany |
||
| 770 | * |
||
| 771 | * @return Payment |
||
| 772 | */ |
||
| 773 | 6 | public function setCustomerCompany(string $customerCompany): self |
|
| 779 | |||
| 780 | /** |
||
| 781 | * @return string |
||
| 782 | */ |
||
| 783 | 3 | public function getCustomerAddress(): ?string |
|
| 787 | |||
| 788 | /** |
||
| 789 | * @param string $customerAddress |
||
| 790 | * |
||
| 791 | * @return Payment |
||
| 792 | */ |
||
| 793 | 6 | public function setCustomerAddress(string $customerAddress): self |
|
| 799 | |||
| 800 | /** |
||
| 801 | * @return string |
||
| 802 | */ |
||
| 803 | 3 | public function getCustomerAddress2(): ?string |
|
| 807 | |||
| 808 | /** |
||
| 809 | * @param string $customerAddress2 |
||
| 810 | * |
||
| 811 | * @return Payment |
||
| 812 | */ |
||
| 813 | 6 | public function setCustomerAddress2(string $customerAddress2): self |
|
| 819 | |||
| 820 | /** |
||
| 821 | * @return string |
||
| 822 | */ |
||
| 823 | 3 | public function getCustomerZipCode(): ?string |
|
| 827 | |||
| 828 | /** |
||
| 829 | * @param string $customerZipCode |
||
| 830 | * |
||
| 831 | * @return Payment |
||
| 832 | */ |
||
| 833 | 6 | public function setCustomerZipCode(string $customerZipCode): self |
|
| 839 | |||
| 840 | /** |
||
| 841 | * @return string |
||
| 842 | */ |
||
| 843 | 3 | public function getCustomerCity(): ?string |
|
| 847 | |||
| 848 | /** |
||
| 849 | * @param string $customerCity |
||
| 850 | * |
||
| 851 | * @return Payment |
||
| 852 | */ |
||
| 853 | 6 | public function setCustomerCity(string $customerCity): self |
|
| 859 | |||
| 860 | /** |
||
| 861 | * @return int |
||
| 862 | */ |
||
| 863 | 3 | public function getCustomerCountryId() |
|
| 867 | |||
| 868 | /** |
||
| 869 | * @param int $customerCountryId |
||
| 870 | * |
||
| 871 | * @return Payment |
||
| 872 | */ |
||
| 873 | 6 | public function setCustomerCountryId(int $customerCountryId): self |
|
| 879 | |||
| 880 | /** |
||
| 881 | * @return string |
||
| 882 | */ |
||
| 883 | 3 | public function getCustomerCountry(): ?string |
|
| 887 | |||
| 888 | /** |
||
| 889 | * @param string $customerCountry |
||
| 890 | * |
||
| 891 | * @return Payment |
||
| 892 | */ |
||
| 893 | 6 | public function setCustomerCountry(string $customerCountry): self |
|
| 899 | |||
| 900 | /** |
||
| 901 | * @return string |
||
| 902 | */ |
||
| 903 | 3 | public function getCustomerCountryCode(): ?string |
|
| 907 | |||
| 908 | /** |
||
| 909 | * @param string $customerCountryCode |
||
| 910 | * @return Payment |
||
| 911 | */ |
||
| 912 | 6 | public function setCustomerCountryCode(string $customerCountryCode): self |
|
| 917 | |||
| 918 | /** |
||
| 919 | * @return string |
||
| 920 | */ |
||
| 921 | 3 | public function getCustomerPhone(): ?string |
|
| 925 | |||
| 926 | /** |
||
| 927 | * @param string $customerPhone |
||
| 928 | * |
||
| 929 | * @return Payment |
||
| 930 | */ |
||
| 931 | 6 | public function setCustomerPhone(string $customerPhone): self |
|
| 937 | |||
| 938 | /** |
||
| 939 | * @return string |
||
| 940 | */ |
||
| 941 | 3 | public function getCustomerFax(): ?string |
|
| 945 | |||
| 946 | /** |
||
| 947 | * @param string $customerFax |
||
| 948 | * |
||
| 949 | * @return Payment |
||
| 950 | */ |
||
| 951 | 6 | public function setCustomerFax(string $customerFax): self |
|
| 957 | |||
| 958 | /** |
||
| 959 | * @return string |
||
| 960 | */ |
||
| 961 | 3 | public function getCustomerEmail(): ?string |
|
| 965 | |||
| 966 | /** |
||
| 967 | * @param string $customerEmail |
||
| 968 | * |
||
| 969 | * @return Payment |
||
| 970 | */ |
||
| 971 | 6 | public function setCustomerEmail(string $customerEmail): self |
|
| 977 | |||
| 978 | /** |
||
| 979 | * @return string |
||
| 980 | */ |
||
| 981 | 3 | public function getCustomerNote(): ?string |
|
| 985 | |||
| 986 | /** |
||
| 987 | * @param string $customerNote |
||
| 988 | * |
||
| 989 | * @return Payment |
||
| 990 | */ |
||
| 991 | 6 | public function setCustomerNote(string $customerNote): self |
|
| 997 | |||
| 998 | /** |
||
| 999 | * @return string |
||
| 1000 | */ |
||
| 1001 | 3 | public function getCustomerCvrnr(): ?string |
|
| 1005 | |||
| 1006 | /** |
||
| 1007 | * @param string $customerCvrnr |
||
| 1008 | * |
||
| 1009 | * @return Payment |
||
| 1010 | */ |
||
| 1011 | 6 | public function setCustomerCvrnr(string $customerCvrnr): self |
|
| 1017 | |||
| 1018 | /** |
||
| 1019 | * @return int |
||
| 1020 | */ |
||
| 1021 | 3 | public function getCustomerCustTypeId(): ?int |
|
| 1025 | |||
| 1026 | /** |
||
| 1027 | * @param int $customerCustTypeId |
||
| 1028 | * |
||
| 1029 | * @return Payment |
||
| 1030 | */ |
||
| 1031 | 6 | public function setCustomerCustTypeId(int $customerCustTypeId): self |
|
| 1037 | |||
| 1038 | /** |
||
| 1039 | * @return string |
||
| 1040 | */ |
||
| 1041 | 3 | public function getCustomerEan(): ?string |
|
| 1045 | |||
| 1046 | /** |
||
| 1047 | * @param string $customerEan |
||
| 1048 | * |
||
| 1049 | * @return Payment |
||
| 1050 | */ |
||
| 1051 | 6 | public function setCustomerEan(string $customerEan): self |
|
| 1057 | |||
| 1058 | /** |
||
| 1059 | * @return string |
||
| 1060 | */ |
||
| 1061 | 3 | public function getCustomerRes1(): ?string |
|
| 1065 | |||
| 1066 | /** |
||
| 1067 | * @param string $customerRes1 |
||
| 1068 | * |
||
| 1069 | * @return Payment |
||
| 1070 | */ |
||
| 1071 | 6 | public function setCustomerRes1(string $customerRes1): self |
|
| 1077 | |||
| 1078 | /** |
||
| 1079 | * @return string |
||
| 1080 | */ |
||
| 1081 | 3 | public function getCustomerRes2(): ?string |
|
| 1085 | |||
| 1086 | /** |
||
| 1087 | * @param string $customerRes2 |
||
| 1088 | * |
||
| 1089 | * @return Payment |
||
| 1090 | */ |
||
| 1091 | 6 | public function setCustomerRes2(string $customerRes2): self |
|
| 1097 | |||
| 1098 | /** |
||
| 1099 | * @return string |
||
| 1100 | */ |
||
| 1101 | 3 | public function getCustomerRes3(): ?string |
|
| 1105 | |||
| 1106 | /** |
||
| 1107 | * @param string $customerRes3 |
||
| 1108 | * |
||
| 1109 | * @return Payment |
||
| 1110 | */ |
||
| 1111 | 6 | public function setCustomerRes3(string $customerRes3): self |
|
| 1117 | |||
| 1118 | /** |
||
| 1119 | * @return string |
||
| 1120 | */ |
||
| 1121 | 3 | public function getCustomerRes4(): ?string |
|
| 1125 | |||
| 1126 | /** |
||
| 1127 | * @param string $customerRes4 |
||
| 1128 | * |
||
| 1129 | * @return Payment |
||
| 1130 | */ |
||
| 1131 | 6 | public function setCustomerRes4(string $customerRes4): self |
|
| 1137 | |||
| 1138 | /** |
||
| 1139 | * @return string |
||
| 1140 | */ |
||
| 1141 | 3 | public function getCustomerRes5(): ?string |
|
| 1145 | |||
| 1146 | /** |
||
| 1147 | * @param string $customerRes5 |
||
| 1148 | * |
||
| 1149 | * @return Payment |
||
| 1150 | */ |
||
| 1151 | 6 | public function setCustomerRes5(string $customerRes5): self |
|
| 1157 | |||
| 1158 | /** |
||
| 1159 | * @return string |
||
| 1160 | */ |
||
| 1161 | 3 | public function getCustomerIp(): ?string |
|
| 1165 | |||
| 1166 | /** |
||
| 1167 | * @param string $customerIp |
||
| 1168 | * |
||
| 1169 | * @return Payment |
||
| 1170 | */ |
||
| 1171 | 6 | public function setCustomerIp(string $customerIp): self |
|
| 1177 | |||
| 1178 | /** |
||
| 1179 | * @return string |
||
| 1180 | */ |
||
| 1181 | 3 | public function getDeliveryName(): ?string |
|
| 1185 | |||
| 1186 | /** |
||
| 1187 | * @param string $deliveryName |
||
| 1188 | * |
||
| 1189 | * @return Payment |
||
| 1190 | */ |
||
| 1191 | 6 | public function setDeliveryName(string $deliveryName): self |
|
| 1197 | |||
| 1198 | /** |
||
| 1199 | * @return string |
||
| 1200 | */ |
||
| 1201 | 3 | public function getDeliveryCompany(): ?string |
|
| 1205 | |||
| 1206 | /** |
||
| 1207 | * @param string $deliveryCompany |
||
| 1208 | * |
||
| 1209 | * @return Payment |
||
| 1210 | */ |
||
| 1211 | 6 | public function setDeliveryCompany(string $deliveryCompany): self |
|
| 1217 | |||
| 1218 | /** |
||
| 1219 | * @return string |
||
| 1220 | */ |
||
| 1221 | 3 | public function getDeliveryAddress(): ?string |
|
| 1225 | |||
| 1226 | /** |
||
| 1227 | * @param string $deliveryAddress |
||
| 1228 | * |
||
| 1229 | * @return Payment |
||
| 1230 | */ |
||
| 1231 | 6 | public function setDeliveryAddress(string $deliveryAddress): self |
|
| 1237 | |||
| 1238 | /** |
||
| 1239 | * @return string |
||
| 1240 | */ |
||
| 1241 | 3 | public function getDeliveryAddress2(): ?string |
|
| 1245 | |||
| 1246 | /** |
||
| 1247 | * @param string $deliveryAddress2 |
||
| 1248 | * |
||
| 1249 | * @return Payment |
||
| 1250 | */ |
||
| 1251 | 6 | public function setDeliveryAddress2(string $deliveryAddress2): self |
|
| 1257 | |||
| 1258 | /** |
||
| 1259 | * @return string |
||
| 1260 | */ |
||
| 1261 | 3 | public function getDeliveryZipCode(): ?string |
|
| 1265 | |||
| 1266 | /** |
||
| 1267 | * @param string $deliveryZipCode |
||
| 1268 | * |
||
| 1269 | * @return Payment |
||
| 1270 | */ |
||
| 1271 | 6 | public function setDeliveryZipCode(string $deliveryZipCode): self |
|
| 1277 | |||
| 1278 | /** |
||
| 1279 | * @return string |
||
| 1280 | */ |
||
| 1281 | 3 | public function getDeliveryCity(): ?string |
|
| 1285 | |||
| 1286 | /** |
||
| 1287 | * @param string $deliveryCity |
||
| 1288 | * |
||
| 1289 | * @return Payment |
||
| 1290 | */ |
||
| 1291 | 6 | public function setDeliveryCity(string $deliveryCity): self |
|
| 1297 | |||
| 1298 | /** |
||
| 1299 | * @return int |
||
| 1300 | */ |
||
| 1301 | 3 | public function getDeliveryCountryID() |
|
| 1305 | |||
| 1306 | /** |
||
| 1307 | * @param int $deliveryCountryID |
||
| 1308 | * |
||
| 1309 | * @return Payment |
||
| 1310 | */ |
||
| 1311 | 6 | public function setDeliveryCountryID(int $deliveryCountryID): self |
|
| 1317 | |||
| 1318 | /** |
||
| 1319 | * @return string |
||
| 1320 | */ |
||
| 1321 | 3 | public function getDeliveryCountry(): ?string |
|
| 1325 | |||
| 1326 | /** |
||
| 1327 | * @param string $deliveryCountry |
||
| 1328 | * |
||
| 1329 | * @return Payment |
||
| 1330 | */ |
||
| 1331 | 6 | public function setDeliveryCountry(string $deliveryCountry): self |
|
| 1337 | |||
| 1338 | /** |
||
| 1339 | * @return string |
||
| 1340 | */ |
||
| 1341 | 3 | public function getDeliveryPhone(): ?string |
|
| 1345 | |||
| 1346 | /** |
||
| 1347 | * @param string $deliveryPhone |
||
| 1348 | * |
||
| 1349 | * @return Payment |
||
| 1350 | */ |
||
| 1351 | 6 | public function setDeliveryPhone(string $deliveryPhone): self |
|
| 1357 | |||
| 1358 | /** |
||
| 1359 | * @return string |
||
| 1360 | */ |
||
| 1361 | 3 | public function getDeliveryFax(): ?string |
|
| 1365 | |||
| 1366 | /** |
||
| 1367 | * @param string $deliveryFax |
||
| 1368 | * |
||
| 1369 | * @return Payment |
||
| 1370 | */ |
||
| 1371 | 6 | public function setDeliveryFax(string $deliveryFax): self |
|
| 1377 | |||
| 1378 | /** |
||
| 1379 | * @return string |
||
| 1380 | */ |
||
| 1381 | 3 | public function getDeliveryEmail(): ?string |
|
| 1385 | |||
| 1386 | /** |
||
| 1387 | * @param string $deliveryEmail |
||
| 1388 | * |
||
| 1389 | * @return Payment |
||
| 1390 | */ |
||
| 1391 | 6 | public function setDeliveryEmail(string $deliveryEmail): self |
|
| 1397 | |||
| 1398 | /** |
||
| 1399 | * @return string |
||
| 1400 | */ |
||
| 1401 | 3 | public function getDeliveryEan(): ?string |
|
| 1405 | |||
| 1406 | /** |
||
| 1407 | * @param string $deliveryEan |
||
| 1408 | * |
||
| 1409 | * @return Payment |
||
| 1410 | */ |
||
| 1411 | 6 | public function setDeliveryEan(string $deliveryEan): self |
|
| 1417 | |||
| 1418 | /** |
||
| 1419 | * @return string |
||
| 1420 | */ |
||
| 1421 | 3 | public function getShippingMethod(): ?string |
|
| 1425 | |||
| 1426 | /** |
||
| 1427 | * @param string $shippingMethod |
||
| 1428 | * |
||
| 1429 | * @return Payment |
||
| 1430 | */ |
||
| 1431 | 6 | public function setShippingMethod(string $shippingMethod): self |
|
| 1437 | |||
| 1438 | /** |
||
| 1439 | * @return int |
||
| 1440 | */ |
||
| 1441 | 3 | public function getShippingMethodId(): ?int |
|
| 1445 | |||
| 1446 | /** |
||
| 1447 | * @param int $shippingMethodId |
||
| 1448 | * @return Payment |
||
| 1449 | */ |
||
| 1450 | 6 | public function setShippingMethodId(int $shippingMethodId) : self |
|
| 1455 | |||
| 1456 | /** |
||
| 1457 | * @return Money |
||
| 1458 | */ |
||
| 1459 | 3 | public function getShippingFee(): ?Money |
|
| 1463 | |||
| 1464 | /** |
||
| 1465 | * @param Money $shippingFee |
||
| 1466 | * |
||
| 1467 | * @return Payment |
||
| 1468 | */ |
||
| 1469 | 3 | public function setShippingFee(Money $shippingFee): self |
|
| 1475 | |||
| 1476 | /** |
||
| 1477 | * @return string |
||
| 1478 | */ |
||
| 1479 | 3 | public function getPaymentMethod(): ?string |
|
| 1483 | |||
| 1484 | /** |
||
| 1485 | * @param string $paymentMethod |
||
| 1486 | * |
||
| 1487 | * @return Payment |
||
| 1488 | */ |
||
| 1489 | 6 | public function setPaymentMethod(string $paymentMethod): self |
|
| 1495 | |||
| 1496 | /** |
||
| 1497 | * @return int |
||
| 1498 | */ |
||
| 1499 | 3 | public function getPaymentMethodId(): ?int |
|
| 1503 | |||
| 1504 | /** |
||
| 1505 | * @param int $paymentMethodId |
||
| 1506 | * @return Payment |
||
| 1507 | */ |
||
| 1508 | 6 | public function setPaymentMethodId(int $paymentMethodId) : self |
|
| 1513 | |||
| 1514 | /** |
||
| 1515 | * @return Money |
||
| 1516 | */ |
||
| 1517 | 3 | public function getPaymentFee(): ?Money |
|
| 1521 | |||
| 1522 | /** |
||
| 1523 | * @param Money $paymentFee |
||
| 1524 | * |
||
| 1525 | * @return Payment |
||
| 1526 | */ |
||
| 1527 | 3 | public function setPaymentFee(Money $paymentFee): self |
|
| 1533 | |||
| 1534 | /** |
||
| 1535 | * @return string |
||
| 1536 | */ |
||
| 1537 | 3 | public function getLoadBalancerRealIp(): ?string |
|
| 1541 | |||
| 1542 | /** |
||
| 1543 | * @param string $loadBalancerRealIp |
||
| 1544 | * |
||
| 1545 | * @return Payment |
||
| 1546 | */ |
||
| 1547 | 6 | public function setLoadBalancerRealIp(string $loadBalancerRealIp): self |
|
| 1553 | |||
| 1554 | /** |
||
| 1555 | * @return string |
||
| 1556 | */ |
||
| 1557 | 3 | public function getReferrer(): ?string |
|
| 1561 | |||
| 1562 | /** |
||
| 1563 | * @param string $referrer |
||
| 1564 | * |
||
| 1565 | * @return Payment |
||
| 1566 | */ |
||
| 1567 | 6 | public function setReferrer(string $referrer): self |
|
| 1573 | |||
| 1574 | /** |
||
| 1575 | * @return PaymentLine[]|iterable |
||
| 1576 | */ |
||
| 1577 | 6 | public function getPaymentLines(): iterable |
|
| 1581 | |||
| 1582 | /** |
||
| 1583 | * @param PaymentLine[]|iterable $paymentLines |
||
| 1584 | * |
||
| 1585 | * @return Payment |
||
| 1586 | */ |
||
| 1587 | 3 | public function setPaymentLines(iterable $paymentLines): self |
|
| 1593 | |||
| 1594 | /** |
||
| 1595 | * @param PaymentLine $paymentLine |
||
| 1596 | * |
||
| 1597 | * @return Payment |
||
| 1598 | */ |
||
| 1599 | 3 | public function addPaymentLine(PaymentLine $paymentLine): self |
|
| 1606 | |||
| 1607 | /** |
||
| 1608 | * Returns the default currency for this payment |
||
| 1609 | * |
||
| 1610 | * @return null|string |
||
| 1611 | */ |
||
| 1612 | 6 | protected function getCurrency() : ?string |
|
| 1616 | |||
| 1617 | /** |
||
| 1618 | * A helper method for creating a Money object from a float based on the shared currency |
||
| 1619 | * |
||
| 1620 | * @param int $amount |
||
| 1621 | * @return Money|null |
||
| 1622 | */ |
||
| 1623 | 6 | protected function createMoney(int $amount = 0) : ?Money |
|
| 1631 | |||
| 1632 | /** |
||
| 1633 | * A helper method for creating a Money object from a float based on the shared currency |
||
| 1634 | * |
||
| 1635 | * The float can be any format, i.e. 1.50 or 1,50 |
||
| 1636 | * |
||
| 1637 | * @param string $amount |
||
| 1638 | * @return Money|null |
||
| 1639 | */ |
||
| 1640 | 6 | protected function createMoneyFromFloat(string $amount = '0.00') : ?Money |
|
| 1645 | } |
||
| 1646 |
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: