Edits history of script submission #3834 for ' Get customers search (stripe)'

  • deno
    import Stripe from "https://esm.sh/stripe?target=deno";
    
    type Stripe = {
      token: string;
    };
    export async function main(
      auth: Stripe,
      query: string,
      limit?: number,
      page?: string,
    ) {
      const token = auth["token"];
      const stripe = Stripe(`${token}`, {
        httpClient: Stripe.createFetchHttpClient(),
      });
      const searchParams: Stripe.CustomerSearchParams = {
        query,
        limit: limit || undefined,
        page: page || undefined
      };
      const searchCustomers = await stripe.customers.search(searchParams);
      return searchCustomers;
    }

    Submitted by jbmolle697 916 days ago