Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/amazon-web-services/13.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php 发出Amazon灵活付款请求时出现无效的签名错误_Php_Amazon Web Services_Amazon - Fatal编程技术网

Php 发出Amazon灵活付款请求时出现无效的签名错误

Php 发出Amazon灵活付款请求时出现无效的签名错误,php,amazon-web-services,amazon,Php,Amazon Web Services,Amazon,我在Amazon中使用PHP时遵循以下说明: 下面是我如何签名的: $string_to_sign = "GET\nauthorize.payments-sandbox.amazon.com\n/cobranded-ui/actions/start\n SignatureMethod=HmacSHA256&SignatureVersion=2&callerKey='.$my_access_key_id.'&callerReference='.$caller_referen

我在Amazon中使用PHP时遵循以下说明:

下面是我如何签名的:

$string_to_sign = "GET\nauthorize.payments-sandbox.amazon.com\n/cobranded-ui/actions/start\n
SignatureMethod=HmacSHA256&SignatureVersion=2&callerKey='.$my_access_key_id.'&callerReference='.$caller_reference.'&paymentReason='.$payment_reason.'&pipelineName=SingleUse&returnUrl='.$return_url.'&transactionAmount=1.1";

$encoded_string_to_sign = URLEncode(Base64_Encode(hash_hmac("sha256", $string_to_sign, "1"))); 

但我不知道为什么签名没有正确编码。要看的一件事是hash_hmac(“sha256“,$string_to_sign,“1”),我在其中随机放置了“1”,因为Amazon没有给出其他东西放入其中的说明。我如何知道Amazon需要我在该函数中放置哪个键?我在他们的指示中没有注意到。但可能是我做错了什么?

用于
$key
参数的值是由Amazon颁发的密钥


正如我在中所解释的,您确实应该看看中包含的代码。

在哪里可以获得沙盒密钥,请帮助我?