Spaces:
Sleeping
Sleeping
| 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: | |
| async def update_payment_status(status: bool, _id: int): | |
| supabase = await async_supabase_client(supabase_config) | |
| response = await supabase.table(Tables.PAYMENTS) \ | |
| .update({'status': 'accepted' if status else 'declined'}) \ | |
| .eq('id', _id) \ | |
| .execute() | |
| return response.data[0]['id'] | |