Skip to content

Instantly share code, notes, and snippets.

@maxcodes
Created December 1, 2021 06:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save maxcodes/5fee3a84c80254a163e51619080f6e53 to your computer and use it in GitHub Desktop.
Save maxcodes/5fee3a84c80254a163e51619080f6e53 to your computer and use it in GitHub Desktop.
php recurrente
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'https://app.recurrente.com/api/checkouts');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, "{ \"items\": [{ \"price_id\": \"pr_XXXXX\" }] }");
$headers = array();
$headers[] = 'X-Public-Key: pk_live_XXXXX';
$headers[] = 'X-Secret-Key: sk_live_XXXXX';
$headers[] = 'Content-Type: application/json';
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
$result = curl_exec($ch);
if (curl_errno($ch)) {
echo 'Error:' . curl_error($ch);
}
curl_close($ch);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment