in_app_purchase.h 932 B

123456789101112131415161718192021222324252627282930313233343536
  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 SHELL_BROWSER_MAC_IN_APP_PURCHASE_H_
  5. #define SHELL_BROWSER_MAC_IN_APP_PURCHASE_H_
  6. #include <string>
  7. #include "base/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. InAppPurchaseCallback callback);
  20. } // namespace in_app_purchase
  21. #endif // SHELL_BROWSER_MAC_IN_APP_PURCHASE_H_