我在集成Neteller API以将钱从用户帐户转移到我们的商家帐户时遇到了问题。我成功地收到了accessToken (使用auth_code授予类型),但是当我尝试使用transferIn时,我得到的错误身份验证凭据无效。
这是我的代码:
//getting the accessToken from NETELLER's response
$accessToken = $_POST['accessToken'];
$service_url = "https://test.api.neteller.com/v1/transferIn";
$curl = curl_init($service_url);
$curl_post_data = array(
"paymentMethod" => array(
"type" => "neteller",
"value" => "netellertest_USD@neteller.com"
),
"transaction" => array(
"merchantRefId" => (string)date('YmdHis'),
"amount" => 25,
"currency" => "USD"
),
"verificationCode" => "234124"
);
$jsonDataEncoded = json_encode($curl_post_data);
curl_setopt($curl, CURLOPT_POSTFIELDS, $jsonDataEncoded);
$headers = array(
"Content-type: application/json",
"Authorization: Bearer " . $accessToken
);
curl_setopt($curl, CURLOPT_HTTPHEADER, $headers);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curl, CURLOPT_POST, true);
$curl_response = curl_exec($curl);
curl_close($curl);但是,我得到了这个错误:
{ "error":{ "code": "5279", "message": "Authentication credentials are invalid" } }我是否遗漏了transferIn卷发字段中的任何内容?
谢谢!
发布于 2015-10-05 11:04:31
您不应该使用auth_code授予类型,正确的类型是client_credentials。这将在最新的REST指南第41页中详细解释,您可以从您的商业帐户>> "Developer“选项卡>>文档”页面“下载该指南。
为了澄清-- auth_code流从用户那里获得授权(对于ex )。有关订阅付款、其他帐户简介信息等)。尽管它也适用于支付,但它将为流程增加2个步骤,并可能成为一个转换杀手。
此外,我在您的代码中发现了一些问题,您还应该解决这些问题:
verificationCode是270955。此信息可在REST指南第153页上查阅。如果您遇到任何问题,请尝试实现client_credentials授权类型流并在这里发布,我将尽力帮助您。或者,你可以在Skype上添加我(它在我的个人资料中)。
https://stackoverflow.com/questions/32740245
复制相似问题