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

##Ejemplo uso

###Importamos la clase CotizarTarifa

from 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.2.tar.gz (3.8 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.2-py3-none-any.whl (4.8 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for tarifafedextest-0.2.tar.gz
Algorithm Hash digest
SHA256 0fbea1ccb7ef6ab95fc89c5a8b77e41624f4fdd2668f918eaad479a6f74c391f
MD5 b3a62666d46185aef26aef1f9dc6396e
BLAKE2b-256 6fdfc018915c0cd6bb81684adc61132962b4abac32d40edef3097e1f1eb60a9b

See more details on using hashes here.

File details

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

File metadata

  • Download URL: tarifafedextest-0.2-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.2-py3-none-any.whl
Algorithm Hash digest
SHA256 6032c91382f185cd0b129884d2b3d380474dfb0f32f1a99ebbcfaa1c4be02988
MD5 3fdf20e4f8d2c76072a16467d33fe88c
BLAKE2b-256 39671537df8ed3aff4a59c47eb7fead51e29453e4c1bfcc1f57ee4ca2a165a9c

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