1
を返しませんnoneを返します。私はpayment_url
なしで応答を印刷しようとした場合PagSeguroは私がPagSeguro(ブラジルのペイパル)を設定しようとしていると<a href="https://github.com/rochacbruno/python-pagseguro" rel="nofollow noreferrer">this python library</a></p> <p>を使用してそうすることで、私はそれが常に返さURLを試してみて、取得するサンプルスクリプトを作ったが、毎回きたリダイレクトURL
from pagseguro import PagSeguro
config = {'sandbox': True}
pg = PagSeguro(email="email", token="token", config=config)
pg.sender = {
"name": "Bruno Rocha",
"area_code": 11,
"phone": 981001213,
"email": "[email protected]",
}
pg.shipping = {
"type": pg.SEDEX,
"street": "Av Brig Faria Lima",
"number": 1234,
"complement": "5 andar",
"district": "Jardim Paulistano",
"postal_code": "06650030",
"city": "Sao Paulo",
"state": "SP",
"country": "BRA"
}
pg.reference = "0"
pg.items = [
{"id": "0001", "description": "Produto 1", "amount": 354.20, "quantity": 2, "weight": 200},
{"id": "0002", "description": "Produto 2", "amount": 50, "quantity": 1, "weight": 1000}
]
pg.redirect_url = "http://meusite.com/obrigado"
pg.notification_url = "http://meusite.com/notification"
response = pg.checkout()
print(response.payment_url)
(私はスクリプトの中で私の本当のトークンと電子メールに入れている)、それは、オブジェクトを出力しますが、私はどちらかそれを解析するかどうかはわかりません。
print dir(response) # show the names in the module namespace
print dir(response.payment_url) # show the names in the module namespace
は、あなたがより多くの情報を取得する必要があり、追加のキー名を与える:
私の答えが正しいと印を付けてください。 – alexisdevarennes