Retrieves Plan and Pricing for current order creation
191402
def get_all_context(self):
        
        self.plan_pricing = get_object_or_404(PlanPricing.objects.all().select_related('plan', 'pricing'),
                                              Q(pk=self.kwargs['pk']) & Q(plan__available=True) & (
                                                  Q(plan__customized=self.request.user) | Q(
                                                      plan__customized__isnull=True)))


        # User is not allowed to create new order for Plan when he has different Plan
        # He should use Plan Change View for this kind of action
        if not self.request.user.userplan.is_expired() and self.request.user.userplan.plan != self.plan_pricing.plan:
            raise Http404

        self.plan = self.plan_pricing.plan
        self.pricing = self.plan_pricing.pricing
1130581
def query_order(self, status=None, begintime=None, endtime=None):
        
        return self._post(
            'merchant/order/getbyfilter',
            data={
                'status': status,
                'begintime': begintime,
                'endtime': endtime
            }
        )
308989
def create_order(self, order_deets):
        """"""
        request = self._post('transactions/orders', order_deets)
        return self.responder(request)
503935
def pricing width, height, pcb_layers, quantity = nil
      post_request "pricing", {width_in_mils: width, height_in_mils: height, pcb_layers: pcb_layers, quantity: quantity}
    end
476091
def _get_price(self, package):
        """"""

        for price in package['prices']:
            if not price.get('locationGroupId'):
                return price['id']

        raise SoftLayer.SoftLayerError("Could not find valid price")
740762
def get_orders(self, **params):
        """"""
        response = self._get('v2', 'orders', params=params)
        return self._make_api_object(response, Order)
4127
def prices(self):
        
        # if accessing and stale - update first
        if self._needupdate or self.now != self.parent.now:
            self.update(self.root.now)
        return self._prices.loc[:self.now]
200760
function selection() {
    global $order;

    for ($i=1; $i<13; $i++) {
      $expires_month[] = array('id' => sprintf('%02d', $i), 'text' => strftime('%B - (%m)',mktime(0,0,0,$i,1,2000)));
    }

    $today = getdate();
    for ($i=$today['year']; $i < $today['year']+15; $i++) {
      $expires_year[] = array('id' => strftime('%y',mktime(0,0,0,1,1,$i)), 'text' => strftime('%Y',mktime(0,0,0,1,1,$i)));
    }

    $onFocus = ' onfocus="methodSelect(\'pmt-' . $this->code . '\')"';

    $selection = array('id' => $this->code,
                       'module' => $this->title,
                       'fields' => array(array('title' => MODULE_PAYMENT_LINKPOINT_API_TEXT_CREDIT_CARD_OWNER,
                                               'field' => zen_draw_input_field('linkpoint_api_cc_owner', $order->billing['firstname'] . ' ' . $order->billing['lastname'], 'id="'.$this->code.'-cc-owner"'. $onFocus . ' autocomplete="off"'),
                                                 'tag' => $this->code.'-cc-owner'),
                                         array('title' => MODULE_PAYMENT_LINKPOINT_API_TEXT_CREDIT_CARD_NUMBER,
                                               'field' => zen_draw_input_field('linkpoint_api_cc_number', $ccnum, 'id="'.$this->code.'-cc-number"' . $onFocus . ' autocomplete="off"'),
                                                 'tag' => $this->code.'-cc-number'),
                                         array('title' => MODULE_PAYMENT_LINKPOINT_API_TEXT_CREDIT_CARD_EXPIRES,
                                               'field' => zen_draw_pull_down_menu('linkpoint_api_cc_expires_month', $expires_month, strftime('%m'), 'id="'.$this->code.'-cc-expires-month"' . $onFocus) . '&nbsp;' . zen_draw_pull_down_menu('linkpoint_api_cc_expires_year', $expires_year, '', 'id="'.$this->code.'-cc-expires-year"' . $onFocus),
                                                 'tag' => $this->code.'-cc-expires-month'),
                                         array('title' => MODULE_PAYMENT_LINKPOINT_API_TEXT_CVV,
                                               'field' => zen_draw_input_field('linkpoint_api_cc_cvv', '', 'size="4" maxlength="4"'. ' id="'.$this->code.'-cc-cvv"' . $onFocus . ' autocomplete="off"') . ' ' . '<a href="javascript:popupWindow(\'' . zen_href_link(FILENAME_POPUP_CVV_HELP) . '\')">' . MODULE_PAYMENT_LINKPOINT_API_TEXT_POPUP_CVV_LINK . '</a>',
                                                 'tag' => $this->code.'-cc-cvv')));

    return $selection;
  }
811268
def get_last_available_price(self) -> PriceModel:
        
        price_db = PriceDbApplication()
        symbol = SecuritySymbol(self.security.namespace, self.security.mnemonic)
        result = price_db.get_latest_price(symbol)
        return result
664983
def pricing(self):
        
        if self._pricing is None:
            from twilio.rest.pricing import Pricing
            self._pricing = Pricing(self)
        return self._pricing
1206538
def placeOrder(self, contract, order, orderId=None, account=None):
        

        # get latest order id before submitting an order
        self.requestOrderIds()

        # continue...
        useOrderId = self.orderId if orderId == None else orderId
        if account:
            order.m_account = account
        self.ibConn.placeOrder(useOrderId, contract, order)

        account_key = order.m_account
        self.orders[useOrderId] = {
            "id":       useOrderId,
            "symbol":   self.contractString(contract),
            "contract": contract,
            "status":   "SENT",
            "reason":   None,
            "avgFillPrice": 0.,
            "parentId": 0,
            "time": datetime.fromtimestamp(int(self.time)),
            "account": None
        }
        if hasattr(order, "m_account"):
            self.orders[useOrderId]["account"] = order.m_account

        # return order id
        return useOrderId
1193142
def create(self, price_estimate):
        
        kwargs = {}
        try:
            previous_price_estimate = price_estimate.get_previous()
        except ObjectDoesNotExist:
            pass
        else:
            configuration = previous_price_estimate.consumption_details.configuration
            kwargs['configuration'] = configuration
        month_start = core_utils.month_start(datetime.date(price_estimate.year, price_estimate.month, 1))
        kwargs['last_update_time'] = month_start
        return super(ConsumptionDetailsQuerySet, self).create(price_estimate=price_estimate, **kwargs)
103613
def createPlan(self, plan, thread_id=None):
        
        thread_id, thread_type = self._getThread(thread_id, None)

        data = {
            "event_type": "EVENT",
            "event_time": plan.time,
            "title": plan.title,
            "thread_id": thread_id,
            "location_id": plan.location_id or "",
            "location_name": plan.location or "",
            "acontext": ACONTEXT,
        }
        j = self._post(self.req_url.PLAN_CREATE, data, fix_request=True, as_json=True)
384465
def get_orderbook(self):
        
        if self in self.parent.books.keys():
            return self.parent.books[self]

        return {
            "bid": [0], "bidsize": [0],
            "ask": [0], "asksize": [0]
        }
175896
def get_shipping_costs(params)
      raise ArgumentError unless params[:ItemID]
      response = get_json_response(build_request_url('GetShippingCosts', params))
      return response
    end
594533
def list_fees(location_id, opts = {})
      data, _status_code, _headers = list_fees_with_http_info(location_id, opts)
      return data
    end
335974
def _prepare_orders(self, orders):
        

        for detail in PAYU_ORDER_DETAILS:
            if not any([detail in order for order in orders]):
                for order in orders:
                    order[detail] = PAYU_ORDER_DETAILS_DEFAULTS.get(detail, None)

        return orders