<?php
$curl = curl_init();
curl_setopt($curl, CURLOPT_RETURNTRANSFER,true);
curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($curl, CURLOPT_POST, true);
curl_setopt($curl, CURLOPT_URL,'https://api-3t.sandbox.paypal.com/nvp');curl_setopt($curl,CURLOPT_POSTFIELDS,http_build_query(
array(
'USER' => 'XXXXXXXXXXX',
'PWD' => 'XXXXXXXXXXXXX',
'SIGNATURE' => 'XXXXXXXXXXXXXXXXXXXXXXXXXXX',
'VERSION' => '108',
'METHOD' => 'ManageRecurringPaymentsProfileStatus',
'PROFILEID' => 'I-xxxxxxxx',
'ACTION' => 'Cancel' variables (Suspend, Cancel, Reactivate)
)
)
);
$response = curl_exec($curl);
curl_close($curl);
$nvp = array();if (preg_match_all('/(?<name>[^\=]+)\=(?<value>[^&]+)&?/', $response, $matches)) {
foreach ($matches['name'] as $offset => $name) {
$nvp[$name] = urldecode($matches['value'][$offset]);
}
}
printf("%s",print_r($nvp, true));
我无法从PayPal的交易中获取此PROFILEID。如果有人对这个问题有任何想法,请帮助我。谢谢