This repository has been archived by the owner on Oct 15, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 4
Orders
Matheus B. Nakaya edited this page Jul 10, 2018
·
7 revisions
The order is the shop cart representation.
Authorization | able |
---|---|
Basic Auth | ✅ |
OAuth | ✅ |
Map<String, Object> subtotals = new HashMap<>();
subtotals.put("shipping", 15000);
Map<String, Object> amount = new HashMap<>();
amount.put("currency", "BRL");
amount.put("subtotals", subtotals);
Map<String, Object> product1 = new HashMap<>();
product1.put("product", "Product 1 Description");
product1.put("category", "TOYS_AND_GAMES");
product1.put("quantity", 2);
product1.put("detail", "Anakin's Light Saber");
product1.put("price", 100000000);
Map<String, Object> product2 = new HashMap<>();
product2.put("product", "Product 2 Description");
product2.put("category", "SCIENCE_AND_LABORATORY");
product2.put("quantity", 5);
product2.put("detail", "Pym particles");
product2.put("price", 2450000000);
List items = new ArrayList();
items.add(product1);
items.add(product2);
Map<String, Object> customer = new HashMap<>();
customer.put("id", "CUS-XXOBPZ80QLYP");
Map<String, Object> order = new HashMap<>();
order.put("ownId", "order_own_id");
order.put("amount", amount);
order.put("items", items);
order.put("customer", customer);
Map<String, Object> responseCreation = order.create(order, setup);
Authorization | able |
---|---|
Basic Auth | ✅ |
OAuth | ✅ |
Map<String, Object> responseGet = order.get("order_id", setup);
Authorization | able |
---|---|
Basic Auth | ✅ |
OAuth | ✅ |
Map<String, Object> responseList = order.list(setup);
Authorization | able |
---|---|
Basic Auth | ✅ |
OAuth | ✅ |
Map<String, Object> responseListOrderPayments = order.listOrderPayments("order_id", setup);