Index: openacs-4/packages/ecommerce/www/gift-certificate-finalize-order.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/ecommerce/www/gift-certificate-finalize-order.xql,v diff -u -r1.1 -r1.2 --- openacs-4/packages/ecommerce/www/gift-certificate-finalize-order.xql 10 Jul 2001 20:42:02 -0000 1.1 +++ openacs-4/packages/ecommerce/www/gift-certificate-finalize-order.xql 26 May 2002 04:36:50 -0000 1.2 @@ -1,43 +1,62 @@ + - - - select count(*) from ec_gift_certificates where gift_certificate_id=:gift_certificate_id - - + + + select count(*) + from ec_gift_certificates + where gift_certificate_id=:gift_certificate_id + + - - - - select gift_certificate_state from ec_gift_certificates where gift_certificate_id=:gift_certificate_id - - + + + select gift_certificate_state + from ec_gift_certificates + where gift_certificate_id=:gift_certificate_id + + - - - + + insert into ec_creditcards - (creditcard_id, user_id, creditcard_number, creditcard_last_four, creditcard_type, creditcard_expire, billing_zip_code) - values - (:creditcard_id, :user_id, :creditcard_number, :ccstuff_1, :creditcard_type,:expiry,:billing_zip_code) - - - + (creditcard_id, user_id, creditcard_number, creditcard_last_four, creditcard_type, creditcard_expire, billing_address) + values + (:creditcard_id, :user_id, :creditcard_number, :ccstuff_1, :creditcard_type, :expiry, :address_id) + + - - - - update ec_financial_transactions set failed_p='t', to_be_captured_p='f' where transaction_id=:transaction_id - - + + + select c.creditcard_number as card_number, substring(creditcard_expire for 2) as card_exp_month, substring(creditcard_expire from 4 for 2) as card_exp_year, c.creditcard_type, + p.first_names || ' ' || p.last_name as card_name, + a.zip_code as billing_zip, + a.line1 as billing_address, + a.city as billing_city, + coalesce(a.usps_abbrev, a.full_state_name) as billing_state, + a.country_code as billing_country + from ec_creditcards c, persons p, ec_addresses a + where c.user_id=p.person_id + and c.creditcard_id = :creditcard_id + and c.billing_address = a.address_id + + - - - - update ec_gift_certificates set gift_certificate_state='failed_authorization' where gift_certificate_id=:gift_certificate_id - - + + + update ec_financial_transactions + set failed_p='t', to_be_captured_p='f' + where transaction_id=:transaction_id + + - + + + update ec_gift_certificates + set gift_certificate_state='failed_authorization' + where gift_certificate_id=:gift_certificate_id + + +