# Testar no sandbox
# Explicação: https://xflowpayments.com/blog/api-pix-python/

from xflow import xflow

teste = xflow("POST", "/charges", json={
    "amountCents": 1990,
    "customer": {"name": "Cliente", "email": "c@exemplo.com", "document": "00000000000"},
})

xflow("POST", f"/test/charges/{teste['id']}/pay")

paga = xflow("GET", f"/charges/{teste['id']}")
print(paga["status"], paga["livemode"])  # paid False
