All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.mercadopago.example.apis.order.GetOrderById Maven / Gradle / Ivy

The newest version!
package com.mercadopago.example.apis.order;

import com.mercadopago.MercadoPagoConfig;
import com.mercadopago.client.order.OrderClient;
import com.mercadopago.exceptions.MPApiException;
import com.mercadopago.exceptions.MPException;
import com.mercadopago.net.MPResponse;

/**
 * Mercado Pago Get Order.
 *
 * @see Documentation
 */
public class GetOrderById {

    public static void main(String[] args) {
        MercadoPagoConfig.setAccessToken("{{ACCESS_TOKEN}}");
        OrderClient client = new OrderClient();

        try {
            MPResponse order = client.get("{{order_id}}").getResponse();
            System.out.println("Getting order: " + order.getContent());

        } catch (MPException | MPApiException e) {
            System.out.println("Error getting order: " + e.getMessage());
        }
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy