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
Escrow
somentelucas edited this page Sep 4, 2018
·
8 revisions
TO DO
Authorization | able |
---|---|
Basic Auth | ❌ |
OAuth | ✅ |
Map<String, Object> responseRelease = Moip.API.escrows().release("escrow_id", setup);
To create a payment using escrow, use the Payments resource and include the following object:
"escrow":{
"description" : "Description of the escrow"
}
Example of a payment with escrow using the credit card hash:
Map<String, Object> taxDocument = payloadFactory(
value("type", "CPF"),
value("number", "33333333333")
);
Map<String, Object> phone = payloadFactory(
value("countryCode", "55"),
value("areaCode", "11"),
value("number", "66778899")
);
Map<String, Object> holder = payloadFactory(
value("fullname", "Portador Teste Moip"),
value("birthdate", "1988-12-30"),
value("taxDocument", taxDocument),
value("phone", phone)
);
Map<String, Object> creditCard = payloadFactory(
value("hash", "CREDIT_CARD_HASH"),
value("holder", holder)
);
Map<String, Object> fundingInstrument = payloadFactory(
value("method", "CREDIT_CARD"),
value("creditCard", creditCard)
);
Map<String, Object> escrowDescription = payloadFactory(
value("description", "Escrow description")
);
Map<String, Object> escrow = payloadFactory(
value("escrow", escrowDescription)
);
Map<String, Object> payment = payloadFactory(
value("installmentCount", 1),
value("escrow", escrow),
value("statementDescriptor", "minhaLoja.com"),
value("fundingInstrument", fundingInstrument)
);
Map<String, Object> newPay = Moip.API.payments().pay(payment, "order_id", setup);