[open-ils-commits] r14317 - trunk/Open-ILS/src/perlmods/OpenILS/Application/Circ (erickson)
svn at svn.open-ils.org
svn at svn.open-ils.org
Thu Oct 8 16:53:41 EDT 2009
Author: erickson
Date: 2009-10-08 16:53:36 -0400 (Thu, 08 Oct 2009)
New Revision: 14317
Modified:
trunk/Open-ILS/src/perlmods/OpenILS/Application/Circ/Money.pm
Log:
made CC payment arguments more flexible
Modified: trunk/Open-ILS/src/perlmods/OpenILS/Application/Circ/Money.pm
===================================================================
--- trunk/Open-ILS/src/perlmods/OpenILS/Application/Circ/Money.pm 2009-10-08 20:45:23 UTC (rev 14316)
+++ trunk/Open-ILS/src/perlmods/OpenILS/Application/Circ/Money.pm 2009-10-08 20:53:36 UTC (rev 14317)
@@ -44,11 +44,13 @@
userid
patron_credit
note
- cc_type
- cc_number
- cc_expire_month
- cc_expire_year
- cc_approval_code
+ cc_args : {
+ type
+ number
+ expire_month
+ expire_year
+ approval_code
+ }
check_number
payments: [
[trans_id, amt],
@@ -71,12 +73,8 @@
my $credit = $payments->{patron_credit} || 0;
my $drawer = $e->requestor->wsid;
my $note = $payments->{note};
- my $cc_type = $payments->{cc_type};
- my $cc_number = $payments->{cc_number};
- my $cc_expire_month = $payments->{cc_expire_month};
- my $cc_expire_year = $payments->{cc_expire_year};
- my $cc_approval_code = $payments->{cc_approval_code};
my $check_number = $payments->{check_number};
+ my $cc_args = $payments->{cc_args};
my $total_paid = 0;
my %orgs;
@@ -88,7 +86,6 @@
return $e->die_event unless $e->allowed('CREATE_PAYMENT', $patron->home_ou);
}
-
# first collect the transactions and make sure the transaction
# user matches the requested user
my %xacts;
@@ -163,15 +160,14 @@
if ($payobj->has_field('accepting_usr')) { $payobj->accepting_usr($e->requestor->id); }
if ($payobj->has_field('cash_drawer')) { $payobj->cash_drawer($drawer); }
- if ($payobj->has_field('cc_type')) { $payobj->cc_type($cc_type); }
+ if ($payobj->has_field('cc_type')) { $payobj->cc_type($cc_args->{type}); }
+ if ($payobj->has_field('check_number')) { $payobj->check_number($check_number); }
# Store the last 4 digits?
- #if ($payobj->has_field('cc_number')) { $payobj->cc_number($cc_number); }
- #if ($payobj->has_field('approval_code')) { $payobj->approval_code($cc_approval_code); }
-
- if ($payobj->has_field('expire_month')) { $payobj->expire_month($cc_expire_month); }
- if ($payobj->has_field('expire_year')) { $payobj->expire_year($cc_expire_year); }
- if ($payobj->has_field('check_number')) { $payobj->check_number($check_number); }
+ #if ($payobj->has_field('cc_number')) { $payobj->cc_number($cc_args->{number}); }
+ #if ($payobj->has_field('approval_code')) { $payobj->approval_code($cc_args->{approval_code}); }
+ if ($payobj->has_field('expire_month')) { $payobj->expire_month($cc_args->{expire_month}); }
+ if ($payobj->has_field('expire_year')) { $payobj->expire_year($cc_args->{expire_year}); }
# update the transaction if it's done
if( (my $cred = ($trans->balance_owed - $amount)) <= 0 ) {
@@ -198,6 +194,7 @@
# TODO send to credit card processor
# amount == $total_paid
# user == $user_id
+ # other args == $cc_args (hash)
# $e->rollback if processing fails. This will undo everything.
}
More information about the open-ils-commits
mailing list