project/app/scripts/modules/payment-api.js
/*
   * Utility function to extract the correct shipping options for a country.
   */
Utility function to extract the correct shipping options for a country.
Utility function to extract the correct shipping options for a country .
optionsForCountry(country) {
    if (!country || !SHIPPING_OPTIONS.hasOwnProperty(country)) {
      country = 'international';
    }
    let options = SHIPPING_OPTIONS[country];
    options.sort((a, b) => {
      return a.price - b.price;
    });
    return options;
  }
optionsForCountry ( country ) { if ( ! country || ! SHIPPING_OPTIONS . hasOwnProperty ( country ) ) { country = 'international' ; } let options = SHIPPING_OPTIONS [ country ] ; options . sort ( ( a , b ) => { return a . price - b . price ; } ) ; return options ; }
Utility function to extract the correct shipping options for a country.
Utility function to extract the correct shipping options for a country .
// Sort by price, lowest first