import json import stripe from typing import List, Dict, Union, Any from app import create_app, db from models import Payments, PaymentBatch, SinglePayments, PaymentPlans from splynx import Splynx, SPLYNX_URL, SPLYNX_KEY, SPLYNX_SECRET from services import log_activity from config import Config splynx = Splynx(url=SPLYNX_URL, key=SPLYNX_KEY, secret=SPLYNX_SECRET) api_key = Config.STRIPE_LIVE_API_KEY stripe.api_key = api_key if __name__ == "__main__": splynx_id = 1218789 result = splynx.get(url=f"/api/2.0/admin/finance/invoices?main_attributes[customer_id]={splynx_id}&main_attributes[status]=not_paid&main_attributes[status]=pending") print(json.dumps(result,indent=2))