Stripe: how to send email address to checkout server action (without database)

Can I send an email from the url query, like site.com/checkout?email=test@test.com, to the stripe checkout server action?

@George Since you’re working on stripe right now, can you take a quick look at this post?

Maybe I’m misunderstanding but how about using the $GET.email value into this “Customer Email” field?

Any idea on how to actually fill the $GET.email? (I made these variables at input to see if I get any input fields at the component on the content page)

On the client side email in your url is your GET parameter. The value of $GET.email can be set on-click as a dynamic event for example.

Normally I’d do it that way, but since it’s the stripe component and not a regular server action I’m not sure how I can send a parameter to it. I’m pretty sure that Wappler needs to support that?

I am not getting the issue you’re having but here is what I meant. I’ll use an API I already have called redirect but yours can be “email” with a similar setup. I can use that “redirect” value in the Session.


(and of course, you’d need to run that API on the client side with a server connect)

Thanks Fred! I understand that part.

But I’m not sure how to send the data to the server connect, because it’s not a regular server connect.

This is how I would do it with a regular server connect:

But this server action is loaded as ‘session url’ within the stripe component, and thus I don’t have the possibility to send extra parameters:

I had in mind that you could run a regular server action in parallel to the StripeJS, but if that’s not the plan / not working as planned, maybe you could use one of these StripeJS dynamic events to run the API?
image

Ah I didn’t think of that, but if running in parallel: how do I get the parameter from one server action to the other one?

And as a plan B I can try out the setup created dynamic event but I have a feeling they’re not going to work for this, but either way I can check it out thanks :smiley:

The server connect for the “GET.email” API must run on page load. So GET.email is set even before you create the checkout session. So when you run the session, it will have that email value.
I’m also curious to see if that second option works too… :grinning:

I too feel this is not going to work since Setup is most likely about the Stripe setupIntent.
I'd rather try with Done or Ready. Ready must be for when the StripeJS initialises and is ready, which seems appropriate in your case.