called from finish context
saves pdf as file
@param array $cart
@param array $orderDetails
516601
private function generateRightOfWithdrawalInformationAndForm($cart, $products)
    {
        $this->set('cart', $cart);
        $manufacturers = [];
        foreach ($products as $product) {
            $manufacturers[$product->manufacturer->id_manufacturer][] = $product;
        }
        $this->set('manufacturers', $manufacturers);
        $this->set('saveParam', 'I');
        $this->RequestHandler->renderAs($this, 'pdf');
        return $this->render('generateRightOfWithdrawalInformationAndForm');
    }
1270532
func GetOrderDetails(rw http.ResponseWriter, req *http.Request, params denco.Params) {
	// some actual stuff should happen in here
}
1341094
protected function updateCart(array $order, array $cart)
    {
        foreach ($cart['items'] as $item) {

            $data = array(
                'user_id' => $order['user_id'],
                'order_id' => $order['order_id']
            );

            $this->cart->update($item['cart_id'], $data);
        }
    }
801149
public function dispatchOrderLineOnCreatedEvent(
        OrderInterface $order,
        CartLineInterface $cartLine,
        OrderLineInterface $orderLine
    ) {
        $orderLineOnCreatedEvent = new OrderLineOnCreatedEvent(
            $order,
            $cartLine,
            $orderLine
        );

        $this->eventDispatcher->dispatch(
            ElcodiCartEvents::ORDERLINE_ONCREATED,
            $orderLineOnCreatedEvent
        );

        return $this;
    }
226050
public function saveOrder($orderData, $shop)
    {
        $endpoint = 'woocommerce/alternative_save_order';

        $params = array_merge($this->prepareParams(), ['order_data' => $orderData, 'shop' => $shop] );

        return $this->restClient->post( $endpoint, $params );
    }
544531
private function saveProductToDataBase($productId, $count, $attributesAndValues = null, $additionalProducts = null, $combinationId = null)
    {
        $order = $this->getIncompleteOrderFromDB();

        if (\Yii::$app->getModule('shop')->enableCombinations) {
            if (!empty($attributesAndValues)) {
                $combination = $this->getCombination($attributesAndValues, $productId);
                if (!empty($combination)) {
                    $orderProduct = $this->getOrderProduct($order->id, $productId, $combination->id);
                }
                else {
                    throw new Exception(\Yii::t('cart', 'Such attributes combination does not exist'));
                }
            }
            else if(!empty($combinationId)) {
                $orderProduct = $this->getOrderProduct($order->id, $productId, $combinationId);
            }
            else {
                $orderProduct = $this->getOrderProduct($order->id, $productId, null);
            }
        } else {
            $orderProduct = new OrderProduct();
            $orderProduct->product_id = $productId;
            $orderProduct->order_id = $order->id;
        }

        $orderProduct->count += $count;
        if ($orderProduct->validate()) {
            $orderProduct->save();

            if (!empty($additionalProducts)) {
                foreach ($additionalProducts as $additionalProduct) {
                    $orderProductAdditionalProduct = OrderProductAdditionalProduct::find()
                        ->where(['order_product_id' => $orderProduct->id, 'additional_product_id' => $additionalProduct['productId']])
                        ->one();
                    if (empty($orderProductAdditionalProduct)) {
                        $orderProductAdditionalProduct = new OrderProductAdditionalProduct();
                        $orderProductAdditionalProduct->order_product_id = $orderProduct->id;
                        $orderProductAdditionalProduct->additional_product_id = $additionalProduct['productId'];
                        $orderProductAdditionalProduct->number = $additionalProduct['number'];
                        if ($orderProductAdditionalProduct->validate()) $orderProductAdditionalProduct->save();
                    }
                    else {
                        $orderProductAdditionalProduct->number += $additionalProduct['number'];
                        if ($orderProductAdditionalProduct->validate()) $orderProductAdditionalProduct->save();

                    }
                }
            }
        } else die(var_dump($orderProduct->errors));
    }
254757
private function writeViewForImaging(InvoiceInterface $invoice, $storagePath)
    {
        $html = $this->htmlGenerator->generate($invoice);
        $storagePath = $storagePath ?: storage_path().'/framework';

        $this->files->put($path = $storagePath.'/'.$invoice->getId().'.pdf', $html);

        return $path;
    }
689300
function createShortDescription( $order, $maxDescLen )
    {
        //__DEBUG__
        $this->logger->writeTimedString("createShortDescription");
        //___end____

        $descText       = '';
        $productItems   = $order->productItems();

        foreach( $productItems as $item )
        {
            $descText .= $item['object_name'] . ',';
        }
        $descText   = rtrim( $descText, "," );

        $descLen    = strlen( $descText );
        if( ($maxDescLen > 0) && ($descLen > $maxDescLen) )
        {
            $descText = substr($descText, 0, $maxDescLen - 3) ;
            $descText .= '...';
        }

        //__DEBUG__
        $this->logger->writeTimedString("descText=$descText");
        //___end____

        return $descText;
    }
1066304
public function saveOrder(QuoteTransfer $quoteTransfer, CheckoutResponseTransfer $checkoutResponse)
    {
        Propel::getConnection()->beginTransaction();

        $paymentTransfer = $quoteTransfer->getPayment()->getPayone();
        $paymentTransfer->setFkSalesOrder($checkoutResponse->getSaveOrder()->getIdSalesOrder());
        $payment = $this->savePayment($paymentTransfer);

        $paymentDetailTransfer = $paymentTransfer->getPaymentDetail();
        $this->savePaymentDetail($payment, $paymentDetailTransfer);

        Propel::getConnection()->commit();
    }
772317
private function exportOrder(Order $order, int $foundOrder)
    {
        $logger = $this->getLogger();

        try {
            $eventDispatcher = $this->getEventDispatcher();
            $filesystem = $this->getFilesystem();

            $event = $eventDispatcher->dispatch(
                EventStore::PRE_ORDER_EXPORT,
                new PrepareOrderExportEvent($filesystem, $order)
            );

            $logger->debug(
                'Try to write the order export.',
                [
                    'file' => $file = $this->getOrderNameGenerator()->getOrderName($order),
                    'number' => $foundOrder
                ] + ($exportData = $event->getExportData())
            );

            $written = ($isStopped = $event->isPropagationStopped())
                ? false
                : $filesystem->put($file, $this->getView()->render($this->getFileTemplate(), $exportData));

            if (!$written) {
                $logger->error(
                    'Failed to write order export file.',
                    ['file' => $file, 'number' => $foundOrder, 'isStopped' => $isStopped] + $exportData
                );

                $eventDispatcher->dispatch(
                    EventStore::POST_ORDER_EXPORT_FAIL,
                    new FailedOrderExportEvent($filesystem, $order)
                );
            } else {
                $logger->info(
                    'Wrote order export file.',
                    ['file' => $file, 'number' => $foundOrder] + $exportData
                );

                $eventDispatcher->dispatch(
                    EventStore::POST_ORDER_EXPORT,
                    new FinishOrderExportEvent($file, $filesystem, $order)
                );
            }
        } catch (SkippableException $exc) {
            $logger->warning(
                'Exception while writing the order export file.',
                ['exception' => $exc, 'order' => $order]
            );

            $eventDispatcher->dispatch(
                EventStore::POST_ORDER_EXPORT_FAIL,
                (new FailedOrderExportEvent($filesystem, $order))->setException($exc)
            );
        }
    }
1365945
public OvhItemDetail order_orderId_details_orderDetailId_extension_GET(Long orderId, Long orderDetailId) throws IOException {
		String qPath = "/me/order/{orderId}/details/{orderDetailId}/extension";
		StringBuilder sb = path(qPath, orderId, orderDetailId);
		String resp = exec(qPath, "GET", sb.toString(), null);
		return convertTo(resp, OvhItemDetail.class);
	}
1251913
public function addOrderDetail(array $newOrderDetail)
    {
        $orderDetail = new OrderDetail();
        if ($newOrderDetail) {
            foreach ($newOrderDetail as $k => $v) {
                if (array_key_exists($k, $orderDetail) && (strlen($v))) {
                    $orderDetail->$k = $v;
                }
            }
        }
        $this->orderDetails[] = new \SoapVar($orderDetail, SOAP_ENC_OBJECT, self::SOAP_ORDERDETAIL, self::PAYLINE_NAMESPACE);
    }
923602
private function _addOrderTotalAndSellerInformationToOrder($orderTotal)
    {
        $response
            = $this->callStepAndCheckForException(
                'addOrderTotalAndSellerInformationToOrder',
                array($orderTotal, $this->currencyCode)
            );
        
        $this->printResponseToWebpage(
            "printSetOrderReferenceDetailsResponse", array($response)
        );
    }
1321439
public function getCaptureDetails($oOrder = null, $aRequestParameters = array())
    {
        $oData = $this->_callOrderRequest(
            'getCaptureDetails',
            $oOrder,
            $aRequestParameters,
            array('amazon_capture_id'),
            $blProcessable
        );

        //Update Order info
        if ($blProcessable === true && isset($oData->GetCaptureDetailsResult->CaptureDetails)) {
            $this->setCaptureState($oOrder, $oData->GetCaptureDetailsResult->CaptureDetails, true);
        }

        return $oData;
    }
603227
public function onPostDelete(OrderEvent $event)
    {
        $order = $event->getOrder();
        if ($order->getType() === OrderTypes::TYPE_CART) {
            $this->provider->clearCart();
        }
    }
708713
public function indexOrder($order_id)
    {
        $this->setOrder($order_id);
        $this->submitIndexOrder();
        $this->setTitleIndexOrder();
        $this->setBreadcrumbIndexOrder();

        $this->setData('order', $this->data_order);

        $this->setDataPanelLogsIndexOrder();
        $this->setDataPanelSummaryIndexOrder();
        $this->setDataPanelCommentIndexOrder();
        $this->setDataPanelCustomerIndexOrder();
        $this->setDataPanelComponentsIndexOrder();
        $this->setDataPanelPaymentAddressIndexOrder();
        $this->setDataPanelShippingAddressIndexOrder();

        $this->outputIndexOrder();
    }
64151
function _doCapt($oID, $amt = 0, $currency = 'USD') {
    global $db, $messageStack;
    $_POST['captamt'] = preg_replace('/[^0-9.%]/', '', $_POST['captamt']);

    //@TODO: Read current order status and determine best status to set this to
    $new_order_status = (int)MODULE_PAYMENT_LINKPOINT_API_ORDER_STATUS_ID;
    if ($new_order_status == 0) $new_order_status = 1;

    $proceedToCapture = true;
    $captureNote = strip_tags(zen_db_input($_POST['captnote']));
    if (isset($_POST['captconfirm']) && $_POST['captconfirm'] == 'on') {
    } else {
      $messageStack->add_session(MODULE_PAYMENT_LINKPOINT_API_TEXT_CAPTURE_CONFIRM_ERROR, 'error');
      $proceedToCapture = false;
    }

    $lp_trans_num = (isset($_POST['captauthid']) && $_POST['captauthid'] != '') ? strip_tags(zen_db_input($_POST['captauthid'])) : '';
    $sql = "select lp_trans_num, chargetotal from " . TABLE_LINKPOINT_API . " where order_id = " . (int)$oID . " and transaction_result = 'APPROVED' order by date_added";
    if ($lp_trans_num != '') $sql = "select lp_trans_num, chargetotal from " . TABLE_LINKPOINT_API . " where lp_trans_num = :trans_num: and transaction_result = 'APPROVED' order by date_added";
    $sql = $db->bindVars($sql, ':trans_num:', $lp_trans_num, 'string');
    $query = $db->Execute($sql);
    if ($query->RecordCount() < 1) {
      $messageStack->add_session(MODULE_PAYMENT_LINKPOINT_API_TEXT_NO_MATCHING_ORDER_FOUND, 'error');
      $proceedToCapture = false;
    }
    $captureAmt = (isset($_POST['captamt']) && $_POST['captamt'] != '') ? (float)strip_tags(zen_db_input($_POST['captamt'])) : $query->fields['chargetotal'];
    if (isset($_POST['btndocapture']) && $_POST['btndocapture'] == MODULE_PAYMENT_LINKPOINT_API_ENTRY_CAPTURE_BUTTON_TEXT) {
      if ($captureAmt == 0) {
        $messageStack->add_session(MODULE_PAYMENT_LINKPOINT_API_TEXT_INVALID_CAPTURE_AMOUNT, 'error');
        $proceedToCapture = false;
      }
    }
    /**
     * Submit capture request to Gateway
     */
    if ($proceedToCapture) {
      unset($myorder);
      $myorder["ordertype"] = 'POSTAUTH';
      $myorder["oid"] = $query->fields['lp_trans_num'];
      $myorder["chargetotal"] = number_format($captureAmt, 2, '.', '');
      $myorder["comments"]  = htmlentities($captureNote, ENT_QUOTES, 'UTF-8');

      $result = $this->_sendRequest($myorder);
      $response_alert = $result['r_approved'] . ' ' . $result['r_error'] . ($this->commError == '' ? '' : ' Communications Error - Please notify webmaster.');
      $failure = ($result["r_approved"] != "APPROVED");
      if ($failure) {
        $messageStack->add_session($response_alert, 'error');
      } else {
        // Success, so save the results
        $this->_updateOrderStatus($oID, $new_order_status, 'FUNDS COLLECTED. Auth Code: ' . substr($result['r_code'], 0, 6) . ' - ' . 'Trans ID: ' . $result['r_tdate'] . "\n" . ' Amount: ' . number_format($captureAmt, 2) . "\n" . $captureNote);
        $messageStack->add_session(sprintf(MODULE_PAYMENT_LINKPOINT_API_TEXT_CAPT_INITIATED, $captureAmt, $result['r_tdate'], substr($result['r_code'], 0, 6)), 'success');
        return true;
      }
    }
    return false;
  }