Neteller TransferOut与PHP/CURL

Nic*_*ins 6 php payment curl

我在使用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));
Run Code Online (Sandbox Code Playgroud)

显然,所有变量($ transaction_id,$ amount,$ currency)都是适当设置的.然而,我得到的回应是:

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

)
Run Code Online (Sandbox Code Playgroud)

我很困惑,肯定是accessToken是我需要的凭据,而且它们已经收到了.我是否打算在transferOut curl postfields中包含任何其他内容?

提前致谢

Nic*_*ins 4

根据用户3584460的评论

$headers看起来不太好——尝试一下$headers = array("Content-type: application/json", "Authorization: Bearer " . $accessToken);。至少这是根据http://php.net/manual/en/function.curl-setopt.php的格式

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