Skip to content

Commit

Permalink
feat: recuperar saldo da conta
Browse files Browse the repository at this point in the history
  • Loading branch information
jpdev01 committed Nov 25, 2023
1 parent 74d5446 commit 5bb52c6
Show file tree
Hide file tree
Showing 4 changed files with 46 additions and 5 deletions.
3 changes: 2 additions & 1 deletion src/main/java/br/com/jpdev01/asaassdk/http/Domain.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@ public enum Domain {
CUSTOMER_ACCOUNT_NOTIFICATIONS("customers/$id/notifications"),
PAYMENT_STATUS("payments/$id/status"),
PAYMENT_RESTORE("payments/$id/restore"),
INSTALLMENT("installments");
INSTALLMENT("installments"),
FINANCE_BALANCE("finance/balance");

private final String value;

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
package br.com.jpdev01.asaassdk.rest.finance;

import java.math.BigDecimal;

public class FinanceBalance {

public BigDecimal balance;

public static FinanceBalanceFetcher fetcher() {
return new FinanceBalanceFetcher();
}

public BigDecimal getBalance() {
return balance;
}

public FinanceBalance setBalance(BigDecimal value) {
this.balance = value;
return this;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
package br.com.jpdev01.asaassdk.rest.finance;

import br.com.jpdev01.asaassdk.http.Domain;
import br.com.jpdev01.asaassdk.rest.action.Fetcher;

public class FinanceBalanceFetcher extends Fetcher<FinanceBalance> {

@Override
public String getResourceUrl() {
return Domain.FINANCE_BALANCE.toString();
}

@Override
public Class<FinanceBalance> getResourceClass() {
return FinanceBalance.class;
}
}
10 changes: 6 additions & 4 deletions src/main/java/br/com/jpdev01/asaassdk/teste/Teste.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import br.com.jpdev01.asaassdk.http.Asaas;
import br.com.jpdev01.asaassdk.rest.action.ResourceSet;
import br.com.jpdev01.asaassdk.rest.finance.FinanceBalance;
import br.com.jpdev01.asaassdk.rest.installment.Installment;
import br.com.jpdev01.asaassdk.rest.installment.InstallmentDeleter;
import br.com.jpdev01.asaassdk.rest.payment.Payment;
Expand Down Expand Up @@ -77,10 +78,11 @@ public static void main(String[] args) {
// ResourceSet<Installment> installmentResourceSet = Installment.reader().read();
// DeletedResource installmentDeleted = Installment.deleter(installmentResourceSet.getData().get(0).getId()).delete();
// ResourceSet<PixTransaction> pixTransactionResourceSet = PixTransaction.reader().read();
ResourceSet<PixTransaction> pixTransactionResourceSet = PixTransaction.reader()
.setType(PixTransactionType.DEBIT)
.read();
PixTransaction cancelledPixTransaction = PixTransaction.canceller("35363f6e-93e2-11ec-b9d9-96f4053b1bd4").create();
// ResourceSet<PixTransaction> pixTransactionResourceSet = PixTransaction.reader()
// .setType(PixTransactionType.DEBIT)
// .read();
// PixTransaction cancelledPixTransaction = PixTransaction.canceller("35363f6e-93e2-11ec-b9d9-96f4053b1bd4").create();
FinanceBalance financeBalance = FinanceBalance.fetcher().fetch();

// PixAddressKey.creator().setType(PixAddressKeyType.EVP).create();
// PixAddressKey.reader().read();
Expand Down

0 comments on commit 5bb52c6

Please sign in to comment.