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
Customers
Matheus B. Nakaya edited this page Jul 11, 2018
·
10 revisions
Here, on Moip, the customer is a service user or a buyer of your business.
Authorization | able |
---|---|
Basic Auth | ✅ |
OAuth | ✅ |
Map<String, Object> taxDocument = new HashMap<>();
taxDocument.put("type", "CPF");
taxDocument.put("number", "10013390023");
Map<String, Object> phone = new HashMap<>();
phone.put("countryCode", "55");
phone.put("areaCode", "11");
phone.put("number", "22226842");
Map<String, Object> shippingAddress = new HashMap<>();
shippingAddress.put("city", "Sao Paulo");
shippingAddress.put("district", "Itaim BiBi");
shippingAddress.put("street", "Av. Brigadeiro Faria Lima");
shippingAddress.put("streetNumber", "3064");
shippingAddress.put("state", "SP");
shippingAddress.put("country", "BRA");
shippingAddress.put("zipCode", "01451001");
Map<String, Object> customer = new HashMap<>();
customer.put("ownId", "customer_own_id");
customer.put("fullname", "Customer Full Name");
customer.put("email", "[email protected]");
customer.put("birthDate", "1980-5-10");
customer.put("taxDocument", taxDocument);
customer.put("phone", phone);
customer.put("shippingAddress", shippingAddress);
Map<String, Object> newCustomer = Moip.API.customers().create(customer, setup);
Authorization | able |
---|---|
Basic Auth | ✅ |
OAuth | ✅ |
Map<String, Object> taxDocumentHolder = new HashMap<>();
taxDocumentHolder.put("type", "CPF");
taxDocumentHolder.put("number", "22288866644");
Map<String, Object> phoneHolder = new HashMap<>();
phoneHolder.put("countryCode", "55");
phoneHolder.put("areaCode", "11");
phoneHolder.put("number", "55552266");
Map<String, Object> holder = new HashMap<>();
holder.put("fullname", "Test Holder Moip");
holder.put("birthdate", "1990-10-22");
holder.put("taxDocument", taxDocumentHolder);
holder.put("phone", phoneHolder);
Map<String, Object> creditCard = new HashMap<>();
creditCard.put("expirationMonth", "05");
creditCard.put("expirationYear", "22");
creditCard.put("number", "4012001037141112");
creditCard.put("cvc", "123");
creditCard.put("holder", holder);
Map<String, Object> fundingInstrument = new HashMap<>();
fundingInstrument.put("method", "CREDIT_CARD");
fundingInstrument.put("creditCard", creditCard);
Map<String, Object> newCreditCard = Moip.API.customers().addCreditCard(fundingInstrument, "customer_id", setup);
Authorization | able |
---|---|
Basic Auth | ✅ |
OAuth | ✅ |
Map<String, Object> deleteCreditCardResponse = Moip.API.customers().deleteCreditCard(ccId, setup);
Authorization | able |
---|---|
Basic Auth | ✅ |
OAuth | ✅ |
Map<String, Object> responseGet = Moip.API.customers().get("customer_id", setup);
Authorization | able |
---|---|
Basic Auth | ✅ |
OAuth | ✅ |
Map<String, Object> listResponse = Moip.API.customers().list(setup);