pfpi 1.0.1

Creator: railscoderz

Last updated:

Add to Cart

Description:

pfpi 1.0.1

PFPI (Paguelo Facil Payment Interface)
Easy python module to do payments through Paguelo Facil payment gateway.
Requirements

Python 2.7.x

Installing

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.

License

For personal and professional use. You cannot resell or redistribute these repositories in their original state.

Customer Reviews

There are no reviews.