/// <summary>
        /// 支付
        /// </summary>
        public static void Pay(string SDKName, PayInfo payInfo)
        {
            Debug.Log("Pay  SDKname " + SDKName + " GetHasSDKService " + GetHasSDKService(s_payServiceList, SDKName));

            //优先使用本地配置的SDK
            if (GetHasSDKService(s_payServiceList, SDKName))
            {
                try
                {
                    GetPayService(SDKName).Pay(payInfo.goodsID, payInfo.tag);
                }
                catch (Exception e)
                {
                    Debug.LogError("SDKManager Pay Exception: " + e.ToString());
                }
            }
            else if (s_useNewSDKManager)
            {
                SDKManagerNew.Pay(SDKName, payInfo);
            }
            else
            {
                Debug.LogError("支付SDK 没有配置! ");
            }
        }
        ///// <summary>
        ///// 支付,默认访问第一个接口
        ///// </summary>
        //public static void Pay(PayInfo payInfo)
        //{
        //    Pay(null, payInfo);
        //}

        /// <summary>
        /// 支付,默认访问第一个接口
        /// </summary>
        public static void Pay(PayInfo payInfo)
        {
            Dictionary <string, string> data = new Dictionary <string, string>();

            if (payInfo.storeName != null)
            {
                data.Add(SDKInterfaceDefine.SDKName, payInfo.storeName);
            }
            data.Add(SDKInterfaceDefine.ModuleName, SDKInterfaceDefine.ModuleName_Pay); //支付不传FunctionName

            data.Add(SDKInterfaceDefine.FunctionName, SDKInterfaceDefine.Pay_FunctionName_OnPay);

            data.Add(SDKInterfaceDefine.Pay_ParameterName_GoodsID, payInfo.goodsID);
            data.Add(SDKInterfaceDefine.Pay_ParameterName_GoodsType, payInfo.goodsType.ToString());
            data.Add(SDKInterfaceDefine.Pay_ParameterName_OrderID, payInfo.orderID);
            data.Add(SDKInterfaceDefine.Pay_ParameterName_Price, payInfo.price.ToString());
            data.Add(SDKInterfaceDefine.Pay_ParameterName_GoodsName, payInfo.goodsName + "");
            data.Add(SDKInterfaceDefine.Pay_ParameterName_Currency, payInfo.currency);
            data.Add(SDKInterfaceDefine.ParameterName_UserID, payInfo.userID);
            data.Add(SDKInterfaceDefine.Tag, payInfo.tag);
            data.Add(SDKInterfaceDefine.Pay_ParameterName_PrepayID, payInfo.prepay_id);


            Call(data);
        }
Example #3
0
 public OnPayInfo(PayInfo payInfo, bool isSuccess, StoreName storeName)
 {
     this.isSuccess = isSuccess;
     this.goodsId   = payInfo.goodsID;
     this.orderID   = null;
     this.storeName = storeName;
     this.goodsName = payInfo.goodsName;
     this.price     = payInfo.price;
     this.currency  = null;
     this.receipt   = null;
     this.goodsType = payInfo.goodsType;
     userID         = null;
 }
Example #4
0
        /// <summary>
        /// 支付,默认访问第一个接口
        /// </summary>
        public static void Pay(PayInfo payInfo)
        {
            //优先使用本地配置的SDK
            if (s_payServiceList.Count > 0)
            {
                try
                {
                    GetPayService(0).Pay(payInfo);
                }
                catch (Exception e)
                {
                    Debug.LogError("SDKManager Pay Exception: " + e.ToString());
                }
            }

            else if (s_useNewSDKManager)
            {
                if (GetPrePay(""))
                {
                    try
                    {
                        GetPayService("PublicPayClass").Pay(payInfo);
                    }
                    catch (Exception e)
                    {
                        Debug.LogError("SDKManager PublicPayClass Exception: " + e.ToString());
                    }
                }
                else
                {
                    SDKManagerNew.Pay(payInfo);
                }
            }
            else
            {
                Debug.Log("支付SDK 没有配置! ");
            }
        }
 /// <summary>
 /// 支付,默认访问第一个接口
 /// </summary>
 public static void Pay(PayInfo payInfo)
 {
     //优先使用本地配置的SDK
     if (s_payServiceList.Count > 0)
     {
         try
         {
             GetPayService(0).Pay(payInfo.goodsID, payInfo.tag);
         }
         catch (Exception e)
         {
             Debug.LogError("SDKManager Pay Exception: " + e.ToString());
         }
     }
     else if (s_useNewSDKManager)
     {
         SDKManagerNew.Pay(payInfo);
     }
     else
     {
         Debug.Log("支付SDK 没有配置! ");
     }
 }
Example #6
0
 /// <summary>
 /// 支付,默认访问第一个接口
 /// </summary>
 public static void Pay(PayInfo payInfo)
 {
     Pay(null, payInfo);
 }
 virtual public void Pay(PayInfo payInfo)
 {
 }