Lines 306-311
my $handlers = {
Link Here
|
306 |
}, |
306 |
}, |
307 |
}; |
307 |
}; |
308 |
|
308 |
|
|
|
309 |
my $param_to_cli = { |
310 |
currency_type => 'currency-type', |
311 |
current_location => 'location', |
312 |
end_item => 'end-item', |
313 |
fee_acknowledged => 'fee-acknowledged', |
314 |
fee_amount => 'fee-amount', |
315 |
fee_identifier => 'fee-identifier', |
316 |
fee_type => 'fee-type', |
317 |
hold_mode => 'hold-mode', |
318 |
institution_id => 'location', |
319 |
item_identifier => 'item', |
320 |
location_code => 'location', |
321 |
login_password => 'sip_pass', |
322 |
login_user_id => 'sip_user', |
323 |
no_block => 'no-block', |
324 |
patron_identifier => 'patron', |
325 |
patron_password => 'password', |
326 |
payment_type => 'payment-type', |
327 |
pickup_location => 'pickup-location', |
328 |
start_item => 'start-item', |
329 |
summary => 'summary', |
330 |
terminal_password => 'sip_pass', |
331 |
transaction_id => 'transaction-id', |
332 |
}; |
333 |
|
309 |
my $data = run_command_message('login'); |
334 |
my $data = run_command_message('login'); |
310 |
|
335 |
|
311 |
if ( $data =~ '^941' ) { ## we are logged in |
336 |
if ( $data =~ '^941' ) { ## we are logged in |
Lines 335-341
sub build_command_message {
Link Here
|
335 |
foreach my $key ( keys %$parameters ) { |
360 |
foreach my $key ( keys %$parameters ) { |
336 |
unless ( $parameters->{$key} ) { |
361 |
unless ( $parameters->{$key} ) { |
337 |
unless ( $optional{$key} ) { |
362 |
unless ( $optional{$key} ) { |
338 |
say "$key is required for $message"; |
363 |
my $param_name = $param_to_cli->{$key} // $key; |
|
|
364 |
say "$param_name is required for $message"; |
339 |
return; |
365 |
return; |
340 |
} |
366 |
} |
341 |
} |
367 |
} |
342 |
- |
|
|