/// <summary> /// 接收到询问支付限制的事件 /// </summary> /// <param name="e"></param> /// <param name="args"></param> private void OnCheckPayLimit(CheckPayLimitEvent e, object[] args) { PayLimitType payLimitType = PayLimitType.None;//默认不需要实名认证,无限制 Debug.LogWarning("OnCheckPayLimit====openRealName==" + openRealName); if (openRealName) { if (RealNameStatus == RealNameStatus.NotRealName) { StartRealNameAttestation(); //自动开始实名制认证 payLimitType = PayLimitType.NoRealName; } else if (RealNameStatus == RealNameStatus.IsRealName) { if (isAdult) //成年 { payLimitType = PayLimitType.None; } else //未成年 { CheckPayLimitBySDK(e.payAmount); Debug.LogWarning("CheckPayLimitBySDK"); return; } } else if (RealNameStatus == RealNameStatus.NotNeed) { payLimitType = PayLimitType.None;//默认不需要实名认证,无限制 } } Debug.LogWarning("OnCheckPayLimit====payLimitType==" + payLimitType); CheckPayLimitResultEvent.Dispatch(e.payAmount, payLimitType); }
/// <summary> /// 查询支付结果的回调 /// </summary> /// <param name="isLimit"></param> private void OnPayLimitCallBack(bool isLimit, int payAmount) { PayLimitType payLimitType = PayLimitType.None; if (isLimit) { payLimitType = PayLimitType.ChildLimit; } Debug.Log("OnPayLimitCallBack from SDK:" + payLimitType); CheckPayLimitResultEvent.Dispatch(payAmount, payLimitType); }
static public void Dispatch(int l_payAmount, PayLimitType l_payLimitType) { GlobalEvent.DispatchTypeEvent <CheckPayLimitResultEvent>(new CheckPayLimitResultEvent(l_payAmount, l_payLimitType)); }
public PayLimitType payLimitType = PayLimitType.None;//限制购买(如: 本单超出未成年限制) public CheckPayLimitResultEvent(int payAmount, PayLimitType l_payLimitType) { this.payAmount = payAmount; payLimitType = l_payLimitType; }