use of com.forgerock.openbanking.common.model.openbanking.domain.account.FRTransactionData in project openbanking-aspsp by OpenBankingToolkit.
the class AcceptDueScheduledPaymentTask method createTransaction.
private FRTransaction createTransaction(Account account, FRScheduledPayment payment, FRCreditDebitIndicator creditDebitCode, Balance balance, FRAmount amount) {
log.info("Create transaction");
String transactionId = UUID.randomUUID().toString();
DateTime bookingDate = new DateTime(payment.getCreated());
FRTransactionData transactionData = FRTransactionData.builder().transactionId(transactionId).status(FRTransactionData.FREntryStatus.BOOKED).valueDateTime(DateTime.now()).accountId(account.getId()).amount(amount).creditDebitIndicator(creditDebitCode).bookingDateTime(bookingDate).statementReferences(new ArrayList<>()).balance(FRTransactionData.FRTransactionCashBalance.builder().amount(balance.getCurrencyAndAmount()).creditDebitIndicator(balance.getCreditDebitIndicator()).type(FRBalanceType.INTERIMBOOKED).build()).build();
if (payment.getScheduledPayment().getReference() != null) {
transactionData.setTransactionReference(payment.getScheduledPayment().getReference());
}
FRTransaction transaction = FRTransaction.builder().id(transactionId).bookingDateTime(bookingDate).accountId(account.getId()).transaction(transactionData).build();
log.info("Transaction created {}", transaction);
return transaction;
}
use of com.forgerock.openbanking.common.model.openbanking.domain.account.FRTransactionData in project openbanking-aspsp by OpenBankingToolkit.
the class AcceptFilePaymentTask method createTransaction.
private FRTransaction createTransaction(Account account, FRFilePayment payment, FRCreditDebitIndicator creditDebitCode, Balance balance, FRAmount amount) {
log.info("Create transaction");
String transactionId = UUID.randomUUID().toString();
DateTime bookingDate = new DateTime(payment.getCreated());
FRTransactionData transactionData = FRTransactionData.builder().transactionId(transactionId).status(FRTransactionData.FREntryStatus.BOOKED).valueDateTime(DateTime.now()).accountId(account.getId()).amount(amount).creditDebitIndicator(creditDebitCode).bookingDateTime(bookingDate).statementReferences(new ArrayList<>()).balance(FRTransactionData.FRTransactionCashBalance.builder().amount(balance.getCurrencyAndAmount()).creditDebitIndicator(balance.getCreditDebitIndicator()).type(FRBalanceType.INTERIMBOOKED).build()).build();
transactionData.setTransactionReference(payment.getRemittanceReference());
transactionData.setTransactionInformation(payment.getRemittanceUnstructured());
FRTransaction transaction = FRTransaction.builder().id(transactionId).bookingDateTime(bookingDate).accountId(account.getId()).transaction(transactionData).build();
log.info("Transaction created {}", transaction);
return transaction;
}
use of com.forgerock.openbanking.common.model.openbanking.domain.account.FRTransactionData in project openbanking-aspsp by OpenBankingToolkit.
the class AcceptSinglePaymentTask method createTransaction.
private FRTransaction createTransaction(Account account, FRPaymentSetup paymentSetup, FRCreditDebitIndicator creditDebitCode, Balance balance, FRAmount amount) {
log.info("Create transaction");
String transactionId = UUID.randomUUID().toString();
DateTime bookingDate = new DateTime(paymentSetup.getCreated());
FRTransactionData transactionData = FRTransactionData.builder().accountId(account.getId()).transactionId(transactionId).amount(amount).creditDebitIndicator(creditDebitCode).status(FRTransactionData.FREntryStatus.BOOKED).bookingDateTime(bookingDate).valueDateTime(DateTime.now()).balance(FRTransactionData.FRTransactionCashBalance.builder().amount(balance.getCurrencyAndAmount()).creditDebitIndicator(balance.getCreditDebitIndicator()).type(FRBalanceType.INTERIMBOOKED).build()).build();
if (paymentSetup.getInitiation().getRemittanceInformation() != null) {
transactionData.setTransactionReference(paymentSetup.getInitiation().getRemittanceInformation().getReference());
transactionData.setTransactionInformation(paymentSetup.getInitiation().getRemittanceInformation().getUnstructured());
}
FRTransaction transaction = FRTransaction.builder().id(transactionId).bookingDateTime(bookingDate).accountId(account.getId()).transaction(transactionData).statementIds(// Need a mutable list to be set here so don't use Lombok.singular to init list
new ArrayList<>()).build();
log.info("Transaction created {}", transaction);
return transaction;
}
use of com.forgerock.openbanking.common.model.openbanking.domain.account.FRTransactionData in project openbanking-aspsp by OpenBankingToolkit.
the class AcceptDomesticPaymentTask method createTransaction.
private FRTransaction createTransaction(Account account, FRDomesticConsent payment, FRCreditDebitIndicator creditDebitIndicator, Balance balance, FRAmount amount) {
log.info("Create transaction");
String transactionId = UUID.randomUUID().toString();
DateTime bookingDate = new DateTime(payment.getCreated());
FRTransactionData transactionData = FRTransactionData.builder().transactionId(transactionId).status(FRTransactionData.FREntryStatus.BOOKED).valueDateTime(DateTime.now()).accountId(account.getId()).amount(amount).creditDebitIndicator(creditDebitIndicator).bookingDateTime(bookingDate).statementReferences(new ArrayList<>()).balance(FRTransactionData.FRTransactionCashBalance.builder().amount(balance.getCurrencyAndAmount()).creditDebitIndicator(balance.getCreditDebitIndicator()).type(FRBalanceType.INTERIMBOOKED).build()).build();
if (payment.getInitiation().getRemittanceInformation() != null) {
transactionData.setTransactionReference(payment.getInitiation().getRemittanceInformation().getReference());
transactionData.setTransactionInformation(payment.getInitiation().getRemittanceInformation().getUnstructured());
}
FRTransaction transaction = FRTransaction.builder().id(transactionId).bookingDateTime(bookingDate).accountId(account.getId()).transaction(transactionData).build();
log.info("Transaction created {}", transaction);
return transaction;
}
use of com.forgerock.openbanking.common.model.openbanking.domain.account.FRTransactionData in project openbanking-aspsp by OpenBankingToolkit.
the class AcceptDueStandingOrderTask method createTransaction.
private FRTransaction createTransaction(Account account, FRStandingOrder payment, FRCreditDebitIndicator creditDebitCode, Balance balance, FRAmount amount) {
log.debug("Create transaction");
String transactionId = UUID.randomUUID().toString();
DateTime bookingDate = new DateTime(payment.getCreated());
FRTransactionData transactionData = FRTransactionData.builder().transactionId(transactionId).status(FRTransactionData.FREntryStatus.BOOKED).valueDateTime(DateTime.now()).accountId(account.getId()).amount(amount).creditDebitIndicator(creditDebitCode).bookingDateTime(bookingDate).statementReferences(new ArrayList<>()).balance(FRTransactionData.FRTransactionCashBalance.builder().amount(balance.getCurrencyAndAmount()).creditDebitIndicator(balance.getCreditDebitIndicator()).type(FRBalanceType.INTERIMBOOKED).build()).build();
if (payment.getStandingOrder().getReference() != null) {
transactionData.setTransactionReference(payment.getStandingOrder().getReference());
}
FRTransaction transaction = FRTransaction.builder().id(transactionId).bookingDateTime(bookingDate).accountId(account.getId()).transaction(transactionData).build();
log.info("Transaction created {}", transaction);
return transaction;
}
Aggregations