in_app_purchase.h 1020 B

12345678910111213141516171819202122232425262728293031323334353637
  1. // Copyright (c) 2017 Amaplex Software, Inc.
  2. // Use of this source code is governed by the MIT license that can be
  3. // found in the LICENSE file.
  4. #ifndef ELECTRON_SHELL_BROWSER_MAC_IN_APP_PURCHASE_H_
  5. #define ELECTRON_SHELL_BROWSER_MAC_IN_APP_PURCHASE_H_
  6. #include <string>
  7. #include "base/functional/callback.h"
  8. namespace in_app_purchase {
  9. // --------------------------- Typedefs ---------------------------
  10. typedef base::OnceCallback<void(bool isProductValid)> InAppPurchaseCallback;
  11. // --------------------------- Functions ---------------------------
  12. bool CanMakePayments();
  13. void RestoreCompletedTransactions();
  14. void FinishAllTransactions();
  15. void FinishTransactionByDate(const std::string& date);
  16. std::string GetReceiptURL();
  17. void PurchaseProduct(const std::string& productID,
  18. int quantity,
  19. const std::string& username,
  20. InAppPurchaseCallback callback);
  21. } // namespace in_app_purchase
  22. #endif // ELECTRON_SHELL_BROWSER_MAC_IN_APP_PURCHASE_H_