type Stripe = {
token: string;
};
/**
* Delete terminal readers reader
* Deletes a Reader object.
*/
export async function main(auth: Stripe, reader: string) {
const url = new URL(`https://api.stripe.com/v1/terminal/readers/${reader}`);
const response = await fetch(url, {
method: "DELETE",
headers: {
"Content-Type": "application/x-www-form-urlencoded",
Authorization: "Bearer " + auth.token,
},
body: undefined,
});
if (!response.ok) {
const text = await response.text();
throw new Error(`${response.status} ${text}`);
}
return await response.json();
}
Submitted by hugo697 291 days ago
type Stripe = {
token: string;
};
/**
* Delete terminal readers reader
* <p>Deletes a <code>Reader</code> object.</p>
*/
export async function main(auth: Stripe, reader: string) {
const url = new URL(`https://api.stripe.com/v1/terminal/readers/${reader}`);
const response = await fetch(url, {
method: "DELETE",
headers: {
"Content-Type": "application/x-www-form-urlencoded",
Authorization: "Bearer " + auth.token,
},
body: undefined,
});
if (!response.ok) {
const text = await response.text();
throw new Error(`${response.status} ${text}`);
}
return await response.json();
}
Submitted by hugo697 419 days ago