通过Paguelo Facil网关进行支付的接口
pfpi的Python项目详细描述
pfpi(Paguelo Facil支付界面)
简单的python模块通过paguelo facil支付网关进行支付。
要求
- python 2.7.x
安装
- 安装pfpi模块:
$ pip install pfpi
如何添加新的信用卡。
frompfpi.modelsimportCreditCardServicecommerce_key='abcdef'production_mode=False# Change to True if you want use the production environmentcc=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 cardprintresult# return a JSON object with the result
如何付款。
frompfpi.modelsimportPaymentServicecommerce_key='abcdef'production_mode=False# Change to True if you want use the production environmentp=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 Paymentprintresult# return a JSON object with the result
如何使用信用卡上的代币付款
frompfpi.modelsimportTokenPaymentService,CreditCardServicecommerce_key='abcdef'production_mode=False# Change to True if you want use the production environmentcc=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 tokentoken=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 Paymentprintresult# return a JSON object with the result
卸载pfpi
$ pip uninstall pfpi
其他信息
本模块基于以下文档link
发行说明:
- 1.0.0:添加信用卡和付款的服务。
- 1.0.1:在调用API服务之前应用验证。