0 - hidden input of sku
 1 - checkbox itemOffer
 2 - actions
 3 - status
 4 - sku
 5 - asin
 6 - product name
 7 - date created
 8 - qty
 9 - your price
 10 - condition
 11 - low price
 12 - buy-box price
 13 - fulfilled by
10960
def listing_row_to_object(row)
        l = Listing.new
        row.css('td').each_with_index do |td, i|

          txt = td.text.strip # yes, slightly slower to do this here, but I type less.

          case i
          when 4
            l.sku = txt
          when 5
            l.asin = txt
          when 6
            l.product_name = txt
          when 7
            l.created_at = parse_amazon_time(txt)
          when 8
            l.quantity = (inputs = td.css('input')).any? ? inputs.first['value'].to_i : txt.to_i
          when 10
            l.price = get_price(td)
          when 11
            l.condition = txt
          when 12
            l.low_price = get_low_price(td)
          when 3
            l.status = txt
          end
        end
        l
      end
172956
public function isSuccessful()
    {
        # Validate the Hash
        $hashSecretWord = $this->data['secretWord']; # Input your secret word
        $hashSid = $this->data['accountNumber']; #Input your seller ID (2Checkout account number)
        $hashOrder = $this->data['sale_id'];
        $hashInvoice = $this->data['invoice_id'];
        $StringToHash = strtoupper(md5($hashOrder.$hashSid.$hashInvoice.$hashSecretWord));

        return $StringToHash == $this->data['md5_hash'];
    }
432357
def bought_get(self, session, fields=[], **kwargs):
        ''''''
        request = TOPRequest('taobao.trades.bought.get')
        if not fields:
            trade = Trade()
            fields = trade.fields
        request['fields'] = fields
        for k, v in kwargs.iteritems():
            if k not in ('start_created','end_created','status','seller_nick','type','page_no','page_size','rate_status') or v==None: continue
            request[k] = v
        self.create(self.execute(request, session))
        return self.trades
52618
def build_checkout_params(self, **kwargs):
        
        params = kwargs or {}
        if self.sender:
            params['senderName'] = self.sender.get('name')
            params['senderAreaCode'] = self.sender.get('area_code')
            params['senderPhone'] = self.sender.get('phone')
            params['senderEmail'] = is_valid_email(self.sender.get('email'))
            params['senderCPF'] = is_valid_cpf(self.sender.get('cpf'))
            params['senderCNPJ'] = is_valid_cnpj(self.sender.get('cnpj'))
            params['senderBornDate'] = self.sender.get('born_date')
            params['senderHash'] = self.sender.get('hash')

        if self.config.USE_SHIPPING:
            if self.shipping:
                params['shippingType'] = self.shipping.get('type')
                params['shippingAddressStreet'] = self.shipping.get('street')
                params['shippingAddressNumber'] = self.shipping.get('number')
                params['shippingAddressComplement'] = self.shipping.get(
                    'complement')
                params['shippingAddressDistrict'] = self.shipping.get(
                    'district')
                params['shippingAddressPostalCode'] = self.shipping.get(
                    'postal_code')
                params['shippingAddressCity'] = self.shipping.get('city')
                params['shippingAddressState'] = self.shipping.get('state')
                params['shippingAddressCountry'] = self.shipping.get('country',
                                                                     'BRA')
                if self.shipping.get('cost'):
                    params['shippingCost'] = self.shipping.get('cost')
        else:
            params['shippingAddressRequired'] = 'false'

        if self.extra_amount:
            params['extraAmount'] = self.extra_amount

        params['reference'] = self.reference
        params['receiverEmail'] = self.data['email']

        if self.redirect_url:
            params['redirectURL'] = self.redirect_url

        if self.notification_url:
            params['notificationURL'] = self.notification_url

        if self.abandon_url:
            params['abandonURL'] = self.abandon_url

        for i, item in enumerate(self.items, 1):
            params['itemId%s' % i] = item.get('id')
            params['itemDescription%s' % i] = item.get('description')
            params['itemAmount%s' % i] = item.get('amount')
            params['itemQuantity%s' % i] = item.get('quantity')
            params['itemWeight%s' % i] = item.get('weight')
            params['itemShippingCost%s' % i] = item.get('shipping_cost')

        if self.payment:

            params['paymentMethod'] = self.payment.get('method')
            params['paymentMode'] = self.payment.get('mode')

        if self.credit_card:
            params['billingAddressCountry'] = 'BRA'

            credit_card_keys_map = [
                ('creditCardToken', 'credit_card_token'),
                ('installmentQuantity', 'installment_quantity'),
                ('installmentValue', 'installment_value'),
                ('noInterestInstallmentQuantity',
                 'no_interest_installment_quantity'),
                ('creditCardHolderName', 'card_holder_name'),
                ('creditCardHolderCPF', 'card_holder_cpf'),
                ('creditCardHolderBirthDate', 'card_holder_birth_date'),
                ('creditCardHolderAreaCode', 'card_holder_area_code'),
                ('creditCardHolderPhone', 'card_holder_phone'),
                ('billingAddressStreet', 'billing_address_street'),
                ('billingAddressNumber', 'billing_address_number'),
                ('billingAddressComplement', 'billing_address_complement'),
                ('billingAddressDistrict', 'billing_address_district'),
                ('billingAddressPostalCode', 'billing_address_postal_code'),
                ('billingAddressCity', 'billing_address_city'),
                ('billingAddressState', 'billing_address_state'),
            ]

            for key_to_set, key_to_get in credit_card_keys_map:
                params[key_to_set] = self.credit_card.get(key_to_get)

        if self.pre_approval:

            params['preApprovalCharge'] = self.pre_approval.get('charge')
            params['preApprovalName'] = self.pre_approval.get('name')
            params['preApprovalDetails'] = self.pre_approval.get('details')
            params['preApprovalAmountPerPayment'] = self.pre_approval.get(
                'amount_per_payment')
            params['preApprovalMaxAmountPerPayment'] = self.pre_approval.get(
                'max_amount_per_payment')
            params['preApprovalPeriod'] = self.pre_approval.get('period')
            params['preApprovalMaxPaymentsPerPeriod'] = self.pre_approval.get(
                'max_payments_per_period')
            params['preApprovalMaxAmountPerPeriod'] = self.pre_approval.get(
                'max_amount_per_period')
            params['preApprovalInitialDate'] = self.pre_approval.get(
                'initial_date')
            params['preApprovalFinalDate'] = self.pre_approval.get(
                'final_date')
            params['preApprovalMaxTotalAmount'] = self.pre_approval.get(
                'max_total_amount')

        self.data.update(params)
        self.clean_none_params()
1274819
def is_hidden_container(self, key, val):
        

        if key in ("layers", "classes", "styles", "symbols", "labels",
                   "outputformats", "features", "scaletokens",
                   "composites") and isinstance(val, list):
            return True
        else:
            return False
1274752
def add(self, name, productcat_id, standard_price, retail_price_low, retail_price_high, category_id, quantity, alarm_number, desc, prov, city, postage_type, have_invoice, have_guarantee, session, **kwargs):
        ''''''
        request = TOPRequest('taobao.fenxiao.product.add')
        request['name'] = name
        request['productcat_id'] = productcat_id
        request['standard_price'] = standard_price
        request['retail_price_low'] = retail_price_low
        request['retail_price_high'] = retail_price_high
        request['category_id'] = category_id
        request['quantity'] = quantity
        request['alarm_number'] = alarm_number
        request['desc'] = desc
        request['prov'] = prov
        request['city'] = city
        request['postage_type'] = postage_type
        request['have_invoice'] = have_invoice
        request['have_guarantee'] = have_guarantee
        for k, v in kwargs.iteritems():
            if k not in ('cost_price', 'outer_id', 'postage_id', 'postage_ordinary', 'postage_fast', 'postage_ems', 'discount_id', 'trade_type','is_authz','pic_path','image','properties','property_alias','input_properties','sku_standard_prices','sku_cost_prices','sku_outer_ids','sku_quantitys','sku_properties','dealer_cost_price','sku_dealer_cost_prices') and v==None: continue
            request[k] = v
        self.create(self.execute(request, session), fields=['pid','created'], models={'created':TOPDate})
        return self
348642
function() {
        if (!this.items.length) {
            this.hide();
            return;
        }

        this.fireEvent('showing');

        var iPos = this.input.offset();

        this.element
            .css('top', iPos.top + this.input.outerHeight())
            .css(Toolkit.isRTL ? 'right' : 'left', iPos.left)
            .reveal();

        this.input.aria('expanded', true);

        this.fireEvent('shown');
    }
318472
public function getStock(string $sku) {
    $query = $this->connection->select('acm_sku_stock');
    $query->fields('acm_sku_stock');
    $query->condition('sku', $sku);
    $result = $query->execute()->fetchAll();

    // We may not have any entry.
    if (empty($result)) {
      return [];
    }

    // Log if more than one found.
    if (count($result) > 1) {
      $this->logger->error('Duplicate entries found for stock of sku @sku.', [
        '@sku' => $sku,
      ]);
    }

    // Get the first result.
    $data = reset($result);

    return (array) $data;
  }
898369
def sku_update(self, product_id, properties, session, **kwargs):
        ''''''
        request = TOPRequest('taobao.fenxiao.product.sku.update')
        request['product_id'] = product_id
        request['properties'] = properties
        for k, v in kwargs.iteritems():
            if k not in ('quantity', 'standard_price', 'agent_cost_price', 'sku_number', 'dealer_cost_price') and v==None: continue
            request[k] = v
        self.create(self.execute(request, session), fields=['result','created'], models={'created':TOPDate})
        return self
1331075
public function getCurrentProduct()
    {
        try {
            $product = $this->coreRegistry->registry('current_product');
            if ($product instanceof Product) {
                return [
                    'sku' => $product->getSku(),
                    'id'  => $product->getId(),
                ];
            }
        } catch (\Exception $e) {
            throw $e;
        }

        return false;
    }
573399
def add(self, num_iid, properties, quantity, price, session, outer_id=None, item_price=None, lang=None):
        ''''''
        request = TOPRequest('taobao.item.sku.add')
        request['num_iid'] = num_iid
        request['properties'] = properties
        request['quantity'] = quantity
        request['price'] = price
        if outer_id!=None:
            request['outer_id'] = outer_id
        if item_price!=None:
            request['item_price'] = item_price
        if lang!=None:
            request['lang'] = lang
        self.create(self.execute(request, session)['sku'])
        return self
525718
def build_pre_approval_payment_params(self, **kwargs):
        

        params = kwargs or {}

        params['reference'] = self.reference
        params['preApprovalCode'] = self.code

        for i, item in enumerate(self.items, 1):
            params['itemId%s' % i] = item.get('id')
            params['itemDescription%s' % i] = item.get('description')
            params['itemAmount%s' % i] = item.get('amount')
            params['itemQuantity%s' % i] = item.get('quantity')
            params['itemWeight%s' % i] = item.get('weight')
            params['itemShippingCost%s' % i] = item.get('shipping_cost')

        self.data.update(params)
        self.clean_none_params()
610382
protected function parseIOS6StyleReceipt(): void
    {
        $this->receipt = $this->raw_data['receipt'];
        $this->purchases = [];
        $this->purchases[] = new PurchaseItem($this->raw_data['receipt']);

        if (array_key_exists('bid', $this->raw_data['receipt'])) {
            $this->bundle_id = $this->raw_data['receipt']['bid'];
        }
    }
977685
protected function actionListProduct()
    {
        list($selected, $action, $value) = $this->getPostedAction();

        $deleted = $updated = 0;

        foreach ($selected as $id) {

            if ($action === 'status' && $this->access('product_edit')) {
                $updated += (int) $this->product->update($id, array('status' => $value));
            }

            if ($action === 'delete' && $this->access('product_delete')) {
                $deleted += (int) $this->product->delete($id);
            }
        }

        if ($updated > 0) {
            $message = $this->text('Updated %num item(s)', array('%num' => $updated));
            $this->setMessage($message, 'success');
        }

        if ($deleted > 0) {
            $message = $this->text('Deleted %num item(s)', array('%num' => $deleted));
            $this->setMessage($message, 'success');
        }
    }
1259213
def payu_hidden_fields(transaction)
      html = ""

      %w(pos_id pos_auth_key pay_type session_id amount amount_netto desc
      order_id desc2 trsDesc first_name last_name street street_hn
      street_an city post_code country email phone language client_ip
      js payback_login sig ts
      ).each do |field|
        value = transaction.send(field)
        html << hidden_field_tag(field, value) unless value.blank?
      end

      html.html_safe
    end
828010
protected function parseIOS7StyleReceipt(): void
    {
        $this->receipt = $this->raw_data['receipt'];
        $this->app_item_id = $this->raw_data['receipt']['app_item_id'];
        $this->purchases = [];

        if (array_key_exists('original_purchase_date_ms', $this->raw_data['receipt'])) {
            $this->original_purchase_date = Carbon::createFromTimestampUTC(
                (int)round($this->raw_data['receipt']['original_purchase_date_ms'] / 1000)
            );
        }

        if (array_key_exists('request_date_ms', $this->raw_data['receipt'])) {
            $this->request_date = Carbon::createFromTimestampUTC(
                (int)round($this->raw_data['receipt']['request_date_ms'] / 1000)
            );
        }

        if (array_key_exists('receipt_creation_date_ms', $this->raw_data['receipt'])) {
            $this->receipt_creation_date = Carbon::createFromTimestampUTC(
                (int)round($this->raw_data['receipt']['receipt_creation_date_ms'] / 1000)
            );
        }

        foreach ($this->raw_data['receipt']['in_app'] as $purchase_item_data) {
            $this->purchases[] = new PurchaseItem($purchase_item_data);
        }

        if (array_key_exists('bundle_id', $this->raw_data['receipt'])) {
            $this->bundle_id = $this->raw_data['receipt']['bundle_id'];
        }

        if (array_key_exists('latest_receipt_info', $this->raw_data)) {

            $this->latest_receipt_info = array_map(
                function ($data) {
                    return new PurchaseItem($data);
                },
                $this->raw_data['latest_receipt_info']
            );

            usort(
                $this->latest_receipt_info,
                function (PurchaseItem $a, PurchaseItem $b) {
                    return $b->getPurchaseDate()->timestamp - $a->getPurchaseDate()->timestamp;
                }
            );
        }

        if (array_key_exists('latest_receipt', $this->raw_data)) {
            $this->latest_receipt = $this->raw_data['latest_receipt'];
        }

        if (array_key_exists('pending_renewal_info', $this->raw_data)) {
            $this->pending_renewal_info = array_map(
                function ($data) {
                    return new PendingRenewalInfo($data);
                },
                $this->raw_data['pending_renewal_info']
            );
        }

        if (array_key_exists('is-retryable', $this->raw_data)) {
            $this->is_retryable = true;
        }
    }
1370498
def onchange_partner_id(self):
        '''
        
        '''
        if self.partner_id:
            partner_rec = self.env['res.partner'].browse(self.partner_id.id)
            order_ids = [folio.order_id.id for folio in self]
            if not order_ids:
                self.partner_invoice_id = partner_rec.id
                self.partner_shipping_id = partner_rec.id
                self.pricelist_id = partner_rec.property_product_pricelist.id
                raise _('Not Any Order For  %s ' % (partner_rec.name))
            else:
                self.partner_invoice_id = partner_rec.id
                self.partner_shipping_id = partner_rec.id
                self.pricelist_id = partner_rec.property_product_pricelist.id