Yusuke Maeda > Finance-Bank-JP-MUFG > Finance::Bank::JP::MUFG

Download:
Finance-Bank-JP-MUFG-0.07.tar.gz

Dependencies

Annotate this POD

View/Report Bugs
Module Version: 0.07   Source  

NAME ^

Finance::Bank::JP::MUFG - Checks account balances and transactions of MUFG-DIRECT account.

SYNOPSIS ^

  use Finance::Bank::JP::MUFG;

  my $mufg = Finance::Bank::JP::MUFG->new(
      contract_no => 'your_contract_no',
      password    => 'your_direct_password',
  )->login;

  my @accounts = $mufg->accounts;

  for my $account (@accounts) {
      printf "%-s  %-s  %-7s %9syen %9syen\n",
          $account->branch,
          $account->account_kind,
          $account->account_no,
          commify($account->balance),
          commify($account->withdrawal_limit);
  }

  my @transactions = $mufg->transactions(
      account_no       => 1,
      transaction_kind => 1,
      period           => 1,
  );

  for my $transaction (@transactions) {
      printf "%-s  %-s  %-s  %syen  %syen  %syen  %-s\n",
          $transaction->date->ymd('/'),
          $transaction->abstract,
          $transaction->description,
          commify($transaction->outlay),
          commify($transaction->income),
          commify($transaction->balance),
          $transaction->memo;
  }

  my $csv_path = $mufg->download_transactions(
      account_no       => 1,
      transaction_kind => 1,
      period           => 4,
      from             => '2012/9/1',
      to               => '2012/10/12',
      save_dir         => '/tmp',
      to_utf8          => 0,
  );

  say $csv_path;

  $mufg->logout;

DESCRIPTION ^

This module provides methods to access data from MUFG-DIRECT accounts, including account balances and recent transactions. It also provides a method to download data in CSV format from a given date or date range.

CONSTRUCTOR AND STARTUP ^

new( %options )

Creates and returns a new Finance::Bank::JP::MUFG object.

  my $mufg = Finance::Bank::JP::MUFG->new( ... );

This constructor has to pass two parameters of the Contract Number and Password.

  contract_no => 'your_contract_no',
  password    => 'your_direct_password',

You can also specify the user agent.

  agent => [alias]

The list of valid aliases is:

METHODS ^

$mufg->login()

Runs login process and returns a self object. Be sure to call after object creation.

$mufg->accounts()

Returns an array of all the account balances. This array stores Finance::Bank::JP::MUFG::Account objects, and you can access with the following accessors.

$mufg->transactions( %options )

Specify as follows, passing the hash to the argument.

Returns an array of transactions. This array stores Finance::Bank::JP::MUFG::Transaction objects, and you can access with the following accessors.

$mufg->download_transactions( %options )

Returns a saved path. Specify as follows, passing the hash to the argument.

AUTHOR ^

Yusuke Maeda <dev.perfumed.garden@gmail.com>

FINANCE::BANK::JP::MUFG'S GIT REPOSITORY ^

Finance::Bank::JP::MUFG is hosted at GitHub.

Repository: https://github.com/perforb/p5-Finance-Bank-JP-MUFG

SEE ALSO ^

MUFG-DIRECT

WWW::Mechanize

HTML::TreeBuilder::XPath

HTML::Selector::XPath

Finance::Bank::JP::MUFG::Account

Finance::Bank::JP::MUFG::Transaction

LICENSE ^

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

syntax highlighting: