inAppPurchase
In-App-Käufe im Mac App Store.
Process: Main
Ereignisse
Das inAppPurchase Modul sendet folgende Ereignisse aus:
Event: 'transactions-updated'
Kehrt zurück:
eventEventtransactionsTransaction[] - Array of Transaction objects.
Wird ausgelöst, wenn eine oder mehrere transactions aktualisiert wurden.
Methoden
Das Modul inAppPurchase verfügt über die folgenden Methoden:
inAppPurchase.purchaseProduct(productID[, opts])
productIDzeichenketteoptsInteger | Object (optional) - Definiert die Menge, wenn als Integer angegeben.quantityInteger (optional) - Anzahl der Gegenstände, die der Benutzer kaufen möchte.usernamestring (optional) - Der string, der die Transaktion mit einem Benutzerkonto auf Ihrem Dienst (applicationUsername) verknüpft.
Gibt Promise<boolean> zurück - Gibt true zurück, wenn das Produkt gültig ist und zur Zahlungswarteschlange hinzugefügt wurde.
You should listen for the transactions-updated event as soon as possible and certainly before you call purchaseProduct.
inAppPurchase.getProducts(productIDs)
productIDsstring[] - Die Identifikatoren des zu erhaltenden Produktes.
Returns Promise<Product[]> - Resolves with an array of Product objects.
Ruft die Produktbeschreibungen ab.
inAppPurchase.canMakePayments()
Gibt boolean zurück - ob ein Benutzer eine Zahlung leisten kann.
inAppPurchase.restoreCompletedTransactions()
Restores finished transactions. This method can be called either to install purchases on additional devices, or to restore purchases for an application that the user deleted and reinstalled.
The payment queue delivers a new transaction for each previously completed transaction that can be restored. Each transaction includes a copy of the original transaction.
inAppPurchase.getReceiptURL()
Gibt string zurück - den Pfad zur Quittung.
inAppPurchase.finishAllTransactions()
Erledigt alle ausstehenden Transaktionen.
inAppPurchase.finishTransactionByDate(date)
datestring - The ISO formatted date of the transaction to finish.
Completes the pending transactions corresponding to the date.