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
Multipayments
somentelucas edited this page Aug 29, 2018
·
8 revisions
TO DO
TO DO
Authorization | able |
---|---|
Basic Auth | ✅ |
OAuth | ✅ |
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("number", 5555666677778884),
value("cvc", 123),
value("expirationMonth", 12),
value("expirationYear", 24),
value("holder", holder)
);
Map<String, Object> fundingInstrument = payloadFactory(
value("method", "CREDIT_CARD"),
value("creditCard", creditCard)
);
Map<String, Object> payment = payloadFactory(
value("installmentCount", 1),
value("statementDescriptor", "minhaLoja.com"),
value("fundingInstrument", fundingInstrument)
);
Map<String, Object> newPay = Moip.API.multiorders().pay(payment, "multiorder_id", setup);
The Credit Card Hash is an encrypted version of the credit card. This encryption must occur on the front-end using our Javascript Encryption SDK.
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> payment = payloadFactory(
value("installmentCount", 1),
value("statementDescriptor", "minhaLoja.com"),
value("fundingInstrument", fundingInstrument)
);
Map<String, Object> newPay = Moip.API.multiorders().pay(payment, "multiorder_id", setup);