Edits history of script submission #22542 for ' Confirm a Payment Intent (stripe)'

  • bunnative
    One script reply has been approved by the moderators
    Ap­pro­ved
    //native
    
    type Stripe = {
      token: string;
    };
    export async function main(stripe_con: Stripe, id: string) {
      const STRIPE_CONFIRM_PAYMENT_URL = `https://api.stripe.com/v1/payment_intents/:${id}/confirm`;
    
      const token = stripe_con["token"];
    
      const response = await fetch(STRIPE_CONFIRM_PAYMENT_URL, {
        method: "POST",
        headers: {
          Authorization: "Bearer " + token,
          "Content-Type": "application/json",
        },
      });
    
      return await response.json();
    }
    

    Submitted by hugo989 7 days ago