Integraton package of pago46
Project description
Pago46 Python Package
Python Library for the integration with the cash payment plataform of pago46.
Description
This library it was developed for give e-merchants of pago46 a standard, easy and fast integration to integrate his products/services with Pago46 to can offer the option of pay with cash to his clients
Configuration.
to configure the client of Pago46 it's necessary to have a MERCHANT_SECRET and MERCHANT_KEY (those key are provided by Pago46) with those keys we can generate calls to PAGO46 API.
we must configure the MERCHANT_SECRET, MERCHANT_KEY and PAGO46_API_HOST on enviroment variables.
Example
import os
os.environ["PAGO46_MERCHANT_KEY"] = "<merchant_key>"
os.environ["PAGO46_MERCHANT_SECRET"] = "<merchant_secret>"
os.environ["PAGO46_API_HOST"] = "http://sandboxapi.pago46.com" # for testing or "https://api.pago46.com" for production
with the environment variables set, we can intilialize the client
from pago46.client import Pago46
client = Pago46()
Example Get all orders
response = client.get_all_orders()
Example create a order
from pago46.client import Pago46
client = Pago46()
payload = {
"currency": "CLP", # Tipo de moneda
"merchant_order_id": '0001', # id que identifica una transacción.
"notify_url":"http://merchant.com/app/response", # La URL en la que pago46 publicara la respuesta al modificarse el estado de la transacción.
"price": 1000,# precio de la orden
"return_url": "http://final.merchant.com",# url a la cual el user será redirigido al terminar el proceso.
"timeout": 60, # duración en que la transacción estará activa para ser pagada en minutos.
"description": "description of product.", # (opcional): descripción opcional del producto/servicio.
}
# create a new order
response = client.create_order(payload)
Example to mark a order as complete.
payload = {"order_id": "0001"}
response = client.mark_order_as_complete(payload)
Example get a order by ID
order_id = "0001"
response = client.get_order_by_id(order_id)
Example get a order by Notification ID
notification_id = "fe0eac28aa774b539b0e12d0227bf27f"
response= client.get_order_by_notification_id(notification_id)
Example get order details by order ID
order_id = "121d3b2c-b985-4592-b8fc-b5c6d9ce5a13"
response = client.get_order_details_by_order_id(order_id)
Installation
You can install Pago46 Package in the usual ways. The simplest way is with pip:
pip install Pago46
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
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 pago46-0.0.2.tar.gz.
File metadata
- Download URL: pago46-0.0.2.tar.gz
- Upload date:
- Size: 4.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.20.1 setuptools/40.6.2 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.6.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
32a82e57873f3109af27bfd2a06670f205f79f0eafd458395d842b3e1e73ceb8
|
|
| MD5 |
e13d8ca7e3a4c9e076557dcec6b842ca
|
|
| BLAKE2b-256 |
ab7c8d37b124e0e5693eaf3c9d851165664eae500e63586b799e03ed40f43436
|
File details
Details for the file pago46-0.0.2-py3-none-any.whl.
File metadata
- Download URL: pago46-0.0.2-py3-none-any.whl
- Upload date:
- Size: 18.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.20.1 setuptools/40.6.2 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.6.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
da253a3c62bf55ef5b3b6fcbee8e13a0b6d060b5dab46c298c2aace3f46212a5
|
|
| MD5 |
731ee7f5dab84ddd76bac8f1682379a4
|
|
| BLAKE2b-256 |
c72d7b3ac472531ceb072720c65274e5e5eef17d0c6145fcc01c9c17893e1feb
|