public override void InitializeIAP(int roleID) { IAPManager.LT_PURCHASE_NOTIFICATION_DELEGATE fnPurchaseCallback = (bSuccess, pProduct) => { SDK.BUY_STATE state = bSuccess ? BUY_STATE.LT_BUY_SUCCEED : BUY_STATE.LT_BUY_PAY_FAILED; SDK.BUY_INFO info = new SDK.BUY_INFO(); info.iBillingType = pProduct.iBillingType; info.strOrderId = "";//pProduct.strOrderId; if (bSuccess) { //Callback info.strTransactionId = pProduct.strTransactionId; info.strReceipt = pProduct.strReceipt; } else { } if (_BuyCallback != null) { _BuyCallback(state, info); } }; IAPManager.Instance.InitializeIAP(roleID, fnPurchaseCallback); }
public override void Buy(SDK.BUY_INFO pProduct) { Debug.Log("LTKakao::Buy"); #if (UNITY_IOS || UNITY_IPHONE || UNITY_ANDROID) IAPManager.Instance.BuyProductByID(pProduct.iBillingType, pProduct.strOrderId, pProduct.strProductId); #else Debug.Log("LTKakao::Buy()! Can not use on this platform type!"); #endif }
public static int DoPurchase(IntPtr L) { int count = LuaDLL.lua_gettop(L); const int nRet = 0; if (count == 3 && LuaScriptMgr.CheckTypes(L, 1, typeof(float), typeof(string), typeof(string))) { int purchaseType = (int)LuaScriptMgr.GetNumber(L, 1); string orderId = LuaScriptMgr.GetString(L, 2); string productId = LuaScriptMgr.GetString(L, 3); // 开启支付 sdk var productInfo = new SDK.BUY_INFO(); productInfo.iBillingType = purchaseType; productInfo.strOrderId = orderId; productInfo.strProductId = productId; LTPlatformBase.ShareInstance().Buy(productInfo); } else if (count == 4 && LuaScriptMgr.CheckTypes(L, 1, typeof(float), typeof(string), typeof(string), typeof(string))) { int purchaseType = (int)LuaScriptMgr.GetNumber(L, 1); string orderId = LuaScriptMgr.GetString(L, 2); string productId = LuaScriptMgr.GetString(L, 3); string transactionId = LuaScriptMgr.GetString(L, 4); // 开启支付 sdk var productInfo = new SDK.BUY_INFO(); productInfo.iBillingType = purchaseType; productInfo.strOrderId = orderId; productInfo.strProductId = productId; productInfo.strTransactionId = transactionId; LTPlatformBase.ShareInstance().Buy(productInfo); } else { LogParamError("DoPurchase", count); } return(GameUtilWrap.CheckReturnNum(L, count, nRet)); }
public abstract void Buy(SDK.BUY_INFO pProduct);
public override void Buy(SDK.BUY_INFO pProduct) { }