PayumBundle icon indicating copy to clipboard operation
PayumBundle copied to clipboard

Stripe - Prefill customer email

Open carlos-mg89 opened this issue 5 years ago • 1 comments
trafficstars

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

carlos-mg89 avatar Feb 28 '20 10:02 carlos-mg89

$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]' ]);

rudyhadoux avatar May 23 '22 14:05 rudyhadoux