Add description an email
This commit is contained in:
@@ -147,13 +147,15 @@ $router->post('/checkout', function () {
|
|||||||
if ($_POST['paymentMethod'] == 0) {
|
if ($_POST['paymentMethod'] == 0) {
|
||||||
Stripe::setApiKey($_SERVER['STRIPE_API_SECRET_KEY']);
|
Stripe::setApiKey($_SERVER['STRIPE_API_SECRET_KEY']);
|
||||||
$customer = Customer::create([
|
$customer = Customer::create([
|
||||||
"description" => $_POST['firstName'] . ' ' . $_POST['lastName'] . ' - ' . $_POST['email'],
|
'description' => $_POST['firstName'] . ' ' . $_POST['lastName'] . ' - ' . $_POST['email'],
|
||||||
"source" => $_POST['stripeToken'], // obtained with Stripe.js
|
'source' => $_POST['stripeToken'], // obtained with Stripe.js
|
||||||
|
'email' => $_POST['email'],
|
||||||
]);
|
]);
|
||||||
// Charge the Customer instead of the card:
|
// Charge the Customer instead of the card:
|
||||||
$charge = Charge::create([
|
$charge = Charge::create([
|
||||||
'amount' => $cartTotal,
|
'amount' => $cartTotal,
|
||||||
'currency' => 'usd',
|
'currency' => 'usd',
|
||||||
|
'description' => date('Y') . ' Dinner in the Woods',
|
||||||
'customer' => $customer->id,
|
'customer' => $customer->id,
|
||||||
]);
|
]);
|
||||||
// make payment
|
// make payment
|
||||||
|
|||||||
Reference in New Issue
Block a user