Open Dyend opened 3 years ago
Hmmm, odd. I've never seen that happen (after thousands of orders).
"MLC" is "MercadoLibre Colombia", right? I wonder if it's a quirk (or bug?) that's only seen in that region.
I assume these are not the real numbers, right? It would make no sense that two different payments have the same id.
I guess the right thing to do would be to try using collection_id
, and if that's missing, paymen_id
. Should also fail if none of them is set:
MLC is "mercado libre chile" and yes those are not real numbers. I asked on mercado pago support and their anwser was "the field payment_id will be always sent in payment notifications, however collection_id can change with integration type, for example can be order id in products that generate orders."
Right now i'm in production with my fork of this repo, i changed collection id with payment_id, and everything is working fine.
But maybe the best solution is what you said, so it wont dont break anything.
This causes an exception when is not sent, here i will show an example with credit card payment and its json anwser
here with debit card:
as we can see collection id is not sent with debit card payment, but payment_id yes and is the same id.
here is the exception :