class Endpoints(object):
def __init__(self, options):
super(Endpoints, self).__init__()
self.token = None
self.options = options
def __getattr__(self, name):
print('PRINT ENDPOINT NAME -><><><>',name)
if name in Constants.APIS['PIX']['ENDPOINTS']:
self.endpoints = Constants.APIS['PIX']['ENDPOINTS']
self.urls = Constants.APIS['PIX']['URL']
elif name in Constants.APIS['OPEN-FINANCE']['ENDPOINTS']:
self.endpoints = Constants.APIS['OPEN-FINANCE']['ENDPOINTS']
self.urls = Constants.APIS['OPEN-FINANCE']['URL']
elif name in Constants.APIS['PAYMENTS']['ENDPOINTS']:
self.endpoints = Constants.APIS['PAYMENTS']['ENDPOINTS']
self.urls = Constants.APIS['PAYMENTS']['URL']
elif name in Constants.APIS['OPENING-ACCOUNTS']['ENDPOINTS']:
self.endpoints = Constants.APIS['OPENING-ACCOUNTS']['ENDPOINTS']
self.urls = Constants.APIS['OPENING-ACCOUNTS']['URL']
else:
self.endpoints = Constants.APIS['CHARGES']['ENDPOINTS']
self.urls = Constants.APIS['CHARGES']['URL']
self.options['certificate'] = None
print('Setting certificate to None')
self.get_url()
return partial( self.request, self.endpoints[name])