Skip to content
Open
Changes from all 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
27 changes: 27 additions & 0 deletions index.d.ts
Original file line number Diff line number Diff line change
@@ -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
);