laravel / cashier-paddle

Cashier Paddle provides an expressive, fluent interface to Paddle's subscription billing services.
https://laravel.com/docs/cashier-paddle
MIT License
238 stars 57 forks source link

[2.x] Update Cashier::api error message #217

Closed Ahmad-Alkaf closed 9 months ago

Ahmad-Alkaf commented 9 months ago

Hello, I just spent two days debugging an error that can be easily debugged, if the error message is descriptive. But Paddle seems just to say "Invalid Request" or this is what I thought. My problem was not a bug it was a "bad request" because I did not pass something important (email) that my Billable class didn't have (Team). Nevertheless, the way I debugged this, is by digging to the source of the error (Cashier::api) and dd its response which is the following: 2023_12_08_02_09_37_Window

Clearly, the error by Paddle is descriptive but its (detail) not very much. I don't want anyone to waste his time debugging an error that does not exist on the error stack. Before my pull request: 2023-12-08 02_21_20-Business - Laptop POS and 2 more pages - Personal - Microsoft​ Edge

After: 2023-12-08 02_20_21-Business - Laptop POS and 2 more pages - Personal - Microsoft​ Edge Thank you very much for your patience, keep up the great work!

driesvints commented 9 months ago

Thanks @Ahmad-Alkaf. I changed the message format here a bit and added an extra safeguard when creating customers.