#jessp1736
1 messages · Page 1 of 1 (latest)
Hello what is it?
I'm listening for two webhook events payment_method.attached and payment_method.detached. Will there always be a customer object if I were to retrieve the PaymentMethod and expand the customer?
Not if it's not attached to a customer
So it's likely that's the case for detached events
I'm wondering if there is a way to retrieve the customer if I receive an event and the customer is not available.
What do you mean?
If I get a webhook event for payment_method.detached the customer data will not be present (presumably) , right?
Hi 👋 I'm stepping in as @misty harness needs to go
hello and thank you
You are correct, there will not be a Customer associated with that PM as it is detached
I do see on the event object there is a key called "previous_attributes" will it be avilable there?
I can see that it is populated on my test account event but I'd love to confirm that I can count on it being there.
The test mode behavior will mirror live mode so you should test out detaching saved payment methods and inspecting the Event object returned by the webhook
Awesome! Thank you