Skip to content

Instantly share code, notes, and snippets.

@webtoffee-git
Last active October 17, 2024 09:37
Show Gist options
  • Save webtoffee-git/ef5771f27e2e0d28a2337c0934b1e5c6 to your computer and use it in GitHub Desktop.
Save webtoffee-git/ef5771f27e2e0d28a2337c0934b1e5c6 to your computer and use it in GitHub Desktop.
Code to force disconnect the Stripe app - By WebToffee (Stripe Payment Gateway for WooCommerce)
<?php //Do not copy this line of code
add_action("admin_init", "wt_disconnect_app");
function wt_disconnect_app(){
if(isset($_REQUEST['page']) && "wt_stripe_menu" === sanitize_text_field($_REQUEST['page']) && isset($_REQUEST['action']) && "delete_app" === sanitize_text_field($_REQUEST['action'])){
delete_transient("wtst_refresh_token_calling");
//Sandobx tokens
delete_option("wt_stripe_account_id_test");
delete_option("wt_stripe_access_token_test");
delete_option("wt_stripe_refresh_token_test");
delete_option("wt_stripe_oauth_connected_test");
delete_transient("wtst_oauth_expriy_test");
//Live tokens
delete_option("wt_stripe_account_id_live");
delete_option("wt_stripe_access_token_live");
delete_option("wt_stripe_refresh_token_live");
delete_option("wt_stripe_oauth_connected_live");
delete_transient("wtst_oauth_expriy_live");
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment