Error: Class 'Stripe\Stripe' not found
Résolu
mobrobot
Messages postés
173
Date d'inscription
Statut
Membre
Dernière intervention
-
mobrobot Messages postés 173 Date d'inscription Statut Membre Dernière intervention -
mobrobot Messages postés 173 Date d'inscription Statut Membre Dernière intervention -
A voir également:
- Class 'stripe\stripeclient' not found
- Fan error lenovo - Forum Refroidissement
- Playback error reconnect in 3s (1/5) francais - Forum Box et Streaming vidéo
- Whea error occt - Forum Processeur
- A javascript error occurred in the main process - Forum Matériel & Système
- Error 1962 ✓ - Forum PC fixe
3 réponses
encore une fois comment penses-tu qu'on puisse te venir en aide sans voir la moindre ligne de code ??
la page charge.php
<?php require_once 'vendor/autoload.php'; \Stripe\Stripe::setApiKey('pk_test_xxxxxxx'); //Sanitize POST Array $POST = filter_var_array($_POST, FILTER_SANITIZE_STRING); $first_name = $POST['prenom']; $last_name = $POST['nom']; $email = $POST['email']; $token = $POST['stripeToken']; // Create customer in stripe $customer = \Stripe\Customer::create(array( "email" => $email, "source" => $token )); //Charge Customer $charge = \Stripe\Charge::create(array( "amount" => 5000, "currency" => "usd", "description" => "Cyberpunk 2077", "customer" => $customer->id )); print_r($charge); ?>
Bonsoir, j'ai mis a jour le fichier vendor en fessant appelle avec le CMD, y'a un problème qui me bloque au niveau du fichier charge.php
voici ce qui s'affiche quand je génère le token.
Mon code charge.php
voici ce qui s'affiche quand je génère le token.
Fatal error: Uncaught (Status 400) (Request req_jxSfVvPRWqw6XO) No such token: 'tok_1IbQVs2eZvKYlo2CjNsKtjay' thrown in C:\xampp\htdocs\paypage\vendor\stripe\stripe-php\lib\Exception\ApiErrorException.php on line 38
Mon code charge.php
<?php require_once 'vendor/autoload.php'; $stripe = new \Stripe\StripeClient( 'sk_test_xxxxxxxxxxxxxxxxxxxxxxxxxx' ); //Sanitize POST Array $POST = filter_var_array($_POST, FILTER_SANITIZE_STRING); $first_name = $POST['prenom']; $last_name = $POST['nom']; $email = $POST['email']; $token = $POST['stripeToken']; $custmer = $stripe->customers->create([ 'email' => $email, 'description' => 'Grand thef auto 5', 'source' => $token ]); $charge = $stripe->charges->create([ 'amount' => 4000, 'currency' => 'usd', 'descriptin' => 'Grand Thef Auto V', 'customer' => $custmer->id ]); print_r($charger); ?>