@@ -, +, @@ SIP fee paid messages cash register". Do *not* set a cash register for the SIP account you will be testing with. fees. message in it! --- C4/SIP/ILS.pm | 3 ++- C4/SIP/ILS/Transaction/FeePayment.pm | 23 ++++++++++++++++++++--- C4/SIP/Sip/MsgType.pm | 2 ++ 3 files changed, 24 insertions(+), 4 deletions(-) --- a/C4/SIP/ILS.pm +++ a/C4/SIP/ILS.pm @@ -310,7 +310,8 @@ sub pay_fee { return { status => $trans, - pay_response => $trans_result->{pay_response} + pay_response => $trans_result->{pay_response}, + error => $error, }; } --- a/C4/SIP/ILS/Transaction/FeePayment.pm +++ a/C4/SIP/ILS/Transaction/FeePayment.pm @@ -76,10 +76,27 @@ sub pay { }; } } - my $pay_response = $account->pay($pay_options); + + my $ok = 1; + my $pay_response; + my $error; + try { + $pay_response = $account->pay($pay_options); + } + catch { + if ( ref($_) =~ /^Koha::Exceptions/ ) { + $ok = 0; + $error = $_->description; + } + else { + $_->rethrow; + } + }; + return { - ok => 1, - pay_response => $pay_response + ok => $ok, + pay_response => $pay_response, + error => $error }; } --- a/C4/SIP/Sip/MsgType.pm +++ a/C4/SIP/Sip/MsgType.pm @@ -1153,6 +1153,8 @@ sub handle_fee_paid { $status = $pay_result->{status}; my $pay_response = $pay_result->{pay_response}; + $resp .= maybe_add( FID_SCREEN_MSG, $pay_result->{error}, $server ) if $pay_result->{error if $pay_result->{error}; + my $failmap = { "no_item" => "No matching item could be found", "no_checkout" => "Item is not checked out", --