From 30ccd483e85fc69290ec1e52f85a16ba9c85c2b4 Mon Sep 17 00:00:00 2001 From: erickson Date: Mon, 14 Feb 2011 21:06:51 +0000 Subject: [PATCH] capture credit card order_number Uunique payment transaction ID for online payments git-svn-id: svn://svn.open-ils.org/ILS/trunk@19443 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- Open-ILS/examples/fm_IDL.xml | 1 + Open-ILS/src/perlmods/lib/OpenILS/Application/Circ/Money.pm | 4 +++- Open-ILS/src/sql/Pg/002.schema.config.sql | 2 +- Open-ILS/src/sql/Pg/080.schema.money.sql | 1 + Open-ILS/src/sql/Pg/upgrade/0486.schema.mccp-order-number.sql | 7 +++++++ 5 files changed, 13 insertions(+), 2 deletions(-) create mode 100644 Open-ILS/src/sql/Pg/upgrade/0486.schema.mccp-order-number.sql diff --git a/Open-ILS/examples/fm_IDL.xml b/Open-ILS/examples/fm_IDL.xml index 6985dcd3d6..0f130066c2 100644 --- a/Open-ILS/examples/fm_IDL.xml +++ b/Open-ILS/examples/fm_IDL.xml @@ -1571,6 +1571,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + diff --git a/Open-ILS/src/perlmods/lib/OpenILS/Application/Circ/Money.pm b/Open-ILS/src/perlmods/lib/OpenILS/Application/Circ/Money.pm index 66de1abc0d..d472820bc8 100644 --- a/Open-ILS/src/perlmods/lib/OpenILS/Application/Circ/Money.pm +++ b/Open-ILS/src/perlmods/lib/OpenILS/Application/Circ/Money.pm @@ -143,7 +143,7 @@ sub make_payments { my %orgs; # unless/until determined by payment processor API - my ($approval_code, $cc_processor, $cc_type) = (undef,undef,undef); + my ($approval_code, $cc_processor, $cc_type, $cc_order_number) = (undef,undef,undef, undef); my $patron = $e->retrieve_actor_user($user_id) or return $e->die_event; @@ -302,6 +302,7 @@ sub make_payments { $approval_code = $cc_payload->{"authorization"}; $cc_type = $cc_payload->{"card_type"}; $cc_processor = $cc_payload->{"processor"}; + $cc_order_number = $cc_payload->{"order_number"}; $logger->info("Credit card payment for user $user_id succeeded"); } } else { @@ -346,6 +347,7 @@ sub make_payments { } $payment->approval_code($approval_code) if $approval_code; + $payment->cc_order_number($cc_order_number) if $cc_order_number; $payment->cc_type($cc_type) if $cc_type; $payment->cc_processor($cc_processor) if $cc_processor; $payment->cc_first_name($cc_args->{'billing_first'}) if $cc_args->{'billing_first'}; diff --git a/Open-ILS/src/sql/Pg/002.schema.config.sql b/Open-ILS/src/sql/Pg/002.schema.config.sql index c8496a9c18..857d1a1fcd 100644 --- a/Open-ILS/src/sql/Pg/002.schema.config.sql +++ b/Open-ILS/src/sql/Pg/002.schema.config.sql @@ -70,7 +70,7 @@ CREATE TABLE config.upgrade_log ( install_date TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT NOW() ); -INSERT INTO config.upgrade_log (version) VALUES ('0485'); -- dbs +INSERT INTO config.upgrade_log (version) VALUES ('0486'); -- berick CREATE TABLE config.bib_source ( id SERIAL PRIMARY KEY, diff --git a/Open-ILS/src/sql/Pg/080.schema.money.sql b/Open-ILS/src/sql/Pg/080.schema.money.sql index e227a18da3..805da2032e 100644 --- a/Open-ILS/src/sql/Pg/080.schema.money.sql +++ b/Open-ILS/src/sql/Pg/080.schema.money.sql @@ -630,6 +630,7 @@ CREATE TABLE money.credit_card_payment ( cc_processor TEXT, cc_first_name TEXT, cc_last_name TEXT, + cc_order_number TEXT, expire_month INT, expire_year INT, approval_code TEXT diff --git a/Open-ILS/src/sql/Pg/upgrade/0486.schema.mccp-order-number.sql b/Open-ILS/src/sql/Pg/upgrade/0486.schema.mccp-order-number.sql new file mode 100644 index 0000000000..7035953ca3 --- /dev/null +++ b/Open-ILS/src/sql/Pg/upgrade/0486.schema.mccp-order-number.sql @@ -0,0 +1,7 @@ +BEGIN; + +INSERT INTO config.upgrade_log (version) VALUES ('0486'); + +ALTER TABLE money.credit_card_payment ADD COLUMN cc_order_number TEXT; + +COMMIT; -- 2.11.0