code: function (str) {
  
          if (!str || !str.length || str.length < 2) {
              return null;
          }
  
          var jsonStr = str.substring(1, str.length - 1);
  
          return JSON.parse(jsonStr);
      }
docs: The backend is not returning valid JSON. It sends it wrapped with parenthesis.  This function will become obselete soon, see https://github.com/couchcommerce/checkout-api/issues/2