3 #This drops anything from the database that could cause live things to happen.
4 #You'd want to do this on a test copy of your live database but NEVER on the
7 #-all exports (all records in part_export, part_export_option export_svc)
8 #-all non-POST invoice destinations (cust_main_invoice)
9 #-all payment gateways and agent payment gw overrides (payment_gateway,
10 # payment_gateway_option, agent_payment_gateway)
11 #-everything in the job queue (queue and queue_arg)
12 #-business-onlinepayment and business-onlinepayment-ach config
14 #-masks all payment info
16 foreach my $table (qw(
18 payment_gateway_option
24 print "DELETE FROM $table;\n";
25 print "DELETE FROM h_$table;\n";
28 # don't break foreign keys in cust_pay_*, just scrub fields that could be
29 # used to access the gateway
30 print "UPDATE payment_gateway SET gateway_module = 'Test', disabled = 'Y', gateway_username = NULL, gateway_password = 'NULL';\n";
31 print "DELETE FROM h_payment_gateway;\n";
33 foreach my $table (qw(
37 print "DELETE FROM $table;\n";
40 print "DELETE FROM cust_main_invoice WHERE dest != 'POST';\n";
43 business-onlinepayment
44 business-onlinepayment-ach
47 print "DELETE FROM conf WHERE name = '$item';\n";
48 print "DELETE FROM h_conf WHERE name = '$item';\n";
51 my @ptables = map { ($_, "h_$_") } qw(
58 foreach my $table (@ptables) {
59 print "UPDATE $table SET payinfo = paymask WHERE payby IN ( 'CARD','DCRD','CHEK','DCHK' );\n";
62 print "UPDATE cust_main set paycvv = NULL;\n";
63 print "UPDATE h_cust_main set paycvv = NULL;\n";