oracle
8.1.6
insert into ec_problems_log
(problem_id, problem_date, problem_details, gift_certificate_id)
values
(ec_problem_id_sequence.nextval, sysdate,
'Customer pushed reload on gift-certificate-finalize-order.tcl but gift_certificate_state wasn't authorized or failed',:gift_certificate_id)
insert into ec_gift_certificates
(gift_certificate_id, gift_certificate_state, amount, issue_date, purchased_by, expires, claim_check, certificate_message,
certificate_to, certificate_from, recipient_email, last_modified, last_modifying_user, modified_ip_address)
values
(:gift_certificate_id, 'confirmed', :amount, sysdate, :user_id, add_months(sysdate,:gc_months),:claim_check, :certificate_message,
:certificate_to, :certificate_from, :recipient_email, sysdate, :user_id, :peeraddr)
insert into ec_financial_transactions
(transaction_id, gift_certificate_id, creditcard_id, transaction_amount, transaction_type, inserted_date)
values
(:transaction_id, :gift_certificate_id, :creditcard_id, :amount, 'charge', sysdate)
update ec_financial_transactions
set authorized_date=sysdate, to_be_captured_p='t', transaction_id = :pgw_transaction_id
where transaction_id=:transaction_id
update ec_gift_certificates
set authorized_date=sysdate, gift_certificate_state='authorized'
where gift_certificate_id=:gift_certificate_id
select round((sysdate-issue_date)*86400) as n_seconds
from ec_gift_certificates
where gift_certificate_id = :gift_certificate_id