diff --git a/index.d.ts b/index.d.ts new file mode 100644 index 0000000..72ad1ab --- /dev/null +++ b/index.d.ts @@ -0,0 +1,27 @@ +type Platform = 'amazon' | 'apple' | 'google' | 'roku'; + +interface Payment { + receipt: any, // always required + productId: string, + packageName: string, + secret: string, + subscription?: boolean, + keyObject?: any, // required, if google + userId?: string, // required, if amazon + devToken?: string, // required, if roku +} + +interface Response { + receipt: any, + platform: Platform, + productId: string, + transactionId: string, + purchaseDate: number, + expirationDate: number, +} + +export function verifyPayment ( + platform: Platform, + payment: Payment, + callback: (error: string, response: Response & any) => void +);