//native
type Basistheory = {
apiKey: string;
};
/**
* Three DS.Get Session By Id
* Three DS.Get Session By Id
*/
export async function main(auth: Basistheory, id: string) {
const url = new URL(`https://api.basistheory.com/3ds/sessions/${id}`);
const response = await fetch(url, {
method: "GET",
headers: {
"BT-API-KEY": auth.apiKey,
},
body: undefined,
});
if (!response.ok) {
const text = await response.text();
throw new Error(`${response.status} ${text}`);
}
return await response.json();
}
Submitted by hugo697 235 days ago