@param string $orderId
@param string $invoiceKey

@return \SkyHub\Api\Handler\Response\HandlerInterface
760862
public function invoice($orderId, $invoiceKey)
    {
        /** @var OrderHandler $handler */
        $handler = $this->requestHandler();
        return $handler->invoice($orderId, $invoiceKey);
    }
740688
public function delivery($orderId)
    {
        $transformer = new DeliveryTransformer(self::STATUS_COMPLETE);
        $body        = $transformer->output();

        /** @var \SkyHub\Api\Handler\Response\HandlerInterface $responseHandler */
        $responseHandler = $this->service()->post($this->baseUrlPath("$orderId/delivery"), $body);
        return $responseHandler;
    }
216289
private function generateInvoice($order)
    {
        // create and persist the invoice entity
        $invoice = $this->orderInvoiceManager->generateDebitInvoice($order);

        // write invoice contents (pdf) in a temporary file
        $temp_file = sys_get_temp_dir() . '/librinfo_invoice_' . $invoice->getNumber() . '.pdf';
        if (file_exists($temp_file)) {
            unlink($temp_file);
        }
        file_put_contents($temp_file, $invoice->getFile());

        return $temp_file;
    }
725077
public function invoiceAction(Request $request)
    {
        /** @var \Ekyna\Component\Sale\Order\OrderInterface $order */
        $order = $this->get('ekyna_order.order.repository')->findOneBy([
            'id' => $request->attributes->get('orderId', null), 
            'type' => OrderTypes::TYPE_ORDER
        ]);
        if (null === $order) {
            throw new NotFoundHttpException('Order not found.');
        }

        // Admin or owner security check
        if(!($this->get('security.authorization_checker')->isGranted('ROLE_ADMIN') || $order->getUser() == $this->getUser())) {
            throw new AccessDeniedHttpException('You are not allowed to view this resource.');
        }

        $response = new Response();
        $response->setLastModified($order->getUpdatedAt());
        if ($response->isNotModified($request)) {
            return $response;
        }

        $content = $this->renderView('EkynaOrderBundle:Document:invoice.html.twig', [
            'order' => $order,
        ]);

        $format = $request->attributes->get('_format', 'html');
        if ('html' === $format) {
            $response->setContent($content);
        } elseif ('pdf' === $format) {
            $response->setContent($this->get('knp_snappy.pdf')->getOutputFromHtml($content));
            $response->headers->add(['Content-Type' => 'application/pdf']);
        } else {
            throw new NotFoundHttpException('Unsupported format.');
        }

        if ($request->query->get('_download', false)) {
            $filename = sprintf('order-%s.%s', $order->getNumber(), $format);
            $contentDisposition = $response->headers->makeDisposition(
                ResponseHeaderBag::DISPOSITION_ATTACHMENT, $filename
            );
            $response->headers->set('Content-Disposition', $contentDisposition);
        }

        return $response;
    }
636856
public function sendOrder(Request $request, $order_id)
    {
        $elementIds = $request->request->get('elements', []);
        $acceptor = $this->getAuthenticatedUser();

        $basketElements = $this->doAcceptElements($order_id, $elementIds, $acceptor);

        $success = !empty($basketElements);

        if ('json' === $request->getRequestFormat()) {
            return $this->app->json([
                'success'  => $success,
                'msg'      => $success
                    ? $this->app->trans('Order has been sent')
                    : $this->app->trans('An error occured while sending, please retry  or contact an admin if problem persists'),
                'order_id' => $order_id,
            ]);
        }

        return $this->app->redirectPath('prod_orders', [
            'success' => (int) $success,
            'action'  => 'send',
        ]);
    }
221638
public function getInvoiceSourcesByReferenceRange($invoiceSourceType, $invoiceSourceReferenceFrom, $invoiceSourceReferenceTo)
    {
        if ($invoiceSourceType === Source::Order) {
            $query = sprintf(
                "select order_id from #__hikashop_order where order_number between '%s' and '%s'",
                $this->getDb()->escape($invoiceSourceReferenceFrom),
                $this->getDb()->escape($invoiceSourceReferenceTo)
            );
            return $this->getSourcesByQuery($invoiceSourceType, $query);
        }
        return array();
    }
253630
public AbucoinsOrder getAbucoinsOrder(String orderID) throws IOException {
    AbucoinsOrder order =
        abucoinsAuthenticated.getOrder(
            orderID,
            exchange.getExchangeSpecification().getApiKey(),
            signatureCreator,
            exchange.getExchangeSpecification().getPassword(),
            timestamp());
    if (order.getMessage() != null) throw new ExchangeException(order.getMessage());

    return order;
  }
393065
public function sortable(
        array $orderColumns = [],
        string $orderByKey = 'order_by',
        string $directionKey = 'direction'
    ): void {
        $model = $this->resolveQueryBuilderFromModel($this->model);
        $request = $this->app->make('request');

        $orderByValue = $request->input($orderByKey);
        $directionValue = $request->input($directionKey);

        $this->set('filter.order_by', ['key' => $orderByKey, 'value' => $orderByValue]);
        $this->set('filter.direction', ['key' => $directionKey, 'value' => $directionValue]);
        $this->set('filter.columns', $orderColumns);

        $this->model = $this->setupBasicQueryFilter($model, [
            'order_by' => $orderByValue,
            'direction' => $directionValue,
            'columns' => $orderColumns,
        ]);
    }
1155051
public function transformFromOrder(OrderInterface $order, InvoiceInterface $invoice)
    {
        $event = new OrderTransformEvent($order);
        $this->eventDispatcher->dispatch(TransformerEvents::PRE_ORDER_TO_INVOICE_TRANSFORM, $event);

        $invoice->setName($order->getBillingName());
        $invoice->setAddress1($order->getBillingAddress1());
        $invoice->setAddress2($order->getBillingAddress2());
        $invoice->setAddress3($order->getBillingAddress3());
        $invoice->setCity($order->getBillingCity());
        $invoice->setCountry($order->getBillingCountryCode());
        $invoice->setPostcode($order->getBillingPostcode());

        $invoice->setEmail($order->getBillingEmail());
        $invoice->setFax($order->getBillingFax());
        $invoice->setMobile($order->getBillingMobile());
        $invoice->setPhone($order->getBillingPhone());
        $invoice->setReference($order->getReference());

        $invoice->setCurrency($order->getCurrency());
        $invoice->setCustomer($order->getCustomer());
        $invoice->setTotalExcl($order->getTotalExcl());
        $invoice->setTotalInc($order->getTotalInc());

        $invoice->setPaymentMethod($order->getPaymentMethod());

        $invoice->setLocale($order->getLocale());

        foreach ($order->getOrderElements() as $orderElement) {
            $invoiceElement = $this->createInvoiceElementFromOrderElement($orderElement);
            $invoiceElement->setInvoice($invoice);
            $invoice->addInvoiceElement($invoiceElement);
        }

        if ($order->getDeliveryCost() > 0) {
            $this->addDelivery($invoice, $order);
        }

        $invoice->setStatus(InvoiceInterface::STATUS_OPEN);

        $event = new InvoiceTransformEvent($invoice);
        $this->eventDispatcher->dispatch(TransformerEvents::POST_ORDER_TO_INVOICE_TRANSFORM, $event);
    }
250685
public function createPaymentById($orderId)
    {
        $query = $this->getFactory()->createPaymentPayoneQuery();
        $query->findByFkSalesOrder($orderId);

        return $query;
    }
1063376
public function createPaymentByInvoiceTitleAndCustomerIdQuery($invoiceTitle, $customerId)
    {
        $query = $this->getFactory()->createPaymentPayoneQuery();
        $query->useSpySalesOrderQuery()
            ->filterByFkCustomer($customerId)
            ->endUse()
            ->useSpyPaymentPayoneDetailQuery()
            ->filterByInvoiceTitle($invoiceTitle)
            ->endUse()
            ->useSpyPaymentPayoneApiLogQuery()
            ->filterByStatus(PayoneApiConstants::RESPONSE_TYPE_APPROVED)
            ->endUse();

        return $query;
    }
402269
public function get($orderId, $fulfillmentId, $fulfillmentEventId)
    {
        $endpoint = '/admin/orders/'.$orderId.'/fulfillments/'.$fulfillmentId.'/events/'.$fulfillmentEventId.'.json';
        $response = $this->request($endpoint);
        return $this->createObject(FulfillmentEvent::class, $response['fulfillment_event']);
    }
281241
public OvhPaymentMethods order_orderId_paymentMethods_GET(Long orderId) throws IOException {
		String qPath = "/me/order/{orderId}/paymentMethods";
		StringBuilder sb = path(qPath, orderId);
		String resp = exec(qPath, "GET", sb.toString(), null);
		return convertTo(resp, OvhPaymentMethods.class);
	}
437856
public function setSubscriptionOrderId($orderId)
    {
        if (strlen($orderId) > 40) {
            throw new InvalidArgumentException("Subscription order id cannot be longer than 40 characters");
        }
        if (preg_match('/[^a-zA-Z0-9_-]/', $orderId)) {
            throw new InvalidArgumentException("Subscription order id cannot contain special characters");
        }
        $this->parameters['sub_orderid'] = $orderId;
    }
560067
public function findByInvoiceId($invoiceId)
    {
        $result = $this->connection()->get($this->getEndpoint() . '/find_by_invoice_id/' . urlencode($invoiceId));

        return $this->makeFromResponse($result);
    }
1009812
public function cancelOrder(int $orderId, bool $mapping = false)
    {
        $options = ['form_params' => ['id' => $orderId]];
        $response = $this->sendRequest(Api::POST, $this->getApiUrn(['order', 'delete']), $options);

        if ($mapping) {
            $response = $this->deserializeItem($response, Order::class);
        }

        return $response;
    }
1149839
protected function addDelivery(InvoiceInterface $invoice, OrderInterface $order)
    {
        /** @var InvoiceElementInterface $invoiceElement */
        $invoiceElement = $this->invoiceElementManager->create();

        $invoiceElement->setQuantity(1);
        $invoiceElement->setPrice($order->getDeliveryCost());
        $invoiceElement->setUnitPriceExcl($order->getDeliveryCost());
        $invoiceElement->setUnitPriceInc($order->getDeliveryCost());
        $invoiceElement->setTotal($order->getDeliveryCost());
        $invoiceElement->setVatRate(0);

        $invoiceElement->setDesignation($this->deliveryPool->getMethod($order->getDeliveryMethod())->getName());
        $invoiceElement->setDescription($this->deliveryPool->getMethod($order->getDeliveryMethod())->getName());

        $invoiceElement->setInvoice($invoice);
        $invoice->addInvoiceElement($invoiceElement);
    }