Skip to content

DeveloperCielo/order-management

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Cielo Lio Order Management

SDK para integração com o order management da plataforma da Cielo/M4U na cloud.

Configuração do Order Management

OrderManagement orderManagement = new OrderManagement("id do merchant",
                                                      "access token",
                                                      Environment.PRODUCTION);

Criação de um Order

Order order = new Order("0992f1d5-cee5-40d9-a964-8f4d6a9e4aa6");
order.setReference("PEDIDO #1234");
order.setStatus(Order.Status.DRAFT);
order.setNotes("Mesa 1");
order.setPrice(9155);

order.addNewItem(500).setSku("ede8f84a-8b86-45cb-8e57-6a593c25c6ed")
                     .setQuantity(2)
                     .setUnitOfMeasure(OrderItem.UnitOfMeasure.EACH);

order.addNewItem(1500).setSku("c2f5fb9a-5542-406e-8b79-17892329cda8")
                      .setQuantity(3)
                      .setUnitOfMeasure(OrderItem.UnitOfMeasure.EACH);

order.addNewItem(550).setName("Valor avulso")
                     .setQuantity(3)
                     .setUnitOfMeasure(OrderItem.UnitOfMeasure.EACH);

order.addNewItem(2005).setName("Valor avulso")
                      .setUnitOfMeasure(OrderItem.UnitOfMeasure.EACH);

try {
    order = orderManagement.createOrder(order);
} catch (IOException e) {
    // ...
} catch (CieloRequestException e) {
    e.printStackTrace();
}

Cancelando um Order

try {
	orderManagement.cancelOrder("de305d54-75b4-431b-adb2-eb6b9e546014");
} catch (IOException e) {
	// TODO Auto-generated catch block
	e.printStackTrace();
} catch (CieloRequestException e) {
	// TODO Auto-generated catch block
	e.printStackTrace();
}

Liberando um Order para pagamento

try {
	orderManagement.placeOrder("de305d54-75b4-431b-adb2-eb6b9e546014");
} catch (IOException e) {
	// TODO Auto-generated catch block
	e.printStackTrace();
} catch (CieloRequestException e) {
	// TODO Auto-generated catch block
	e.printStackTrace();
}

Liberando um Order para verificação

try {
	orderManagement.releaseOrderForVerification("de305d54-75b4-431b-adb2-eb6b9e546014");
} catch (IOException e) {
	// TODO Auto-generated catch block
	e.printStackTrace();
} catch (CieloRequestException e) {
	// TODO Auto-generated catch block
	e.printStackTrace();
}

Aprovar um Order após o pagamento

try {
	orderManagement.approveOrder("de305d54-75b4-431b-adb2-eb6b9e546014");
} catch (IOException e) {
	// TODO Auto-generated catch block
	e.printStackTrace();
} catch (CieloRequestException e) {
	// TODO Auto-generated catch block
	e.printStackTrace();
}

Reprovar um Order após o pagamento

try {
	orderManagement.rejectOrder("de305d54-75b4-431b-adb2-eb6b9e546014");
} catch (IOException e) {
	// TODO Auto-generated catch block
	e.printStackTrace();
} catch (CieloRequestException e) {
	// TODO Auto-generated catch block
	e.printStackTrace();
}

Concluid um Order

try {
	orderManagement.closeOrder("de305d54-75b4-431b-adb2-eb6b9e546014");
} catch (IOException e) {
	// TODO Auto-generated catch block
	e.printStackTrace();
} catch (CieloRequestException e) {
	// TODO Auto-generated catch block
	e.printStackTrace();
}

Consultar um Order

try {
	orderManagement.getOrder("de305d54-75b4-431b-adb2-eb6b9e546014");
} catch (IOException e) {
	// TODO Auto-generated catch block
	e.printStackTrace();
} catch (CieloRequestException e) {
	// TODO Auto-generated catch block
	e.printStackTrace();
}

About

Cielo Lio Order Management

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages