Created
December 1, 2021 06:04
-
-
Save maxcodes/5fee3a84c80254a163e51619080f6e53 to your computer and use it in GitHub Desktop.
php recurrente
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$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