Add HMAC function, and update the CMS and Mailer services
A new module has been added to create HMACs, primarily used in the billing service for data verification. Keystatic CMS usage has been conditioned to Node.js runtime only, and a fallback to the mock CMS client has been implemented for Edge Runtime. Mailer services now accommodate environment-specific providers.
This commit is contained in:
@@ -11,11 +11,13 @@ export async function POST(request: Request) {
|
||||
const provider = billingConfig.provider;
|
||||
const logger = await getLogger();
|
||||
|
||||
const ctx = {
|
||||
name: 'billing.webhook',
|
||||
provider,
|
||||
};
|
||||
|
||||
logger.info(
|
||||
{
|
||||
name: 'billing.webhook',
|
||||
provider,
|
||||
},
|
||||
ctx,
|
||||
`Received billing webhook. Processing...`,
|
||||
);
|
||||
|
||||
@@ -32,9 +34,7 @@ export async function POST(request: Request) {
|
||||
await service.handleWebhookEvent(request);
|
||||
|
||||
logger.info(
|
||||
{
|
||||
name: 'billing.webhook',
|
||||
},
|
||||
ctx,
|
||||
`Successfully processed billing webhook`,
|
||||
);
|
||||
|
||||
@@ -44,7 +44,7 @@ export async function POST(request: Request) {
|
||||
|
||||
logger.error(
|
||||
{
|
||||
name: 'billing',
|
||||
...ctx,
|
||||
error: JSON.stringify(error),
|
||||
},
|
||||
`Failed to process billing webhook`,
|
||||
|
||||
Reference in New Issue
Block a user