E-commerce tools for Python: payment gateways and shipping services.
Project description
synrg-ecommerce
E-commerce tools for Python: payment gateways and shipping services.
Installation
pip install synrg-ecommerce
Payment Gateways
Supports MercadoPago, Plexo, and dLocal Go.
from synrg_ecommerce import PaymentGatewayFactory, PaymentProvider, PaymentRequest, PaymentItem
from synrg_ecommerce.payments.providers.mercado_pago import MercadoPagoConfig
gateway = PaymentGatewayFactory.create(
PaymentProvider.MERCADO_PAGO,
config=MercadoPagoConfig(access_token="APP_USR-...", sandbox=True),
)
result = gateway.create_payment(PaymentRequest(
external_reference="order-123",
items=[PaymentItem(id="1", title="Producto", quantity=1, unit_price=500.0)],
success_url="https://mysite.com/success",
failure_url="https://mysite.com/failure",
pending_url="https://mysite.com/pending",
))
print(result.checkout_url) # redirect the user here
Shipping Services
Supports Moova, DAC, PedidosYa, and Depunta.
from synrg_ecommerce import ShippingServiceFactory, ShippingProvider, QuoteRequest, ShippingAddress, Package
from synrg_ecommerce.shipping.providers.moova import MoovaConfig
service = ShippingServiceFactory.create(
ShippingProvider.MOOVA,
config=MoovaConfig(app_id="...", app_secret="...", sandbox=True),
)
quotes = service.get_quotes(QuoteRequest(
origin=ShippingAddress(street="18 de Julio", number="1234", city="Montevideo",
state="Montevideo", country="UY", postal_code="11100"),
destination=ShippingAddress(street="Rambla México", number="5890", city="Montevideo",
state="Montevideo", country="UY", postal_code="11400"),
packages=[Package(weight_kg=1.5, length_cm=30, width_cm=20, height_cm=10)],
))
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
synrg_ecommerce-0.1.0.tar.gz
(58.2 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file synrg_ecommerce-0.1.0.tar.gz.
File metadata
- Download URL: synrg_ecommerce-0.1.0.tar.gz
- Upload date:
- Size: 58.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d1b4bcdc8512dcceaaabe4cbc073d1720b3f1d07afc60da294e4807f04d05f17
|
|
| MD5 |
6e3e66c3df9a4df4799afae8e503a723
|
|
| BLAKE2b-256 |
043bfabcbaa32579a3844c636ba389344ccbf61f536792ee3cec088ce1bb8963
|
File details
Details for the file synrg_ecommerce-0.1.0-py3-none-any.whl.
File metadata
- Download URL: synrg_ecommerce-0.1.0-py3-none-any.whl
- Upload date:
- Size: 67.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b77861434797dd52e4a131bc4c075d9e1d983cb22a9a40fc8a1b05201e4301e6
|
|
| MD5 |
05e41fce4c175bccf058d16548862edd
|
|
| BLAKE2b-256 |
cb162770725605e4e93588b9034eb266977e5a68fabc30f785b949b7612cdc65
|