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

advice_code not defined in StripeError (incorrect release notes for v16.5.0) #1815

Open
LeonMelis opened this issue Feb 12, 2025 · 1 comment

Comments

@LeonMelis
Copy link
Contributor

Describe the bug

The v16.5.0 release notes states that support for advice_code in the StripeError object is added:

Add support for advice_code on StripeError

However, it does not seem to be actually added. In fact, searching for advice_code in the entire repository only yields one occurrence: the release notes of 16.5.0.

Also note that the release notes mention StripeError, though in this PHP lib the class is known as ErrorObject.

See: https://github.com/stripe/stripe-php/releases/tag/v16.5.0

This field should be added to the PHPDoc of the ErrorObject class, so IDEs and linters can use this.

While we are at it: it would be really helpful to define the $last_payment_error in PaymentIntent.php as being an ErrorObject, instead of a generic StripeObject, again for code completion and linters.

To Reproduce

  • Fetch version 16.5.0 (or newer, at least up to 05c7c3a)
  • Notice how /lib/ErrorObject.php does not define the advice_code field in the class description (PHPDoc)
  • Notice how in the entire project advice_code is only mentioned once: in the release notes of v16.5.0

Expected behavior

The field advice_code should be defined in the PHPDoc of class ErrorObject in lib/ErrorObject.php

And if possible, the field $last_payment_error in PaymentIntent.php should be defined as an ErrorObject instead of a generic StripeObject

Code snippets

OS

n/a

PHP version

n/a

Library version

stripe-php v16.5.0

API version

n/a

Additional context

No response

@LeonMelis LeonMelis added the bug label Feb 12, 2025
@jar-stripe
Copy link
Contributor

Hi @LeonMelis thanks for the report, and very sorry for the inconvenience here! Let me look into this and see what is going on. Will be back in touch soon!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants