Add renewal status
This commit is contained in:
@@ -117,7 +117,7 @@ export default new Hono<{Bindings: Bindings; Variables: Variables}>()
|
|||||||
products = products.filter(p => p.provider === 'play_store')
|
products = products.filter(p => p.provider === 'play_store')
|
||||||
}
|
}
|
||||||
|
|
||||||
return c.json({active: activeProducts, subscriptions: products})
|
return c.json({active: activeProducts, available: products})
|
||||||
})
|
})
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
+14
-14
@@ -132,7 +132,7 @@ export type Subscription =
|
|||||||
*/
|
*/
|
||||||
interval: 'monthly' | 'annual'
|
interval: 'monthly' | 'annual'
|
||||||
active: boolean
|
active: boolean
|
||||||
autoRenew: boolean
|
autoRenewStatus: RevenueCatSubscription['auto_renewal_status'] | null
|
||||||
provider: RevenueCatSubscription['store']
|
provider: RevenueCatSubscription['store']
|
||||||
status: RevenueCatSubscription['status'] | null
|
status: RevenueCatSubscription['status'] | null
|
||||||
entitlements: RevenueCatSubscription['entitlements']['items']
|
entitlements: RevenueCatSubscription['entitlements']['items']
|
||||||
@@ -148,7 +148,7 @@ export type Subscription =
|
|||||||
checkoutId: string
|
checkoutId: string
|
||||||
interval: 'monthly' | 'annual'
|
interval: 'monthly' | 'annual'
|
||||||
active: boolean
|
active: boolean
|
||||||
autoRenew: boolean
|
autoRenewStatus: RevenueCatSubscription['auto_renewal_status'] | null
|
||||||
storeSubscriptionIdentifier: string | null
|
storeSubscriptionIdentifier: string | null
|
||||||
provider: RevenueCatSubscription['store']
|
provider: RevenueCatSubscription['store']
|
||||||
status: RevenueCatSubscription['status'] | null
|
status: RevenueCatSubscription['status'] | null
|
||||||
@@ -194,9 +194,9 @@ export function normalizeMainSubscriptionProduct({
|
|||||||
checkoutId: product.store_identifier,
|
checkoutId: product.store_identifier,
|
||||||
interval: 'monthly',
|
interval: 'monthly',
|
||||||
active: subscription?.gives_access ?? false,
|
active: subscription?.gives_access ?? false,
|
||||||
autoRenew: true,
|
|
||||||
platform: 'android',
|
platform: 'android',
|
||||||
provider: 'play_store',
|
provider: 'play_store',
|
||||||
|
autoRenewStatus: subscription?.auto_renewal_status ?? null,
|
||||||
storeSubscriptionIdentifier:
|
storeSubscriptionIdentifier:
|
||||||
subscription?.store_subscription_identifier ?? null,
|
subscription?.store_subscription_identifier ?? null,
|
||||||
status: subscription?.status ?? null,
|
status: subscription?.status ?? null,
|
||||||
@@ -216,7 +216,7 @@ export function normalizeMainSubscriptionProduct({
|
|||||||
checkoutId: product.store_identifier,
|
checkoutId: product.store_identifier,
|
||||||
interval: 'annual',
|
interval: 'annual',
|
||||||
active: subscription?.gives_access ?? false,
|
active: subscription?.gives_access ?? false,
|
||||||
autoRenew: true,
|
autoRenewStatus: subscription?.auto_renewal_status ?? null,
|
||||||
platform: 'android',
|
platform: 'android',
|
||||||
provider: 'play_store',
|
provider: 'play_store',
|
||||||
storeSubscriptionIdentifier:
|
storeSubscriptionIdentifier:
|
||||||
@@ -238,7 +238,7 @@ export function normalizeMainSubscriptionProduct({
|
|||||||
checkoutId: product.store_identifier,
|
checkoutId: product.store_identifier,
|
||||||
interval: 'monthly',
|
interval: 'monthly',
|
||||||
active: subscription?.gives_access ?? false,
|
active: subscription?.gives_access ?? false,
|
||||||
autoRenew: true,
|
autoRenewStatus: subscription?.auto_renewal_status ?? null,
|
||||||
platform: 'android',
|
platform: 'android',
|
||||||
provider: 'play_store',
|
provider: 'play_store',
|
||||||
storeSubscriptionIdentifier:
|
storeSubscriptionIdentifier:
|
||||||
@@ -260,7 +260,7 @@ export function normalizeMainSubscriptionProduct({
|
|||||||
checkoutId: product.store_identifier,
|
checkoutId: product.store_identifier,
|
||||||
interval: 'annual',
|
interval: 'annual',
|
||||||
active: subscription?.gives_access ?? false,
|
active: subscription?.gives_access ?? false,
|
||||||
autoRenew: true,
|
autoRenewStatus: subscription?.auto_renewal_status ?? null,
|
||||||
platform: 'android',
|
platform: 'android',
|
||||||
provider: 'play_store',
|
provider: 'play_store',
|
||||||
storeSubscriptionIdentifier:
|
storeSubscriptionIdentifier:
|
||||||
@@ -282,7 +282,7 @@ export function normalizeMainSubscriptionProduct({
|
|||||||
checkoutId: product.store_identifier,
|
checkoutId: product.store_identifier,
|
||||||
interval: 'monthly',
|
interval: 'monthly',
|
||||||
active: subscription?.gives_access ?? false,
|
active: subscription?.gives_access ?? false,
|
||||||
autoRenew: true,
|
autoRenewStatus: subscription?.auto_renewal_status ?? null,
|
||||||
platform: 'android',
|
platform: 'android',
|
||||||
provider: 'play_store',
|
provider: 'play_store',
|
||||||
storeSubscriptionIdentifier:
|
storeSubscriptionIdentifier:
|
||||||
@@ -304,7 +304,7 @@ export function normalizeMainSubscriptionProduct({
|
|||||||
checkoutId: product.store_identifier,
|
checkoutId: product.store_identifier,
|
||||||
interval: 'annual',
|
interval: 'annual',
|
||||||
active: subscription?.gives_access ?? false,
|
active: subscription?.gives_access ?? false,
|
||||||
autoRenew: true,
|
autoRenewStatus: subscription?.auto_renewal_status ?? null,
|
||||||
platform: 'android',
|
platform: 'android',
|
||||||
provider: 'play_store',
|
provider: 'play_store',
|
||||||
storeSubscriptionIdentifier:
|
storeSubscriptionIdentifier:
|
||||||
@@ -330,7 +330,7 @@ export function normalizeMainSubscriptionProduct({
|
|||||||
checkoutId: product.store_identifier,
|
checkoutId: product.store_identifier,
|
||||||
interval: 'monthly',
|
interval: 'monthly',
|
||||||
active: subscription?.gives_access ?? false,
|
active: subscription?.gives_access ?? false,
|
||||||
autoRenew: true,
|
autoRenewStatus: subscription?.auto_renewal_status ?? null,
|
||||||
platform: 'web',
|
platform: 'web',
|
||||||
provider: 'stripe',
|
provider: 'stripe',
|
||||||
price: 0,
|
price: 0,
|
||||||
@@ -353,7 +353,7 @@ export function normalizeMainSubscriptionProduct({
|
|||||||
checkoutId: product.store_identifier,
|
checkoutId: product.store_identifier,
|
||||||
interval: 'annual',
|
interval: 'annual',
|
||||||
active: subscription?.gives_access ?? false,
|
active: subscription?.gives_access ?? false,
|
||||||
autoRenew: true,
|
autoRenewStatus: subscription?.auto_renewal_status ?? null,
|
||||||
platform: 'web',
|
platform: 'web',
|
||||||
provider: 'stripe',
|
provider: 'stripe',
|
||||||
price: 0,
|
price: 0,
|
||||||
@@ -376,7 +376,7 @@ export function normalizeMainSubscriptionProduct({
|
|||||||
checkoutId: product.store_identifier,
|
checkoutId: product.store_identifier,
|
||||||
interval: 'monthly',
|
interval: 'monthly',
|
||||||
active: subscription?.gives_access ?? false,
|
active: subscription?.gives_access ?? false,
|
||||||
autoRenew: true,
|
autoRenewStatus: subscription?.auto_renewal_status ?? null,
|
||||||
platform: 'web',
|
platform: 'web',
|
||||||
provider: 'stripe',
|
provider: 'stripe',
|
||||||
price: 0,
|
price: 0,
|
||||||
@@ -399,7 +399,7 @@ export function normalizeMainSubscriptionProduct({
|
|||||||
checkoutId: product.store_identifier,
|
checkoutId: product.store_identifier,
|
||||||
interval: 'annual',
|
interval: 'annual',
|
||||||
active: subscription?.gives_access ?? false,
|
active: subscription?.gives_access ?? false,
|
||||||
autoRenew: true,
|
autoRenewStatus: subscription?.auto_renewal_status ?? null,
|
||||||
platform: 'web',
|
platform: 'web',
|
||||||
provider: 'stripe',
|
provider: 'stripe',
|
||||||
price: 0,
|
price: 0,
|
||||||
@@ -422,7 +422,7 @@ export function normalizeMainSubscriptionProduct({
|
|||||||
checkoutId: product.store_identifier,
|
checkoutId: product.store_identifier,
|
||||||
interval: 'monthly',
|
interval: 'monthly',
|
||||||
active: subscription?.gives_access ?? false,
|
active: subscription?.gives_access ?? false,
|
||||||
autoRenew: true,
|
autoRenewStatus: subscription?.auto_renewal_status ?? null,
|
||||||
platform: 'web',
|
platform: 'web',
|
||||||
provider: 'stripe',
|
provider: 'stripe',
|
||||||
price: 0,
|
price: 0,
|
||||||
@@ -445,7 +445,7 @@ export function normalizeMainSubscriptionProduct({
|
|||||||
checkoutId: product.store_identifier,
|
checkoutId: product.store_identifier,
|
||||||
interval: 'annual',
|
interval: 'annual',
|
||||||
active: subscription?.gives_access ?? false,
|
active: subscription?.gives_access ?? false,
|
||||||
autoRenew: true,
|
autoRenewStatus: subscription?.auto_renewal_status ?? null,
|
||||||
platform: 'web',
|
platform: 'web',
|
||||||
provider: 'stripe',
|
provider: 'stripe',
|
||||||
price: 0,
|
price: 0,
|
||||||
|
|||||||
Reference in New Issue
Block a user