成功登录亚马逊帐户授权后,亚马逊支付出现 "AccessDenied" 错误
Getting "AccessDenied" error on amazon pay after success logged in authorized on amazon account
我已经为 amazon pay 实施了 PHP SDK,目前我遇到一个错误,当我点击 amazon pay 按钮时,将打开一个弹出窗口询问 amazon 的登录凭据,然后在成功登录后它将重定向到地址簿和付款方式选择页面,在该页面上我遇到了这个错误,Json 我得到的响应如下。
AmazonPay\ResponseParser Object
(
[response] => Array
(
[Status] => 401
[ResponseBody] =>
Sender
AccessDenied
Access denied
11e659e5-6413-4f49-ab38-339472490e5c
)
)
{
"Error": {
"Type": "Sender",
"Code": "AccessDenied",
"Message": "Access denied"
},
"RequestID": "11e659e5-6413-4f49-ab38-339472490e5c",
"ResponseStatus": "401"
}
因此,如果您知道此错误,请向我提出建议。
提前致谢!
请在 amazon pay 配置文件上设置适当的国家明智配置设置。即,如果您所在的国家/地区 select 英国,那么亚马逊支付沙盒仅适用于英镑和英国,如果您尝试使用其他地区或货币,那么您将收到此访问被拒绝错误。
同时交叉检查您在文件中设置的 Amazon Sandbox 凭据,并确保所有设置都是正确的。
<?php
namespace AmazonPay;
$config = array(
'merchant_id' => 'YOUR_MERCHANT_ID',
'access_key' => 'YOUR_ACCESS_KEY',
'secret_key' => 'YOUR_SECRET_KEY',
'client_id' => 'YOUR_LOGIN_WITH_AMAZON_CLIENT_ID',
'region' => 'REGION',
'sandbox' => true);
$client = new Client($config);
// Also you can set the sandbox variable in the config() array of the Client class by
$client->setSandbox(true);
单击 here 查看在您的网站上实施亚马逊支付网关的完整文档。
请注意,您需要在 amazon pay 配置文件中设置正确的国家/地区配置设置。例如,如果您 select Region is UK and Currency is GBP while registration on seller-central account 那么您必须设置 'region' => 'uk' 和 'currency'=> 'GBP' 在亚马逊支付配置文件中。如果您添加不同的区域或货币详细信息,那么您将收到拒绝访问错误。
请..按照下面的代码
<?php
namespace AmazonPay;
$config = array(
'merchant_id' => 'YOUR_MERCHANT_ID',
'access_key' => 'YOUR_ACCESS_KEY',
'secret_key' => 'YOUR_SECRET_KEY',
'client_id' => 'YOUR_LOGIN_WITH_AMAZON_CLIENT_ID',
'region' => 'uk', //set value here
'currency_code' => 'GBP' //set value here
'sandbox' => true);
$client = new Client($config);
我已经为 amazon pay 实施了 PHP SDK,目前我遇到一个错误,当我点击 amazon pay 按钮时,将打开一个弹出窗口询问 amazon 的登录凭据,然后在成功登录后它将重定向到地址簿和付款方式选择页面,在该页面上我遇到了这个错误,Json 我得到的响应如下。
AmazonPay\ResponseParser Object
(
[response] => Array
(
[Status] => 401
[ResponseBody] =>
Sender
AccessDenied
Access denied
11e659e5-6413-4f49-ab38-339472490e5c
)
)
{
"Error": {
"Type": "Sender",
"Code": "AccessDenied",
"Message": "Access denied"
},
"RequestID": "11e659e5-6413-4f49-ab38-339472490e5c",
"ResponseStatus": "401"
}
因此,如果您知道此错误,请向我提出建议。 提前致谢!
请在 amazon pay 配置文件上设置适当的国家明智配置设置。即,如果您所在的国家/地区 select 英国,那么亚马逊支付沙盒仅适用于英镑和英国,如果您尝试使用其他地区或货币,那么您将收到此访问被拒绝错误。
同时交叉检查您在文件中设置的 Amazon Sandbox 凭据,并确保所有设置都是正确的。
<?php
namespace AmazonPay;
$config = array(
'merchant_id' => 'YOUR_MERCHANT_ID',
'access_key' => 'YOUR_ACCESS_KEY',
'secret_key' => 'YOUR_SECRET_KEY',
'client_id' => 'YOUR_LOGIN_WITH_AMAZON_CLIENT_ID',
'region' => 'REGION',
'sandbox' => true);
$client = new Client($config);
// Also you can set the sandbox variable in the config() array of the Client class by
$client->setSandbox(true);
单击 here 查看在您的网站上实施亚马逊支付网关的完整文档。
请注意,您需要在 amazon pay 配置文件中设置正确的国家/地区配置设置。例如,如果您 select Region is UK and Currency is GBP while registration on seller-central account 那么您必须设置 'region' => 'uk' 和 'currency'=> 'GBP' 在亚马逊支付配置文件中。如果您添加不同的区域或货币详细信息,那么您将收到拒绝访问错误。
请..按照下面的代码
<?php
namespace AmazonPay;
$config = array(
'merchant_id' => 'YOUR_MERCHANT_ID',
'access_key' => 'YOUR_ACCESS_KEY',
'secret_key' => 'YOUR_SECRET_KEY',
'client_id' => 'YOUR_LOGIN_WITH_AMAZON_CLIENT_ID',
'region' => 'uk', //set value here
'currency_code' => 'GBP' //set value here
'sandbox' => true);
$client = new Client($config);