用PHP/CURL实现Neteller转出

用PHP/CURL实现Neteller转出,php,curl,payment,Php,Curl,Payment,我在使用Neteller API从我们的商户帐户向用户转账时遇到了一些问题。我已成功接收accessToken,但是当我尝试使用transferOut时,我只是得到了无效的凭据?我使用的代码是: $headers = array( "Content-type" => "application/json", "Authorization" => "Bearer " . $accessToken ); //build the re

我在使用Neteller API从我们的商户帐户向用户转账时遇到了一些问题。我已成功接收accessToken,但是当我尝试使用transferOut时,我只是得到了无效的凭据?我使用的代码是:

    $headers = array(
        "Content-type" => "application/json",
        "Authorization" => "Bearer " . $accessToken
    );

    //build the request body structure
    $requestParams = array(
        "payeeProfile" => array(
            "email" => $the_email_address_to_send_to
        ),
        "transaction" => array(
            "merchantRefId" => $transaction_id,
            "amount" => $amount,
            "currency" => $currencyCode
        )
    );

    // encode the requestParams to a string
    $requestParams = json_encode($requestParams);

    // The curl stuff
    $curl = curl_init();
    curl_setopt($curl, CURLOPT_POST, 1);
    curl_setopt($curl, CURLOPT_URL, "https://api.neteller.com/v1/transferOut");
    curl_setopt($curl, CURLOPT_HTTPHEADER, $headers);
    curl_setopt($curl, CURLOPT_POSTFIELDS, $requestParams);
    curl_setopt($curl, CURLOPT_FOLLOWLOCATION, true);
    curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);

    // Ok lets send this lovely looking curl over
    $serverOutput = json_decode(curl_exec($curl));
显然,所有变量($transaction\u id、$amount、$currency)都已正确设置。然而,我得到的答复是:

stdClass Object
(
[error] => stdClass Object
    (
        [code] => 5279
        [message] => Authentication credentials are invalid
    )

)
我很困惑,accessToken肯定是我需要的凭证,而且已经收到了。我是否要在转出字段中包含其他内容

提前感谢

根据:


$headers
看起来不正常-请尝试
$headers=array(“内容类型:application/json”,“授权:Bearer”。$accessToken)。至少这是根据


注意,商户参考ID也需要有一定的长度。不确定是什么-找不到引用,但8个字符不够长。

$headers
看起来不正常-尝试
$headers=array(“内容类型:应用程序/json”,“授权:承载者”。$accessToken)。至少这是Yep所说的格式,很简单。谢谢