Edits history of script submission #22547 for ' Create a Payout (stripe)'

  • bun
    One script reply has been approved by the moderators
    Ap­pro­ved
    import StripeClient from "stripe@11";
    
    type Stripe = {
      token: string;
    };
    export async function main(
      stripe_con: Stripe,
      amount: number,
      currency: string
    ) {
      const token = stripe_con["token"];
      const stripe = StripeClient(`${token}`, {
        httpClient: StripeClient.createFetchHttpClient(),
      });
    
      const payout = await stripe.payouts.create({
        amount: amount,
        currency: `${currency}`,
      });
    
      return await payout.json();
    }
    

    Submitted by hugo989 20 days ago