sub pay_fee {
my ($self, $patron_id, $patron_pwd, $fee_amt, $fee_type,
- $pay_type, $fee_id, $trans_id, $currency) = @_;
+ $pay_type, $fee_id, $trans_id, $currency, $check_number,
+ $register_login) = @_;
$self->verify_session;
$xact->sip_payment_type($pay_type);
# We don't presently use this, but we might in the future.
$xact->patron_password($patron_pwd);
+ $xact->check_number($check_number);
+ $xact->register_login($register_login);
$xact->do_fee_payment();
sub pay_bills {
my ($self, $paymentref) = @_;
my $user = $self->patron->{user};
- if ($self->sip_payment_type eq '02' || $self->sip_payment_type eq '01') {
+ my $ptype = $self->sip_payment_type || '';
+ my $rlogin = $self->register_login || '';
+
+ my $params = {
+ userid => $user->id,
+ note => "Via SIP2",
+ payments => $paymentref,
+ payment_type => 'cash_payment'
+ };
+
+ if ($rlogin) {
+ syslog('LOG_DEBUG', "Register login sent as '$rlogin'");
+
+ if ($rlogin =~ /\\.+/) { # Windows domain login
+ my @parts = split(/\\/, $rlogin);
+ $rlogin = $parts[1];
+ }
+
+ $params->{note} = "Via SIP2: Register login '$rlogin'";
+ }
+
+ if ($ptype eq '02' || $ptype eq '01') {
# '01' is "VISA"
# '02' is "credit card"
- my $transaction_id = $self->transaction_id ? $self->transaction_id : 'Not provided by SIP client';
- return $U->simplereq('open-ils.circ', 'open-ils.circ.money.payment', $self->{authtoken},
- { payment_type => "credit_card_payment", userid => $user->id, note => "via SIP2",
- cc_args => { approval_code => $transaction_id, },
- payments => $paymentref}, $user->last_xact_id);
- } else {
- # record as "cash"
- return $U->simplereq('open-ils.circ', 'open-ils.circ.money.payment', $self->{authtoken},
- { payment_type => "cash_payment", userid => $user->id, note => "via SIP2",
- payments => $paymentref}, $user->last_xact_id);
+
+ $params->{payment_type} = 'credit_card_payment';
+ $params->{cc_args} = {
+ approval_code =>
+ $self->transaction_id || 'Not provided by SIP client'
+ };
+
+ } elsif ($ptype eq '05') {
+ $params->{payment_type} = 'check_payment';
+ $params->{check_number} =
+ $self->check_number || 'Not Provided by SIP Client';
}
+
+ return $U->simplereq('open-ils.circ', 'open-ils.circ.money.payment',
+ $self->{authtoken}, $params, $user->last_xact_id);
}