Edits history of script submission #22545 for ' Create Invoice Line Item (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,
      customer_id: string,
      price_id: string
    ) {
      const token = stripe_con["token"];
      const stripe = StripeClient(`${token}`, {
        httpClient: StripeClient.createFetchHttpClient(),
      });
    
      const invoiceItem = await stripe.invoiceItems.create({
        customer: `${customer_id}`,
        price: `${price_id}`,
      });
    
      return await invoiceItem.json();
    }
    

    Submitted by hugo989 7 days ago