<?php
require_once('Stripe/lib/Stripe.php');
Stripe::setApiKey(trim($pkey));
try
{
$customer = Stripe_Customer::create(array(
'email' => $_POST['stripeEmail'],
'source' => $_POST['stripeToken'],
'plan' => trim($plan)
));
}
catch(Exception $e)
{
//header('Location:oops.html');
error_log("unable to sign up customer:" . $_POST['stripeEmail'].
", error:" . $e->getMessage());
}
?>
Run Code Online (Sandbox Code Playgroud)
在这里,我想获取客户 ID,因此我打印 $customer 对象,它提供了条带对象,但我不知道如何从该结果中检索客户 ID。如果有人知道请帮助我。提前致谢