Created by rossmccrann 212 days ago Viewed 53 times 1 Point
Cancel a [payment intent (https://stripe.com/docs/payments/payment-intents). Once canceled, no additional charges will be made by the payment intent and any operations on the payment intent will fail with an error. For payment intents with status=requires_capture, the remaining amount_capturable will automatically be refunded. See the docs for more information.
No comments yet
export async function main(stripe_con: wmill.Resource<"stripe">, cancel_id: string) {
const STRIPE_CANCEL_PAYOUT_URL =
`https://api.stripe.com/v1/payouts/:${cancel_id}/cancel`;
const token = stripe_con["token"];
const response = await fetch(STRIPE_CANCEL_PAYOUT_URL, {
method: "POST",
headers: {
Authorization: "Bearer " + token,
"Content-Type": "application/json",
},
});
return await response.json();
}
No comments yet