diff --git a/README.rst b/README.rst
index fc3dba7..10e4503 100644
--- a/README.rst
+++ b/README.rst
@@ -104,7 +104,6 @@ Search for payments
def index(req, **kwargs):
filters = {
"id": None,
- "site_id": None,
"external_reference": None
}
diff --git a/examples/payment-search/search-approved-payments.py b/examples/payment-search/search-approved-payments.py
index 2e5c8be..26cd73c 100644
--- a/examples/payment-search/search-approved-payments.py
+++ b/examples/payment-search/search-approved-payments.py
@@ -37,14 +37,13 @@ def index(req, **kwargs):
- id | site_id | date_created | operation_type | external_reference |
"""
+ id | date_created | operation_type | external_reference |
"""
for payment in searchResult["response"]["results"]:
output += ""
- output += ""+payment["collection"]["id"]+" | \n"
- output += ""+payment["collection"]["site_id"]+" | \n"
- output += ""+payment["collection"]["date_created"]+" | \n"
- output += ""+payment["collection"]["operation_type"]+" | \n"
- output += ""+payment["collection"]["external_reference"]+" | \n"
+ output += ""+payment["id"]+" | \n"
+ output += ""+payment["date_created"]+" | \n"
+ output += ""+payment["operation_type"]+" | \n"
+ output += ""+payment["external_reference"]+" | \n"
output += "
"
output += """
diff --git a/examples/payment-search/search-creditcard-payments.py b/examples/payment-search/search-creditcard-payments.py
index bbe4e0a..7d3601a 100644
--- a/examples/payment-search/search-creditcard-payments.py
+++ b/examples/payment-search/search-creditcard-payments.py
@@ -20,7 +20,7 @@ def index(req, **kwargs):
filters = {
"begin_date": "2011-10-21T00:00:00Z",
"end_date": "2011-10-25T24:00:00Z",
- "payment_type": "credit_card",
+ "payment_type_id": "credit_card",
"operation_type": "regular_payment"
}
@@ -39,9 +39,9 @@ def index(req, **kwargs):
id | external_reference | status |
"""
for payment in searchResult["response"]["results"]:
output += ""
- output += ""+payment["collection"]["id"]+" | \n"
- output += ""+payment["collection"]["external_reference"]+" | \n"
- output += ""+payment["collection"]["status"]+" | \n"
+ output += ""+payment["id"]+" | \n"
+ output += ""+payment["external_reference"]+" | \n"
+ output += ""+payment["status"]+" | \n"
output += "
"
output += """
diff --git a/examples/payment-search/search-funded-payments-by-name.py b/examples/payment-search/search-funded-payments-by-name.py
index 872ddce..a8471c8 100644
--- a/examples/payment-search/search-funded-payments-by-name.py
+++ b/examples/payment-search/search-funded-payments-by-name.py
@@ -19,7 +19,7 @@ def index(req, **kwargs):
filters = {
"installments": 12,
- "reason": "product_name",
+ "description": "product_name",
"operation_type": "regular_payment"
}
@@ -38,9 +38,9 @@ def index(req, **kwargs):
id | external_reference | status |
"""
for payment in searchResult["response"]["results"]:
output += ""
- output += ""+payment["collection"]["id"]+"\n"
- output += " | "+payment["collection"]["external_reference"]+"\n"
- output += " | "+payment["collection"]["status"]+"\n"
+ output += " | "+payment["id"]+"\n"
+ output += " | "+payment["external_reference"]+"\n"
+ output += " | "+payment["status"]+"\n"
output += " |
"
output += """
diff --git a/examples/payment-search/search-payments-from-email-and-date.py b/examples/payment-search/search-payments-from-email-and-date.py
index fd1de3b..eb73049 100644
--- a/examples/payment-search/search-payments-from-email-and-date.py
+++ b/examples/payment-search/search-payments-from-email-and-date.py
@@ -2,7 +2,7 @@
"""
MercadoPago SDK
-Search payments from two e-mails in January
+Search payments from an e-mail in January
"""
# Import Mercadopago library
@@ -18,7 +18,7 @@ def index(req, **kwargs):
mp = mercadopago.MP("CLIENT_ID", "CLIENT_SECRET")
filters = {
- "payer_email": "mail02@mail02.com%20mail01@mail01.com",
+ "payer.email": "mail02@mail02.com",
"begin_date": "2011-01-01T00:00:00Z",
"end_date": "2011-02-01T00:00:00Z"
}
@@ -31,17 +31,16 @@ def index(req, **kwargs):
- Search payments from two e-mails in January
+ Search payments from an e-mail in January
- id | site_id | payment_type | status |
"""
+ id | payment_type | status |
"""
for payment in searchResult["response"]["results"]:
output += ""
- output += ""+payment["collection"]["id"]+"\n"
- output += " | "+payment["collection"]["site_id"]+"\n"
- output += " | "+payment["collection"]["payment_type"]+"\n"
- output += " | "+payment["collection"]["status"]+"\n"
+ output += " | "+payment["id"]+"\n"
+ output += " | "+payment["payment_type"]+"\n"
+ output += " | "+payment["status"]+"\n"
output += " |
"
output += """
diff --git a/examples/payment-search/search-payments.py b/examples/payment-search/search-payments.py
index f23deb1..aca84b3 100644
--- a/examples/payment-search/search-payments.py
+++ b/examples/payment-search/search-payments.py
@@ -18,7 +18,6 @@ def index(req, **kwargs):
mp = mercadopago.MP("CLIENT_ID", "CLIENT_SECRET")
filters = {
- "site_id": "MLA", # Argentina: MLA; Brasil: MLB
"external_reference": "Bill001"
}
@@ -37,9 +36,9 @@ def index(req, **kwargs):
id | external_reference | status |
"""
for payment in searchResult["response"]["results"]:
output += ""
- output += ""+payment["collection"]["id"]+" | \n"
- output += ""+payment["collection"]["external_reference"]+" | \n"
- output += ""+payment["collection"]["status"]+" | \n"
+ output += ""+payment["id"]+" | \n"
+ output += ""+payment["external_reference"]+" | \n"
+ output += ""+payment["status"]+" | \n"
output += "
"
output += """
diff --git a/mercadopago/mercadopago.py b/mercadopago/mercadopago.py
index 00f2d88..021ddc2 100644
--- a/mercadopago/mercadopago.py
+++ b/mercadopago/mercadopago.py
@@ -90,7 +90,7 @@ def get_payment(self, id):
uri_prefix = "/sandbox" if self.__sandbox else ""
- payment_info = self.__rest_client.get(uri_prefix+"/collections/notifications/"+id+"?access_token="+access_token)
+ payment_info = self.__rest_client.get("/v1/payments/"+id+"?access_token="+access_token)
return payment_info
def get_payment_info(self, id):
@@ -117,8 +117,8 @@ def refund_payment(self, id):
"""
access_token = self.get_access_token()
- refund_status = {"status":"refunded"}
- response = self.__rest_client.put("/collections/"+id+"?access_token="+access_token, refund_status)
+ refund_status = {}
+ response = self.__rest_client.post("/v1/payments/"+id+"/refunds?access_token="+access_token, refund_status)
return response
@@ -132,7 +132,7 @@ def cancel_payment(self, id):
access_token = self.get_access_token()
cancel_status = {"status":"cancelled"}
- response = self.__rest_client.put("/collections/"+id+"?access_token="+access_token, cancel_status)
+ response = self.__rest_client.put("/v1/payments/"+id+"?access_token="+access_token, cancel_status)
return response
@@ -167,7 +167,7 @@ def search_payment(self, filters, offset=0, limit=0):
uri_prefix = "/sandbox" if self.__sandbox else ""
- payment_result = self.__rest_client.get(uri_prefix+"/collections/search", filters)
+ payment_result = self.__rest_client.get("/v1/payments/search", filters)
return payment_result
def create_preference(self, preference):
diff --git a/setup.py b/setup.py
index 0f37119..92fc8d8 100644
--- a/setup.py
+++ b/setup.py
@@ -25,7 +25,7 @@ def run(self):
setup(
name='mercadopago',
- version='0.3.4',
+ version='0.3.5',
author='Horacio Casatti ',
author_email='horacio.casatti@mercadolibre.com',
keywords='api mercadopago checkout payment ipn sdk integration',