From db4e6f72908d20f2e651144962e197ee41629f7e Mon Sep 17 00:00:00 2001 From: Dennis Kugelmann Date: Wed, 19 Sep 2018 13:49:24 +0200 Subject: [PATCH] More complete in-app-purchase PurchasedItem interface --- types/in-app-purchase/index.d.ts | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/types/in-app-purchase/index.d.ts b/types/in-app-purchase/index.d.ts index b27daf2c20..36eb31e7b2 100644 --- a/types/in-app-purchase/index.d.ts +++ b/types/in-app-purchase/index.d.ts @@ -26,6 +26,7 @@ export function validateOnce(service: Service, secretOrPubKey: any, receipt: Rec export function isValidated(response: ValidationResponse): boolean; export function isExpired(item: PurchasedItem): boolean; +export function isCanceled(item: PurchasedItem): boolean; export function getPurchaseData(purchaseData?: ValidationResponse, options?: { ignoreCanceled: boolean; ignoreExpired: boolean; @@ -94,10 +95,15 @@ export interface ValidationResponse { export interface PurchasedItem { bundleId?: string; // only Apple + appItemId?: string; orderId?: string; // only Google + originalTransactionId?: string; // only Apple transactionId: string; productId: string; - purchaseDate: number; + originalPurchaseDate?: string; // only Apple + purchaseDate: number | string; + isTrial?: boolean; // only Apple + cancellationDate?: number; // only Apple/Google // iTunes, windows and amazon subscription only // Google subscriptions only with google play store api info expirationDate?: number;