From a8ac7c95d2ff1526ddd0bf51d32185231c9bc4f3 Mon Sep 17 00:00:00 2001 From: Chris Smith Date: Fri, 15 Mar 2019 19:39:46 -0500 Subject: [PATCH] Add description an email --- index.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/index.php b/index.php index a0f69b5..a6d003f 100644 --- a/index.php +++ b/index.php @@ -147,13 +147,15 @@ $router->post('/checkout', function () { if ($_POST['paymentMethod'] == 0) { Stripe::setApiKey($_SERVER['STRIPE_API_SECRET_KEY']); $customer = Customer::create([ - "description" => $_POST['firstName'] . ' ' . $_POST['lastName'] . ' - ' . $_POST['email'], - "source" => $_POST['stripeToken'], // obtained with Stripe.js + 'description' => $_POST['firstName'] . ' ' . $_POST['lastName'] . ' - ' . $_POST['email'], + 'source' => $_POST['stripeToken'], // obtained with Stripe.js + 'email' => $_POST['email'], ]); // Charge the Customer instead of the card: $charge = Charge::create([ 'amount' => $cartTotal, 'currency' => 'usd', + 'description' => date('Y') . ' Dinner in the Woods', 'customer' => $customer->id, ]); // make payment