-
-
Save aruprakshit/f4742766b66135446f59 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$str = 'TESTME|UATTXN0001|NA|2|NA|NA|NA|INR|NA|R|NA|NA|NA|F|Andheri|Mumbai|02240920005|support@billdesk.com|NA|NA|NA|https://www.billdesk.com'; | |
$checksum = hash_hmac('sha256',$str,'ABCDEF1234567890', false); | |
$checksum = strtoupper($checksum); | |
echo $checksum; | |
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<head> | |
<META HTTP-EQUIV="Pragma" CONTENT="no-cache"> | |
<META HTTP-EQUIV="expires" CONTENT="Wed, 26 Feb 1997, 08:21:57 GMT"> | |
<style> | |
.bodytxt4 { | |
font-family: Verdana, Arial, Helvetica, sans-serif; | |
font-size: 12px; | |
font-weight: bold; | |
color: #666666; | |
} | |
.bodytxt { | |
font-family: Verdana, Arial, Helvetica, sans-serif; | |
font-size: 13px; | |
font-weight: normal; | |
color: #000000; | |
} | |
.bullet1 { | |
list-style-type: square; | |
list-style-position: inside; | |
list-style-image: none; | |
font-family: Verdana, Arial, Helvetica, sans-serif; | |
font-size: 10px; | |
font-weight: bold; | |
color: #FF9900; | |
} | |
.bodytxt2 { | |
font-family: Verdana, Arial, Helvetica, sans-serif; | |
font-size: 8pt; | |
font-weight: normal; | |
color: #333333; | |
} | |
A.sac2 { | |
COLOR: #000000; | |
font-family: Verdana, Arial, Helvetica, sans-serif; | |
font-size: 10px; | |
font-weight: bold; | |
text-decoration: none; | |
} | |
A.sac2:visited { | |
COLOR: #314D5A; TEXT-DECORATION: none | |
} | |
A.sac2:hover { | |
COLOR: #FF9900; TEXT-DECORATION: underline | |
} | |
</style> | |
</head> | |
<body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0"> | |
<table width="100%" border="0" cellspacing="0" cellpadding="0"> | |
<tr> | |
<td align="left" valign="top"> | |
<table width="100%" border="0" cellspacing="0" cellpadding="0"> | |
<tr> | |
<td align="center" valign="middle" ><table width="100%" border="0" cellspacing="0" cellpadding="0"> | |
<tr> | |
<td align="center"></td> | |
</tr> | |
<tr> | |
<td height="85" align="center"><br> | |
<table width="80%" border="0" cellpadding="0" cellspacing="1" bgcolor="#CCCCCC"> | |
<tr> | |
<td bgcolor="#CCCCCC"><table width="100%" border="0" cellpadding="6" cellspacing="0" bgcolor="#FFFFFF"> | |
<tr valign="top"> | |
<td colspan="2" align="left"><img src="/images/opps.gif" width="20" height="20"> <span class="bodytxt4">Error | |
</span></td> | |
</tr> | |
<tr valign="top"> | |
<td colspan="2" align="left"><table width="100%" border="0" cellspacing="0" cellpadding="0"> | |
<tr> | |
<td width="87%" bgcolor="#cccccc" height="1" align="center"></td> | |
</tr> | |
</table></td> | |
</tr> | |
<tr> | |
<td width="60%" align="left" valign="bottom"><table width="100%" border="0" cellpadding="1" cellspacing="0" bgcolor="#FFFFFF"> | |
<tr> | |
<td width="4%" align="right" valign="top"></td> | |
<td width="96%" class="bodytxt"> </td> | |
</tr> | |
<tr> | |
<td height="19" align="right" valign="top"><li class="bullet1"></li></td> | |
<td class="bodytxt2">Sorry we are uable to process your request right now - Invalid merchant details (ERRP004).</td> | |
</tr> | |
<tr> | |
<td align="right" valign="top"></td> | |
<td class="bodytxt2" > </td> | |
</tr> | |
<tr> | |
<td align="right" valign="top"></td> | |
<td class="bodytxt2" > </td> | |
</tr> | |
</table></td> | |
<td align="right" valign="bottom"> </td> | |
</tr> | |
</table></td> | |
</tr> | |
</table> | |
</td> | |
</tr> | |
</table> | |
</td> | |
</tr> | |
</table></td> | |
</tr> | |
</table> | |
</body> | |
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require "uri" | |
require "net/http" | |
url = 'https://pgi.billdesk.com/pgidsk/PGIMerchantPayment' | |
hash = { | |
MerchantID: 'xxxx', | |
CustomerID: 'A1234RT56', | |
Key_1: 'NA', | |
TxnAmount: '2', | |
Key_2: 'NA', | |
Key_3: 'NA', | |
Key_4: 'NA', | |
CurrencyType: 'INR', | |
Key_5: 'NA', | |
TypeField1: 'R', | |
SecurityID: 'maduracol', | |
Key_6: 'NA', | |
Key_7: 'NA', | |
TypeField2: 'F', | |
Txtadditionalinfo1: ""*12, | |
Txtadditionalinfo2: ""*12, | |
Txtadditionalinfo3: ""*12, | |
Txtadditionalinfo4: ""*12, | |
Txtadditionalinfo5: ""*12, | |
Txtadditionalinfo6: ""*12, | |
Txtadditionalinfo7: ""*12, | |
RU: 'http://14.18.60.129/shopping_cart/checkout' | |
} | |
msg = hash.values.join("|") << "|5ZYpFMJQ" | |
uri = URI.parse(url) | |
req = Net::HTTP::Post.new(url) | |
req.set_form_data({'msg' => msg}) | |
http = Net::HTTP.new(uri.host, uri.port) | |
http.use_ssl = true if uri.scheme == 'https' | |
http.start do |h| | |
response = h.request req | |
puts "Headers: #{response.to_hash.inspect}" | |
puts response.body | |
response = h.request Net::HTTP::Get.new(URI.parse(response['location'])) | |
File.open('out.htm', 'w') { |f| f.write response.body } | |
end |
alex88
commented
Jan 20, 2015
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment