Skip to content

Commit 9819dd9

Browse files
authored
Merge pull request mercadopago#31 from mercadopago/release/2.0.0
Release/2.0.0
2 parents b8a6bf9 + 70d9ff9 commit 9819dd9

29 files changed

Lines changed: 454 additions & 463 deletions

MANIFEST.in

100644100755
File mode changed.

README.rst

100644100755
Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ Get an existent Checkout preference
4747
::
4848

4949
def index(req, **kwargs):
50-
preferenceResult = mp.get_preference("PREFERENCE_ID")
50+
preferenceResult = mp.preference.get("PREFERENCE_ID")
5151
5252
return json.dumps(preferenceResult, indent=4)
5353

@@ -68,7 +68,7 @@ Create a Checkout preference
6868
]
6969
}
7070

71-
preferenceResult = mp.create_preference(preference)
71+
preferenceResult = mp.preference.create(preference)
7272

7373
return json.dumps(preferenceResult, indent=4)
7474

@@ -89,7 +89,7 @@ Update an existent Checkout preference
8989
]
9090
}
9191
92-
preferenceResult = mp.update_preference(id, preference)
92+
preferenceResult = mp.preference.update(id, preference)
9393
9494
return json.dumps(preferenceResult, indent=4)
9595

@@ -107,7 +107,7 @@ Search for payments
107107
"external_reference": None
108108
}
109109

110-
searchResult = mp.search_payment(filters)
110+
searchResult = mp.payment.search(filters)
111111
112112
return json.dumps(searchResult, indent=4)
113113

@@ -121,7 +121,7 @@ Get payment data
121121

122122
def index(req, **kwargs):
123123
mp = mercadopago.MP("CLIENT_ID", "CLIENT_SECRET")
124-
paymentInfo = mp.get_payment (kwargs["id"])
124+
paymentInfo = mp.payment.get(kwargs["id"])
125125
126126
if paymentInfo["status"] == 200:
127127
return json.dumps(paymentInfo, indent=4)
@@ -134,7 +134,7 @@ Cancel (only for pending payments)
134134
::
135135

136136
def index(req, **kwargs):
137-
result = mp.cancel_payment("ID")
137+
result = mp.payment.cancel("ID")
138138
139139
// Show result
140140
return json.dumps(result, indent=4)
@@ -146,7 +146,7 @@ Refund (only for accredited payments)
146146
::
147147

148148
def index(req, **kwargs):
149-
result = mp.refund_payment("ID")
149+
result = mp.payment.get_refund("ID")
150150
151151
// Show result
152152
return json.dumps(result, indent=4)
@@ -177,21 +177,21 @@ Create payment
177177

178178
::
179179

180-
mp.post ("/v1/payments", payment_data)
180+
mp.genericcall.post("/v1/payments", payment_data)
181181

182182
Create customer
183183
~~~~~~~~~~~~~~~
184184

185185
::
186186

187-
mp.post ("/v1/customers", {"email": "email@test.com"})
187+
mp.genericcall.post("/v1/customers", {"email": "email@test.com"})
188188

189189
Get customer
190190
~~~~~~~~~~~~
191191

192192
::
193193

194-
mp.get ("/v1/customers/CUSTOMER_ID")
194+
mp.genericcall.get("/v1/customers/CUSTOMER_ID")
195195

196196
* View more Custom checkout related APIs in Developers Site
197197
* Argentina: `https://www.mercadopago.com.ar/developers <https://www.mercadopago.com.ar/developers>`_
@@ -208,22 +208,22 @@ You can access any other resource from the MercadoPago API using the generic met
208208
::
209209

210210
// Get a resource, with optional URL params. Also you can disable authentication for public APIs
211-
mp.get ("/resource/uri", [params], [authenticate=true]);
211+
mp.genericcall.get("/resource/uri", [params], [authenticate=true]);
212212

213213
// Create a resource with "data" and optional URL params.
214-
mp.post ("/resource/uri", data, [params]);
214+
mp.genericcall.post("/resource/uri", data, [params]);
215215

216216
// Update a resource with "data" and optional URL params.
217-
mp.put ("/resource/uri", data, [params]);
217+
mp.genericcall.put("/resource/uri", data, [params]);
218218

219219
// Delete a resource with optional URL params.
220-
mp.delete ("/resource/uri", [params]);
220+
mp.genericcall.delete("/resource/uri", [params]);
221221

222222
For example, if you want to get the Sites list (no params and no authentication):
223223

224224
::
225225

226-
result = mp.get ("/sites", null, false);
226+
result = mp.genericcall.get("/sites", null, false);
227227

228228
print (json.dumps(result, indent=4))
229229

examples/checkout-buttons/basic-preference/button.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ def index(req, **kwargs):
2222
}
2323
mp = mercadopago.MP("CLIENT_ID", "CLIENT_SECRET")
2424

25-
preferenceResult = mp.create_preference(preference)
25+
preferenceResult = mp.preference.create(preference)
2626

2727
url = preferenceResult["response"]["init_point"]
2828

examples/instant-payment-notifications/receive-ipn.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ def index(req, **kwargs):
2020
mp = mercadopago.MP("CLIENT_ID", "CLIENT_SECRET")
2121

2222
# Get the payment reported by the IPN. Glossary of attributes response in https://developers.mercadopago.com
23-
paymentInfo = mp.get_payment_info(kwargs["id"])
23+
paymentInfo = mp.payment.get(kwargs["id"])
2424

2525
# Show payment information
2626
if paymentInfo["status"] == 200:

examples/payment-search/search-approved-payments.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ def index(req, **kwargs):
2626
}
2727

2828
# Search payment data according to filters
29-
searchResult = mp.search_payment(filters)
29+
searchResult = mp.payment.search(filters)
3030

3131
# Processes the payment information
3232
output = """
@@ -45,7 +45,7 @@ def index(req, **kwargs):
4545
output += "<td>"+payment["operation_type"]+"</td>\n"
4646
output += "<td>"+payment["external_reference"]+"</td>\n"
4747
output += "</tr>"
48-
output += """
48+
output += """
4949
</table>
5050
</body>
5151
</html>

examples/payment-search/search-creditcard-payments.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ def index(req, **kwargs):
2525
}
2626

2727
# Search payment data according to filters
28-
searchResult = mp.search_payment(filters)
28+
searchResult = mp.payment.search(filters)
2929

3030
# Show payment information
3131
output = """

examples/payment-search/search-funded-payments-by-name.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ def index(req, **kwargs):
2424
}
2525

2626
# Search payment data according to filters
27-
searchResult = mp.search_payment(filters)
27+
searchResult = mp.payment.search(filters)
2828

2929
# Show payment information
3030
output = """

examples/payment-search/search-payments-from-email-and-date.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ def index(req, **kwargs):
2424
}
2525

2626
# Search payment data according to filters
27-
searchResult = mp.search_payment(filters)
27+
searchResult = mp.payment.search(filters)
2828

2929
# Show payment information
3030
output = """

examples/payment-search/search-payments.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ def index(req, **kwargs):
2222
}
2323

2424
# Search payment data according to filters
25-
searchResult = mp.search_payment(filters)
25+
searchResult = mp.payment.search(filters)
2626

2727
# Show payment information
2828
output = """

examples/preapproval-payments/button.py

Lines changed: 0 additions & 47 deletions
This file was deleted.

0 commit comments

Comments
 (0)