Home › Forums › Stripe Payments Plugin › Prefill email on payment OR send custom email to Stripe
- This topic has 7 replies, 2 voices, and was last updated 2 days, 21 hours ago by
mariuselz.
-
AuthorPosts
-
May 3, 2025 at 7:04 pm #5483
mariuselz
ParticipantHello,
I am having an issue and I was wondering if there is a way to send/prefill the email to payment form or to Stripe when creating a subscription.
My flow:
1. User goes to https://mywebsite.com/asp-payment-box/?product_id=1350
2. Fills in the details and presses Pay, or pays with Apple/Google Pay. Then the data is sent to Stripe for purchasing the subscription.
3. I catch the payment in my API with an action (asp_stripe_payment_completed)
4. In my API, I update my DB based on Stripe payment email (because I am able to see the Stripe object in the asp_stripe_payment_completed callback)My problem:
In my DB, the user is “[email protected]”
In Stripe, especially if user pays by Apple/Google Pay, the email can be different (for example “[email protected]”)
This causes an issue in my DB updating, my code will look for “[email protected]” and it will not update the correct user ([email protected])Looking forward for any ideas. Much appreciated, thank you!
Best,
MariusMay 4, 2025 at 5:00 am #5493Admin
KeymasterHi, the use case you described will require custom code development. We’ve sent you an email with more details, please reply to that email.
May 14, 2025 at 1:06 pm #5539Admin
KeymasterWe’ve created an example addon that demonstrates how to capture a custom piece of information via a query parameter on the payment page and pass it to the Stripe API as metadata. Sharing it here in case it’s helpful:
July 29, 2025 at 4:11 pm #5603mariuselz
ParticipantHi, thank you for this information.
Does it work with the “email” as well? I am asking because I’m aware this field might be sensitive, maybe it cannot be overwritten?
Looking forward to your reply, thank you!
Best,
MariusJuly 31, 2025 at 7:47 am #5604Admin
KeymasterThe earlier example in this thread talks about sending the data to Stripe as as metadata (additional data).
If you want to pre-fill the standard email field’s data when the page is loaded, you can try the following example to see if that can work for your scenario:
September 30, 2025 at 6:26 pm #5634mariuselz
ParticipantThank you, this is working. Use $_GET[’email’] to get the email dynamically from the url.
I have tested and it seems the subscription is created on this particular email, in Stripe. Even if the transaction is done via Apple Pay (no email to fill in). Which is perfect!
-
This reply was modified 3 days, 2 hours ago by
mariuselz.
September 30, 2025 at 6:33 pm #5636mariuselz
ParticipantUpdate: it was working on Apple Pay if I open a Stripe window from my API.
But it is not working if I prefill S-Plugins form and then pay with Apple Pay.-
This reply was modified 3 days, 1 hour ago by
mariuselz.
September 30, 2025 at 10:53 pm #5638mariuselz
ParticipantSo after 4-5h of trying a lot of things, I solved this by sending the App email as metadata on subscription purchase. Then in my API (on payment complete event), I am waiting for Customer to be updated with the metadata, then update the Customer email (payment one, original) with App email from metadata. Then I proceed to update my DB. Not ideal, but works. Maybe it helps someone
-
This reply was modified 3 days, 2 hours ago by
-
AuthorPosts
- You must be logged in to reply to this topic.