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

Bank Accounts

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

Introduction

TO DO

Dependencies

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

Features

Index

Create bank account

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> getResponse = Moip.API.accounts().createBankAccount(bankAccount, "moip_account_id", setup);

Get bank account

Authorization able
Basic Auth
OAuth
Map<String, Object> getResponse = Moip.API.bankAccounts().get("bank_account_id", setup);

Delete bank account

Authorization able
Basic Auth
OAuth
Map<String, Object> getResponse = Moip.API.bankAccounts().delete("bank_account_id", setup);

Update bank account

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> getResponse = Moip.API.bankAccounts().update(bankAccount, "bank_account_id", setup);

List bank accounts

Authorization able
Basic Auth
OAuth
List<Map<String, Object>> getResponse = Moip.API.accounts().listBankAccounts("moip_account_id", setup);
Clone this wiki locally