小编Nic*_*ins的帖子

Neteller TransferOut与PHP/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);

    // …
Run Code Online (Sandbox Code Playgroud)

php payment curl

6
推荐指数
1
解决办法
537
查看次数

标签 统计

curl ×1

payment ×1

php ×1