"""
API SDK for SantimPay Payment Gateway
"""
from .config import Config

import httpx
from .core import SantimPayCheckout, SantimPayDirectPay

class SantimPay:
    http_client = ""
    merchant_id = ""
    private_key = ""
    DEFAULT_TIMEOUT = 1000 * 60 * 2
    checkout = ""
    directPay = ""

    def __init__(self, merchant_id: str, private_key: str, test = False):
        """__Santimay Payment gateway__

        Args:
            merchant_id (str): your merchat id from santimpay
            private_key (str): generated by your own
            test (bool, optional): weather if it is in test mode or not. Defaults to False.
        """
        self.merchant_id = merchant_id
        self.private_key = private_key
        base_url = Config.DEFAULT_TEST_HOST if test else Config.DEFAULT_HOST
        headers = {
            "Content-Type": "application/json; charset=UTF-8",
            "Accepts": "application/json",
        }

        self.http_client = httpx.Client(base_url=base_url, headers=headers)
        
        self.checkout = SantimPayCheckout(self.http_client, merchant_id, private_key)
        self.directPay = SantimPayDirectPay(self.http_client, merchant_id, private_key)
    
