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.4

##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.4.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.4-py3-none-any.whl (4.8 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: tarifafedextest-0.4.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.4.tar.gz
Algorithm Hash digest
SHA256 3e756c960e5bb2333174f9dc965f85276eb26afda40ca0804d6599cbfacbdc01
MD5 4f755b8f5ec3365e239694e24348b1cf
BLAKE2b-256 3d6f20c8cb78d5731aac1e42d2c7c4ab1fcd4b81f101300e8b84f54f52a44637

See more details on using hashes here.

File details

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

File metadata

  • Download URL: tarifafedextest-0.4-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.4-py3-none-any.whl
Algorithm Hash digest
SHA256 22cd48415f2c005f01c9a6f3661bd7e0a8d0e888d4aa3c8134dd9b07864882e1
MD5 796ae69655c33579c466b11144c88203
BLAKE2b-256 dfa1f528aa08f9674fba482037a322fd648951154365a7c94fda211b373418dd

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