Перейти к основному содержанию

inAppPurchase

History
Version(s)Changes
None
API ADDED

Покупки внутри приложения в Mac App Store.

Process: Main

События

Модуль inAppPurchase генерирует следующие события:

Ивент: 'transactions-updated'

History
Version(s)Changes
None
API ADDED

Возвращает:

  • event Event
  • transactions Transaction[] - Array of Transaction objects.

Возникает при обновлении одной или нескольких транзакций.

Методы

Модуль inAppPurchase имеет следующие методы:

inAppPurchase.purchaseProduct(productID[, opts])

History
Version(s)Changes
None

This method now returns a Promise instead of using a callback function.

None

Added username option to opts parameter.

None
API ADDED
  • строка productID
  • opts Integer | Object (optional) - If specified as an integer, defines the quantity.
    • quantity Integer (опционально) - Количество товаров, которое хочет приобрести пользователь.
    • username string (optional) - The string that associates the transaction with a user account on your service (applicationUsername).

Возвращает Promise<boolean> - Возвращает true, если товар действителен и добавлен в очередь платежей.

Вы должны начать считывать событие transactions-updated как можно скорее и в любом случае перед тем, как вызвать purchaseProduct.

inAppPurchase.getProducts(productIDs)

History
  • productIDs string[] - Идентификаторы получаемых продуктов.

Returns Promise<Product[]> - Resolves with an array of Product objects.

Получает описания товара.

inAppPurchase.canMakePayments()

History
Version(s)Changes
None
API ADDED

Returns boolean - whether a user can make a payment.

inAppPurchase.restoreCompletedTransactions()

History
Version(s)Changes
None
API ADDED

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()

History
Version(s)Changes
None
API ADDED

Returns string - the path to the receipt.

inAppPurchase.finishAllTransactions()

History
Version(s)Changes
None
API ADDED

Завершает все ожидающие транзакции.

inAppPurchase.finishTransactionByDate(date)

History
Version(s)Changes
None
API ADDED
  • date string - Дата завершения транзакции в формате ISO.

Завершает отложенные транзакции, соответствующие дате.