sorry for my English . I have a lot of confusion in my head.
I can not test this line in php.
developer.paypal.com/webapps/developer/docs/classic/lifecycle/sb_calls/
curl -s --insecure https//api-3t.sandbox.paypal.com/nvp -d
"USER={YourUserID}
&PWD={YourPassword}
&SIGNATURE={YourSignature}
&METHOD=SetExpressCheckout
&VERSION=98
&PAYMENTREQUEST_0_AMT=10
&PAYMENTREQUEST_0_CURRENCYCODE=USD
&PAYMENTREQUEST_0_PAYMENTACTION=SALE
&cancelUrl=http//www.example.com/cancel.html
&returnUrl=http//www.example.com/success.html"
I'm using: libcurl. but I can not do the conversion
thank
Note that (a) you're missing a few ":" characters in the (3) URLs, (b) you need to URL encode the parameter keys and values and (c) you don't need to avoid SSL certificate validation against the specified Paypal server. But you can use this for similar functionality in PHP:
$url = 'https://api-3t.sandbox.paypal.com/nvp';
$data = array(
'USER' => '{YourUserID}',
'PWD' => '{YourPassword}',
'SIGNATURE' => '{YourSignature}',
'METHOD' => 'SetExpressCheckout',
'VERSION' => '98',
'PAYMENTREQUEST_0_AMT' => 10,
'PAYMENTREQUEST_0_CURRENCYCODE' => 'USD',
'PAYMENTREQUEST_0_PAYMENTACTION' => 'SALE',
'cancelUrl' => 'http://www.example.com/cancel.html',
'returnUrl' => 'http://www.example.com/success.html'
);
$post = http_build_query($data);
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, $post);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
$response = curl_exec($ch);
curl_close($ch);
echo $response;