Skip to content

Commit

Permalink
Merge pull request #145 from Laktus/feature/implement_vormerksaldo
Browse files Browse the repository at this point in the history
BVPSD2-256 AIS BalanceType expected (Vormerksaldo)
  • Loading branch information
age-77 committed Dec 14, 2021
2 parents 18e6d48 + 431d514 commit acf7d10
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ public class BalancesReport {

private Balance readyBalance;
private Balance unreadyBalance;
private Balance reservedBalance;
private Balance creditBalance;
private Balance availableBalance;
private Balance usedBalance;
Expand All @@ -37,6 +38,11 @@ public BalancesReport unreadyBalance(Balance unreadyBalance) {
return this;
}

public BalancesReport reservedBalance(Balance reservedBalance) {
this.reservedBalance = reservedBalance;
return this;
}

public BalancesReport creditBalance(Balance creditBalance) {
this.creditBalance = creditBalance;
return this;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,32 +38,32 @@ public SinglePaymentJob(TransactionRequest<SinglePayment> transactionRequest, Hb
AbstractHBCIJob createHbciJob() {
SinglePayment singlePayment = transactionRequest.getTransaction();

AbstractSEPAGV paympentJob;
AbstractSEPAGV paymentJob;
if (singlePayment instanceof FutureSinglePayment) {
paympentJob = new GVTermUebSEPA(dialog.getPassport(), GVTermUebSEPA.getLowlevelName());
paympentJob.setParam("date", ((FutureSinglePayment) singlePayment).getExecutionDate().toString());
paymentJob = new GVTermUebSEPA(dialog.getPassport(), GVTermUebSEPA.getLowlevelName());
paymentJob.setParam("date", ((FutureSinglePayment) singlePayment).getExecutionDate().toString());
} else {
if (singlePayment.isInstantPayment()) {
paympentJob = new GVInstantUebSEPA(dialog.getPassport(), GVInstantUebSEPA.getLowlevelName());
paymentJob = new GVInstantUebSEPA(dialog.getPassport(), GVInstantUebSEPA.getLowlevelName());
} else {
paympentJob = new GVUebSEPA(dialog.getPassport(), GVUebSEPA.getLowlevelName());
paymentJob = new GVUebSEPA(dialog.getPassport(), GVUebSEPA.getLowlevelName());
}
}

paympentJob.setParam("src", getHbciKonto());
paympentJob.setParam("dst", createReceiverAccount(singlePayment));
paympentJob.setParam("btg", new Value(singlePayment.getAmount(), singlePayment.getCurrency()));
paymentJob.setParam("src", getHbciKonto());
paymentJob.setParam("dst", createReceiverAccount(singlePayment));
paymentJob.setParam("btg", new Value(singlePayment.getAmount(), singlePayment.getCurrency()));
if (singlePayment.getPurpose() != null) {
paympentJob.setParam("usage", singlePayment.getPurpose());
paymentJob.setParam("usage", singlePayment.getPurpose());
}
if (singlePayment.getPurposecode() != null) {
paympentJob.setParam("purposecode", singlePayment.getPurposecode());
paymentJob.setParam("purposecode", singlePayment.getPurposecode());
}
if (singlePayment.getEndToEndId() != null) {
paympentJob.setParam("endtoendid", singlePayment.getEndToEndId());
paymentJob.setParam("endtoendid", singlePayment.getEndToEndId());
}

return paympentJob;
return paymentJob;
}

private Konto createReceiverAccount(SinglePayment singlePayment) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ default BalancesReport createBalancesReport(GVRSaldoReq gvSaldoReq, String accou
@Mapping(target = "availableBalance", source = "available")
@Mapping(target = "creditBalance", source = "kredit")
@Mapping(target = "unreadyBalance", source = "unready")
@Mapping(target = "reservedBalance", source = "reserved")
@Mapping(target = "usedBalance", source = "used")
BalancesReport toBalancesReport(GVRSaldoReq.Info saldoInfo);

Expand Down

0 comments on commit acf7d10

Please sign in to comment.