I am creating a web app:
I need to update the database when payment is successful and the card is charged (not decline).
my code is here: I first create the customer. (btw, the variables are declared, everything is working)
$customer = \Stripe\Customer::create(array(
'email' => $_POST['stripeEmail'],
'source' => $_POST['stripeToken'],
'description' => $stripeEmail
));
then I create the subscription for the customer:
$subscription = \Stripe\Subscription::create(array(
"customer" => $customer->id,
"plan" => $planName
));
My question: do I need to create a webhook to detect if payment is successful? or is it successful upon form submitting successfully?