Transaction as reported by the device

Hierarchy (view full)

Properties

amountMicros?: number

Amount paid by the user, if known, in micro units. Divide by 1,000,000 for value.

currency?: string

Currency used to pay for the transaction, if known.

expirationDate?: Date

Time when the subscription is set to expire following this transaction

isAcknowledged?: boolean

True when the transaction has been acknowledged to the platform.

isConsumed?: boolean

True when the transaction was consumed.

isPending?: boolean

True when the transaction is still pending payment.

lastRenewalDate?: Date

Time a subscription was last renewed

platform: Platform

Platform this transaction was created on

products: {
    id: string;
    offerId?: string;
}[] = []

Purchased products

Type declaration

  • id: string

    Product identifier

  • Optional offerId?: string

    Offer identifier, if known

purchaseDate?: Date

Time the purchase was made.

For subscriptions this is equal to the date of the first transaction. Note that it might be undefined for deleted transactions (google for instance don't provide any info in that case).

purchaseId?: string

Identifier for the purchase this transaction is a part of.

renewalIntent?: RenewalIntent

Is the subscription set to renew.

renewalIntentChangeDate?: Date

Time when the renewal intent was changed

state: CdvPurchase.TransactionState = TransactionState.UNKNOWN_STATE

State this transaction is in

transactionId: string = ''

Transaction identifier.

Accessors

Methods

  • Finish a transaction.

    When the application has delivered the product, it should finalizes the order. Only after that, money will be transferred to your account. This method ensures that no customers is charged for a product that couldn't be delivered.

    Returns Promise<void>

    Example

    store.when()
    .approved(transaction => transaction.verify())
    .verified(receipt => receipt.finish())
  • Verify a transaction.

    This will trigger a call to the receipt validation service for the attached receipt. Once the receipt has been verified, you can finish the transaction.

    Returns Promise<void>

    Example

    store.when()
    .approved(transaction => transaction.verify())
    .verified(receipt => receipt.finish())