Commit 15a3e888 authored by datdiep's avatar datdiep

fix

parent ab94ad51
...@@ -61,11 +61,10 @@ namespace UF.AssessmentProject.Providers ...@@ -61,11 +61,10 @@ namespace UF.AssessmentProject.Providers
} }
var rawsig = DateTime.Parse(req.timestamp).ToString("yyyyMMddHHmmss") + req.partnerkey + req.partnerrefno + req.totalamount + req.partnerpassword; var rawsig = DateTime.Parse(req.timestamp).ToString("yyyyMMddHHmmss") + req.partnerkey + req.partnerrefno + req.totalamount + req.partnerpassword;
string sig = CommonUtils.EncodeBase64((CommonUtils.ComputeSha256Hash(rawsig))); string sig = CommonUtils.ComputeSha256Hash((CommonUtils.EncodeBase64(rawsig)));
var partner = db.Partners.Where(c => c.partnerkey == req.partnerkey).FirstOrDefault(); var partner = db.Partners.Where(c => c.partnerkey == req.partnerkey).FirstOrDefault();
string encodepass = CommonUtils.EncodeBase64(partner.partnerpassword);
if (partner == null || (partner != null && encodepass != req.partnerpassword) || sig != req.sig) if (partner == null || (partner != null && CommonUtils.EncodeBase64(partner.partnerpassword) != req.partnerpassword) || sig != req.sig)
{ {
return new Model.Transaction.ResponseMessage return new Model.Transaction.ResponseMessage
{ {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment