Package com.bank.service.internal

Examples of com.bank.service.internal.DefaultTransferService


    return new JdbcAccountRepository(dataSource());
  }

  @Bean
  public TransferService transferService() {
    DefaultTransferService transferService =
        new DefaultTransferService(accountRepository(), feePolicy());
    transferService.setMinimumTransferAmount(
        env.getProperty("minimum.transfer.amount", double.class));
    return transferService;
  }
View Full Code Here


    Properties props = new Properties();
    props.load(TransferScript.class.getClassLoader()
        .getResourceAsStream("com/bank/config/app.properties"));

    TransferService transferService = new DefaultTransferService(
        new JdbcAccountRepository(dataSource),
        new FlatFeePolicy(Double.valueOf(props.getProperty("flatfee.amount"))));

    transferService.setMinimumTransferAmount(
        Double.valueOf(props.getProperty("minimum.transfer.amount")));

    // generate a random amount between 10.00 and 90.00 dollars
    double amount = (new Random().nextInt(8) + 1) * 10;

    TransferReceipt reciept = transferService.transfer(amount, "A123", "C456");

    System.out.println(reciept);
  }
View Full Code Here

    Properties props = new Properties();
    props.load(this.getClass().getClassLoader()
        .getResourceAsStream("com/bank/config/app.properties"));

    this.transferService = new DefaultTransferService(
        new JdbcAccountRepository(dataSource),
        new FlatFeePolicy(Double.valueOf(props.getProperty("flatfee.amount"))));

    this.transferService.setMinimumTransferAmount(
        Double.valueOf(props.getProperty("minimum.transfer.amount")));
View Full Code Here

TOP

Related Classes of com.bank.service.internal.DefaultTransferService

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.