How to integrate with Mercado Pago QR Code #90
Replies: 4 comments
-
header used to identify where the message comes from: |
Beta Was this translation helpful? Give feedback.
-
website used for webhook integration testing https://webhook.site/ |
Beta Was this translation helpful? Give feedback.
-
https://discord.com/channels/1078660903450464286/1247303239284559933/1247303239284559933 |
Beta Was this translation helpful? Give feedback.
-
After some more investigation I figured there's another way to do the integration and that might fit better for my needs on the flow I'm planning for the application. The steps I listed above is useful when you're integration with local stores. Which is in fact what this app is supposed to do, a self checkout totem. The problem with that approach is that I don't know in advance the payment Id to update on my system bringing some more complexity to the code since I'd have to filter events and fetch the payment Id if I really want it or could do less and only use the merchant order status and that's it. Only wen I found this thread on MercadoPago discord server I realized the solution was right there. you can create a Payment and set the payment method as pix this will create the QRCode for you and return the PaymentId which for integration purposes that's exactly what I need.
|
Beta Was this translation helpful? Give feedback.
-
Integrating Mercado Pago QR Code Payments
This guide provides a comprehensive overview of how to integrate with Mercado Pago QR code payments.
webhook order created payload payload
The system will receive a notification about the newly created merchant order via webhook.
it can be used to query merchant_order details and get the the
external_reference_id
use
external_reference_id
to find the current order on the system and save the association"order_status": "payment_required"
is the value we're looking for, use this to update the order statusPayment notifications
The messages below will be triggered as soon as you make the payment on your bank account.
merchant order updated webhook payload
when using the sdk to get the details the
order_status
is changed topaid
Important
All requests must be verified. Check more details about how to validate webhook requests' origin
This is one way of validating whether the payment was accepted. might not be the more accurate but I'm going for simplicity on this first investigation.
Beta Was this translation helpful? Give feedback.
All reactions