inAppPurchase
Покупки внутри приложения в Mac App Store.
Process: Main
События
Модуль inAppPurchase генерирует следующие события:
Ивент: 'transactions-updated'
Возвращает:
eventEventtransactionsTransaction[] - Array of Transaction objects.
Возникает при обновлении одной или нескольких транзакций.
Методы
Модуль inAppPurchase имеет следующие методы:
inAppPurchase.purchaseProduct(productID[, opts])
- строка
productID optsInteger | Object (optional) - If specified as an integer, defines the quantity.quantityInteger (опционально) - Количество товаров, которое хочет приобрести пользователь.usernamestring (optional) - The string that associates the transaction with a user account on your service (applicationUsername).
Возвращает Promise<boolean> - Возвращает true, если товар действителен и добавлен в очередь платежей.
Вы должны начать считывать событие transactions-updated как можно скорее и в любом случае перед тем, как вызвать purchaseProduct.
inAppPurchase.getProducts(productIDs)
productIDsstring[] - Идентификаторы получаемых продуктов.
Returns Promise<Product[]> - Resolves with an array of Product objects.
Получает описания товара.
inAppPurchase.canMakePayments()
Returns boolean - whether a user can make a payment.
inAppPurchase.restoreCompletedTransactions()
How can I get paid for translation or proofreading of this? Do you pay by Paypal? Can i also create reports for this?-Pls reply-Thank you in adv. 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()
Returns string - the path to the receipt.
inAppPurchase.finishAllTransactions()
Завершает все ожидающие транзакции.
inAppPurchase.finishTransactionByDate(date)
datestring - Дата завершения транзакции в формате ISO.
Завершает отложенные транзакции, соответствующие дате.