select creditcard_id, user_id
from ec_orders
where order_id=:order_id
update ec_orders
set order_state='in_basket', confirmed_date=null, saved_p = 't'
where order_id=:order_id
update ec_creditcards
set failed_p='t'
where creditcard_id=:creditcard_id
update ec_financial_transactions
set to_be_captured_p = 'f'
where order_id=:order_id
and creditcard_id =:creditcard_id
select max(transaction_id)
from ec_financial_transactions
where order_id=:order_id
update ec_orders
set order_state='in_basket', confirmed_date=null
where order_id=:order_id
select user_id
from ec_orders
where order_id=:order_id
update ec_orders
set order_state='in_basket', confirmed_date=null
where order_id=:order_id