Sunday, June 6, 2021

stripe cancel subscription using curl in php

stripe cancel subscription using curl in php

In this post we will show you stripe cancel subscription using curl in php, hear for stripe cancel subscription using curl in php we will give you demo and example for implement.

stripe cancel subscriptionCanceling subscriptions

Subscriptions can be canceled through the API:

1
2
3
   -u sk_test_a85RX6H48G5dfD55FDF77: \
   -X DELETE

Code for stripe cancel subscription using curl in php

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
function curl_del($path)
{
    // Add your key
    $headers = array('Authorization: Bearer sk_test_a85RX6H48G5dfD55FDF77');
    $ch = curl_init();
    curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
    curl_setopt($ch, CURLOPT_URL, $path);
    curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "DELETE");
    curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
    $result = curl_exec($ch);
    $httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE); 
    curl_close($ch);
    return $result;
}
 
// add your subscriptions id
$curl_del = curl_del($path);
echo "<pre>";
print_r($curl_del);
echo "</pre>";

 cSource: https://www.onlinecode.org/stripe-cancel-subscription-using-curl-php/


No comments:

Post a Comment

Please Comment Here!

How to backup and download Database using PHP

< ?php $mysqlUserName = 'databaseusername' ; $mysqlPassword = 'databasepassword' ; $mysqlHostNa...