#CowLover24
1 messages · Page 1 of 1 (latest)
Can you share the event ID? Likely this exists on another object, for example looking at the customer object instead
here is a charge pending event evt_3NGSE2Pql6NU3Z0m0ZMkYDlk
The customer does have a phone in their billing details and it appears on the invoice. so I assumed the charge object would also have the phone
No that's not propagated from the customer.phone -- anything in the charge billing_details refers to the payment method used (pm_1NGSF0Pql6NU3Z0m3DQsXxpo here) which does not include a phone number
Oh okay thank you that clears things up a bit. Is there a good method on getting the phone number into the payment method?
I am having my customers put in their payment info on Stripe's hosted invoice page. Where I am supplying the email. is there a way to also supply a phone number? Say when I create an invoice or a subscription?
No AFAIK the hosted invoice page does not collect a billing phone number so it can't do that
if you know your customer has one though you can either refer to the customer object or update the payment method billing details after the fact for any future payments
So, if I have a customer that has a phone number attached to it, there is no way to use that vluae when creating an invoice/subscription to apply it to the payment method. It would need to be done separately is that right? And when you say refer to the customer object you mean actually fetch the customer and just get it from there?
Yes, refer to the customer object here means that you would need to retrieve the customer and check their phone field https://stripe.com/docs/api/customers/object#customer_object-phone
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
To clarify: are you currently sending your users to our hosted invoice page and then you collect the phone number elsewhere?
And yes, unfortunately it looks like our hosted invoice page doesn't have a way to force phone number collection. I can check if our other products like Checkout Support this, otherwise you may need your own custom payments page to collect the phone number along with the initial payment
Here is the flow: We are using the connect platform. Our users will create their customers on the application. supplyling their name, email, phone to create the customer. Then when they have them subscribe or send a one time invoice their payment information is gathered from the hosted invoice page. Does that make sense?
My idea was I wanted to be able to listen for the charge.failed event. Then just grabbing that phone number on the charge object to be able to send an sms notification.
Yes thank you for clarifying. Unfortunately I don't think there is a way to do this for the first charge on an invoice. Trying to think of whether there is another event that you could listen to that this would be a part of
As a workaround it may be possible to add the phone number as metadata and grab that from another event
And of course if you are fine making an API call here a lot of these events come with a Customer ID which you could use to retrieve all of the customer info
Alrighty sounds good thank you for the info. I just wasn't sure if there was a simple solution I was missing. I think with this new information I can figure it out. Thank you so much
Sounds good, glad I could give you an idea of where to go. From looking at my test events now, it does look like none of them include the full customer by default. So you will likely either want to retrieve the customer or go the metadata route