| 123456789101112131415161718192021222324252627282930313233343536 |
- <?php
- /**
- * This file is part of the Klarna Order Management module
- *
- * (c) Klarna Bank AB (publ)
- *
- * For the full copyright and license information, please view the NOTICE
- * and LICENSE files that were distributed with this source code.
- */
- namespace Klarna\Ordermanagement\Observer;
- use Magento\Framework\Event\Observer;
- use Magento\Framework\Event\ObserverInterface;
- /**
- * Generate item list for payment capture
- */
- class PrepareCapture implements ObserverInterface
- {
- /**
- * @param Observer $observer
- * @return void
- */
- public function execute(\Magento\Framework\Event\Observer $observer)
- {
- $payment = $observer->getPayment();
- if (false === strpos($payment->getMethod(), 'klarna_')) {
- return;
- }
- $payment->setInvoice($observer->getInvoice());
- }
- }
|