Skip to content

Commit c8fc6e1

Browse files
authored
Merge pull request #21 from iriks-it/master
Update PaymentInformationManagement.php
2 parents 7e70bd2 + 6122e96 commit c8fc6e1

File tree

1 file changed

+16
-12
lines changed

1 file changed

+16
-12
lines changed

Plugin/Magento/Checkout/Model/PaymentInformationManagement.php

Lines changed: 16 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,8 @@ class PaymentInformationManagement
2525
*/
2626
public function __construct(
2727
Data $helper
28-
) {
28+
)
29+
{
2930
$this->helper = $helper;
3031
}
3132

@@ -38,17 +39,20 @@ public function __construct(
3839
*/
3940
public function beforeSavePaymentInformation(
4041
\Magento\Checkout\Model\PaymentInformationManagement $subject,
41-
$cartId,
42-
PaymentInterface $paymentMethod,
43-
AddressInterface $address
44-
) {
45-
$extAttributes = $address->getExtensionAttributes();
46-
if (!empty($extAttributes)) {
47-
$this->helper->transportFieldsFromExtensionAttributesToObject(
48-
$extAttributes,
49-
$address,
50-
'extra_checkout_billing_address_fields'
51-
);
42+
$cartId,
43+
PaymentInterface $paymentMethod,
44+
AddressInterface $address = null
45+
)
46+
{
47+
if ($address) {
48+
$extAttributes = $address->getExtensionAttributes();
49+
if (!empty($extAttributes)) {
50+
$this->helper->transportFieldsFromExtensionAttributesToObject(
51+
$extAttributes,
52+
$address,
53+
'extra_checkout_billing_address_fields'
54+
);
55+
}
5256
}
5357
}
5458
}

0 commit comments

Comments
 (0)