Skip to content
Closed
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 22 additions & 6 deletions src/routes/webhooks/apple.ts
Original file line number Diff line number Diff line change
Expand Up @@ -124,12 +124,28 @@ const handleNotifcationRequest = async (
switch (getAppleTransactionType({ transactionInfo })) {
case AppleTransactionType.Consumable:
if (isCorePurchaseApple({ transactionInfo })) {
await handleCoresPurchase({
transactionInfo,
user,
environment,
notification,
});
if (
notification.notificationType === NotificationTypeV2.ONE_TIME_CHARGE
) {
await handleCoresPurchase({
transactionInfo,
user,
environment,
notification,
});
} else {
logger.error(
{
environment,
notification,
notificationType: notification.notificationType,
user,
transactionInfo,
provider: SubscriptionProvider.AppleStoreKit,
},
'Unsupported Apple Consumable notification type for cores purchase',
);
}
} else {
throw new Error('Unsupported Apple Consumable transaction type');
}
Expand Down
Loading