projects
/
Business-OnlinePayment-WesternACH.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
c5ceaf6
)
Allowed nonessential fields to be left undefined
author
mark
<mark>
Tue, 23 Jun 2009 05:25:34 +0000
(
05:25
+0000)
committer
mark
<mark>
Tue, 23 Jun 2009 05:25:34 +0000
(
05:25
+0000)
lib/Business/OnlinePayment/WesternACH.pm
patch
|
blob
|
history
diff --git
a/lib/Business/OnlinePayment/WesternACH.pm
b/lib/Business/OnlinePayment/WesternACH.pm
index
e18a122
..
94ba800
100644
(file)
--- a/
lib/Business/OnlinePayment/WesternACH.pm
+++ b/
lib/Business/OnlinePayment/WesternACH.pm
@@
-22,6
+22,20
@@
my $defaults = {
schedule => 'live',
};
schedule => 'live',
};
+my $required = { map { $_ => 1 } ( qw(
+ login
+ password
+ command
+ amount
+ tender_type
+ _full_name
+ routing_code
+ check_number
+ _check_type
+))};
+
+
+
# Structure of the XML request document
# Right sides of the hash entries are Business::OnlinePayment
# field names. Those that start with _ are local method names.
# Structure of the XML request document
# Right sides of the hash entries are Business::OnlinePayment
# field names. Those that start with _ are local method names.
@@
-144,7
+158,11
@@
sub build {
elsif(exists($defaults->{$val})) {
$data->{$k} = $defaults->{$val};
}
elsif(exists($defaults->{$val})) {
$data->{$k} = $defaults->{$val};
}
- # 6. Fail.
+ # 6. If the value is not required, use an empty string.
+ elsif(! $required->{$val}) {
+ $data->{$k} = '';
+ }
+ # 7. Fail.
else {
croak "Missing request field: '$val'";
}
else {
croak "Missing request field: '$val'";
}