PayumBundle
PayumBundle copied to clipboard
Stripe - Prefill customer email
Hi!
I have the PayumBundle set up with stripe_checkout gateway and users can do one time payments withouts issues. However, I find the customer email field empty in the Stripe checkout form.
I'm filling the payment client email:
$payment->setClientEmail('[email protected]');
As well as passing the customerEmail parameter in the details array:
$payment->setDetails([
'customerEmail' => '[email protected]'
]);
However the email field isn't being completed. I believe the name of the parameter in the details array is the one that matters, or at least this is what I can read here https://stripe.com/docs/payments/checkout/client#prefilling-customer-data
Any ideas about why would not be the details not be sent/processed correctly?
Thanks in advance
$session = \Stripe\Checkout\Session::create([ 'payment_method_types' => ['card'], 'line_items' => [[ 'price_data' => [ 'product_data' => [ 'name' => $productName, 'metadata' => [ 'pro_id' => $productID ] ], 'unit_amount' => $stripeAmount, 'currency' => $currency, ], 'quantity' => 1, 'description' => $productName, ]], 'mode' => 'payment', 'success_url' => STRIPE_SUCCESS_URL.'?session_id={CHECKOUT_SESSION_ID}', 'cancel_url' => STRIPE_CANCEL_URL, 'customer_email' => '[email protected]' ]);