-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPaymentResponse.aspx
More file actions
25 lines (21 loc) · 878 Bytes
/
PaymentResponse.aspx
File metadata and controls
25 lines (21 loc) · 878 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
<%@ Page Language="C#" %>
<%@ Import Namespace="System.Security.Cryptography" %>
<%
// Receive the response parameters
string status = Request.Form["status"];
string signature = Request.Form["signature"];
string identifier = Request.Form["identifier"];
string data = Request.Form["data"];
// Generate your signature
string customKey = data["amount"] + identifier;
string secret = "YOUR_SECRET_KEY";
byte[] bytes = Encoding.UTF8.GetBytes(secret);
HMACSHA256 hmac = new HMACSHA256(bytes);
byte[] hashValue = hmac.ComputeHash(Encoding.UTF8.GetBytes(customKey));
string mySignature = BitConverter.ToString(hashValue).Replace("-", "").ToLower();
string myIdentifier = "YOUR_GIVEN_IDENTIFIER";
if (status == "success" && signature == mySignature && identifier == myIdentifier)
{
// your operation logic
}
%>