File tree Expand file tree Collapse file tree 1 file changed +16
-12
lines changed
Plugin/Magento/Checkout/Model Expand file tree Collapse file tree 1 file changed +16
-12
lines changed Original file line number Diff line number Diff 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}
You can’t perform that action at this time.
0 commit comments