summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/Business/OnlinePayment/WesternACH.pm20
1 files changed, 19 insertions, 1 deletions
diff --git a/lib/Business/OnlinePayment/WesternACH.pm b/lib/Business/OnlinePayment/WesternACH.pm
index e18a122..94ba800 100644
--- a/lib/Business/OnlinePayment/WesternACH.pm
+++ b/lib/Business/OnlinePayment/WesternACH.pm
@@ -22,6 +22,20 @@ my $defaults = {
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.
@@ -144,7 +158,11 @@ sub build {
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'";
}