You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When try to process an order via API during checkout, if no address is set an exception error occurred:
PHP message: PHP Fatal error: Uncaught TypeError: Argument 4 passed to Experius\ExtraCheckoutAddressFields\Plugin\Magento\Checkout\Model\PaymentInformationManagement::beforeSavePaymentInformation() must implement interface Magento\Quote\Api\Data\AddressInterface, null given ...
This happen because no default null value is set of fourth parameter, and also check if address is null.
The code method beforeSavePaymentInformation in Experius\ExtraCheckoutAddressFields\Plugin\Magento\Checkout\Model\PaymentInformationManagement should be modified as:
public function beforeSavePaymentInformation(
\Magento\Checkout\Model\PaymentInformationManagement $subject,
$cartId,
\Magento\Quote\Api\Data\PaymentInterface $paymentMethod,
\Magento\Quote\Api\Data\AddressInterface $address = null
) {
if (is_null($address))
return;
$extAttributes = $address->getExtensionAttributes();
if (!empty($extAttributes)) {
$this->helper->transportFieldsFromExtensionAttributesToObject(
$extAttributes,
$address,
'extra_checkout_billing_address_fields'
);
}
}
The text was updated successfully, but these errors were encountered:
When try to process an order via API during checkout, if no address is set an exception error occurred:
PHP message: PHP Fatal error: Uncaught TypeError: Argument 4 passed to Experius\ExtraCheckoutAddressFields\Plugin\Magento\Checkout\Model\PaymentInformationManagement::beforeSavePaymentInformation() must implement interface Magento\Quote\Api\Data\AddressInterface, null given ...
This happen because no default null value is set of fourth parameter, and also check if address is null.
The code method beforeSavePaymentInformation in Experius\ExtraCheckoutAddressFields\Plugin\Magento\Checkout\Model\PaymentInformationManagement should be modified as:
The text was updated successfully, but these errors were encountered: