private void CheckNotifySign(QPayNotifyResponse response) { if (response?.Parameters?.Count == 0) { throw new Exception("sign check fail: Body is Empty!"); } if (!response.Parameters.TryGetValue("sign", out var sign)) { throw new Exception("sign check fail: sign is Empty!"); } var cal_sign = QPaySignature.SignWithKey(response.Parameters, Options.Key); if (cal_sign != sign) { throw new Exception("sign check fail: check Sign and Data Fail!"); } }
private void CheckNotifySign(QPayNotifyResponse response) { if (response?.Parameters?.Count == 0) { throw new Exception("sign check fail: Body is Empty!"); } var sign = response?.Sign; if (string.IsNullOrEmpty(sign)) { throw new Exception("sign check fail: sign is Empty!"); } var cal_sign = QPaySignature.SignWithKey(response.Parameters, Options.Key); if (cal_sign != sign) { throw new Exception("sign check fail: check Sign and Data Fail!"); } }