﻿#if UNITY_IOS
namespace Stove.StoveSDK
{
    using System.Runtime.InteropServices;

    public class IAPInterface
    {
        [DllImport("__Internal")]
        private static extern void stove_iap_setCustomBillingGUID(string guid);
        internal static void SetCustomBillingGUID(string guid)
        {
            stove_iap_setCustomBillingGUID(guid);
        }

        [DllImport("__Internal")]
        private static extern void stove_iap_initialize(string identifier);
        internal static void Initialize(string identifier)
        {
            stove_iap_initialize(identifier);
        }

        [DllImport("__Internal")]
        private static extern void stove_iap_fetchProducts(string identifier);
        internal static void FetchProducts(string identifier)
        {
            stove_iap_fetchProducts(identifier);
        }

        [DllImport("__Internal")]
        private static extern void stove_iap_startPurchaseWithProduct(string product, string identifier);
        internal static void StartPurchase(string product, string identifier)
        {
            stove_iap_startPurchaseWithProduct(product, identifier);
        }

        [DllImport("__Internal")]
        private static extern void stove_iap_startPurchase(string product, string serviceOrderId, string optional, string identifier);
        internal static void StartPurchase(string product, string serviceOrderId, string optional, string identifier)
        {
            stove_iap_startPurchase(product, serviceOrderId, optional, identifier);
        }

        [DllImport("__Internal")]
        private static extern void stove_iap_setListener(string identifier);
        internal static void SetListener(string identifier)
        {
            stove_iap_setListener(identifier);
        }

        [DllImport("__Internal")]
        private static extern bool stove_iap_flush();
        internal static bool Flush()
        {
            return stove_iap_flush();
        }

        [DllImport("__Internal")]
        private static extern void stove_iap_consume(string product, string identifier);
        internal static void Consume(string product, string identifier)
        {
            stove_iap_consume(product, identifier);
        }

        [DllImport("__Internal")]
        private static extern void stove_iap_fetchVoidedPurchases(string identifier);
        internal static void FetchVoidedPurchases(string identifier)
        {
            stove_iap_fetchVoidedPurchases(identifier);
        }

        [DllImport("__Internal")]
        private static extern void stove_iap_handleVoidedPurchases(string identifier);
        internal static void HandleVoidedPurchases(string identifier)
        {
            stove_iap_handleVoidedPurchases(identifier);
        }

        [DllImport("__Internal")]
        private static extern string stove_iap_version();
        internal static string GetVersion()
        {
            return stove_iap_version();
        }
    }
}

#endif