inactivate_account.sql (1205B)
1 -- 2 -- This file is part of TALER 3 -- Copyright (C) 2026 Taler Systems SA 4 -- 5 -- TALER is free software; you can redistribute it and/or modify it under the 6 -- terms of the GNU General Public License as published by the Free Software 7 -- Foundation; either version 3, or (at your option) any later version. 8 -- 9 -- TALER is distributed in the hope that it will be useful, but WITHOUT ANY 10 -- WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR 11 -- A PARTICULAR PURPOSE. See the GNU General Public License for more details. 12 -- 13 -- You should have received a copy of the GNU General Public License along with 14 -- TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> 15 -- 16 17 DROP FUNCTION IF EXISTS merchant_do_inactivate_account; 18 CREATE FUNCTION merchant_do_inactivate_account ( 19 IN in_h_wire BYTEA 20 ,OUT out_found BOOL 21 ) 22 LANGUAGE plpgsql 23 AS $$ 24 BEGIN 25 UPDATE merchant_accounts 26 SET active=FALSE 27 WHERE h_wire=in_h_wire; 28 out_found = FOUND; 29 IF out_found 30 THEN 31 -- Notify taler-merchant-kyccheck about the change in 32 -- accounts. (TALER_DBEVENT_MERCHANT_ACCOUNTS_CHANGED) 33 NOTIFY XDQM4Z4N0D3GX0H9JEXH70EBC2T3KY7HC0TJB0Z60D2H781RXR6AG; 34 END IF; 35 36 END $$;