#krista2780
1 messages ยท Page 1 of 1 (latest)
the email would be on the Customer object so you have to fetch the customer using the Customer ID from the Subscription object
For all other subscriptions that we have, we use the stripe_charge_event.data.object.billing_details.email ... is it possible make an update to the subscription we created so that it comes through this structure like out other subscriptions?
I think that depends on how the Subscriptions were created. I assume the others (that have email on billing_details were created through Stripe Checkout which collects it on the billing details of the card / PaymentMethod? and in the case of your test from Dashboard, the test customer's card never had billing details collected? just a hunch
correct!
So i was wondering if i can update the subscription to retroactively add the billing details that were not added.
If not, I understand your last response and I will make an additional api request for the email since this is a real subscription for an active customer.
Hi there ๐ jumping in as my teammate needs to step away here shortly. I need to double check exactly where that value is put, but I think you'll be able to update it. While I do that, can you share the ID of two Events from your testing, one with the email and one without?
sure one moment
here is the event where the email https://dashboard.stripe.com/events/evt_3OHA4FCfwYrvlXdJ0mJxqy3B
Sign in to the Stripe Dashboard to manage business payments and operations in your account. Manage payments and refunds, respond to disputes and more.
let me find a regular one with it. one moment
Sign in to the Stripe Dashboard to manage business payments and operations in your account. Manage payments and refunds, respond to disputes and more.
Thank you for your patience. I think that is coming from the underlying Source object that is being used. (The one where you do see the email is using a Payment Method instead, with populated billing_details). I would suggest trying to update the owner.email field on the Source object being used to make the payment:
https://stripe.com/docs/api/sources/object?lang=node#source_object-owner-email
but let me know if that doesn't work.
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
ok I will try that now
So i went ahead and updated the owner.email but since the charge object was already generated without it, when i go to query stripe_charge_event.data.object.billing_details.email its still empty. so i think it would only work if a new charge event was created right?
Correct, it won't update the existing Charge or Event objects.
ok cool but i assume next month when the subscription renews it will be there. and if not, i can add the additional query to fetch the customer's details that way.
I would expect it to be, but you can recreate this flow in a test clock to be sure. You can:
- Go through the steps to replicate the issue
- Make the corrective change
- Advance the Test Clock's time to see how the change impacts future Charges/Events
https://stripe.com/docs/billing/testing/test-clocks
perfect, thank you!