/******************************************************* * Copyright (C) 2018 XMind Ltd. - All Rights Reserved *******************************************************/ #ifndef IAP_H #define IAP_H #include /* * Make the file activated, so that it can be handoff to iOS. * arguments: * productID String - The identifiers of the product to purchase. (The identifier of com.example.app.product1 is product1). * quantity Integer (optional) - The number of items the user wants to purchase. * callback Function (optional) - The callback called when the payment is added to the PaymentQueue. * isProductValid Boolean - Determine if the product is valid and added to the payment queue. */ Napi::Value IapPurchaseProduct(const Napi::CallbackInfo& info); /* * Retrieves the product descriptions. * arguments: * productIDs String[] - The identifiers of the products to get. * callback Function - The callback called with the products or an empty array if the products don't exist. * products Product[] - Array of Product objects */ Napi::Value IapGetProducts(const Napi::CallbackInfo& info); /* * Returns Boolean, whether a user can make a payment. */ Napi::Value IapCanMakePayments(const Napi::CallbackInfo& info); /* * Returns String, the path to the receipt. */ Napi::Value IapGetReceiptURL(const Napi::CallbackInfo& info); /* * Completes all pending transactions. */ Napi::Value IapFinishAllTransactions(const Napi::CallbackInfo& info); /* * Completes the pending transactions corresponding to the date. * arguments: * date String - The ISO formatted date of the transaction to finish. */ Napi::Value IapFinishTransactionByDate(const Napi::CallbackInfo& info); /* * Restore completed transactions * arguments: * callback Function - The callback called when restore completed or failed */ Napi::Value IapRestoreCompletedTransactions(const Napi::CallbackInfo& info); /* * Refresh receipt * arguments: * callback Function - The callback called when refresh completed or failed */ Napi::Value IapRefreshReceipt(const Napi::CallbackInfo& info); #endif // IAP_H