Django Moova Integration
Project description
django-moova
Starting
These instructions will allow you to install the library in your python project.
Current features
- Create shipment.
- Get tracking info.
- Get shipping label.
Pre-requisitos
- Python >= 3.7
- Django >= 3
- requests >= 2
Installation
- To get the latest stable release from PyPi:
pip install django-moova
or
- From a build
git clone https://gitlab.com/linets/ecommerce/oms/integrations/oms-moova
cd {{project}}
python setup.py sdist
and, install in your project django
pip install {{path}}/django-moova/dist/{{tar.gz file}}
- Settings in django project
DJANGO_MOOVA = {
'MOOVA': {
'BASE_URL': '<MOOVA_BASE_URL>',
'SECRET': '<MOOVA_SECRET_TOKEN>',
'KEY': '<MOOVA_SECRET_KEY>',
'CURRENCY': 'CLP',
'TYPE': 'regular',
'FLOW': 'manual',
'INTERNALCODE': 'XX5555WWW123',
'EXTRA': {},
'ASSURANCE': False,
},
'REMITENTE': {
'STREET': '<STREET>',
'NUMBER': '<NUMBER>',
'FLOOR': '<FLOOR>',
'APARTMENT': '',
'CITY': '<CITY>',
'STATE': '<STATE>',
'POSTALCODE': '<POSTAL_CODE>',
'COUNTRY': 'CHL',
'INSTRUCTIONS': 'Call before delivery',
'FIRST_NAME': '<FIRST_NAME>',
'LAST_NAME': '<LAST_NAME>',
'EMAIL': '<EMAIL>',
'PHONE': '<PHONE>',
},
}
Usage
- Create shipment:
from moova.handler import MoovaHandler
handler = MoovaHandler()
default_data = handler.get_default_payload(instance)
default_data["currency"] = "CLP" # eg. (Optional)
response = handler.create_shipping(default_data)
- Get tracking info:
from moova.handler import MoovaHandler
handler = MoovaHandler()
tracking_info = handler.get_tracking(<identifier>)
- Get shipping label:
from moova.handler import MoovaHandler
handler = MoovaHandler()
label_info = handler.get_shipping_label(<shipping_id>)
Output:
'https://moova-user-data-test.s3.amazonaws.com/etiqueta-10x15.pdf'
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
django-moova-2.1.0.tar.gz
(6.0 kB
view details)
File details
Details for the file django-moova-2.1.0.tar.gz
.
File metadata
- Download URL: django-moova-2.1.0.tar.gz
- Upload date:
- Size: 6.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.1.1 pkginfo/1.4.2 requests/2.22.0 setuptools/57.1.0 requests-toolbelt/0.8.0 tqdm/4.30.0 CPython/3.8.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 12d41af626ebb74aa5f28e74bb5d52c8d2e4ba11206821b1eb8b39139de61c3a |
|
MD5 | 3155174b9d1b333e2a133251c9782957 |
|
BLAKE2b-256 | 6ebfd3393e1cd6d80192b730e1e3171e37d8d1bc2e9f0814201c292f7ec67db1 |