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

  • bun
    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 136 days ago