UNPKG

@qonversion/react-native-sdk

Version:

Qonversion provides full in-app purchases infrastructure, so you do not need to build your own server for receipt validation. Implement in-app subscriptions, validate user receipts, check subscription status, and provide access to your app features and co

41 lines (37 loc) 1.49 kB
import {TransactionEnvironment, TransactionOwnershipType, TransactionType} from "./enums"; class Transaction { originalTransactionId: string; transactionId: string; transactionDate: Date; environment: TransactionEnvironment; ownershipType: TransactionOwnershipType; type: TransactionType; expirationDate?: Date; transactionRevocationDate?: Date; offerCode?: string; promoOfferId?: string; constructor( originalTransactionId: string, transactionId: string, transactionTimestamp: number, environment: TransactionEnvironment, ownershipType: TransactionOwnershipType, type: TransactionType, expirationTimestamp: number | undefined, transactionRevocationTimestamp: number | undefined, offerCode: string | undefined, promoOfferId: string | undefined, ) { this.originalTransactionId = originalTransactionId; this.transactionId = transactionId; this.transactionDate = new Date(transactionTimestamp); this.environment = environment; this.ownershipType = ownershipType; this.type = type; this.expirationDate = expirationTimestamp ? new Date(expirationTimestamp) : undefined; this.transactionRevocationDate = transactionRevocationTimestamp ? new Date(transactionRevocationTimestamp) : undefined; this.offerCode = offerCode; this.promoOfferId = promoOfferId; } } export default Transaction;