From 49785b476276d736c01e64d0f29f124ff5feca2a Mon Sep 17 00:00:00 2001 From: Ole-Martin Bratteng <1681525+omBratteng@users.noreply.github.com> Date: Wed, 12 Nov 2025 23:44:57 +0100 Subject: [PATCH 1/2] fix: log error when Apple issues refund for cores --- src/routes/webhooks/apple.ts | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/routes/webhooks/apple.ts b/src/routes/webhooks/apple.ts index 192566c6e..4f9236138 100644 --- a/src/routes/webhooks/apple.ts +++ b/src/routes/webhooks/apple.ts @@ -147,6 +147,18 @@ const handleNotifcationRequest = async ( // No action needed for refund declined on consumables break; case NotificationTypeV2.REFUND: // TODO: Handle refunds for consumables if needed - since it is Apple who decides if a refund is given, we may need to revoke the consumable + logger.error({ + transactionInfo, + renewalInfo, + user, + environment, + provider: SubscriptionProvider.AppleStoreKit, + notification: { + notificationType: notification.notificationType, + subtype: notification.subtype, + }, + }, "Apple issued refund"); + break; default: throw new Error('Unsupported Apple Consumable notification type'); } From 29f9cd91d4d85f61bb3d603918058b3ab7bf2d33 Mon Sep 17 00:00:00 2001 From: Ole-Martin Bratteng <1681525+omBratteng@users.noreply.github.com> Date: Thu, 13 Nov 2025 00:49:13 +0100 Subject: [PATCH 2/2] fix: lint --- src/routes/webhooks/apple.ts | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/src/routes/webhooks/apple.ts b/src/routes/webhooks/apple.ts index 4f9236138..0a1ec94e0 100644 --- a/src/routes/webhooks/apple.ts +++ b/src/routes/webhooks/apple.ts @@ -147,17 +147,15 @@ const handleNotifcationRequest = async ( // No action needed for refund declined on consumables break; case NotificationTypeV2.REFUND: // TODO: Handle refunds for consumables if needed - since it is Apple who decides if a refund is given, we may need to revoke the consumable - logger.error({ - transactionInfo, - renewalInfo, - user, - environment, - provider: SubscriptionProvider.AppleStoreKit, - notification: { - notificationType: notification.notificationType, - subtype: notification.subtype, + logger.error( + { + transactionInfo, + user, + environment, + provider: SubscriptionProvider.AppleStoreKit, }, - }, "Apple issued refund"); + 'Apple issued refund', + ); break; default: throw new Error('Unsupported Apple Consumable notification type');