emarref-intenttoreceive.web.val.run
Readme

Implements Xero's "Intent to Receive" signature validation webhook.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
import { z } from "npm:zod";
import { config } from "https://esm.town/v/emarref/EnvironmentConfig";
import { add, chain, send } from "https://esm.town/v/emarref/HttpMiddlewareChain";
import { requireHttpMethod } from "https://esm.town/v/emarref/HttpMiddlewareRequireHttpMethod";
import { validateRequest } from "https://esm.town/v/emarref/XeroWebhookMiddlewareValidateRequest";
const env = config({
XERO_WEBHOOK_SIGNING_KEY: z.string(),
});
export default await chain()
.then(add(requireHttpMethod("POST")))
.then(add(validateRequest(env.XERO_WEBHOOK_SIGNING_KEY)))
.then(send());
Val Town is a social website to write and deploy JavaScript.
Build APIs and schedule functions from your browser.
Comments
Nobody has commented on this val yet: be the first!
June 16, 2024