Skip to main content

Interface to do payments through Paguelo Facil gateway

Project description

PFPI (Paguelo Facil Payment Interface)

Easy python module to do payments through Paguelo Facil payment gateway.

Requirements

  • Python 2.7.x

Installing

  1. Install the pfpi module:
$ pip install pfpi

How to add a new credit card.

from pfpi.models import CreditCardService
commerce_key = 'abcdef'
production_mode = False # Change to True if you want use the production environment
cc = CreditCardService(
    commerce=commerce_key, firstname='first name', lastname='last name', email='example@domain.com',
    description='payment description', cc_number='4111111111111111', ccv2='123', cc_expiration='2019-12',
    production_mode=production_mode)
result = cc.call() # Add new credit card
print result # return a JSON object with the result

How to do Payment.

from pfpi.models import PaymentService
commerce_key = 'abcdef'
production_mode = False # Change to True if you want use the production environment
p = PaymentService(
    commerce=commerce_key, firstname='first name', lastname='last name', email='example@domain.com',
    description='payment description', amount=25.00, cc_number='4111111111111111', ccv2='123',
    cc_expiration='2019-12', production_mode=production_mode)
result = p.call() # Do Payment
print result # return a JSON object with the result

How to do Payment using Token given from credit card

from pfpi.models import TokenPaymentService, CreditCardService
commerce_key = 'abcdef'
production_mode = False # Change to True if you want use the production environment
cc = CreditCardService(
    commerce=commerce_key, firstname='first name', lastname='last name', email='example@domain.com',
    description='payment description', cc_number='4111111111111111', ccv2='123', cc_expiration='2019-12',
    production_mode=production_mode)
result = cc.call() # get the credit card token
token = result['token']
p = TokenPaymentService(
    commerce=commerce_key, firstname='first name', lastname='last name', email='example@domain.com',
    description='payment description', amount=25.00, token=token, production_mode=production_mode)
result = p.call() # Do Payment
print result # return a JSON object with the result

Uninstall pfpi

$ pip uninstall pfpi

Additional Info

This module is based on the follow documentation link

Releases notes:

  • 1.0.0: Services added to add credit cards and do payments.
  • 1.0.1: Applying Validations before to call api services.

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

pfpi-1.0.1.tar.gz (5.4 kB view details)

Uploaded Source

File details

Details for the file pfpi-1.0.1.tar.gz.

File metadata

  • Download URL: pfpi-1.0.1.tar.gz
  • Upload date:
  • Size: 5.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.21.0 setuptools/40.6.3 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/2.7.14

File hashes

Hashes for pfpi-1.0.1.tar.gz
Algorithm Hash digest
SHA256 4256de10cf66907a9049b31c33c03b019df2f585f3091519132623c8e02ca5ab
MD5 6a609dfa857c2ca62d3d84346cf95f4d
BLAKE2b-256 805e3286d8931961d1de24ca779ea20c61096871bab41bfd7815bc4c0b87d399

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page