Spaces:
Sleeping
Sleeping
File size: 483 Bytes
b61a9fe |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 |
from dotenv import load_dotenv
from core.constants import Tables
from core.interface.supabase_client import supabase_config, async_supabase_client
load_dotenv()
class PaymentDataSource:
@staticmethod
async def add_payment(payment_json: dict) -> int:
supabase = await async_supabase_client(supabase_config)
response = await supabase.table(Tables.PAYMENTS) \
.insert(payment_json) \
.execute()
return response.data[0]['id']
|