public InteropTransferResponseData commitTransfer()

in service/src/main/java/org/apache/fineract/cn/interoperation/service/internal/service/InteropService.java [257:284]


    public InteropTransferResponseData commitTransfer(@NotNull InteropTransferCommand request) {
        //TODO: error handling
        //TODO: ABORT
        AccountWrapper accountWrapper = validateAndGetAccount(request);

        LocalDateTime transactionDate = getNow();
        //TODO: transaction expiration separated from action expiration
        InteropTransactionEntity transaction = validateAndGetTransaction(request, accountWrapper, transactionDate, true);
        transaction.setTransactionDate(transactionDate);

        validateTransfer(request, accountWrapper);

        TransactionType transactionType = request.getTransactionRole().getTransactionType();
        List<Charge> charges = depositService.getCharges(accountWrapper.account.getIdentifier(), transactionType);

        // TODO add action and set the status to failed in separated transaction
        InteropActionEntity action = addAction(transaction, request, transactionDate);
        MoneyData fee = request.getFspFee();
        action.setFee(fee == null ? null : fee.getAmount());
        // TODO: extend Charge with a property that could be stored in charges

        bookTransfer(request, accountWrapper, action, charges, transactionDate);

        transactionRepository.save(transaction);

        return InteropTransferResponseData.build(request.getTransferCode(), action.getState(), action.getExpirationDate(),
                request.getExtensionList(), request.getTransferCode(), transactionDate);
    }