WWW::Myki::Card - Class for operations with a Myki card
# Print my Myki card money balance my $balance = $card->money; # What time did I stumble home last night? print $card->last_transaction; # Yeesh, really? How? print $card->service; # Ooooohh, now I remember.
WWW::Myki::Card is a class providing account and card management and querying functionality for registered Myki users.
Please note that you're are not meant to call the constructor yourself, instead a WWW::Myki::Card object will be created automatically for you by calls to methods in a WWW::Myki object like cards.
Returns the card ID number.
Returns the name of the registered card holder.
Returns the balance of Myki money on the card.
Returns the balance of the active Myki pass (if any) on the card.
Returns the card type.
Returns the card expiry date in the format DD Mon YYYY, where Mon is the abbreviated month name.
Returns the card status.
Returns the value of any Myki money top up in progress - this is money that has been added by a top up, but may not yet have been credited to the card.
Returns the total of the balance of Myki money and the balance of Myki money top in progress on the card.
Returns the balance of the current active Myki pass (if any) on the card.
Returns the balance of the current inactive Myki pass (if any) on the card.
Returns the last transaction time and date for the card in the format; DD Mon YYYY HH:MM:SS AM/PM, where Mon is the abbreviated month name.
foreach my $trip ( $card->transactions ) { printf( "%10s %8s %-10s %-20s\n", $trip->date, $trip->time, $trip->service, $trip->desc ) } # Prints a formatted list of the last 15 transactions for this card - e.g. # # 29/05/2012 17:28:38 Bus Surburbia,Route SUB16out_new # 29/05/2012 08:08:12 Bus Metro,Route MET16in_new
Returns an array of WWW::Myki::Transaction objects representing the last 15 transactions for the card.
See WWW::Myki::Transaction for more information on transactions. Transaction data is cached on the initial invocation to increase the performance of subsequent calls and reduce unnecessary communication with the Myki portal. This is probably what you want, but if you really do want to force transaction data to be refreshed then you can call the method with the argument refresh set to a true value. e.g.
$card->transactions( refresh => 1 );
Please note that this will incur a performance penalty.
When a WWW::Myki::Card object is created, the card data is cached to improve the performance of subsequent method calls and reduce unessecary network communication. This is probably what you want, however if you do want to force the object to update its cached data for any reason, then you can call refresh. Note that doing so will incur a performance penalty.
Luke Poskitt, <ltp at cpan.org>
<ltp at cpan.org>
Please report any bugs or feature requests to bug-www-myki-card at rt.cpan.org, or through the web interface at http://rt.cpan.org/NoAuth/ReportBug.html?Queue=WWW-Myki-Card. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.
bug-www-myki-card at rt.cpan.org
You can find documentation for this module with the perldoc command.
perldoc WWW::Myki::Card
You can also look for information at:
RT: CPAN's request tracker
http://rt.cpan.org/NoAuth/Bugs.html?Dist=WWW-Myki-Card
AnnoCPAN: Annotated CPAN documentation
http://annocpan.org/dist/WWW-Myki-Card
CPAN Ratings
http://cpanratings.perl.org/d/WWW-Myki-Card
Search CPAN
http://search.cpan.org/dist/WWW-Myki-Card/
Copyright 2012 Luke Poskitt.
This program is free software; you can redistribute it and/or modify it under the terms of either: the GNU General Public License as published by the Free Software Foundation; or the Artistic License.
See http://dev.perl.org/licenses/ for more information.
WWW::Myki, WWW::Myki::Transaction
To install WWW::Myki, copy and paste the appropriate command in to your terminal.
cpanm
cpanm WWW::Myki
CPAN shell
perl -MCPAN -e shell install WWW::Myki
For more information on module installation, please visit the detailed CPAN module installation guide.