Skip to content
This repository has been archived by the owner on Oct 15, 2024. It is now read-only.

Transfers

Lucas Garcia edited this page Sep 6, 2018 · 4 revisions

Introduction

TO DO

Dependencies

import static br.com.moip.helpers.PayloadFactory.payloadFactory;
import static br.com.moip.helpers.PayloadFactory.value;

Features

Index

Create transfer

Authorization able
Basic Auth
OAuth
Map<String, Object> taxDocument = payloadFactory(
    value("type", "CPF"),
    value("number", "33333333333")
);

Map<String, Object> holder = payloadFactory(
    value("fullname", "Portador Teste Moip"),
    value("taxDocument", taxDocument)
);

Map<String, Object> bankAccount = payloadFactory(
    value("bankNumber", "237"),
    value("agencyNumber", "12345"),
    value("agencyCheckNumber", "8"),
    value("accountNumber", "12345678"),
    value("accountCheckNumber", "8"),
    value("type", "CHECKING"),
    value("holder", holder)
);

Map<String, Object> transferInstrument = payloadFactory(
    value("bankAccount", bankAccount),
    value("method", "BANK_ACCOUNT")
);

Map<String, Object> transferObject = payloadFactory(
    value("transferInstrument", transferInstrument),
    value("amount", "5000")
);

Map<String, Object> newTransfer = Moip.API.transfers().create(transferObject, setup);

Revert transfer

Authorization able
Basic Auth
OAuth
Map<String, Object> newTransfer = Moip.API.transfers().revert("transfer_id", setup);

Get transfer

Authorization able
Basic Auth
OAuth
Map<String, Object> newTransfer = Moip.API.transfers().get("transfer_id", setup);

List transfers

Authorization able
Basic Auth
OAuth
Map<String, Object> newTransfer = Moip.API.transfers().list(setup);
Clone this wiki locally