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
Refunds
somentelucas edited this page Sep 3, 2018
·
7 revisions
TO DO
import static br.com.moip.helpers.PayloadFactory.payloadFactory;
import static br.com.moip.helpers.PayloadFactory.value;
Index
Authorization | able |
---|---|
Basic Auth | ✅ |
OAuth | ✅ |
Map<String, Object> newRefund = Moip.API.refunds().refundPayment("payment_id", setup);
Map<String, Object> taxDocument = payloadFactory(
value("type", "CPF"),
value("number", "57390209674")
);
Map<String, Object> holder = payloadFactory(
value("fullname", "Jose Silva"),
value("taxDocument", taxDocument)
);
Map<String, Object> bankAccount = payloadFactory(
value("type", "CHECKING"),
value("bankNumber", "001"),
value("agencyNumber", 4444444),
value("agencyCheckNumber", 2),
value("accountNumber", 1234),
value("accountCheckNumber", 1),
value("holder", holder)
);
Map<String, Object> refundingInstrument = payloadFactory(
value("method", "BANK_ACCOUNT"),
value("bankAccount", bankAccount)
);
Map<String, Object> refundBankAccount = payloadFactory(
value("refundingInstrument", refundingInstrument)
);
Map<String, Object> newRefund = Moip.API.refunds().refundPayment(refundBankAccount, "payment_id", setup);
Map<String, Object> moipAccount = payloadFactory(
value("id", "moip_account_id")
);
Map<String, Object> refundingInstrument = payloadFactory(
value("method", "MOIP_ACCOUNT"),
value("moipAccount", moipAccount)
);
Map<String, Object> refundMoipAccount = payloadFactory(
value("amount", "500"),
value("refundingInstrument", refundingInstrument)
);
Map<String, Object> newRefund = Moip.API.refunds().refundPayment(refundMoipAccount, "payment_id", setup);
Authorization | able |
---|---|
Basic Auth | ✅ |
OAuth | ✅ |
Map<String, Object> newRefund = Moip.API.refunds().refundOrder("order_id", setup);
Map<String, Object> taxDocument = payloadFactory(
value("type", "CPF"),
value("number", "57390209674")
);
Map<String, Object> holder = payloadFactory(
value("fullname", "Jose Silva"),
value("taxDocument", taxDocument)
);
Map<String, Object> bankAccount = payloadFactory(
value("type", "CHECKING"),
value("bankNumber", "001"),
value("agencyNumber", 4444444),
value("agencyCheckNumber", 2),
value("accountNumber", 1234),
value("accountCheckNumber", 1),
value("holder", holder)
);
Map<String, Object> refundingInstrument = payloadFactory(
value("method", "BANK_ACCOUNT"),
value("bankAccount", bankAccount)
);
Map<String, Object> refundBankAccount = payloadFactory(
value("refundingInstrument", refundingInstrument)
);
Map<String, Object> newRefund = Moip.API.refunds().refundOrder(refundBankAccount, "order_id", setup);
Map<String, Object> moipAccount = payloadFactory(
value("id", "moip_account_id")
);
Map<String, Object> refundingInstrument = payloadFactory(
value("method", "MOIP_ACCOUNT"),
value("moipAccount", moipAccount)
);
Map<String, Object> refundMoipAccount = payloadFactory(
value("amount", "500"),
value("refundingInstrument", refundingInstrument)
);
Map<String, Object> newRefund = Moip.API.refunds().refundOrder(refundMoipAccount, "order_id", setup);
Authorization | able |
---|---|
Basic Auth | ✅ |
OAuth | ✅ |
Map<String, Object> getResponse = Moip.API.refunds().get("refund_id", setup);
Authorization | able |
---|---|
Basic Auth | ✅ |
OAuth | ✅ |
Map<String, Object> listPaymentRefundResponse = Moip.API.refunds().listPaymentRefunds("payment_id", setup);
Authorization | able |
---|---|
Basic Auth | ✅ |
OAuth | ✅ |
Map<String, Object> listOrderRefundsResponse = Moip.API.refunds().listOrderRefunds("order_id", setup);