通过插件无法在magento 2中保存自定义付款字段数据,
我正在尝试通过插件保存我的自定义字段数据,但是它不起作用。 插件类 namespace Vendor\Module\Model\Checkout; class PaymentInformationManagementPlugin { protected $paymentMethodManagement; public function __construct( \Magento\Quote\Model\QuoteFactory $quote, \Magento\Quote\Api\PaymentMethodManagementInterface $paymentMethodManagement ) { $this->paymentMethodManagement = $paymentMethodManagement; $this->quoteManagement = $quoteManagement; } public function beforeSavePaymentInformation( \Magento\Checkout\Model\PaymentInformationManagement $subject, $cartId, \Magento\Quote\Api\Data\PaymentInterface $paymentInformation ) { //$paymentInformation->getData('extension_attributes'); $extenstinAttributes = $paymentInformation->getExtensionAttributes(); $taxCode = $extenstinAttributes->getTaxCode(); $paymentInformation->setExtensionAttributes($taxCode); $this->paymentMethodManagement->set($cartId, $paymentInformation); return true; // var_dump($taxCode);exit; // …