Skip to main content

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

Release files for pago46 0.0.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pago46 0.0.2
File Size Uploaded
pago46-0.0.2.tar.gz 4.7 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for pago46 0.0.2
File Interpreter ABI Platform
pago46-0.0.2-py3-none-any.whl Python 3 none any Details

Total release size: 22.8 kB

Release files / pago46-0.0.2.tar.gz

Download URL pago46-0.0.2.tar.gz
Size 4.7 kB
Tags Source
SHA-256 checksum
How to use checksums
32a82e57873f3109af27bfd2a06670f205f79f0eafd458395d842b3e1e73ceb8
BLAKE2b-256 checksum
How to use checksums
ab7c8d37b124e0e5693eaf3c9d851165664eae500e63586b799e03ed40f43436
Upload date
Uploaded using Trusted Publishing?
What is 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

Release files / pago46-0.0.2-py3-none-any.whl

Download URL pago46-0.0.2-py3-none-any.whl
Size 18.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
da253a3c62bf55ef5b3b6fcbee8e13a0b6d060b5dab46c298c2aace3f46212a5
BLAKE2b-256 checksum
How to use checksums
c72d7b3ac472531ceb072720c65274e5e5eef17d0c6145fcc01c9c17893e1feb
Upload date
Uploaded using Trusted Publishing?
What is 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

Release history Release notifications | RSS feed

This release

0.0.2 This release

2 release files

0.0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page