For some reason, I'm getting "Authorization Failed" error when trying to do simple integration with Cybersource REST using the HTTP Signature method. It looks like I have issue in generating the Signature hash. With the example below in C#.
paramdate = "Sat, 04 May 2024 12:49:49 GMT";
Digest = "SHA-256=LDtgqvifUua0IfbA4ZzNpk7xI588HH299/Cp5NT0XzA=";
SecretKey = "0TJqiAKWKxdfyTQb++Qjt9Zw//S7b/lxB0FiLfDO8v8=";
merchantID = "gosignmeup_1714463309";
signature string
var SignatureParm = "host: apitest.cybersource.com\nv-c-date: Sat, 04 May 2024 12:49:49 GMT\n(request-target): post /pts/v2/payments/\ndigest: SHA-256=LDtgqvifUua0IfbA4ZzNpk7xI588HH299/Cp5NT0XzA=\nv-c-merchant-id: gosignmeup_1714463309";
generating hash
var SignatureHash = GenerateSignatureFromParams(SignatureParm, SecretKey); //using C# function from Cybersource Demo
I would get this SignatureHash = "UPGZw6z5J0zy9/ogchmv23qTWT7lf0mmpCkhCKKUPaw=" instead of the hash "5dCGDaAK2AqSpr1KPPKYqZfQAKkidsMfJsddOr7zjJg=" generated by Cybersource online Dev Test using same info above.
Am I missing anything? Any thought?
05-04-2024 06:19 AM - edited 05-04-2024 06:26 AM