Skip to content

Client::createSubscriptionChange() returning EmptyResource throws Fatal Exception #648

@trickeyone

Description

@trickeyone

Warning: Github issues are not an official support channel for Recurly. If you have an urgent request we suggest you contact us through an official channel: [email protected] or https://recurly.zendesk.com

Describe the bug

If a subscription already has a pending change, then a new change is created that matches the existing subscription, per the API docs, the change is removed and a 204 No Content is sent.

Recurly\Client::createSubscriptionChange(): Return value must be of type Recurly\Resources\SubscriptionChange, Recurly\EmptyResource returned {"exception":"[object] (TypeError(code: 0): Recurly\\Client::createSubscriptionChange(): Return value must be of type Recurly\\Resources\\SubscriptionChange, Recurly\\EmptyResource returned

To Reproduce

Have an account with an existing subscription change, then submit a change that matches the current subscription values.

Expected behavior

Recurly\Client::createSubscriptionChange() should add a union return type for PHP8+ to support returning Recurly\Resources\EmptyResource as well as the normal Recurly\Resources\SubscriptionChange

Your Environment

Recurly SDK: 4.9.0
PHP: 8.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions