Vipps Donations #33

Merged
olaven merged 18 commits from vipps-demo into main 2024-08-24 16:55:08 +00:00
1 changed files with 6 additions and 0 deletions
Showing only changes of commit 68a932bdd9 - Show all commits

View File

@ -17,6 +17,12 @@ export const handler = async function (req: Request): Promise<Response> {
return Response.redirect(errorPage);
}
const existingAgreement = await storage.readVippsAgreement({ id: email });
if (existingAgreement) {
console.error("Agreement already exists", email);
return Response.redirect(errorPage);
}
const agreement = await createAgreement(email);
if (agreement instanceof Error) {
console.error("Failed to create Vipps agreement", agreement);