Skip to content

Commit

Permalink
add idempotency key on readme
Browse files Browse the repository at this point in the history
  • Loading branch information
taliyada committed Feb 6, 2024
1 parent 73061bb commit 65c605a
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": '[email protected]'
}
}
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 65c605a

Please sign in to comment.