Advertisement
palsushobhan

WCFM_Delete_Stripe_Accounts_Admin_Dashboard

Jul 7th, 2025
318
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.16 KB | None | 0 0
  1. function delete_stripe_connected_accounts() {
  2.     global $WCFM, $WCFMmp;
  3.     $connected_ids = [
  4.         'acct_1PCJ59RdL98et2qa',
  5.         'acct_1OyCzURkmitdaADc',
  6.         'acct_1NGzfCDIVjmDyJaR',
  7.         'acct_1LBCS8RmPvXG2E9E',
  8.         'acct_1LBCHoRXSLTdUodF',
  9.         'acct_1KL1aKRcSEk1Yoq3',
  10.         'acct_1JuYGIRc49YfvmpW',
  11.     ];
  12.     if (!class_exists('WCFM_Stripe_Connect_Client')) {
  13.         include_once $WCFM->plugin_path . "helpers/class-wcfm-stripe-connect-client.php";
  14.     }
  15.     $testmode = isset($WCFMmp->wcfmmp_withdrawal_options['test_mode']) ? true : false;
  16.     $client_id = sanitize_text_field($testmode ? $WCFMmp->wcfmmp_withdrawal_options['stripe_test_client_id'] : $WCFMmp->wcfmmp_withdrawal_options['stripe_client_id']);
  17.     $secret_key = sanitize_text_field($testmode ? $WCFMmp->wcfmmp_withdrawal_options['stripe_test_secret_key'] : $WCFMmp->wcfmmp_withdrawal_options['stripe_secret_key']);
  18.     $stripe_client = new WCFM_Stripe_Connect_Client($client_id, $secret_key);
  19.  
  20.     foreach ($connected_ids as $connected_id) {
  21.         $stripe_client->delete_account($connected_id);
  22.     }
  23. }
  24.  
  25. add_action( 'shutdown', 'delete_stripe_connected_accounts' );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement