PayPal NVP API - 获取快速结账令牌

I am trying to get the express checkout token for a PayPal one time purchase integration. I get this error when trying to make the cURL request:

ACK=Failure&L_ERRORCODE0=81002&L_SHORTMESSAGE0=Unspecified%20Method&L_LONGMESSAGE0=Method%20Specified%20is%20not%20Supported&L_SEVERITYCODE0=Error1

Here is my code

  <?php
if(!isset($_GET['id'])) {
    header("Location: index.php");
    exit();
}

//Get paypal express checkout token

$ch = curl_init("https://api-3t.sandbox.paypal.com/nvp");
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
        "USER: seller-v3rm_api1.test.com",
        "PWD: <snip>",
        "SIGNATURE: <snip>",
        "METHOD: SetExpressCheckout",
        "VERSION: 93",
        "PAYMENTREQUEST_0_PAYMENTACTION: SALE",
        "PAYMENTREQUEST_0_AMT: 25",
        "PAYMENTREQUEST_0_CURRENCYCODE: USD",
        "RETURNURL: http://test/buy.php",
        "CANCELURL: http://test.com",
    ));
$token = curl_exec($ch);
echo $token;

Am i missing something?

You aren't setting up the request string correctly. I would really recommend taking a look at this PayPal PHP SDK.

First, it will eliminate your need to even mess with this sort of code because it handles it all for you. All you would need to do is open the SetExpressCheckout.php template file that it comes with and fill out the parameters, and then the same for the other calls you might use.

Also, though, if you want you could study the code to see how it's handling the cURL request. You need to build an actual NVP string (ie. &something=like&this=example). Then that is what you send to PayPal via cURL.