Revision history for Perl extension Business::OnlinePayment::IPPay.
+0.08 Fri Dec 14 12:54:14 PST 2012
+ - Pass ACH account type
+
0.07 Sun Oct 28 23:24:21 PDT 2012
- add Reverse Authorization support, patch from dougforpres
- gateway URL change -- note this version will be the minimum required
use vars qw($VERSION $DEBUG @ISA $me);
@ISA = qw(Business::OnlinePayment::HTTPS);
-$VERSION = '0.07';
+$VERSION = '0.08';
$VERSION = eval $VERSION; # modperlstyle: convert the string into a number
$DEBUG = 0;
$content{'TransactionType'} = $check_actions{$action} || $action;
# ACCOUNT TYPE MAP
- my %account_types = ('personal checking' => 'Checking',
- 'personal savings' => 'Savings',
- 'business checking' => 'BusinessCk',
+ my %account_types = ('personal checking' => 'CHECKING',
+ 'personal savings' => 'SAVINGS',
+ 'business checking' => 'CHECKING',
+ 'business savings' => 'SAVINGS',
+ #not technically B:OP valid i guess?
+ 'checking' => 'CHECKING',
+ 'savings' => 'SAVINGS',
);
$content{'account_type'} = $account_types{lc($content{'account_type'})}
|| $content{'account_type'};
tie my %ach, 'Tie::IxHash',
$self->revmap_fields(
+ #wtf, this is a "Type"" attribute of the ACH element,
+ # not a child element like the others
#AccountType => 'account_type',
AccountNumber => 'account_number',
ABA => 'routing_code',
sub _xmlwrite {
my ($self, $writer, $item, $value) = @_;
- $writer->startTag($item);
+
+ my %att = ();
+ if ( $item eq 'ACH' ) {
+ $att{'Type'} = $self->{_content}->{'account_type'}
+ if $self->{_content}->{'account_type'}; #necessary so we don't pass empty?
+ $att{'SEC'} = 'PPD';
+ }
+
+ $writer->startTag($item, %att);
+
if ( ref( $value ) eq 'HASH' ) {
foreach ( keys ( %$value ) ) {
$self->_xmlwrite($writer, $_, $value->{$_});
}else{
$writer->characters($value);
}
+
$writer->endTag($item);
}
account_number => '12345',
routing_code => '111000025', # BoA in Texas taken from Wikipedia
bank_name => 'First National Test Bank',
- account_type => 'Checking',
+ account_type => 'Business Checking',
);
my $voidable;