j'ai un script php curl qui ne fonctionne pas

marcsteph1212
Contributeur
Contributeur

voilà le script comment si vous pouvez m'aider à corriger ce script, merci

 

// $client_id = "ASPHbqljup3eOLN0x8Q_OpBkQcpejjZ0gatK3YksC6vEflRrKciusYs5AC3ZscdnnmddUhKIXk1Pgicd";
// $secret = "EKX98ogpivOisi5iBWhxyZibmXiQGFeLxBf5geDtUJiN5McT2QZxh0krjjJ1tvkbB4gkYkfo6v3waf4T";


// // Configuration de l'API PayPal
// $base_url = 'https://api.paypal.com';

// // Requête SQL pour récupérer tous les ID d'abonnement
// $req4 = $bdd->prepare("SELECT idabonnement FROM personnes WHERE per_pseudo=?");
// $req4->bindParam(1, $pseudo, PDO::PARAM_STR);
// $req4->execute();
// $result = $req4->fetchAll();

// // Boucle sur tous les ID d'abonnement et vérifie le statut de chaque abonnement
// foreach ($result as $row) {
// $subscription_id = $row['subscription_id'];
// $status = $row['status'];
// echo $status;
// // Vérifie si l'abonnement est annulé en appelant l'API PayPal
// if ($status == 'active') {
// $url = $base_url . '/v1/billing/subscriptions/' . $subscription_id;
// $curl = curl_init($url);
// curl_setopt($curl, CURLOPT_HTTPHEADER, array(
// 'Content-Type: application/json',
// 'Authorization: Basic ' . base64_encode($client_id . ':' . $secret)
// )
// }};

// // Vérifie si le nouveau statut est différent de l'ancien statut
// if ($new_status != $status) {
// // Met à jour le statut de l'abonnement dans la base de données
// $int = 0;
// $abonnement_actif = ($new_status == 'active') ? 1 : 0; // Convertit le statut en un booléen
// $req = $bdd->prepare("UPDATE personnes SET idabonnement = ?, abonnementactifoupas = ?, verifier = ? WHERE per_pseudo = ?;");
// $req->bindParam(1, $int, PDO::PARAM_STR);
// $req->bindParam(2, $int, PDO::PARAM_INT);
// $req->bindParam(3, $int, PDO::PARAM_INT);
// $req->bindParam(4, $pseudo, PDO::PARAM_STR);
// $req->execute();
// }

Login to Me Too
0 RÉPONSES 0

Haven't Found your Answer?

It happens. Hit the "Login to Ask the community" button to create a question for the PayPal community.