public String acceptIncomingPayment()

in service/src/main/java/org/apache/fineract/cn/stellarbridge/service/internal/accounting/AccountingAdapter.java [30:71]


  public String acceptIncomingPayment(
      final BridgeConfigurationEntity bridgeConfigurationEntity,
      final BigDecimal amount,
      final String assetCode,
      final LocalDateTime transactionDate) throws InterruptedException {
    final JournalEntry journalEntryFundsAcceptance = new JournalEntry();
    final Creditor creditor = new Creditor(
        bridgeConfigurationEntity.getFineractStellerLedger() + "." + assetCode,
        amount.toString());
    final Debtor debtor = new Debtor(
        bridgeConfigurationEntity.getFineractIncomingLedger() + "." + assetCode,
        amount.toString());

    journalEntryFundsAcceptance.setClerk(stellarBridgeProperties.getUser());
    journalEntryFundsAcceptance.setCreditors(Collections.singleton(creditor));
    journalEntryFundsAcceptance.setDebtors(Collections.singleton(debtor));
    journalEntryFundsAcceptance.setTransactionDate(DateConverter.toIsoString(transactionDate));
    journalEntryFundsAcceptance.setTransactionType("BCHQ");

    final String transactionId = createWithUniqueTransactionIdentifier(journalEntryFundsAcceptance);

    Thread.sleep(2000); //TODO: replace with a wait on the journal entry creation.

    final JournalEntry journalEntryFundsForwarding = new JournalEntry();
    final Creditor fundsForwardingCreditor = new Creditor(
        bridgeConfigurationEntity.getFineractStellerLedger() + "." + assetCode,
        amount.toString());
    final Debtor fundsForwardingDebtor = new Debtor(
        bridgeConfigurationEntity.getFineractIncomingLedger() + "." + assetCode,
        amount.toString());

    journalEntryFundsForwarding.setClerk(stellarBridgeProperties.getUser());
    journalEntryFundsForwarding.setCreditors(Collections.singleton(fundsForwardingCreditor));
    journalEntryFundsForwarding.setDebtors(Collections.singleton(fundsForwardingDebtor));
    journalEntryFundsForwarding.setTransactionDate(DateConverter.toIsoString(transactionDate));
    journalEntryFundsForwarding.setTransactionType("ICCT");

    createWithUniqueTransactionIdentifier(journalEntryFundsForwarding);


    return transactionId;
  }