Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update object tags for meter-related classes #1776

Merged
merged 3 commits into from
Oct 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading