-
Notifications
You must be signed in to change notification settings - Fork 0
/
Suspend.php
34 lines (29 loc) · 1.01 KB
/
Suspend.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
<?php
//Suspand
if(isset($_GET['profile_id']))
{
$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' => 'sukant_api1.mobilyte.com',
'PWD' => '9PZCLK395J63RXPQ',
'SIGNATURE' => 'A1eRIOfCz42bySEn-ogX.K0yYssjAT2HPxhA0eNcmRT2YL7vGIG18weK',
'METHOD' => 'ManageRecurringPaymentsProfileStatus',
'VERSION' => '108',
'ACTION' => 'Suspend',
'NOTE' => 'suspand please',
'PROFILEID' => $_GET['profile_id']
)));
$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]);
}
}
print_r($nvp);
}