2
0

InAppPurchasesAndroid.h 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. /*
  2. * Copyright (c) Contributors to the Open 3D Engine Project.
  3. * For complete copyright and license terms please see the LICENSE at the root of this distribution.
  4. *
  5. * SPDX-License-Identifier: Apache-2.0 OR MIT
  6. *
  7. */
  8. #pragma once
  9. #include <InAppPurchases/InAppPurchasesInterface.h>
  10. #include <jni.h>
  11. namespace InAppPurchases
  12. {
  13. class InAppPurchasesAndroid
  14. : public InAppPurchasesInterface
  15. {
  16. public:
  17. void Initialize() override;
  18. ~InAppPurchasesAndroid();
  19. void QueryProductInfo(AZStd::vector<AZStd::string>& productIds) const override;
  20. void QueryProductInfo() const override;
  21. void PurchaseProduct(const AZStd::string& productId, const AZStd::string& developerPayload) const override;
  22. void PurchaseProduct(const AZStd::string& productId) const override;
  23. void QueryPurchasedProducts() const override;
  24. void RestorePurchasedProducts() const override;
  25. void ConsumePurchase(const AZStd::string& purchaseToken) const override;
  26. void FinishTransaction(const AZStd::string& transactionId, bool downloadHostedContent) const override;
  27. InAppPurchasesCache* GetCache() override;
  28. private:
  29. jobject m_billingInstance;
  30. };
  31. class ProductDetailsAndroid
  32. : public ProductDetails
  33. {
  34. public:
  35. AZ_RTTI(ProductDetailsAndroid, "{59A14DA4-B224-4BBD-B43E-8C7BC2EEFEB5}", ProductDetails);
  36. const AZStd::string& GetProductType() const { return m_productType; }
  37. void SetProductType(const AZStd::string& productType) { m_productType = productType; }
  38. protected:
  39. AZStd::string m_productType;
  40. };
  41. }