From 9a342aad0937e7b3d6b429cf13b583021f30fe44 Mon Sep 17 00:00:00 2001 From: David Brownman <109395161+xavdid-stripe@users.noreply.github.com> Date: Fri, 18 Oct 2024 11:16:47 -0700 Subject: [PATCH] update object tags for meter-related classes (#1776) * update object tags for meter-related classes * fix tests * formatting --- lib/V2/Billing/MeterEvent.php | 2 +- lib/V2/Billing/MeterEventAdjustment.php | 2 +- lib/V2/Billing/MeterEventSession.php | 2 +- tests/Stripe/BaseStripeClientTest.php | 13 +++++++------ 4 files changed, 10 insertions(+), 9 deletions(-) diff --git a/lib/V2/Billing/MeterEvent.php b/lib/V2/Billing/MeterEvent.php index 56009b321..b612f2855 100644 --- a/lib/V2/Billing/MeterEvent.php +++ b/lib/V2/Billing/MeterEvent.php @@ -17,5 +17,5 @@ */ class MeterEvent extends \Stripe\ApiResource { - const OBJECT_NAME = 'billing.meter_event'; + const OBJECT_NAME = 'v2.billing.meter_event'; } diff --git a/lib/V2/Billing/MeterEventAdjustment.php b/lib/V2/Billing/MeterEventAdjustment.php index 7f99059cd..aa10ce37c 100644 --- a/lib/V2/Billing/MeterEventAdjustment.php +++ b/lib/V2/Billing/MeterEventAdjustment.php @@ -16,7 +16,7 @@ */ class MeterEventAdjustment extends \Stripe\ApiResource { - const OBJECT_NAME = 'billing.meter_event_adjustment'; + const OBJECT_NAME = 'v2.billing.meter_event_adjustment'; const STATUS_COMPLETE = 'complete'; const STATUS_PENDING = 'pending'; diff --git a/lib/V2/Billing/MeterEventSession.php b/lib/V2/Billing/MeterEventSession.php index 15f0b761b..14ae5cdd7 100644 --- a/lib/V2/Billing/MeterEventSession.php +++ b/lib/V2/Billing/MeterEventSession.php @@ -14,5 +14,5 @@ */ class MeterEventSession extends \Stripe\ApiResource { - const OBJECT_NAME = 'billing.meter_event_session'; + const OBJECT_NAME = 'v2.billing.meter_event_session'; } diff --git a/tests/Stripe/BaseStripeClientTest.php b/tests/Stripe/BaseStripeClientTest.php index 87ece8304..08b9c3779 100644 --- a/tests/Stripe/BaseStripeClientTest.php +++ b/tests/Stripe/BaseStripeClientTest.php @@ -416,7 +416,7 @@ public function testRawRequestWithStripeContextOption() public function testV2GetRequest() { $this->curlClientStub->method('executeRequestWithRetries') - ->willReturn(['{"object": "billing.meter_event_session"}', 200, []]) + ->willReturn(['{"object": "v2.billing.meter_event_session"}', 200, []]) ; $this->curlClientStub->expects(static::once()) @@ -446,7 +446,7 @@ public function testV2GetRequest() public function testV2PostRequest() { $this->curlClientStub->method('executeRequestWithRetries') - ->willReturn(['{"object": "billing.meter_event_session"}', 200, []]) + ->willReturn(['{"object": "v2.billing.meter_event_session"}', 200, []]) ; $this->curlClientStub->expects(static::once()) @@ -475,7 +475,7 @@ public function testV2PostRequest() public function testV2PostRequestWithEmptyParams() { $this->curlClientStub->method('executeRequestWithRetries') - ->willReturn(['{"object": "billing.meter_event_session"}', 200, []]) + ->willReturn(['{"object": "v2.billing.meter_event_session"}', 200, []]) ; $this->curlClientStub->expects(static::once()) @@ -777,7 +777,7 @@ public function testV2OverridesPreviewVersionIfPassedInRawRequestOptions() public function testV2OverridesPreviewVersionIfPassedInRequestOptions() { $this->curlClientStub->method('executeRequestWithRetries') - ->willReturn(['{"object": "billing.meter_event_session"}', 200, []]) + ->willReturn(['{"object": "v2.billing.meter_event_session"}', 200, []]) ; $this->curlClientStub->expects(static::once()) @@ -802,7 +802,7 @@ public function testV2OverridesPreviewVersionIfPassedInRequestOptions() public function testV1AndV2Request() { $this->curlClientStub->method('executeRequestWithRetries') - ->willReturnOnConsecutiveCalls(['{"object": "billing.meter_event_session"}', 200, []], ['{"object": "billing.meter_event"}', 200, []]) + ->willReturnOnConsecutiveCalls(['{"object": "v2.billing.meter_event_session"}', 200, []], ['{"object": "billing.meter_event"}', 200, []]) ; $this->curlClientStub @@ -816,7 +816,8 @@ public function testV1AndV2Request() $this->assertContains('Stripe-Version: ' . ApiVersion::CURRENT, $opts[\CURLOPT_HTTPHEADER]); return true; - }), MOCK_URL . '/v1/billing/meter_event/bmes_123', + }), + MOCK_URL . '/v1/billing/meter_event/bmes_123', ]) ;