Confirm a Payment Intent ( stripe)
One script reply has been approved by the moderators Verified

Created by rossmccrann 212 days ago Viewed 54 times 1 Point

Confirm that your customer intends to pay with current or provided payment method. Upon confirmation, Stripe will attempt to initiate a payment. See the docs for more information

No comments yet

Login to be able to comment
Points: 0
deno
One script reply has been approved by the moderators
Ap­pro­ved
export async function main(stripe_con: wmill.Resource<"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 rossmccrann 212 days ago

Edited 212 days ago

No comments yet

Login to be able to comment