File tree Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Original file line number Diff line number Diff line change 2020
2121namespace ParadoxLabs \TokenBase \Observer ;
2222
23+ use Magento \Quote \Api \Data \PaymentExtensionInterface ;
24+ use Magento \Sales \Api \Data \OrderPaymentExtensionInterface ;
25+
2326/**
2427 * Custom data field conversion -- quote to order, etc, etc.
2528 */
@@ -74,11 +77,15 @@ public function execute(\Magento\Framework\Event\Observer $observer)
7477
7578 if (!$ payment ->getData ('tokenbase_id ' )) {
7679 $ paymentAttributes = $ payment ->getExtensionAttributes ();
77- if ($ paymentAttributes && $ paymentAttributes ->getTokenbaseId ()) {
80+ if ($ paymentAttributes instanceof PaymentExtensionInterface && $ paymentAttributes ->getTokenbaseId ()) {
7881 $ tokenbaseId = $ paymentAttributes ->getTokenbaseId ();
7982 $ payment ->setData ('tokenbase_id ' , $ tokenbaseId );
80- $ order ->getPayment ()->getExtensionAttributes ()->setTokenbaseId ($ tokenbaseId );
8183 $ order ->getPayment ()->setData ('tokenbase_id ' , $ tokenbaseId );
84+
85+ $ orderPaymentExtn = $ order ->getPayment ()->getExtensionAttributes ();
86+ if ($ orderPaymentExtn instanceof OrderPaymentExtensionInterface) {
87+ $ orderPaymentExtn ->setTokenbaseId ($ tokenbaseId );
88+ }
8289 }
8390 }
8491
You can’t perform that action at this time.
0 commit comments