-
Notifications
You must be signed in to change notification settings - Fork 4
/
flow_client.py
executable file
·45 lines (33 loc) · 986 Bytes
/
flow_client.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
from typing import Any
from pyflowcl import Payment
from pyflowcl.Clients import ApiClient
API_URL = "https://sandbox.flow.cl/api"
API_KEY = "api_key"
API_SECRET = "api_secret"
api = ApiClient(
api_url=API_URL,
api_key=API_KEY,
api_secret=API_SECRET,
)
pago = {
"subject": "Asunto Email",
"commerceOrder": "1234",
"amount": 5000,
"email": "[email protected]",
"urlConfirmation": "https://mariofix.com",
"urlReturn": "https://mariofix.com",
"currency": "CLP",
}
llamada = Payment.create(api, pago)
print(f"{llamada = }")
llamada = Payment.createEmail(api, pago)
print(f"{llamada = }")
llamada = Payment.getStatus(api, "token")
print(f"{llamada = }")
llamada = Payment.getStatusByCommerceId(api, "commerce-id")
print(f"{llamada = }")
llamada = Payment.getStatusByFlowOrder(api, "flow-order")
print(f"{llamada = }")
data: dict[str, Any] = {"apiKey": "", "date": "yyyy-mm-dd"}
llamada = Payment.getPayments(api, data)
print(f"{llamada = }")