Getting started — PuntoPagos Python 0.1 documentation

### Navigation

- index
- next |
- previous |
- PuntoPagos Python 0.1 documentation »

# Getting started

## Create a transaction

First, you need an api key and an api secret provided by puntopagos.

Then instanciate a PuntoPagoRequest object

class `puntopagos.` `PuntoPagoRequest`(config, sandbox=False, ssl=True)

For create a transaction the PuntoPagoRequest class provide the create method.

`PuntoPagoRequest.` `create`(trx_id, medio_pago, monto, detalle='')

  Create a request (and a transaction) to puntopagos.com.

  Parameters: | trx_id – Client unique transaction id (varchar(50)). medio_pago – Payment method id, valid ids in PUNTOPAGOS_PAYMENT_METHODS. monto – Transaction total amount. detalle – Transaction detail (optional).

### Example

    >>> config = {'key': APIKEY, 'secret': APISECRET}
    >>> request = PuntoPagoRequest(config=config)
    >>> response = request.create(trx_id='1', medio_pago='3', monto=100.0)
    >>> response.complete
    True
    >>> response.token
    'LXAAYDOMUAVUBKG0'
    >>> response.redirection_url
    'http://www.puntopagos.com/transaccion/procesar/LXAAYDOMUAVUBKG0'

Response is an instance of PuntoPagoCreateResponse

class `puntopagos.` `PuntoPagoCreateResponse`(response, sandbox=False)

## Retrieving transaction status

For retrieving a transaction status the PuntoPagoRequest class provide status method.

`PuntoPagoRequest.` `status`(token, trx_id, monto)

  Create a request for verify a transaction status

  Parameters: | token – Unique token, asigned by puntopagos to transaction. trx_id – Client unique transaction id (varchar(50)). monto – Transaction total amount.

### Example

    >>> request = PuntoPagoRequest(config=config)
    >>> response = request.status(token='LXAAYDOMUAVUBKG0', monto=100.0, trx_id='1')
    >>> response.complete
    True

Response is an instance of PuntoPagoStatusResponse

class `puntopagos.` `PuntoPagoStatusResponse`(response, sandbox=False)

### Navigation

- index
- next |
- previous |
- PuntoPagos Python 0.1 documentation »