I am developing a platform where the client will have the possibility to pay their dues of the plan that has been assigned to them. A seller is also assigned to this user, each vendor has his Mercado Pago account. Up to now the idea is to generate the payments with the client_id and secret_id of each vendor, so that the client pays directly to this vendor.
The problem arises in that I do not want to generate a preference for each user, since in the MP platform I will have the items to pay (ex: Plan 1, Plan 2, Plan 3), previously generated.
I found that Merchant order serves to link these preferences by their id and also add external references that I need in the API when I receive MercadoPago notification (IPN) to validate this payment.
The problem is that you use: $ mp- > post ('/ merchant_orders', $ merchant_order_data); to create the reference, but it does not return a payment link like the create_preference () method does.
How can I use merchant_order to link the tools that each vendor has created on their MP platform?
My code:
$merchant_order_data = array(...);
$merchant_order_info = $mp->get("/merchant_orders/" + merchant_order_data->id, false);
return response($merchant_order_info);
^ This returns a json with the data.
THANK YOU!