选美API v2包装器

pagseguro的Python项目详细描述


python pagseguro
[![所有贡献者](https://img.shields.io/badge/all_contributors-6-orange.svg?style=flat square)](贡献者)
======
[![构建
状态](https://travis ci.org/rochacbruno/python pagseguro.png)(https://travis ci.org/rochacbruno/python pagseguro)
[![覆盖范围
状态](https://coveralls.io/repos/rochacbruno/python pagseguro/badge.png)(https://coveralls.io/r/rochacbruno/python pagseguro)
[![代码运行状况](https://landscape.io/github/rochacbruno/python pagseguro/master/landscape.svg)(https://landscape.io/github/rochacbruno/python pagseguro/master)
[![Gitter聊天](https://badges.gitter.im/gitterhq/gitter.png)](https://gitter.im/python pagseguro/lobby)

<;a target="\u blank"href="https://www.paypal.com/cgi-bin/webscr?答:放大器和放大器;商业=放大器和放大器;LC = BR和安培;放大器;放大器;= 0安培;/布宜纳布宜纳姆•gif'/>;


>integra_com a api v2 de pagamantos e notifica_e pagseguro utilizando请求。



==================================================================================================================>``` bash
pip安装-e git+https://gcom/rochaccbruno/python-pagseguro 355; egg=pagseguro````

ou

```````
=
```
进行测试
```

como usar
==

_preciso criar a instancia passando como parametro email e token.

>;opcionalmenteépossivel passar o parametro**data**contendo valores a serem passados diretate e para a api.

`` python
来自pagseguro import pagseguro

pg=pagseguro(email="seuemail@dominio.com",token="abcdefghijklmno")
```

````sandbox e config customizadas

ao instanciar um objecto`pagseguro`,voc_poderápassar um par`metro` config` contendo a class de configura_o ser usada pela classe.从pagseguro import pagseguro

config={sandbox':true}
pg=pagseguro(email="seuemail@dominio.com",token="abcdefghijklmno",config=config)
`````

o seu config também pode fazer override de algumas váriaveis pré-definidas na classe de config padr_o.s_o elas:

-货币-moeda utilizada。valor padr_o:`'brl`
-datetime_format-formato de data/hora。valor padr_o:`%y-%m-%dt%h:%m:%s'`
-reference_prefix-formato do valor de reference_ncia do produto。Valor Padr_o:`'ref%s'`obs:nesse caso,sempreénecessário deixar o`%s`ao final do prefixo para que o mesmo seja preenchido automaticamente
-使用运输-用户endere_o de entrega。瓦洛帕德拉芒:`真的`



` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` `配置Endere_o de Entrega
``python
pg.shipping={
"type":pg.sedex,
"street":"av brig faria lima",
"number":1234,
"completion":"5 andar",
"district":"jardim paulistano",
"邮政编码":"06650030",
"city":"圣保罗",
"state":"sp",
"country":"br a"
}
````

caso**country**n_o seja informado o valor default ser ras"bra"

o**type**pode ser pg.sedex,pg.pac,pg.none
>;opcionalmente pode ser numerico seguindo a帕格塞格罗的研究:




<2 sedex br/>Valores Opcionais para**运输**
-"成本":"123456.26"
十进制,com duas casas decimais由大于0.00且小于或等于999900的点(p.e.1234.56)分隔。





<35;35;配置引用



默认情况下,它的前缀为"ref",但如果更改,则可以更改。不同的预取不同的预取不同的预取不同的预取不同的预取不同的预取不同的预取不同的预取不同的预取不同的预取不同的预取不同的预取
pg.reference_prefix=none预取不同的预取不同的预取不同的预取不同的预取不同的预取不同的预取不同的预取不同的预取不同的预取不同的预取不同的预取不同的预取不同的预取不同的预取不同的预取不同的预取不同的预取不同的预取不同的预取不同的预取不同的预取不同的预取不同的预取不同的预取不同的预取不同的预取不同的预取不同的预取不同的预取不同的预取
`` br/>
指定应添加或减去总付款值的额外值。此值可能表示支付的额外费用,或者如果该值为负,则表示授予的折扣。
格式:float(正或负)。
extra pg.u amount=12.70 br/>格式
格式
<35;35<>>>>>>>>>在婴儿车中>在婴儿车中>在婴儿车中>进入婴儿车>购物是一个字典列表,用以下格式表示每个产品。


35;35;35;添加了几个产品

``python
pg.items[
"id":"0001 description":"产品1","金额":354,"数量","重量"<200>br 000>00id">02 0001书写:"产品2"、"金额50"、"数量1"、"重量1000"的"产品2"、"产品2"、"数量50"、"数量50"的"数量"1、"重量1000"的"产品"的"重量"用"gram"表示,即产品的"重量"用"gram"表示。>>>>>>>>>>>>>>>>>>>>>>>{id:"0003","description":"p3,"金额":354.20,"数量":2,"重量":200},
>
>
'
>>
>
>
>
>
>
>
>
>>
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
'>>>>>
>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>>>>>
>将成为付款完成后重定向到url="http://meusite.com/thank you"
"
"



<35;\\\35;\\\设置通知(可选)
>>>>>>>>>'python


<35;x35;proc在购物车全部配置并插入项目后,例如当您的客户单击"付款"按钮时,应执行以下方法。

response=pg.结帐(br/>python br>分页并返回带有属性代码、日期、付款URL、错误的PagesGuroResponse对象。

将买家发送到安全页面的付款页面。

``python
返回重定向(response.payment url)



付款后,买家将通过全局返回url配置重定向回网站,或使用特定的urla in参数**重定向到url**

<35;notifications


pagseguro通过post方法将通知发送到您使用http协议设置的url。

假设您将在http://seusite.com/notification接收通知
br>pseubr>
``python
来自pagsinsurance import pagseguro

def notification
通知是code=request.post['notificationcode'
pg=pagcheck insurance(email="your email@dominio.com",token="abefghijlmno"
在上面的例子中,我们采用**notif14通过页面发送的代码**,我们进行了查询以获取通知数据,返回结果将以以下格式出现在python字典中:

`python

"code""ref>"":"ref00123456789",
>"类型":1,
>"状态":3,
>"取消源":"内部",

>
>"br/>>"br/>>"类型":3,
>"状态":3,
>"3,
>>完整的值列表可以在https://paguol.com.com.com.com.com.com/2/2/2-集成指南/API-br br>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>实现注释
gt;将执行,等待您的拉取请求!!!!>>
>>>>>>35;35; Quokka CMS
[Quokka Cart PagSeguro Processor](https://github.Com /pythonhub /quokka -cart /blob /master /processors /paginsurance data processor.Py)

>>>>>>>>>>35;\\\\\\ 35; Examin Django
>>>>>>>>>>>>>>>>>>>>>IFIFIFIFIFIFIFIFIFIFIFIFIFIFIFIFIF>>>>>>>>>>> >>>>>>>>>>>>>>>>>>>](https://github.Com /rochacbruno /python -paginsurance /tree /master /example /
作者@shyba

>35;检查2py






>35;<35;维护人员


>>感谢这些出色的人([webji](https://github/dodkent/all-contributors\br是的。--所有-贡献者-列表:开始-不要删除或修改此部分>;
124;[<;img src="https://avatars1.githubusercent.com/u/1661112?v=4"width="100px;"/>;<;br/>;<;sub>;patrick mazulo<;sub>;](http://blog.dunderlabs.com)<;br/>;[spell1287;](https://github.com/rochacbruno/python-paginsurance/commits?author=mazulo"代码")["128214;](https://github.com/rochacbruno/python-paginsurance/commits?author=mazulo"文档").124;[<;img src="https://avatars3.hubgitusercontent.com/u/234982?v=4"width="100px;"/>;<;br/>;<;sub>;mauler<;sub>;](http://mauler.github.io)<;br/>;[spell1287;](https://github.com/rochacbruno/python-paginsurance/commits?author=mauler"代码")["128214;](https://github.com/rochacbruno/python-pagseguro/commits?author=mauler"文档").124;[<;img src="https://avatars1.githubusercontent.com/u/178641?v=4"width="100px;"/>;<;br/>;&it;sub>;埃里森·利奥(Ellison Leo)<;sub>;](http://ellison.rocks)<;br/>;["128187;](https://github.com/rochacbruno/python-paginsurance/commits?author=ellisonleao"代码")["128214;](https://github.com/rochacbruno/python-paginsure/commits?author=ellisonleao"文档").124;[<;img src="https://avatars3.gitusercontent.com/u/13952931?v=4"width="100px;"/>;<;br/>;<;sub>;奥古斯托·古拉特(Augusto Goulart)<;/sub>;)(https://augusto goulart.me/<;br/>;[spell128187;](https://github.com/rochacbruno/python-paginsurance/commits?author=augustogoulart"代码")["128214;](https://github.com/rochacbruno/python-pagseguro/commits?author=augustogoulart"文档").124;[<;img src="https://avatars2.githubusercontent.com/u/458654?v=4"width="100px;"/>;<;br>;<;sub>;布鲁诺·罗查(bruno rocha)<;br/>;["128187;](https://github.com/rochacbruno/python-paginsurance/commits?author=rochacbruno"代码")["128214;](https://github.com/rochacbruno/python-pagseguro/commits?author=rochacbruno"文档").124;[<;img src="https://avatars0.githubusercontent.com/u/153288?v=4"width="100px;"/>;<;br/>;<;sub>;Guto Maia<;/sub>;](http://gutomia.net)<;br/>;["128187;](http://github.com/rochacbruno/python-paginsurance/commits?author=gutomia"代码")["128214;](https://github.com/rochacbruno/python-paginsurance/commits?author=gutomia"文档")-124;
124;
124;<124th;<124th;<124th;
124lt;<124br>--all-contributors-list:end-(gt;
此项目遵循[all-contributors]规范(https://github.com/kentcdorg/all-contributors)。欢迎任何形式的贡献!< BR>

欢迎加入QQ群-->: 979659372 Python中文网_新手群

推荐PyPI第三方库


热门话题
java传递实现接口的内部类   java为什么managedbean方法在post请求中的过滤器调用之前调用   java Android应用程序在Android M,O上崩溃,登录A/libc时出错:tid 17938中的致命信号11(SIGSEGV),代码2,故障地址0x343a2944   java JPA存储库。findByAll()返回null,但数据库中存在所有内容   用于发送电子邮件的java Ant脚本   Java小程序HTML页面发生了奇怪的事情   在Postman的请求正文中传递多个JSON数据,并使用Jersy(JXRS)进入Java Rest API   无法强制转换java DAO类   10分钟后重新连接java   正则表达式如何在java中选择字符串直到某个字符   java我的输出有一些问题   Objective中的java时间段   java如何在新屏幕上基于按钮单击在webview中打开url   java哪个selenium版本与Firefox ESR 45.2.0兼容   java无法使用Apache Camel 3.1.0将XML转换为JSON