Skip to content

Commit

Permalink
update object tags for meter-related classes (#1776)
Browse files Browse the repository at this point in the history
* update object tags for meter-related classes

* fix tests

* formatting
  • Loading branch information
xavdid-stripe authored Oct 18, 2024
1 parent 2b237f1 commit 9a342aa
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 9 deletions.
2 changes: 1 addition & 1 deletion lib/V2/Billing/MeterEvent.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,5 @@
*/
class MeterEvent extends \Stripe\ApiResource
{
const OBJECT_NAME = 'billing.meter_event';
const OBJECT_NAME = 'v2.billing.meter_event';
}
2 changes: 1 addition & 1 deletion lib/V2/Billing/MeterEventAdjustment.php
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down
2 changes: 1 addition & 1 deletion lib/V2/Billing/MeterEventSession.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,5 @@
*/
class MeterEventSession extends \Stripe\ApiResource
{
const OBJECT_NAME = 'billing.meter_event_session';
const OBJECT_NAME = 'v2.billing.meter_event_session';
}
13 changes: 7 additions & 6 deletions tests/Stripe/BaseStripeClientTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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())
Expand Down Expand Up @@ -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())
Expand Down Expand Up @@ -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())
Expand Down Expand Up @@ -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())
Expand All @@ -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
Expand All @@ -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',
])
;

Expand Down

0 comments on commit 9a342aa

Please sign in to comment.