示例#1
0
    /// <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);
    }
示例#2
0
 /// <summary>
 /// 检测是否有支付限制  需要监听 CheckPayLimitResultEvent 消息,获取结果
 /// </summary>
 public void CheckPayLimit(int payAmount)
 {
     CheckPayLimitEvent.Dispatch(payAmount);
 }