Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
"""
Instantiate MP with credentials:
mp = mercadopago.MP(client_id, client_secret)
Instantiate MP with Long Live Access Token:
mp = mercadopago.MP(ll_access_token)
"""
if len(args) == 2:
self.__client_id = args[0]
self.__client_secret = args[1]
elif len(args) == 1:
self.__ll_access_token = args[0]
else:
raise MPInvalidCredentials(None)
self.card = Card(self.__client_id, self.__client_secret, self.__ll_access_token, self.version)
self.cardtoken = CardToken(self.__client_id, self.__client_secret, self.__ll_access_token, self.version)
self.customer = Customer(self.__client_id, self.__client_secret, self.__ll_access_token, self.version)
self.payment = Payment(self.__client_id, self.__client_secret, self.__ll_access_token, self.version)
self.preference = Preference(self.__client_id, self.__client_secret, self.__ll_access_token, self.version)
self.genericcall = GenericCall(self.__client_id, self.__client_secret, self.__ll_access_token, self.version)
self.discountcampaign = DiscountCampaign(self.__client_id, self.__client_secret, self.__ll_access_token, self.version)
self.identificationtype = IdentificationType(self.__client_id, self.__client_secret, self.__ll_access_token, self.version)
self.merchantorder = MerchantOrder(self.__client_id, self.__client_secret, self.__ll_access_token, self.version)
def __init__(self, client_id, client_secret, access_token, version):
super(Card, self).__init__(client_id, client_secret, access_token, version)