I have implemented a checkout that defines the success_url. I have added {CHECKOUT_SESSION_ID} to the querystring and it works fine. I would like to include other information that would allow me to tie that response to the user in my database that made the payment. For example, customer email. Is session_id the only variable that can be included or is there a list somewhere?
This URL works:
'success_url' => 'https://www.psychology.com/personality/lizard/success.php?session_id={CHECKOUT_SESSION_ID}',
I tried {email}
{customer}.{email}
{customer->email}`
The only template variable is CHECKOUT_SESSION_ID
on the success_url
and I do not believe you can add CUSTOMER_EMAIL
. This document shows how you can customize your success page to show the customer's email address on the page. However, I do think think that is what you're looking for. If you're trying to attain the customer's email to save to your database, then, I recommend that you listen to webhooks or retrieve the customer object. Stripe webhooks send events that you can listen to and with Checkout, you can listen to checkout.session.completed
for instance and look at the customer_details.email