2 # Status of a Renew Transaction
5 package OpenILS::SIP::Transaction::Renew;
6 use warnings; use strict;
8 use Sys::Syslog qw(syslog);
10 use OpenILS::SIP::Transaction;
11 use OpenILS::Application::AppUtils;
12 my $U = 'OpenILS::Application::AppUtils';
14 our @ISA = qw(OpenILS::SIP::Transaction);
22 my $self = $class->SUPER::new(@_);
24 $self->{_permitted}->{$_} = $fields{$_} for keys %fields;
25 @{$self}{keys %fields} = values %fields;
27 return bless $self, $class;
33 my $resp = $U->simplereq(
35 'open-ils.circ.renew', $self->{authtoken},
36 { barcode => $self->item->id, patron_barcode => $self->patron->id });
38 if( my $code = $U->event_code($resp) ) {
39 syslog('LOG_INFO', "OILS: Renewal failed with event $code : " . $resp->{textcode});
45 $self->item->{due_date} = $resp->{payload}->{circ}->due_date;
46 syslog('LOG_INFO', "OILS: Renewal succeeded with due_date = " . $self->item->{due_date});