Skip to content

Issues with overriding limit in transaction preparation #1042

Description

@ALevi04

Hey,
is someone having issues with overriding limit in transaction preparation ?
I am trying this way and at the end the logs show the correct value but the BATM does not using it, just the one which was set by CAS.

@Override
    public ITransactionPreparation overrideTransactionPreparation(ITransactionPreparation preparation) {
        BigDecimal limit = identityApi.getLimitForUser(preparation.getCellPhoneUsed(),preparation.getCashCurrency());
        preparation.getCashTransactionLimit().clear();
        preparation.getCashTransactionLimit().put(preparation.getCashCurrency(), limit);
        preparation.getCashTransactionLimitWithName().clear();
        preparation.getCashTransactionLimitWithName().put(preparation.getCashCurrency(), new ITransactionLimit() {
            @Override
            public BigDecimal getAmount() {
                return limit;
            }
            @Override
            public String getName() {
                return "LIMIT_TRANSACTION";
            }
            @Override
            public String getCurrency() {
                return preparation.getCashCurrency();
            }
        });
        log.info("Transactions limit override");
        log.info(preparation.getCashTransactionLimitWithName().get(preparation.getCashCurrency()).getAmount().toString());
        log.info(preparation.getCashTransactionLimit().get(preparation.getCashCurrency()).toString());
            return preparation;
    }

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions