Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function delete_stripe_connected_accounts() {
- global $WCFM, $WCFMmp;
- $connected_ids = [
- 'acct_1PCJ59RdL98et2qa',
- 'acct_1OyCzURkmitdaADc',
- 'acct_1NGzfCDIVjmDyJaR',
- 'acct_1LBCS8RmPvXG2E9E',
- 'acct_1LBCHoRXSLTdUodF',
- 'acct_1KL1aKRcSEk1Yoq3',
- 'acct_1JuYGIRc49YfvmpW',
- ];
- if (!class_exists('WCFM_Stripe_Connect_Client')) {
- include_once $WCFM->plugin_path . "helpers/class-wcfm-stripe-connect-client.php";
- }
- $testmode = isset($WCFMmp->wcfmmp_withdrawal_options['test_mode']) ? true : false;
- $client_id = sanitize_text_field($testmode ? $WCFMmp->wcfmmp_withdrawal_options['stripe_test_client_id'] : $WCFMmp->wcfmmp_withdrawal_options['stripe_client_id']);
- $secret_key = sanitize_text_field($testmode ? $WCFMmp->wcfmmp_withdrawal_options['stripe_test_secret_key'] : $WCFMmp->wcfmmp_withdrawal_options['stripe_secret_key']);
- $stripe_client = new WCFM_Stripe_Connect_Client($client_id, $secret_key);
- foreach ($connected_ids as $connected_id) {
- $stripe_client->delete_account($connected_id);
- }
- }
- add_action( 'shutdown', 'delete_stripe_connected_accounts' );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement