Skip to content

Commit

Permalink
Merge pull request #69 from mercadopago/feature/add-idempotency-on-re…
Browse files Browse the repository at this point in the history
…adme

add idempotency key on readme
  • Loading branch information
taliyada authored Feb 6, 2024
2 parents 73061bb + 65c605a commit 86cd378
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,11 @@ import mercadopago

sdk = mercadopago.SDK("YOUR_ACCESS_TOKEN")

request_options = mercadopago.config.RequestOptions()
request_options.custom_headers = {
'x-idempotency-key': '<SOME_UNIQUE_VALUE>'
}

payment_data = {
"transaction_amount": 100,
"token": "CARD_TOKEN",
Expand All @@ -37,7 +42,7 @@ payment_data = {
"email": 'test_user_123456@testuser.com'
}
}
result = sdk.payment().create(payment_data)
result = sdk.payment().create(payment_data, request_options)
payment = result["response"]

print(payment)
Expand Down

0 comments on commit 86cd378

Please sign in to comment.