Skip to main content

Interface to do payments through Paguelo Facil gateway

Project description

PFIG (Paguelo Facil Payment Interface)

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

Requirements

  • Python 2.7.x

Installing

  1. Install the pfig module:
$ pip install pfig

How to add a new credit card.

from pfig.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)
# Add new credit card
result = cc.call()
print result # return a JSON object with the result

How to do Payment.

from pfig.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)
# Do Payment
result = p.call()
print result # return a JSON object with the result

How to do Payment using Token given from credit card

from pfig.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)
# Add new credit card
result = cc.call()
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)
# Do Payment
result = p.call()
print result # return a JSON object with the result

Uninstall pfig

$ pip uninstall pfig

Additional Info

You can see the follow link

Releases notes:

  • 1.0.0: Services added to add credit cards and do payments

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.0b0.tar.gz (5.3 kB view hashes)

Uploaded source

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Huawei Huawei PSF Sponsor Microsoft Microsoft PSF Sponsor NVIDIA NVIDIA PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page