Search... Ctrl + K

Create a Payout (stripe)
One script reply has been approved by the moderators Verified

Created by rossmccrann 100 days ago Used 31 times 1 Point

Send funds to your own bank account. Your Stripe balance must be able to cover the payout amount, or you'll receive an 'Insufficient Funds' error. See the docs for more information

No comments yet

Points: 0
deno
One script reply has been approved by the moderators
Ap­pro­ved
import * as wmill from "https://deno.land/x/windmill@v1.34.0/mod.ts";
import Stripe from "https://esm.sh/stripe?target=deno";

export async function main(
  stripe_con: wmill.Resource<"stripe">,
  amount: number,
  currency: string,
) {
    
  const token = stripe_con["token"];
  const stripe = Stripe(
    `${token}`,
    {
      httpClient: Stripe.createFetchHttpClient(),
    },
  );

  const payout = await stripe.payouts.create({
    amount: amount,
    currency: `${currency}`,
  });

  return await payout.json();
}

Submitted by rossmccrann 100 days ago

Edited 100 days ago

No comments yet