diff --git a/handlers/__init__.py b/handlers/__init__.py index 2db2f71..994b447 100644 --- a/handlers/__init__.py +++ b/handlers/__init__.py @@ -2,3 +2,4 @@ from . import users from . import groups from . import channels +from . import payments diff --git a/handlers/payments/__init__.py b/handlers/payments/__init__.py new file mode 100644 index 0000000..f88da4c --- /dev/null +++ b/handlers/payments/__init__.py @@ -0,0 +1 @@ +from . import payme \ No newline at end of file diff --git a/handlers/payments/payme.py b/handlers/payments/payme.py new file mode 100644 index 0000000..ef47dd1 --- /dev/null +++ b/handlers/payments/payme.py @@ -0,0 +1,76 @@ +import requests +import uuid + +def create_transactions(): + charge_id = str(uuid.uuid4()) + + url = "https://checkout.paycom.uz" + + # Data to be sent in the POST request + data = { + 'merchant': '672b8224c628bf0c13f3c4ef', + 'amount': '500000', + 'account[charge_id]': charge_id + } + # Sending POST request + response = requests.post(url, data=data) + # Check the response + if response.status_code == 200: + # Extract and print the form name="redirect" + if '