Edits history of script submission #2448 for ' Delete accounts account (stripe)'

  • nativets
    One script reply has been approved by the moderators
    Ap­pro­ved
    type Stripe = {
      token: string;
    };
    /**
     * Delete accounts account
     * With Connect, you can delete accounts you manage.
    
    Accounts created using test-mode keys can be deleted at any time. Standard accounts created using live-mode keys cannot be deleted. Custom or Express accounts created using live-mode keys can only be deleted once all balances are zero.
    
    If you want to delete your own account, use the account information tab in your account settings instead.
     */
    export async function main(auth: Stripe, account: string) {
      const url = new URL(`https://api.stripe.com/v1/accounts/${account}`);
    
      const response = await fetch(url, {
        method: "DELETE",
        headers: {
          "Content-Type": "application/x-www-form-urlencoded",
          Authorization: "Bearer " + auth.token,
        },
        body: undefined,
      });
      if (!response.ok) {
        const text = await response.text();
        throw new Error(`${response.status} ${text}`);
      }
      return await response.json();
    }
    

    Submitted by hugo697 368 days ago

  • nativets
    type Stripe = {
      token: string;
    };
    /**
     * Delete accounts account
     * With Connect, you can delete accounts you manage.
    
    Accounts created using test-mode keys can be deleted at any time. Standard accounts created using live-mode keys cannot be deleted. Custom or Express accounts created using live-mode keys can only be deleted once all balances are zero.
    
    If you want to delete your own account, use the account information tab in your account settings instead.
     */
    export async function main(auth: Stripe, account: string) {
      const url = new URL(`https://api.stripe.com/v1/accounts/${account}`);
    
      const response = await fetch(url, {
        method: "DELETE",
        headers: {
          "Content-Type": "application/x-www-form-urlencoded",
          Authorization: "Bearer " + auth.token,
        },
        body: undefined,
      });
      if (!response.ok) {
        const text = await response.text();
        throw new Error(`${response.status} ${text}`);
      }
      return await response.json();
    }
    

    Submitted by hugo697 795 days ago

  • nativets
    type Stripe = {
      token: string;
    };
    /**
     * Delete accounts account
     * <p>With <a href="/docs/connect">Connect</a>, you can delete accounts you manage.
     */
    export async function main(auth: Stripe, account: string) {
      const url = new URL(`https://api.stripe.com/v1/accounts/${account}`);
    
      const response = await fetch(url, {
        method: "DELETE",
        headers: {
          "Content-Type": "application/x-www-form-urlencoded",
          Authorization: "Bearer " + auth.token,
        },
        body: undefined,
      });
      if (!response.ok) {
        const text = await response.text();
        throw new Error(`${response.status} ${text}`);
      }
      return await response.json();
    }
    

    Submitted by hugo697 922 days ago