stripe / stripe-node

Node.js library for the Stripe API.
https://stripe.com
MIT License
3.89k stars 753 forks source link

Add related_object field to event types, remove fetchRelatedObject() … #2190

Closed ramya-stripe closed 1 month ago

ramya-stripe commented 1 month ago

Why?

The fetchRelatedObject() method on the pulled event did not really work as it did not have access to the RequestSender. In the interest of time we will recommend users to use the info in the related_object field on the pulled event to determine which stripe method to call to get the related_object.

That related_object info was available on the pulled event but did not show up in types before. This PR adds that info.

What?

ramya-stripe commented 1 month ago

@helenye-stripe I wanted to add tests that test the type for column C has the data and related_object fields. But there is a broader problem with types that I have described in https://jira.corp.stripe.com/browse/DEVSDK-2192 which @xavdid-stripe is helping to figure out.

Added https://github.com/stripe/stripe-node/pull/2190/commits/6f72bb2afffe29387783a683d5e6df646523e4f0 - but like I said earlier this test will pass even without the changes in this PR

Can we unblock this PR?