def __init__(self,
                 base_url,
                 auth,
                 mcash_merchant,
                 mcash_user=None,
                 mcash_integrator=None,
                 additional_headers=None,
                 logger=None
                 ):
        """
        TODO: we need some explanations of the arguments here
        """
        if additional_headers is None:
            additional_headers = {}

        self.backend = RequestsFramework()
        self.auth = auth
        self.logger = logger or logging.getLogger(__name__)
        base_url = base_url.replace('/merchant/v1', '')
        self.base_url = base_url
        self.merchant_api_base_url = base_url + '/merchant/v1'
        # save the merchant_id, we will use it for some callback values
        self.mcash_merchant = mcash_merchant
        if (mcash_user and mcash_integrator) or (not mcash_user and not mcash_integrator):
            raise ValueError("either mcash_user or mcash_integrator should be set")
        self.mcash_user = mcash_user
        self.mcash_integrator = mcash_integrator
        self.default_headers = self._default_headers.copy()
        self.default_headers.update(additional_headers)
def __init__ ( self , base_url , auth , mcash_merchant , mcash_user = None , mcash_integrator = None , additional_headers = None , logger = None ) : if additional_headers is None : additional_headers = { } self . backend = RequestsFramework ( ) self . auth = auth self . logger = logger or logging . getLogger ( __name__ ) base_url = base_url . replace ( '/merchant/v1' , '' ) self . base_url = base_url self . merchant_api_base_url = base_url + '/merchant/v1' self . mcash_merchant = mcash_merchant if ( mcash_user and mcash_integrator ) or ( not mcash_user and not mcash_integrator ) : raise ValueError ( "either mcash_user or mcash_integrator should be set" ) self . mcash_user = mcash_user self . mcash_integrator = mcash_integrator self . default_headers = self . _default_headers . copy ( ) self . default_headers . update ( additional_headers )
TODO: we need some explanations of the arguments here