Closed bensherred closed 6 months ago
Heya, thanks for your PR. Could you show a before/after example of this? Maybe through a screenshot of the Ignition error page?
Yeah sure thing
Before
A general exception with an invalid key:
An exception due to validation:
After
A general exception with an invalid key:
An exception due to validation:
By catching the exception and calling ->getError()
, we can get the error response from Paddle like so:
The aim of this pull request to make it easier to get the paddle error response. The
Cashier
currently throws an exception when Paddle returns an error, but it only provides theerror.detail
.There is also a
$message
variable which is set but never used. I've therefore updated thePaddleException
to use that custom$message
variable and added a method for getting the Paddle error response.One of the main use cases behind this PR, is being able to get the validation messages and formatting them into a readable format for the user.