Update error handling and function calls in billing services

Minor modifications made to the billing service handlers to improve data interpretation and error processing. The 'getLineItemTypeById' function now uses 'item.variant' for more accurate line item type identification. Unnecessary 'Crypto' object instantiation has been removed in 'createHmac', while improved formatting applied to the error logging within the billing webhook.
This commit is contained in:
giancarlo
2024-05-21 20:41:41 +07:00
parent 70f5ff42df
commit a115e37535
3 changed files with 2 additions and 3 deletions

View File

@@ -36,7 +36,7 @@ export const POST = enhanceRouteHandler(
return new Response('OK', { status: 200 });
} catch (error) {
logger.error(ctx, `Failed to process billing webhook`, error);
logger.error({ ...ctx, error }, `Failed to process billing webhook`);
return new Response('Failed to process billing webhook', {
status: 500,