In this episode, we’re improving how we send customer data to Stripe so that each payment is associated with the right user's email, rather than a hardcoded one. Previously, every payment was attributed to the same email address, which obviously isn’t good for real applications.
We start by digging into how we can pass dynamic info—like the user's actual email—directly from our account form. The trick here is using Livewire’s entangle
feature to sync data between backend and frontend, so when a user fills in their email (or is logged in), it automatically gets picked up and pushed to Stripe as the customer’s billing email.
Next, we run some tests: first with a logged-in user, and then with a guest checkout using a completely different email address. In both cases, we check Stripe’s dashboard to confirm the payment data correctly reflects the email used each time.
This technique isn’t just for emails—you can use it to push all sorts of extra customer info through to Stripe just by entangling those fields. By the end of the episode, you'll know how to hook up your forms so all relevant customer details get sent along with their payment.