stripe / stripe-php

PHP library for the Stripe API.
https://stripe.com
MIT License
3.75k stars 848 forks source link

Fix type of Billing Meter Event #1758

Closed prathmesh-stripe closed 1 month ago

prathmesh-stripe commented 1 month ago

fetchRelatedObject could not correctly return v1 objects. Therefore I had to manually add that type in v2mapping.

$baseEvent = $stripeClient->v2->core->events->retrieve('evt_test_65RD9HQIXX53rfbiu8116QQCIX1TSQbbOu5RHvml0KWLTM');

//print_r($baseEvent);
if ($baseEvent instanceof \Stripe\Events\V1BillingMeterErrorReportTriggeredEvent) {
    print_r($baseEvent->fetchRelatedObject()); // Returns StripeObject. Should return \Stripe\Billing\Meter
}

Followup to move this to codegen: https://jira.corp.stripe.com/browse/DEVSDK-2204

jar-stripe commented 1 month ago

very small nit but can you remove that commented print_r from the PR description?