http://developer.ebay.com/DevZone/shopping/docs/CallRef/GetShippingCosts.html
175896
def get_shipping_costs(params)
      raise ArgumentError unless params[:ItemID]
      response = get_json_response(build_request_url('GetShippingCosts', params))
      return response
    end
1133986
def get_imports(self, option):
        
        if option:
            if len(option) == 1 and option[0].isupper() and len(option[0]) > 3:
                return getattr(settings, option[0])
            else:
                codes = [e for e in option if e.isupper() and len(e) == 3]
                if len(codes) != len(option):
                    raise ImproperlyConfigured("Invalid currency codes found: %s" % codes)
                return codes
        for attr in ('CURRENCIES', 'SHOP_CURRENCIES'):
            try:
                return getattr(settings, attr)
            except AttributeError:
                continue
        return option
1314971
def get_item_prices(self, package_id):
        
        mask = 'mask[pricingLocationGroup[locations]]'

        prices = self.package_svc.getItemPrices(id=package_id, mask=mask)
        return prices
262393
def on_recv_rsp(self, rsp_pb):
        """"""
        ret_code, ret_data = UpdateDealPush.unpack_rsp(rsp_pb)

        if ret_code != RET_OK:
            return ret_code, ret_data
        else:
            deal_dict = ret_data
            col_list = ['trd_env', 'code', 'stock_name', 'deal_id', 'order_id',
                        'qty', 'price', 'trd_side', 'create_time', 'counter_broker_id',
                        'counter_broker_name', 'trd_market',
                        ]

            trade_frame_table = pd.DataFrame([deal_dict], columns=col_list)
            return RET_OK, trade_frame_table
659177
def _get_os_price_id(items, os, location):
    """"""

    for item in items:
        if any([utils.lookup(item,
                             'itemCategory',
                             'categoryCode') != 'os',
                utils.lookup(item,
                             'softwareDescription',
                             'referenceCode') != os]):
            continue

        for price in item['prices']:
            if not _matches_location(price, location):
                continue

            return price['id']

    raise SoftLayer.SoftLayerError("Could not find valid price for os: '%s'" %
                                   os)
683222
def getPrice(self):
        
        analysis_request = self.aq_parent
        client = analysis_request.aq_parent
        if client.getBulkDiscount():
            price = self.getBulkPrice()
        else:
            price = self.getField('Price').get(self)
        return price
629493
def to_array(self):
        
        array = super(ShippingOption, self).to_array()
        array['id'] = u(self.id)  # py2: type unicode, py3: type str

        array['title'] = u(self.title)  # py2: type unicode, py3: type str

        array['prices'] = self._as_array(self.prices)  # type list of LabeledPrice

        return array
400943
def answerShippingQuery(self, shipping_query_id, ok,
                            shipping_options=None,
                            error_message=None):
        
        p = _strip(locals())
        return self._api_request('answerShippingQuery', _rectify(p))
1242519
@Override
	public List<CommerceShippingMethod> findAll() {
		return findAll(QueryUtil.ALL_POS, QueryUtil.ALL_POS, null);
	}
586835
def ebay_call(call, arguments = {})
      raise "#{self} has no eBay token" unless ebay_token
      Ebayr.call(call, arguments.merge(:auth_token => ebay_token))
    end
817355
private function prepareShipping()
    {
        $shipping = array();
        if(!empty($this->_detailsTransactionByCode->getShipping())){
            $shipping = array(
                'addres' => array(
                    'street'    => $this->_detailsTransactionByCode->getShipping()->getAddress()->getStreet(),
                    'number'    => $this->_detailsTransactionByCode->getShipping()->getAddress()->getNumber(),
                    'complement' => $this->_detailsTransactionByCode->getShipping()->getAddress()->getComplement(),
                    'district'  => $this->_detailsTransactionByCode->getShipping()->getAddress()->getDistrict(),
                    'postalCode' => $this->_detailsTransactionByCode->getShipping()->getAddress()->getPostalCode(),
                    'city'      => $this->_detailsTransactionByCode->getShipping()->getAddress()->getCity(),
                    'state'     => $this->_detailsTransactionByCode->getShipping()->getAddress()->getState(),
                    'country'   => $this->_detailsTransactionByCode->getShipping()->getAddress()->getCountry()
                ),
                'type' => $this->_detailsTransactionByCode->getShipping()->getType()->getType(),
                'cost' => $this->_detailsTransactionByCode->getShipping()->getCost()->getCost()
            );
        }
        return $shipping;
    }
1198392
def get_packages(session):
    """"""
    resp = session.get(DELIVERIES_URL, params=_get_params(session.auth.locale))
    parsed = BeautifulSoup(resp.text, HTML_PARSER)
    token_elem = parsed.find(TOKEN_FIND_TAG, TOKEN_FIND_ATTR)
    tid_elem = parsed.find(TID_FIND_TAG, TID_FIND_ATTR)
    if not token_elem or not tid_elem:
        raise UPSError('failed to find token or tid')
    token = token_elem.get(VALUE_ATTR)
    tid = tid_elem.get(VALUE_ATTR)
    resp = session.post(SERVICE_URL, {
        'token': token,
        'uid': session.auth.username,
        'callType': 'allShipments',
        'tid': tid,
        'loc': session.auth.locale
    })
    try:
        packages = []
        data = json.loads(resp.text[UPS_JSON_PREAMBLE_SIZE:])
        shipments = data['shipmentContainer']['inboundShipments'] + \
            data['shipmentContainer']['historyShipments']
        for shipment in shipments:
            from_location = '{}, {}, {}'.format(shipment['sfc'],
                                                shipment['sfs'],
                                                shipment['sfcn'])
            estimated_date = _parsed_date(shipment['sddfd'])
            actual_date = _parsed_date(shipment['dd'])
            packages.append({
                'tracking_number': shipment['tn'],
                'status': shipment['sts'],
                'from': shipment['sfn'],
                'from_location': from_location,
                'estimated_delivery_date': estimated_date,
                'estimated_delivery_timeframe': shipment['sdtfd'],
                'delivery_date': actual_date
            })
        return packages
    except JSONDecodeError:
        raise UPSError('failed to parse json')
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;
    }
394084
def get_billable_items(self):
        
        items = []
        for obj in self.context.getBillableItems():
            if self.is_profile(obj):
                items.append({
                    "obj": obj,
                    "title": obj.Title(),
                    "vat": obj.getAnalysisProfileVAT(),
                    "price": self.format_price(obj.getAnalysisProfilePrice()),
                })
            if self.is_analysis(obj):
                items.append({
                    "obj": obj,
                    "title": obj.Title(),
                    "vat": obj.getVAT(),
                    "price": self.format_price(obj.getPrice()),
                })
        return items
1213338
def getBasePrice(self,**kwargs):
        '''
        
        '''
        payAtDoor = kwargs.get('payAtDoor', False)
        dropIns = kwargs.get('dropIns', 0)

        if dropIns:
            return dropIns * self.dropinPrice
        if payAtDoor:
            return self.doorPrice
        return self.onlinePrice
219279
def get(self, session, fields=[], **kwargs):
        ''''''
        request = TOPRequest('taobao.items.get')
        if not fields:
            item = Item()
            fields = item.fields
        request['fields'] = fields
        for k, v in kwargs.iteritems():
            if k not in ('q', 'nicks', 'cid', 'props', 'product_id', 'page_no', 'order_by', 'ww_status', 'post_free', 'location_state', 'location_city', 'is_3D', 'start_score', 'end_score', 'start_volume', 'end_volume', 'one_station', 'is_cod', 'is_mall', 'is_prepay', 'genuine_security', 'stuff_status', 'start_price', 'end_price', 'page_size', 'promoted_service', 'is_xinpin') and v==None: continue
            if k == 'location_state': k = 'location.state'
            if k == 'location_city': k = 'location.city'
            request[k] = v
        
        self.create(self.execute(request, session))
        return self.items
1090366
function _GetTransactionDetails($oID) {
    if ($oID == '' || $oID < 1) return FALSE;
    global $db, $messageStack, $doPayPal;
    $doPayPal = $this->paypal_init();
    // look up history on this order from PayPal table
    $sql = "select * from " . TABLE_PAYPAL . " where order_id = :orderID order by last_modified DESC, date_added DESC, parent_txn_id DESC, paypal_ipn_id DESC LIMIT 2";
    $sql = $db->bindVars($sql, ':orderID', $oID, 'integer');
    $zc_ppHist = $db->Execute($sql);
    if ($zc_ppHist->RecordCount() == 0) return false;
    $txnID = $zc_ppHist->fields['txn_id'];
    if ($txnID == '' || $txnID === 0) return FALSE;
    /**
     * Read data from PayPal
     */
    $response = $doPayPal->GetTransactionDetails($txnID);
    if (isset($response['RESULT']) && $response['RESULT'] == '7' && $zc_ppHist->RecordCount() > 1) {
      $sql = "select * from " . TABLE_PAYPAL . " where order_id = :orderID and txn_id != :condition: order by last_modified ASC, date_added ASC, paypal_ipn_id ASC LIMIT 1";
      $sql = $db->bindVars($sql, ':orderID', $oID, 'integer');
      $sql = $db->bindVars($sql, ':condition:', $zc_ppHist->fields['txn_id'], 'integer');
      $zc_ppHist = $db->Execute($sql);
      if ($zc_ppHist->RecordCount() == 0) return false;
      $txnID = $zc_ppHist->fields['txn_id'];
      if ($txnID == '' || $txnID === 0) return FALSE;
      $response = $doPayPal->GetTransactionDetails($txnID);
    }

    $error = $this->_errorHandler($response, 'GetTransactionDetails', 10007);
    if ($error === true) {
      return false;
    } else {
      return $response;
    }
  }