public static function readinvoicepdf()
 {
     Komfortkasse_Order::getInvoicePdfPrepare();
     if (!Komfortkasse_Config::getConfig(Komfortkasse_Config::activate_export)) {
         return;
     }
     if (Komfortkasse::check() === false) {
         return;
     }
     $invoiceNumber = Komfortkasse_Config::getRequestParameter('o');
     $invoiceNumber = Komfortkasse::kkdecrypt($invoiceNumber);
     $orderNumber = Komfortkasse_Config::getRequestParameter('order_id');
     $orderNumber = Komfortkasse::kkdecrypt($orderNumber);
     return Komfortkasse_Order::getInvoicePdf($invoiceNumber, $orderNumber);
 }
 /**
  * Update order.
  *
  * @param string $refundIncrementId Increment ID of refund
  * @param string $status status
  * @param string $callbackid callback ID
  *
  * @return void
  */
 public static function updateRefund($refundIncrementId, $status, $callbackid)
 {
     $om = \Magento\Framework\App\ObjectManager::getInstance();
     $resource = $om->get('\\Magento\\Framework\\App\\ResourceConnection');
     $id = $resource->getConnection('default')->fetchOne('SELECT `entity_id` FROM `' . $resource->getTableName('sales_creditmemo') . "` WHERE `increment_id` = '" . $refundIncrementId . "'");
     $creditMemo = $om->create('\\Magento\\Sales\\Model\\Order\\Creditmemo')->load($id);
     $store_id = $creditMemo->getStoreId();
     $store_id_order = [];
     $store_id_order['store_id'] = $store_id;
     if (!Komfortkasse_Config::getConfig(Komfortkasse_Config::activate_update, $store_id_order)) {
         return;
     }
     if ($creditMemo->getTransactionId() == null) {
         $creditMemo->setTransactionId($callbackid);
     }
     $history = $creditMemo->addComment($status . ' [' . $callbackid . ']', false, false);
     $creditMemo->save();
 }