在此页面payment.php上,我想创建一个用于条带化付款的客户,但是我的页面中没有任何内容,控制台中没有任何内容,其中写入了NULL,我不知道如何使它工作
<?php
$token = $_POST['token'];
$name = $_POST['nom'];
require_once('assets/vendor/stripe/init.php');
// (switch to the live key later)
\Stripe\Stripe::setApiKey("sk_test_p5p8Apo5Mn2LIn1po1tg5tYe33df6vQf");
try
{
$customer = \Stripe\Customer::create([
"name" => $name,
"source" => $token,
]);
$reponse= json_decode($customer);
var_dump($reponse);
}
catch(Exception $e)
{
error_log("unable to sign up customer:" . $_POST['stripeEmail'].
", error:" . $e->getMessage());
}