Closed kjfdebruin closed 1 year ago
Thanks. We'd accept a PR for this.
After digging a bit deeper, it unfortunately doesn't look like an easy fix. The transaction succeeded (SubscriptionPaymentSucceeded
was triggered), even though the Paddle response to charge()
was null.
So I am not sure what the appropriate Cashier behaviour would be here. At least the issue is documented in case anyone else comes digging.
Cashier Paddle Version
1.6.1
Laravel Version
9.19
PHP Version
8.2
Database Driver & Version
MySQL 8.0.33-0ubuntu0.22.04.2
Description
When calling a Subscription Single Charge, an
ErrorException
ofTrying to access array offset on value of type null
is sometimes thrown.This seems to be an intermittent Paddle issue. However, it might be worth more gracefully handling the case when it does happen. It has happened twice in about ~40 transactions in the last two weeks.
The error occurs on
/vendor/laravel/cashier-paddle/src/Cashier.php:156
, which is happens when$response
is null below:I would suggest something like this to solve it (and happy to create a PR if it suits the library)
The 101 is
Bad method call
, based on these Paddle Error codesSteps To Reproduce
Unfortunately this is intermittent, and I think it only occurs when Paddle fails to respond.