CyberSource / cybersource-rest-samples-php

PHP sample code for the CyberSource REST API
26 stars 51 forks source link

Signature bug #73

Open bispldeveloper opened 5 months ago

bispldeveloper commented 5 months ago

Hi

I have been trying to get the "Cybersource" signature using the below codes but the response always says - "authentiaction failed!" Can you please help me to solve this

/*Signature code/ $signatureString = "host: ".$request_host."\nrequest-target: ".$httpMethod." ".$resourcePath."\ndigest: SHA-256=".$digest."\nv-c-merchant-id: ".$merchant_id; $signatureByteString = utf8_encode($signatureString); $decodeKey = base64_decode($merchant_secret_key); $signature = base64_encode(hash_hmac("sha256", $signatureByteString, $decodeKey, true));