Bonjour,
J'espère que quelqu'un pourra m'éclairer, je ne comprend pas tout fonctionnait bien cet apres midi...
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
| require_once('stripe/init.php');
$key = require('stripe/config.php');
\Stripe\Stripe::setApiKey($key['key']);
$customer = \Stripe\Customer::create([
"name" => $GLOBALS['controller']->getParam('resa_name'.$litter_id),
"phone" => $GLOBALS['controller']->getParam('resa_phone'.$litter_id),
"email" => $GLOBALS['controller']->getParam('resa_mail'.$litter_id),
"address" => array(
"line1" => $GLOBALS['controller']->getParam('resa_road'.$litter_id),
"line2" => $litter_id,
"city" => $GLOBALS['controller']->getParam('resa_city'.$litter_id),
"postal_code" => $GLOBALS['controller']->getParam('resa_post_code'.$litter_id),
"state" => $GLOBALS['controller']->getParam('resa_sexe'.$litter_id),
),
]);
print_r($customer); |
le print_r donne ceci :
Stripe\Customer Object ( [id] => cus_GA3qpoPJ3iRHEg [object] => customer [address] => [balance] => 0 [created] => 1573504968 [currency] => [default_source] => [delinquent] => [description] => [discount] => [email] => [invoice_prefix] => 3368D9CF [invoice_settings] => Stripe\StripeObject Object ( [custom_fields] => [default_payment_method] => [footer] => ) [livemode] => [metadata] => Stripe\StripeObject Object ( ) [name] => [phone] => [preferred_locales] => Array ( ) [shipping] => [sources] => Stripe\Collection Object ( [object] => list [data] => Array ( ) [has_more] => [total_count] => 0 [url] => /v1/customers/cus_GA3qpoPJ3iRHEg/sources ) [subscriptions] => Stripe\Collection Object ( [object] => list [data] => Array ( ) [has_more] => [total_count] => 0 [url] => /v1/customers/cus_GA3qpoPJ3iRHEg/subscriptions ) [tax_exempt] => none [tax_ids] => Stripe\Collection Object ( [object] => list [data] => Array ( ) [has_more] => [total_count] => 0 [url] => /v1/customers/cus_GA3qpoPJ3iRHEg/tax_ids ) [tax_info] => [tax_info_verification] => )
En bref il renvoie un objet vide, pourtant au moment de créer mon objet customer Stripe\Customer::create, toutes les variables insérées sont bonnes. Qu'est ce qui pourrait empêcher mes variables d entrer dans l'objet costumer sans générer aucune erreur ?
Merci d'avance
Partager