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 412 days ago