CdvPurchase.Transaction
Transaction as reported by the device
See
- Receipt
- store.localTransactions
-
Transaction
- amountMicros
- currency
- expirationDate
- isAcknowledged
- isConsumed
- isPending
- lastRenewalDate
- platform
- products
- purchaseDate
- purchaseId
- renewalIntent
- renewalIntentChangeDate
- state
- transactionId
• Optional
amountMicros: number
Amount paid by the user, if known, in micro units. Divide by 1,000,000 for value.
• Optional
currency: string
Currency used to pay for the transaction, if known.
• Optional
expirationDate: Date
Time when the subscription is set to expire following this transaction
• Optional
isAcknowledged: boolean
True when the transaction has been acknowledged to the platform.
• Optional
isConsumed: boolean
True when the transaction was consumed.
• Optional
isPending: boolean
True when the transaction is still pending payment.
• Optional
lastRenewalDate: Date
Time a subscription was last renewed
• platform: Platform
Platform this transaction was created on
• products: { id
: string
; offerId?
: string
}[] = []
Purchased products
• Optional
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).
• Optional
purchaseId: string
Identifier for the purchase this transaction is a part of.
• Optional
renewalIntent: RenewalIntent
Is the subscription set to renew.
• Optional
renewalIntentChangeDate: Date
Time when the renewal intent was changed
• state: TransactionState
= TransactionState.UNKNOWN_STATE
State this transaction is in
• transactionId: string
= ''
Transaction identifier.
• get
parentReceipt(): Receipt
Return the receipt this transaction is part of.
▸ finish(): Promise
<void
>
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.
Example
store.when()
.approved(transaction => transaction.verify())
.verified(receipt => receipt.finish())
Promise
<void
>
▸ verify(): Promise
<void
>
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.
Example
store.when()
.approved(transaction => transaction.verify())
.verified(receipt => receipt.finish())
Promise
<void
>