interface BridgeCallbacks {
    deferred: ((productId) => void);
    error: ((code, message, options?) => void);
    finished: ((transactionIdentifier, productId) => void);
    purchaseEnqueued: ((productId, quantity) => void);
    purchaseFailed: ((productId, code, message) => void);
    purchased: ((transactionIdentifier, productId, originalTransactionIdentifier?, transactionDate?, discountId?) => void);
    purchasing: ((productId) => void);
    ready: (() => void);
    receiptsRefreshed: ((receipt) => void);
    restoreCompleted: (() => void);
    restoreFailed: ((errorCode) => void);
    restored: ((transactionIdentifier, productId) => void);
}

Hierarchy (view full)

Properties

deferred: ((productId) => void)

Called when a transaction is deferred (waiting for approval)

Type declaration

    • (productId): void
    • Parameters

      • productId: string

      Returns void

error: ((code, message, options?) => void)

Type declaration

    • (code, message, options?): void
    • Parameters

      • code: CdvPurchase.ErrorCode
      • message: string
      • Optional options: {
            productId: string;
            quantity?: number;
        }
        • productId: string
        • Optional quantity?: number

      Returns void

finished: ((transactionIdentifier, productId) => void)

Called when a transaction is in "finished" state

Type declaration

    • (transactionIdentifier, productId): void
    • Parameters

      • transactionIdentifier: string
      • productId: string

      Returns void

purchaseEnqueued: ((productId, quantity) => void)

Called when a transaction has been enqueued

Type declaration

    • (productId, quantity): void
    • Parameters

      • productId: string
      • quantity: number

      Returns void

purchaseFailed: ((productId, code, message) => void)

Called when a transaction failed.

Watch out for ErrorCode.PAYMENT_CANCELLED (means user closed the dialog)

Type declaration

    • (productId, code, message): void
    • Parameters

      Returns void

purchased: ((transactionIdentifier, productId, originalTransactionIdentifier?, transactionDate?, discountId?) => void)

Called when a transaction is in "Purchased" state

Type declaration

    • (transactionIdentifier, productId, originalTransactionIdentifier?, transactionDate?, discountId?): void
    • Parameters

      • transactionIdentifier: string
      • productId: string
      • Optional originalTransactionIdentifier: string
      • Optional transactionDate: string
      • Optional discountId: string

      Returns void

purchasing: ((productId) => void)

Called when a transaction is in "purchasing" state

Type declaration

    • (productId): void
    • Parameters

      • productId: string

      Returns void

ready: (() => void)

Called when the bridge is ready (after setup)

Type declaration

    • (): void
    • Returns void

receiptsRefreshed: ((receipt) => void)

Called when the application receipt is refreshed

Type declaration

restoreCompleted: (() => void)

Called when a call to "restore" is complete

Type declaration

    • (): void
    • Returns void

restoreFailed: ((errorCode) => void)

Called when a call to "restore" failed

Type declaration

restored: ((transactionIdentifier, productId) => void)

Called when a transaction is in "restored" state

Type declaration

    • (transactionIdentifier, productId): void
    • Parameters

      • transactionIdentifier: string
      • productId: string

      Returns void