com.drastikbydesign.stripe
com.drastikbydesign.stripe copied to clipboard
Recurring payment fails: Field 'invoice_id' doesn't have a default value
Hi,
When trying to save a recurring donation, it fails in CRM/Core/Payment/Stripe.php 806:
INSERT INTO civicrm_stripe_subscriptions
(subscription_id, customer_id, contribution_recur_id, processor_id, is_live )
resulting in
[nativecode=1364 ** Field 'invoice_id' doesn't have a default value] [type]
I don't understand what that invoice_id is supposed to be, for now (live site with fundraising), I've
ALTER Table civicrm_stripe_subscriptions modify column invoice_id varchar(255) NOT NULL default '';
Hi @tttp, thanks for the report. invoice_id as a unique relational identifier was deprecated in favor of contribution_recur_id.
I really needed to make an upgrade script that removes "NOT NULL" from invoice_id in civicrm_stripe_subscriptions (and any other table actually).
I'm hesitant to remove those columns entirely, even though they're not needed after the upgrade.
Patch on the way!
Strangely, my sql version happily accepted an entry to the civicrm_stripe_subscriptions table without an invoice_id.
At first I though I might have altered that row in the beginning stages of development of the multiple-subscriptions-per-customer feature and forgot about it.....but apparently not!
5c243da basically adds your alter table statement. Thanks!