This file contains hidden or 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
| using System; | |
| using System.Security.Cryptography; | |
| using System.IO; | |
| using System.Net; | |
| using System.Text; | |
| namespace PayaGateway_GET_Transactions | |
| { | |
| class MainClass { |
This file contains hidden or 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
| let crypto = require('crypto'); | |
| var https = require('follow-redirects').https; | |
| var fs = require('fs'); | |
| var merchantId = '173859436515'; | |
| var merchantKey = 'P1J2V8P2Q3D8'; | |
| var clientId = 'W8yvKQ5XbvAn7dUDJeAnaWCEwA4yXEgd'; | |
| var clientSecret = 'iLzODV5AUsCGWGkr'; | |
| var host = 'https://api-cert.sagepayments.com'; |
This file contains hidden or 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
| <cfsilent> | |
| <cfset nonce = Right(ToString(rand("SHA1PRNG")),10)> | |
| <cfset UnixStamp = left(getTickcount(), 10)> | |
| <cfset Myurl = "https://api-cert.sagepayments.com/accountupdater/v1/accountupdater?startDate=2021-04-10&endDate=2021-04-12"> | |
| <cfset ToBeHashed = "GET" & "#Myurl#" & "417227771521" & "#nonce#" & "#UnixStamp#"> | |
| <cfset strHmac = hmac("#ToBeHashed#","iLzODV5AUsCGWGkr","HMACSHA512")> | |
| <cfset Auth = binaryEncode(binaryDecode(strHmac, "hex"), "base64")> | |
| <cfhttp url="#Myurl#" port="443" method="GET"> | |
| <cfhttpparam NAME="clientID" value="W8yvKQ5XbvAn7dUDJeAnaWCEwA4yXEgd" type="header" encoded="no" > | |
| <cfhttpparam NAME="merchantID" value="417227771521" type="header" encoded="no"> |
OlderNewer