ICODERNET Telegram 921
import requests

class TirikchilikPaymentAPI:
BASE_URL = "https://api.tirikchilik.uz/api/ProjectPay"
SUPPORTED_SYSTEMS = {"click", "payme", "uzum"}

def __init__(self, project_id: int = 1953):
self.project_id = project_id

def create_payment(self, amount: int, payment_system: str, donater: str = "", notes: str = "") -> dict:
if payment_system not in self.SUPPORTED_SYSTEMS:
raise ValueError(f"Unsupported payment system. Choose from: {', '.join(self.SUPPORTED_SYSTEMS)}")

payload = {
"projectId": self.project_id,
"amount": amount,
"source": "",
"donater": donater,
"notes": notes,
"paymentSystem": payment_system
}

response = requests.post(f"{self.BASE_URL}/Create", json=payload)
response.raise_for_status() # Raise error for bad HTTP responses (4xx or 5xx)

return response.json()

def list_payments(self, skip: int = 0, take: int = 10) -> dict:
params = {
"projectId": self.project_id,
"Skip": skip,
"Take": take
}

response = requests.get(f"{self.BASE_URL}/List", params=params)
response.raise_for_status()

return response.json()


trk = TirikchilikPaymentAPI()

# To'lov chekini yaratish
print(trk.create_payment(100000, "uzum"))

# To'lovlar ro'yxatini olish
print(trk.list_payments())
2



tgoop.com/iCoderNet/921
Create:
Last Update:

import requests

class TirikchilikPaymentAPI:
BASE_URL = "https://api.tirikchilik.uz/api/ProjectPay"
SUPPORTED_SYSTEMS = {"click", "payme", "uzum"}

def __init__(self, project_id: int = 1953):
self.project_id = project_id

def create_payment(self, amount: int, payment_system: str, donater: str = "", notes: str = "") -> dict:
if payment_system not in self.SUPPORTED_SYSTEMS:
raise ValueError(f"Unsupported payment system. Choose from: {', '.join(self.SUPPORTED_SYSTEMS)}")

payload = {
"projectId": self.project_id,
"amount": amount,
"source": "",
"donater": donater,
"notes": notes,
"paymentSystem": payment_system
}

response = requests.post(f"{self.BASE_URL}/Create", json=payload)
response.raise_for_status() # Raise error for bad HTTP responses (4xx or 5xx)

return response.json()

def list_payments(self, skip: int = 0, take: int = 10) -> dict:
params = {
"projectId": self.project_id,
"Skip": skip,
"Take": take
}

response = requests.get(f"{self.BASE_URL}/List", params=params)
response.raise_for_status()

return response.json()


trk = TirikchilikPaymentAPI()

# To'lov chekini yaratish
print(trk.create_payment(100000, "uzum"))

# To'lovlar ro'yxatini olish
print(trk.list_payments())

BY #iCoderNet


Share with your friend now:
tgoop.com/iCoderNet/921

View MORE
Open in Telegram


Telegram News

Date: |

A few years ago, you had to use a special bot to run a poll on Telegram. Now you can easily do that yourself in two clicks. Hit the Menu icon and select “Create Poll.” Write your question and add up to 10 options. Running polls is a powerful strategy for getting feedback from your audience. If you’re considering the possibility of modifying your channel in any way, be sure to ask your subscribers’ opinions first. On June 7, Perekopsky met with Brazilian President Jair Bolsonaro, an avid user of the platform. According to the firm's VP, the main subject of the meeting was "freedom of expression." Telegram Android app: Open the chats list, click the menu icon and select “New Channel.” Telegram iOS app: In the “Chats” tab, click the new message icon in the right upper corner. Select “New Channel.” Today, we will address Telegram channels and how to use them for maximum benefit.
from us


Telegram #iCoderNet
FROM American