Specify the shipping methods to show.
420029
public void setShippingMethods(@Nullable List<ShippingMethod> shippingMethods,
                                   @Nullable ShippingMethod defaultShippingMethod) {
        mShippingMethodAdapter.setShippingMethods(shippingMethods, defaultShippingMethod);
    }
708949
public function getCheapestShippingMethod(array $shippingMethods)
    {
        return array_reduce(
            $shippingMethods,
            function ($lowestPriceShippingMethod, ShippingMethod $shippingMethod) {

                $shippingMethodPrice = $shippingMethod->getPrice();
                if (
                    !($lowestPriceShippingMethod instanceof ShippingMethod) ||
                    $shippingMethodPrice
                        ->isLessThan(
                            $this
                                ->currencyConverter
                                ->convertMoney(
                                    $lowestPriceShippingMethod->getPrice(),
                                    $shippingMethodPrice->getCurrency()
                                )
                        )
                ) {
                    return $shippingMethod;
                }

                return $lowestPriceShippingMethod;
            },
            null
        );
    }
429756
def avail_approaches(pkg):
    '''
    '''
    methods = [modname for importer, modname, ispkg in
               pkgutil.walk_packages(path=pkg.__path__)
               if modname not in
               ['common_args', 'directions', 'sobol_sequence']]
    return methods
826065
@Override
	public List<CommerceShippingFixedOptionRel> findByCommerceShippingMethodId(
		long commerceShippingMethodId) {
		return findByCommerceShippingMethodId(commerceShippingMethodId,
			QueryUtil.ALL_POS, QueryUtil.ALL_POS, null);
	}
722789
protected function _setDefaultEmptyPayment()
    {
        // no shipping method there !!
        if (\OxidEsales\Eshop\Core\Registry::getConfig()->getConfigParam('blOtherCountryOrder')) {
            $oPayment = oxNew(\OxidEsales\Eshop\Application\Model\Payment::class);
            if ($oPayment->load('oxempty')) {
                $this->_oEmptyPayment = $oPayment;
            } else {
                // some error with setup ??
                $this->_sPaymentError = -2;
            }
        } else {
            $this->_sPaymentError = -2;
        }
    }
31874
public void presentShippingFlow() {
        final Intent intent = new Intent(mHostActivity, PaymentFlowActivity.class)
                .putExtra(PAYMENT_SESSION_CONFIG, mPaymentSessionConfig)
                .putExtra(PAYMENT_SESSION_DATA_KEY, mPaymentSessionData)
                .putExtra(EXTRA_PAYMENT_SESSION_ACTIVE, true);
        mHostActivity.startActivityForResult(intent, PAYMENT_SHIPPING_DETAILS_REQUEST);
    }
245407
protected function InitShippingAddress()
    {
        $inputFilterUtil = $this->getInputFilterUtil();
        $shippingAddressData = $inputFilterUtil->getFilteredPostInput(TdbDataExtranetUserAddress::FORM_DATA_NAME_SHIPPING);
        if (null !== $shippingAddressData) {
            $this->SetShippingAddressData($shippingAddressData);
            $this->bUserDataSubmission = true;
        } else {
            $billingAddressData = $inputFilterUtil->getFilteredPostInput(TdbDataExtranetUserAddress::FORM_DATA_NAME_BILLING);
            if (null !== $billingAddressData && TdbDataExtranetUserAddress::FORM_DATA_NAME_BILLING == $this->AddressUsedAsPrimaryAddress()) {
                $this->SetShippingAddressData($this->GetBillingAddressData());
            } else {
                $oUser = self::getExtranetUserProvider()->getActiveUser();
                $oShipping = $oUser->GetShippingAddress();
                $aShipping = array();
                if ($oShipping) {
                    $aShipping = $oShipping->sqlData;
                }
                $this->SetShippingAddressData($aShipping);
            }
        }
    }
1242519
@Override
	public List<CommerceShippingMethod> findAll() {
		return findAll(QueryUtil.ALL_POS, QueryUtil.ALL_POS, null);
	}
909434
private function setShippingInformation()
    {
        $shipping = $this->_order->getShippingAddress();
        if ($shipping) {
            if (count($shipping->getStreet()) === 4) {
                $this->_paymentRequest->setShipping()->setAddress()->withParameters(
                    $shipping->getStreetLine(1),
                    $shipping->getStreetLine(2),
                    $shipping->getStreetLine(4),
                    \UOL\PagSeguro\Helper\Data::fixPostalCode($shipping->getPostcode()),
                    $shipping->getCity(),
                    $this->getRegionAbbreviation($shipping),
                    $this->getCountryName($shipping['country_id']),
                    $shipping->getStreetLine(3)
                );
            } else {
                $address = \UOL\PagSeguro\Helper\Data::addressConfig($shipping['street']);
                $this->_paymentRequest->setShipping()->setAddress()->withParameters(
                    $this->getShippingAddress($address[0], $shipping),
                    $this->getShippingAddress($address[1]),
                    $this->getShippingAddress($address[3]),
                    \UOL\PagSeguro\Helper\Data::fixPostalCode($shipping->getPostcode()),
                    $shipping->getCity(),
                    $this->getRegionAbbreviation($shipping),
                    $this->getCountryName($shipping['country_id']),
                    $this->getShippingAddress($address[2])
                );
            }

            $this->_paymentRequest->setShipping()->setType()
                ->withParameters(\PagSeguro\Enum\Shipping\Type::NOT_SPECIFIED); //Shipping Type
            $this->_paymentRequest->setShipping()->setCost()
                ->withParameters(number_format($this->getShippingAmount(), 2, '.', '')); //Shipping Coast
        }
    }
364911
public function Init()
    {
        parent::Init();
        $oUser = TdbDataExtranetUser::GetInstance();
        $shippingAddress = $oUser->GetShippingAddress();
        if (true === $shippingAddress->getIsAmazonShippingAddress()) {
            $oUser->resetAmazonAddresses();
            $basket = $this->getShopService()->getActiveBasket();
            $basket->RecalculateBasket(); // need to recalculate maybe changing address can change basket amount (gross net change)
        }
    }
370514
public function setStatus($s){
        if (is_string($s) && $s){
            if ($s == 'WORKING' || $s == 'SHIPPED' || $s == 'CANCELLED'){
                $this->options['InboundShipmentHeader.ShipmentStatus'] = $s;
            } else {
                return false;
            }
        } else {
            return false;
        }
    }
224685
def _prepare_wsdl_objects(self):
        

        # Default behavior is to not request transit information
        self.ReturnTransitAndCommit = False

        # This is the primary data structure for processShipment requests.
        self.RequestedShipment = self.client.factory.create('RequestedShipment')
        self.RequestedShipment.ShipTimestamp = datetime.datetime.now()

        # Defaults for TotalWeight wsdl object.
        total_weight = self.client.factory.create('Weight')
        # Start at nothing.
        total_weight.Value = 0.0
        # Default to pounds.
        total_weight.Units = 'LB'
        # This is the total weight of the entire shipment. Shipments may
        # contain more than one package.
        self.RequestedShipment.TotalWeight = total_weight

        # This is the top level data structure for Shipper information.
        shipper = self.client.factory.create('Party')
        shipper.Address = self.client.factory.create('Address')
        shipper.Contact = self.client.factory.create('Contact')

        # Link the ShipperParty to our master data structure.
        self.RequestedShipment.Shipper = shipper

        # This is the top level data structure for Recipient information.
        recipient_party = self.client.factory.create('Party')
        recipient_party.Contact = self.client.factory.create('Contact')
        recipient_party.Address = self.client.factory.create('Address')
        # Link the RecipientParty object to our master data structure.
        self.RequestedShipment.Recipient = recipient_party

        # Make sender responsible for payment by default.
        self.RequestedShipment.ShippingChargesPayment = self.create_wsdl_object_of_type('Payment')
        self.RequestedShipment.ShippingChargesPayment.PaymentType = 'SENDER'

        # Start with no packages, user must add them.
        self.RequestedShipment.PackageCount = 0
        self.RequestedShipment.RequestedPackageLineItems = []

        # This is good to review if you'd like to see what the data structure
        # looks like.
        self.logger.debug(self.RequestedShipment)
647667
function (options) {

            if (typeof options === 'object') {

                // Add implementation-specific method prefix (dashboard or app)
                options.name = this.prefix + '.' + options.name;
                return this.transport.send(options);
            }  else {
                throw new Error('Transport options must be an object.');
            }
        }
297446
public static RouteSpecification forCargo(Cargo cargo, DateTime arrivalDeadline) {
      Validate.notNull(cargo);
      Validate.notNull(arrivalDeadline);

      return new RouteSpecification(arrivalDeadline, cargo.getOrigin(), cargo.getDestination());
    }
1307972
public function getShippingMethods($cart, $shipping_address)
    {
        try {
//            $this->logHelper->addInfoLog($this->request->getContent());

            $this->preprocessHook();

            // get immutable quote id stored with transaction
            list(, $quoteId) = explode(' / ', $cart['display_id']);

            // Load quote from entity id
            $quote = $this->cartHelper->getQuoteById($quoteId);

            if (!$quote || !$quote->getId()) {
                $this->throwUnknownQuoteIdException($quoteId);
            }

            $this->checkCartItems($cart, $quote);

            // Load logged in customer checkout and customer sessions from cached session id.
            // Replace parent quote with immutable quote in checkout session.
            $this->sessionHelper->loadSession($quote);

            $addressData = $this->cartHelper->handleSpecialAddressCases($shipping_address);

            if (isset($addressData['email']) && $addressData['email'] !== null) {
                $this->validateAddressData($addressData);
            }

            $shippingOptionsModel = $this->shippingEstimation($quote, $addressData);

            if ($this->taxAdjusted) {
                $this->bugsnag->registerCallback(function ($report) use ($shippingOptionsModel) {
                    $report->setMetaData([
                        'SHIPPING OPTIONS' => [print_r($shippingOptionsModel, 1)]
                    ]);
                });
                $this->bugsnag->notifyError('Cart Totals Mismatch', "Totals adjusted.");
            }

            /** @var \Magento\Quote\Model\Quote $parentQuote */
            $parentQuote = $this->cartHelper->getQuoteById($cart['order_reference']);
            if ($this->couponInvalidForShippingAddress($parentQuote->getCouponCode(), $quote)){
                $address = $parentQuote->isVirtual() ? $parentQuote->getBillingAddress() : $parentQuote->getShippingAddress();
                $additionalAmount = abs($this->cartHelper->getRoundAmount($address->getDiscountAmount()));

                $shippingOptionsModel->addAmountToShippingOptions($additionalAmount);
            }

            return $shippingOptionsModel;
        } catch (\Magento\Framework\Webapi\Exception $e) {
            $this->catchExceptionAndSendError($e, $e->getMessage(), $e->getCode(), $e->getHttpCode());
        } catch (BoltException $e) {
            $this->catchExceptionAndSendError($e, $e->getMessage(), $e->getCode());
        } catch (\Exception $e) {
            $msg = __('Unprocessable Entity') . ': ' . $e->getMessage();
            $this->catchExceptionAndSendError($e, $msg, 6009, 422);
        }
    }
392741
private static function init() {
		self::setInit(true);

		// Initiates Products
		$obj = new Product(ShipmentDetails::PRODUCT_TYPE_NATIONAL_PACKAGE);
		$obj->setName('DHL Paket');
		$obj->setMinLength(15);
		$obj->setMaxLength(200);
		$obj->setMinWidth(11);
		$obj->setMaxWidth(200);
		$obj->setMinHeight(1);
		$obj->setMaxHeight(200);
		$obj->setMaxWeight(31.5);
		$obj->setServices(array(
			'preferredNeighbourEnabled',
			'preferredLocationEnabled',
			'visualCheckOfAgeEnabled',
			'personalHandover',
			'namedPersonOnly',
			'identCheckEnabled',
			'preferredDayEnabled',
			'preferredTimeEnabled',
			'disableNeighbourDelivery',
			'goGreen',
			'additionalInsuranceEnabled',
			'bulkyGoods',
			'cashOnDeliveryEnabled',
			'individualSenderRequiredmentsEnabled',
			'packagingReturn',
			'noticeNonDeliverability'
		));
		self::addProduct($obj);

		$obj = new Product(ShipmentDetails::PRODUCT_TYPE_NATIONAL_PACKAGE_PRIO);
		$obj->setName('DHL Paket PRIO');
		$obj->setMinLength(15);
		$obj->setMaxLength(200);
		$obj->setMinWidth(11);
		$obj->setMaxWidth(200);
		$obj->setMinHeight(1);
		$obj->setMaxHeight(200);
		$obj->setMaxWeight(31.5);
		$obj->setServices(array(
			'preferredNeighbourEnabled',
			'preferredLocationEnabled',
			'visualCheckOfAgeEnabled',
			'namedPersonOnly',
			'identCheckEnabled',
			'preferredDayEnabled',
			'preferredTimeEnabled',
			'disableNeighbourDelivery',
			'goGreen',
			'additionalInsuranceEnabled',
			'cashOnDeliveryEnabled',
			'individualSenderRequiredmentsEnabled',
			'packagingReturn',
			'noticeNonDeliverability'
		));
		self::addProduct($obj);

		$obj = new Product(ShipmentDetails::PRODUCT_TYPE_SAME_DAY_PACKAGE);
		$obj->setName('DHL Paket Taggleich');
		$obj->setMinLength(15);
		$obj->setMaxLength(200);
		$obj->setMinWidth(11);
		$obj->setMaxWidth(200);
		$obj->setMinHeight(1);
		$obj->setMaxHeight(200);
		$obj->setMaxWeight(31.5);
		$obj->setServices(array(
			'preferredNeighbourEnabled',
			'preferredLocationEnabled',
			'visualCheckOfAgeEnabled',
			'namedPersonOnly',
			'identCheckEnabled',
			'preferredDayEnabled',
			'preferredTimeEnabled',
			'disableNeighbourDelivery',
			'goGreen',
			'additionalInsuranceEnabled',
			'bulkyGoods',
			'cashOnDeliveryEnabled',
			'individualSenderRequiredmentsEnabled',
			'packagingReturn',
			'noticeNonDeliverability',
			'returnImmediatlyIfShipmentFailed'
		));
		self::addProduct($obj);

		$obj = new Product(ShipmentDetails::PRODUCT_TYPE_INTERNATIONAL_PACKAGE);
		$obj->setName('DHL Paket International');
		$obj->setMinLength(15);
		$obj->setMaxLength(120);
		$obj->setMinWidth(11);
		$obj->setMaxWidth(60);
		$obj->setMinHeight(1);
		$obj->setMaxHeight(60);
		$obj->setMaxWeight(31.5);
		$obj->setServices(array(
			'endorsementEnabled',
			'returnReceipt',
			'goGreen',
			'additionalInsuranceEnabled',
			'bulkyGoods',
			'cashOnDeliveryEnabled',
			'premium'
		));
		self::addProduct($obj);

		$obj = new Product(ShipmentDetails::PRODUCT_TYPE_EUROPA_PACKAGE);
		$obj->setName('DHL Europapaket');
		$obj->setMinLength(15);
		$obj->setMaxLength(120);
		$obj->setMinWidth(11);
		$obj->setMaxWidth(60);
		$obj->setMinHeight(3.5);
		$obj->setMaxHeight(60);
		$obj->setMaxWeight(31.5);
		$obj->setServices(array(
			'goGreen',
			'additionalInsuranceEnabled'
		));
		self::addProduct($obj);

		$obj = new Product(ShipmentDetails::PRODUCT_TYPE_PACKED_CONNECT);
		$obj->setName('DHL Paket Connect');
		$obj->setMinLength(15);
		$obj->setMaxLength(120);
		$obj->setMinWidth(11);
		$obj->setMaxWidth(60);
		$obj->setMinHeight(3.5);
		$obj->setMaxHeight(60);
		$obj->setMaxWeight(31.5);
		$obj->setServices(array(
			'goGreen',
			'additionalInsuranceEnabled',
			'bulkyGoods'
		));
		self::addProduct($obj);

		$obj = new Product(ShipmentDetails::PRODUCT_TYPE_SAME_DAY_MESSENGER);
		$obj->setName('DHL Kurier Taggleich');
		$obj->setMinLength(15);
		$obj->setMaxLength(200);
		$obj->setMinWidth(11);
		$obj->setMaxWidth(200);
		$obj->setMinHeight(1);
		$obj->setMaxHeight(200);
		$obj->setMaxWeight(31.5);
		$obj->setServices(array(
			'preferredNeighbourEnabled',
			'visualCheckOfAgeEnabled',
			'endorsementEnabled',
			'goGreen',
			'dayOfDeliveryEnabled',
			'deliveryTimeframeEnabled',
			'shipmentHandlingEnabled',
			'perishables',
			'individualSenderRequiredmentsEnabled'
		));
		self::addProduct($obj);

		$obj = new Product(ShipmentDetails::PRODUCT_TYPE_WISH_TIME_MESSENGER);
		$obj->setName('DHL Kurier Wunschzeit');
		$obj->setMinLength(15);
		$obj->setMaxLength(200);
		$obj->setMinWidth(11);
		$obj->setMaxWidth(200);
		$obj->setMinHeight(1);
		$obj->setMaxHeight(200);
		$obj->setMaxWeight(31.5);
		$obj->setServices(array(
			'preferredNeighbourEnabled',
			'visualCheckOfAgeEnabled',
			'endorsementEnabled',
			'goGreen',
			'dayOfDeliveryEnabled',
			'deliveryTimeframeEnabled',
			'shipmentHandlingEnabled',
			'perishables',
			'individualSenderRequiredmentsEnabled'
		));
		self::addProduct($obj);

		$obj = new Product(ShipmentDetails::PRODUCT_TYPE_AUSTRIA_PACKAGE);
		$obj->setName('DHL Paket Austria');
		$obj->setAustria(true);
		$obj->setMinLength(15);
		$obj->setMaxLength(120);
		$obj->setMinWidth(11);
		$obj->setMaxWidth(60);
		$obj->setMinHeight(1);
		$obj->setMaxHeight(60);
		$obj->setMaxWeight(31.5);
		$obj->setServices(array(
			'additionalInsuranceEnabled',
			'bulkyGoods',
			'cashOnDeliveryEnabled'
		));
		self::addProduct($obj);

		$obj = new Product(ShipmentDetails::PRODUCT_TYPE_CONNECT_PACKAGE);
		$obj->setName('DHL Paket Connect');
		$obj->setAustria(true);
		$obj->setMinLength(15);
		$obj->setMaxLength(120);
		$obj->setMinWidth(11);
		$obj->setMaxWidth(60);
		$obj->setMinHeight(3.5);
		$obj->setMaxHeight(60);
		$obj->setMaxWeight(31.5);
		$obj->setServices(array(
			'additionalInsuranceEnabled',
			'bulkyGoods',
			'cashOnDeliveryEnabled'
		));
		self::addProduct($obj);

		$obj = new Product(ShipmentDetails::PRODUCT_TYPE_AUSTRIA_INTERNATIONAL_PACKAGE);
		$obj->setName('DHL Paket International');
		$obj->setAustria(true);
		$obj->setMinLength(15);
		$obj->setMaxLength(120);
		$obj->setMinWidth(11);
		$obj->setMaxWidth(60);
		$obj->setMinHeight(1);
		$obj->setMaxHeight(60);
		$obj->setMaxWeight(31.5);
		$obj->setServices(array(
			'additionalInsuranceEnabled',
			'bulkyGoods',
			'cashOnDeliveryEnabled'
		));
		self::addProduct($obj);
	}
1055785
def send(self, tid, session, feature=None):
        ''''''
        request = TOPRequest('taobao.logistics.dummy.send')
        request['tid'] = tid
        if feature!=None: request['feature'] = feature
        self.create(self.execute(request, session))
        return self.shipping