500 Internal Server error for the customer.subscription.updated event
Reported by @elizoliva in #265 (closed)
We are also having issues with recurring transactions since updating to v6.5.1 (we have since updated to 6.5.2). All recurring payments since the transaction are showing as Pending (Incomplete Transaction), and the Stripe webhook says customer.subscription.updated is failing, while all other webhook events appear to be succeeding. Stripe is reporting a 500 Internal Server error for the customer.subscription.updated event.
In php error logs, we are getting:
[Mon Oct 12 18:10:40.699676 2020] [php7:notice] [pid 17092] [client 172.68.189.63:56216] Stripe Notice: Undefined property of Stripe\\StripeObject instance: plan
[Mon Oct 12 18:10:40.699755 2020] [php7:notice] [pid 17092] [client 172.68.189.63:56216] Stripe Notice: Undefined property of Stripe\\Plan instance: name
Oct 12 18:10:40 [error]
$Fatal Error Details = array(3) {
["message"]=>
string(37) "Expected one Contribution but found 0"
["code"]=>
NULL
["exception"]=>
object(CiviCRM_API3_Exception)#1528 (8) {
["extraParams":"CiviCRM_API3_Exception":private]=>
array(3) {
["is_error"]=>
int(1)
["error_message"]=>
string(37) "Expected one Contribution but found 0"
["error_code"]=>
string(9) "undefined"
}
["message":protected]=>
string(37) "Expected one Contribution but found 0"
["string":"Exception":private]=>
string(0) ""
["code":protected]=>
int(0)
["file":protected]=>
string(69) "/var/www/vhosts/website/htdocs/sites/all/modules/civicrm/api/api.php"
["line":protected]=>
int(133)
["trace":"Exception":private]=>
array(12) {
[0]=>
array(3) {
["file"]=>
string(118) "/var/www/vhosts/website/htdocs/sites/all/civicrm/extensions/com.drastikbydesign.stripe/CRM/Core/Payment/StripeIPN.php"
["line"]=>
int(497)
["function"]=>
string(12) "civicrm_api3"
}
[1]=>
array(5) {
["file"]=>
string(118) "/var/www/vhosts/website/htdocs/sites/all/civicrm/extensions/com.drastikbydesign.stripe/CRM/Core/Payment/StripeIPN.php"
["line"]=>
int(472)
["function"]=>
string(15) "getContribution"
["class"]=>
string(26) "CRM_Core_Payment_StripeIPN"
["type"]=>
string(2) "->"
}
[...]
This is the error we are now getting for each recurring transaction for the past week, which is ~15 transactions.