Skip to content

Instantly share code, notes, and snippets.

Created January 29, 2016 10:13
Show Gist options
  • Save anonymous/cfb512619fdba7e955a5 to your computer and use it in GitHub Desktop.
Save anonymous/cfb512619fdba7e955a5 to your computer and use it in GitHub Desktop.
[Stripe] PHP sample to disconnect an account from a platform
<?php
$apiKey = 'sk_test_...'; // your platform's secret API key
$clientId = 'ca_...'; // your platform's client_id
$accountId = 'acct_...'; // the ID of the account to deauthorize
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_RETURNTRANSFER => 1,
CURLOPT_URL => 'https://connect.stripe.com/oauth/deauthorize',
CURLOPT_POST => 1,
CURLOPT_USERPWD => $apiKey . ':',
CURLOPT_POSTFIELDS => http_build_query(array(
'client_id' => $clientId,
'stripe_user_id' => $accountId
))
));
$resp = curl_exec($curl);
curl_close($curl);
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment