Koha/C4/SIP/ILS/Transaction.pm
Colin Campbell fe179c737d Bug 12820: Handle rental fees in Sip issue and renew
Implement correct handling of fees associated with checking out
an item.
This is associated with fee acknowledged field (BO)

To quote from the Sip2 document
" If this field is N in a Checkout message and there is a fee
associated with checking out the item, the ACS should tell the
SC in the Checkout Response that there is a fee, and refuse to
check out the item. If the SC and the patron then interact and the
patron agrees to pay the fee, this field will be set to Y on a second
Checkout message, indicating to the ACS that the patron has acknowledged
the fee and checkout of the item should not be refused just
because there is a fee associated with the item"

So there are two Checkout requests the first with BO not set to Y is
rejected but the fee amount is returned. The Second Checkout with BO set
to Y should succeed.

Added a debug log message indicating why we block a checkout
when we dont otherwise indicate

Signed-off-by: Brendan Gallagher <brendan@bywatersolutions.com>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
2015-03-25 11:26:06 -03:00

62 lines
1 KiB
Perl

#
# Transaction: Superclass of all the transactional status objects
#
package C4::SIP::ILS::Transaction;
use Carp;
use strict;
use warnings;
use C4::Context;
my %fields = (
ok => 0,
patron => undef,
item => undef,
desensitize => 0,
alert => '',
transaction_id=> undef,
sip_fee_type => '01', # Other/Unknown
fee_amount => undef,
sip_currency => 'USD', # FIXME: why hardcoded?
screen_msg => '',
print_line => '',
fee_ack => 'N',
);
our $AUTOLOAD;
sub new {
my $class = shift;
my $self = {
_permitted => \%fields,
%fields,
};
return bless $self, $class;
}
sub DESTROY {
# be cool
}
sub AUTOLOAD {
my $self = shift;
my $class = ref($self) or croak "$self is not an object";
my $name = $AUTOLOAD;
$name =~ s/.*://;
unless (exists $self->{_permitted}->{$name}) {
croak "Can't access '$name' field of class '$class'";
}
if (@_) {
return $self->{$name} = shift;
} else {
return $self->{$name};
}
}
1;
__END__