Skip to main content

Test de tarifa fedex. Prueba para Manuable

Project description

Tarifa Fedex Test

Prueba: funcion que consulta Web Service de Fedex para cotizar tarifas.

Pre-Requisitos.

Python 3.5 o superior

Instalar dependencias

pip install requests

pip install xmltodict

Instalar

pip install tarifafedextest==0.5

Ejemplo uso

Importamos la clase CotizarTarifa

from tarifafedextest.cotizatarifa import CotizaTarifa

import json

Creamos el nuevo objeto de la clase CotizarTarifa

ct = CotizaTarifa()

Creamos objeto json con las credenciales del cliente

credentials = json.dumps({"Key":"bkjIgUhxdghtLw9L","Password":"6p8oOccHmDwuJZCyJs44wQ0Iw","AccountNumber":"510087720","MeterNumber":"119238439","LanguageCode":"es","LocaleCode":"mx"})

Creamos objeto json con la informacion de paquete a enviar

quote_params = json.dumps({"address_from": {"zip": "64000","country": "MX"},"address_to": {"zip": "64000","country": "MX"},"parcel": { "length": 25.0,"width": 28.0,"height": 46.0,"distance_unit": "cm","weight": 6.5,"mass_unit": "kg"}})

Ejecutamos la funcion get, para obtener la cotizacion

ct.get(credentials,quote_params)

Ejemplo de respuesta

[

{

  "price":"14.71",

  "currency":"USD",

  "service_level":{

     "name":"Priority Overnight",

     "token":"PRIORITY_OVERNIGHT"

  }

},

{

  "price":"11.34",

  "currency":"USD",

  "service_level":{

     "name":"Fedex Express Saver",

     "token":"FEDEX_EXPRESS_SAVER"

  }

},

{

  "price":"12.1",

  "currency":"USD",

  "service_level":{

     "name":"Standard Overnight",

     "token":"STANDARD_OVERNIGHT"

  }

}

]

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

tarifafedextest-0.5.tar.gz (3.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

tarifafedextest-0.5-py3-none-any.whl (4.8 kB view details)

Uploaded Python 3

File details

Details for the file tarifafedextest-0.5.tar.gz.

File metadata

  • Download URL: tarifafedextest-0.5.tar.gz
  • Upload date:
  • Size: 3.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.8.1

File hashes

Hashes for tarifafedextest-0.5.tar.gz
Algorithm Hash digest
SHA256 76beea4500517a9bf79a076a71dd7e89d7f2c05b9813288f96efbb8ad42749e2
MD5 f25bd28efe728aef5d8fb2f2c1baed04
BLAKE2b-256 3fbcff1eb117b130e74bdd0d1b74333c8e04d7af3b6ec0090bb3877396df3afb

See more details on using hashes here.

File details

Details for the file tarifafedextest-0.5-py3-none-any.whl.

File metadata

  • Download URL: tarifafedextest-0.5-py3-none-any.whl
  • Upload date:
  • Size: 4.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.8.1

File hashes

Hashes for tarifafedextest-0.5-py3-none-any.whl
Algorithm Hash digest
SHA256 0251a98901efb67d1bf99484679afdfc0f4201edebf200b203c14e414bd4eafd
MD5 38cb8f81e65a362c3f57b5e22c004daa
BLAKE2b-256 30d0daec4c4f68476226b2d53016bf5dd315e72cfde8e45b4b719aef9bc2e71c

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page