value map for one order.

@param TdbShopOrder                  $oOrder
@param bool                          $bCachingEnabled
@param IMapperCacheTriggerRestricted $oCacheTriggerManager

@return array
969315
private function getOrder(TdbShopOrder $oOrder, $bCachingEnabled, IMapperCacheTriggerRestricted $oCacheTriggerManager)
    {
        $aOrder = array();

        $oLocal = TCMSLocal::GetActive();

        $aOrder['sOrderDate'] = $oLocal->FormatDate($oOrder->fieldDatecreated, TCMSLocal::DATEFORMAT_SHOW_DATE);
        $aOrder['sOrdernumber'] = $oOrder->fieldOrdernumber;
        $aOrder['sSumGrandTotal'] = $oOrder->fieldValueTotalFormated;
        $aOrder['sShippingAddress'] = $this->getShippingAddress($oOrder, $bCachingEnabled, $oCacheTriggerManager);
        $aOrder['sDetailLink'] = $this->getDetailLink($oOrder);
        $orderCurrency = $oOrder->GetFieldPkgShopCurrency();
        if (null !== $orderCurrency) {
            $aOrder['currencyIso'] = $orderCurrency->fieldIso4217;
            $aOrder['currencySymbol'] = $orderCurrency->fieldSymbol;
        }
        $aOrder['bActive'] = false;

        return $aOrder;
    }
672637
public function recurPayment(
        $iSourceOrderNumber,
        $iAmount,
        $sCurrency,
        $sOrderDescription,
        $iOrderNumber = null,
        $bDepositFlag = null
    ) {
        $this->_requestData[self::COMMAND] = self::$COMMAND_RECUR_PAYMENT;

        $this->_setField(self::SOURCE_ORDER_NUMBER, $iSourceOrderNumber);
        $this->_setField(self::AMOUNT, $iAmount);
        $this->_setField(self::CURRENCY, strtoupper($sCurrency));

        $this->_setField(self::ORDER_DESCRIPTION, $sOrderDescription);

        if (!is_null($iOrderNumber)) {
            $this->_setField(self::ORDER_NUMBER, $iOrderNumber);
        }

        if (!is_null($bDepositFlag)) {
            $this->_setField(self::AUTO_DEPOSIT, $bDepositFlag ? self::$BOOL_TRUE : self::$BOOL_FALSE);
        }


        $this->_fingerprintOrder->setOrder(Array(
            self::CUSTOMER_ID,
            self::SHOP_ID,
            self::TOOLKIT_PASSWORD,
            self::SECRET,
            self::COMMAND,
            self::LANGUAGE,
            self::ORDER_NUMBER,
            self::SOURCE_ORDER_NUMBER,
            self::AUTO_DEPOSIT,
            self::ORDER_DESCRIPTION,
            self::AMOUNT,
            self::CURRENCY
        ));

        return new WirecardCEE_QPay_Response_Toolkit_RecurPayment($this->_send());
    }
547721
private function getImageDetails(TdbShopArticle $oArticle, $oImage, IMapperCacheTriggerRestricted $oCacheTriggerManager)
    {
        $oCacheTriggerManager->addTrigger('cms_media', $oImage->fieldCmsMediaId);

        $router = $this->getRouter();
        $quickShopLink = $router->generateWithPrefixes('shop_article_quickshop', array('identifier' => $oArticle->sqlData['cmsident']));
        $quickShopLink = $quickShopLink.'?imageid='.$oImage->id;

        $aImage = array(
            'sImageId' => $oImage->fieldCmsMediaId,
            'sImageTitle' => '',
            'sSelectImageURL' => $quickShopLink,
            'sLargeImageId' => $oImage->fieldCmsMediaId,
            'sLargeTitle' => '',
            'sLargeSelectImageURL' => $quickShopLink,
        );

        return $aImage;
    }
1073873
public function getBillableProducts($bIncludeUnconfirmedTransactions = true)
    {
        $aProductList = array();
        $oOrderItemList = $this->order->GetFieldShopOrderItemList();
        $oOrderItemList->GoToStart();
        while ($oOrderItem = $oOrderItemList->Next()) {
            $iBilled = $this->getProductAmountWithTransactionType(
                $oOrderItem->id,
                self::TRANSACTION_TYPE_PAYMENT,
                $bIncludeUnconfirmedTransactions
            );
            $iRemaining = round($oOrderItem->fieldOrderAmount - $iBilled);
            if ($iRemaining > 0) {
                $aProductList[$oOrderItem->id] = $iRemaining;
            }
        }
        $oOrderItemList->GoToStart();

        return $aProductList;
    }
981008
public static List<LimitOrder> createOrders(
      CurrencyPair currencyPair, Order.OrderType orderType, BitcoindeOrder[] orders) {

    List<LimitOrder> limitOrders = new ArrayList<>();
    for (BitcoindeOrder order : orders) {
      limitOrders.add(createOrder(currencyPair, order, orderType, null, null));
    }
    return limitOrders;
  }
513029
public function processOrderReference(oxOrder $oOrder, stdClass $oOrderReference)
    {
        $sOrderReferenceStatus = $oOrderReference
            ->OrderReferenceStatus
            ->State;

        //Do re-authorization if order was suspended and now it's opened
        if ($sOrderReferenceStatus === 'Open'
            && (string)$oOrder->getFieldData('oxtransstatus') === 'AMZ-Order-Suspended'
        ) {
            $this->authorize($oOrder);
        } else {
            $oOrder->assign(array('oxtransstatus' => 'AMZ-Order-'.$sOrderReferenceStatus));
            $oOrder->save();
        }
    }
527223
public function validateOrder($oBasket, $oUser)
    {
        // validating stock
        $iValidState = $this->validateStock($oBasket);

        if (!$iValidState) {
            // validating delivery
            $iValidState = $this->validateDelivery($oBasket);
        }

        if (!$iValidState) {
            // validating payment
            $iValidState = $this->validatePayment($oBasket);
        }

        if (!$iValidState) {
            //0003110 validating delivery address, it is not be changed during checkout process
            $iValidState = $this->validateDeliveryAddress($oUser);
        }

        if (!$iValidState) {
            // validating minimum price
            $iValidState = $this->validateBasket($oBasket);
        }

        return $iValidState;
    }
396130
public function ExecutePayment(TdbShopOrder &$oOrder, $sMessageConsumer = '')
    {
        $bPaymentOk = parent::ExecutePayment($oOrder);

        $aCommand = array('trefnum' => $this->sMontradaTransactionId, 'amount' => round($oOrder->fieldValueTotal * 100));
        $aAnswer = $this->ExecuteRequestCall('capture', $aCommand);
        if (array_key_exists('rc', $aAnswer) && '000' == $aAnswer['rc']) {
            $bPaymentOk = true;
            // add the response data to the order
            foreach ($aAnswer as $sKey => $sVal) {
                if (!array_key_exists($sKey, $this->aPaymentUserData)) {
                    $this->aPaymentUserData[$sKey] = $sVal;
                }
            }
            $this->SaveUserPaymentDataToOrder($oOrder->id);
            $oOrder->SetStatusPaid();
        } else {
            $bPaymentOk = false;
        }

        if (!$bPaymentOk) {
            // error!
            $sMsg = 'unbekannt';
            if (array_key_exists('rmsg', $aAnswer)) {
                $sMsg = $aAnswer['rmsg'];
            }
            $oMsgManager = TCMSMessageManager::GetInstance();
            $oMsgManager->AddMessage($sMessageConsumer, 'ERROR-ORDER-REQUEST-PAYMENT-ERROR', array('errorMsg' => $sMsg));
        }

        return $bPaymentOk;
    }
198203
public Map<LimitOrder, Boolean> cancelUpToThreeOrders(List<LimitOrder> limitOrders)
      throws IOException {
    Set<Long> ordersToCancel =
        limitOrders.stream().map(Order::getId).map(Long::parseLong).collect(Collectors.toSet());
    if (ordersToCancel.isEmpty() || ordersToCancel.size() > 3) {
      throw new UnsupportedOperationException(
          "Can only batch cancel 1 to 3 orders. " + ordersToCancel.size() + " orders provided.");
    }
    CurrencyPair currencyPair = limitOrders.get(0).getCurrencyPair();
    boolean valid =
        limitOrders.stream().allMatch(order -> order.getCurrencyPair().equals(currencyPair));
    if (!valid) {
      throw new UnsupportedOperationException(
          "Can only batch cancel orders with the same currency pair.");
    }

    OkCoinBatchTradeResult okCoinBatchTradeResult =
        cancelUpToThreeOrders(ordersToCancel, OkCoinAdapters.adaptSymbol(currencyPair));

    Map<String, Boolean> requestResults = new HashMap<>(ordersToCancel.size());
    if (okCoinBatchTradeResult.getSuccess() != null) {
      Arrays.stream(okCoinBatchTradeResult.getSuccess().split(BATCH_DELIMITER))
          .forEach(id -> requestResults.put(id, Boolean.TRUE));
    }
    if (okCoinBatchTradeResult.getError() != null) {
      Arrays.stream(okCoinBatchTradeResult.getError().split(BATCH_DELIMITER))
          .forEach(id -> requestResults.put(id, Boolean.FALSE));
    }
    Map<LimitOrder, Boolean> results = new HashMap<>(limitOrders.size());
    requestResults.forEach(
        (id, result) ->
            limitOrders.stream()
                .filter(order -> order.getId().equals(id))
                .findAny()
                .ifPresent(limitOrder -> results.put(limitOrder, requestResults.get(id))));
    return results;
  }
87808
public function ExecutePayment(TdbShopOrder &$oOrder, $sMessageConsumer = '')
    {
        $bPaymentOk = parent::ExecutePayment($oOrder);
        if ($bPaymentOk) {
            TdbShopPaymentHandler::SetExecutePaymentInterrupt(true);
            $bPaymentOk = $this->ExecuteIPaymentCall($oOrder);
        }

        return $bPaymentOk;
    }
843133
protected function getArticleList(TdbShopOrder $oOrder, IMapperCacheTriggerRestricted $oCacheTriggerManager, $bCachingEnabled)
    {
        $aArticleList = array();
        $oOrderItemList = &$oOrder->GetFieldShopOrderItemList();
        while ($oOrderItem = &$oOrderItemList->Next()) {
            if ($bCachingEnabled) {
                $oCacheTriggerManager->addTrigger($oOrderItem->table, $oOrderItem->id);
            }
            $aArticleList[] = $this->getArticle($oOrderItem, $oCacheTriggerManager, $bCachingEnabled);
        }

        return $aArticleList;
    }
32587
protected function getDataFromVoucher(TdbShopVoucherUse $oVoucherUse, TdbShopVoucher $oVoucher = null, IMapperCacheTriggerRestricted $oCacheTriggerManager, $bCachingEnabled)
    {
        $aVoucher = array(
            'sCode' => '',
            'sName' => '',
            'dValue' => $oVoucherUse->fieldValueUsed,
            'dValueInOrderCurrency' => $oVoucherUse->fieldValueUsedInOrderCurrency,
            'sValue' => TCMSLocal::GetActive()->FormatNumber($oVoucherUse->fieldValueUsed, 2),
            'sValueInOrderCurrency' => TCMSLocal::GetActive()->FormatNumber($oVoucherUse->fieldValueUsedInOrderCurrency, 2),
            'sRemoveFromBasketLink' => '#', );

        if (null !== $oVoucher) {
            $aVoucher['sCode'] = $oVoucher->fieldCode;
            $oVoucherSeries = &$oVoucher->GetFieldShopVoucherSeries();
            if (null !== $oVoucherSeries) {
                if ($bCachingEnabled) {
                    $oCacheTriggerManager->addTrigger($oVoucherSeries->table, $oVoucherSeries->id);
                }
                $aVoucher['sName'] = $oVoucherSeries->fieldName;
            }
        }

        return $aVoucher;
    }
918898
protected function getAddress(TdbShopOrder $oOrder, $iAddressType, IMapperCacheTriggerRestricted $oCacheTriggerManager, $bCachingEnabled)
    {
        $aAddress = array();

        if (self::ADDRESS_TYPE_BILLING === $iAddressType) {
            $oSalutation = $oOrder->GetFieldAdrBillingSalutation();
            if ($oSalutation && $bCachingEnabled) {
                $oCacheTriggerManager->addTrigger($oSalutation->table, $oSalutation->id);
            }
            $aAddress['sSalutation'] = (null !== $oSalutation) ? ($oSalutation->GetName()) : ('');

            $aAddress['sFirstName'] = $oOrder->fieldAdrBillingFirstname;
            $aAddress['sLastName'] = $oOrder->fieldAdrBillingLastname;
            $aAddress['sAdditionalInfo'] = $oOrder->fieldAdrBillingAdditionalInfo;
            $aAddress['sAddressStreet'] = $oOrder->fieldAdrBillingStreet;
            $aAddress['sAddressStreetNr'] = $oOrder->fieldAdrBillingStreetnr;
            $aAddress['sAddressZip'] = $oOrder->fieldAdrBillingPostalcode;
            $aAddress['sAddressCity'] = $oOrder->fieldAdrBillingCity;
            $aAddress['sAddressTelephone'] = $oOrder->fieldAdrBillingTelefon;
            $aAddress['sAddressFax'] = $oOrder->fieldAdrBillingFax;

            $oCountry = $oOrder->GetFieldAdrBillingCountry();
            if (null !== $oCountry) {
                if ($bCachingEnabled) {
                    $oCacheTriggerManager->addTrigger($oCountry->table, $oCountry->id);
                }
                $aAddress['sAddressCountry'] = (null !== $oCountry) ? ($oCountry->GetName()) : ('');
            }
        } elseif (self::ADDRESS_TYPE_SHIPPING === $iAddressType) {
            $oSalutation = $oOrder->GetFieldAdrShippingSalutation();
            if ($oSalutation && $bCachingEnabled) {
                $oCacheTriggerManager->addTrigger($oSalutation->table, $oSalutation->id);
            }
            $aAddress['sSalutation'] = (null !== $oSalutation) ? ($oSalutation->GetName()) : ('');

            $aAddress['sFirstName'] = $oOrder->fieldAdrShippingFirstname;
            $aAddress['sLastName'] = $oOrder->fieldAdrShippingLastname;
            $aAddress['sAdditionalInfo'] = $oOrder->fieldAdrShippingAdditionalInfo;
            $aAddress['sAddressStreet'] = $oOrder->fieldAdrShippingStreet;
            $aAddress['sAddressStreetNr'] = $oOrder->fieldAdrShippingStreetnr;
            $aAddress['sAddressZip'] = $oOrder->fieldAdrShippingPostalcode;
            $aAddress['sAddressCity'] = $oOrder->fieldAdrShippingCity;
            $aAddress['sAddressTelephone'] = $oOrder->fieldAdrShippingTelefon;
            $aAddress['sAddressFax'] = $oOrder->fieldAdrShippingFax;

            $oCountry = $oOrder->GetFieldAdrShippingCountry();
            if (null !== $oCountry) {
                if ($bCachingEnabled) {
                    $oCacheTriggerManager->addTrigger($oCountry->table, $oCountry->id);
                }
                $aAddress['sAddressCountry'] = (null !== $oCountry) ? ($oCountry->GetName()) : ('');
            }
        }

        return $aAddress;
    }
553382
protected function getArticle(
        TdbShopOrderStatusItem $oPosition,
        IMapperCacheTriggerRestricted $oCacheTriggerManager,
        $bCachingEnabled
    ) {
        $oOrderItem = $oPosition->GetFieldShopOrderItem();
        $aArticle = array();
        /** @var $oArticle TdbShopArticle */
        $oArticle = &$oOrderItem->GetFieldShopArticle();

        $aArticle['iAmount'] = number_format((float) $oOrderItem->fieldOrderAmount, 0, ',', '');
        $aArticle['iUsedAmount'] = number_format($oPosition->fieldAmount, 0, ',', '');
        $aArticle['sManufacturer'] = $oOrderItem->fieldShopManufacturerName;
        $aArticle['sArticleName'] = $oOrderItem->fieldName;
        $aArticle['sArticleVariantName'] = $oOrderItem->fieldNameVariantInfo;
        $aArticle['sPrice'] = $oOrderItem->fieldOrderPriceFormated;
        $aArticle['sPriceTotal'] = $oOrderItem->fieldOrderPriceTotalFormated;
        $aArticle['sUsedPriceTotal'] = $oOrderItem->fieldPrice * $oPosition->fieldAmount;

        if ($oArticle) {
            $aArticle['sImageId'] = $this->getArticleImageId($oArticle, $oCacheTriggerManager, $bCachingEnabled);
            $aArticle = $this->GetVariantInfo($oArticle, $aArticle, $oCacheTriggerManager, $bCachingEnabled);
            $aArticle['sArticleDetailURL'] = $oArticle->getLink(true);
            if ($bCachingEnabled) {
                $oCacheTriggerManager->addTrigger($oArticle->table, $oArticle->id);
            }
        }

        return $aArticle;
    }
672756
@Override
	public List<CommerceOrderNote> findByCommerceOrderId(long commerceOrderId) {
		return findByCommerceOrderId(commerceOrderId, QueryUtil.ALL_POS,
			QueryUtil.ALL_POS, null);
	}
277386
public function ExecutePayment(TdbShopOrder &$oOrder, $sMessageConsumer = '')
    {
        $bPaymentOk = parent::ExecutePayment($oOrder, $sMessageConsumer);

        $aParams = array();
        // payment preauthorization values
        if (isset($_SESSION['3ds_payment'])) {
            $aParams = $_SESSION['3ds_payment'];
            unset($_SESSION['3ds_payment']);
        }

        // execute preauthorization
        $aResponse = $this->PayOnePreauthorization($aParams, $oOrder);
        if ($aResponse['success']) {
            $bPaymentOk = true;
            // reset payOne session
            if (isset($_SESSION['PayOneResponse'])) {
                unset($_SESSION['PayOneResponse']);
            }
        } else {
            $bPaymentOk = false;
        }

        if (!$bPaymentOk) {
            $oMsgManager = TCMSMessageManager::GetInstance();
            $oMsgManager->AddMessage($sMessageConsumer, 'ERROR-ORDER-REQUEST-PAYMENT-ERROR', array('errorMsg' => $aResponse['errormessage']));
        }

        return $bPaymentOk;
    }
635945
public function processAuthorization(oxOrder $oOrder, stdClass $oAuthorizationDetails)
    {
        $oAuthorizationStatus = $oAuthorizationDetails->AuthorizationStatus;

        //Update Order with primary response info
        $oOrder->assign(array('oxtransstatus' => 'AMZ-Authorize-'.$oAuthorizationStatus->State));
        $oOrder->save();

        // Handle Declined response
        if ($oAuthorizationStatus->State === 'Declined'
            && $this->getConfig()->getConfigParam('sAmazonMode') === bestitAmazonPay4OxidClient::OPTIMIZED_FLOW
        ) {
            switch ($oAuthorizationStatus->ReasonCode) {
                case "InvalidPaymentMethod":
                    /** @var bestitAmazonPay4Oxid_oxEmail $oEmail */
                    $oEmail = $this->getObjectFactory()->createOxidObject('oxEmail');
                    $oEmail->sendAmazonInvalidPaymentEmail($oOrder);
                    break;
                case "AmazonRejected":
                    /** @var bestitAmazonPay4Oxid_oxEmail $oEmail */
                    $oEmail = $this->getObjectFactory()->createOxidObject('oxEmail');
                    $oEmail->sendAmazonRejectedPaymentEmail($oOrder);
                    $this->closeOrderReference($oOrder, array(), false);
                    break;
                default:
                    $this->closeOrderReference($oOrder, array(), false);
            }
        }

        //Authorize handling was selected Direct Capture after Authorize and Authorization status is Open
        if ($oAuthorizationStatus->State === 'Open'
            && $this->getConfig()->getConfigParam('sAmazonCapture') === 'DIRECT'
        ) {
            $this->capture($oOrder);
        }
    }