Skip to content

Commit dd88082

Browse files
author
Pedro Gonçalves
committed
Added tracking headers feature
1 parent b8a6bf9 commit dd88082

1 file changed

Lines changed: 14 additions & 2 deletions

File tree

mercadopago/mercadopago.py

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,13 @@ class MPInvalidCredentials(MPException):
3333

3434

3535
class MP(object):
36-
version = "1.1.1"
36+
version = "1.2.0"
3737
__access_data = None
3838
__ll_access_token = None
3939
__sandbox = False
40+
platform_id = None
41+
integrator_id = None
42+
corporation_id = None
4043

4144
def __init__(self, *args):
4245
"""
@@ -80,6 +83,15 @@ def get_access_token(self):
8083
else:
8184
raise MPInvalidCredentials(str(access_data))
8285

86+
def set_platform_id(self, platform_id):
87+
self.platform_id = platform_id
88+
89+
def set_integrator_id(self, integrator_id):
90+
self.integrator_id = integrator_id
91+
92+
def set_corporation_id(self, corporation_id):
93+
self.corporation_id = corporation_id
94+
8395
def get_payment(self, id):
8496
"""
8597
Get information for specific payment
@@ -353,7 +365,7 @@ def post(self, uri, data=None, params=None, content_type=MIME_JSON):
353365
data = JSONEncoder().encode(data)
354366

355367
s = self.get_session()
356-
api_result = s.post(self.__API_BASE_URL+uri, params=params, data=data, headers={'x-product-id': self.PRODUCT_ID, 'x-tracking-id': self.TRACKING_ID, 'User-Agent':self.USER_AGENT, 'Content-type':content_type, 'Accept':self.MIME_JSON})
368+
api_result = s.post(self.__API_BASE_URL+uri, params=params, data=data, headers={'x-product-id': self.PRODUCT_ID, 'x-tracking-id': self.TRACKING_ID, 'User-Agent':self.USER_AGENT, 'Content-type':content_type, 'Accept':self.MIME_JSON, 'x-platform-id':self.__outer.platform_id, 'x-integrator-id':self.__outer.integrator_id, 'x-corporation-id':self.__outer.corporation_id})
357369

358370
response = {
359371
"status": api_result.status_code,

0 commit comments

Comments
 (0)