com.drastikbydesign.stripe icon indicating copy to clipboard operation
com.drastikbydesign.stripe copied to clipboard

Recurring payment fails: Field 'invoice_id' doesn't have a default value

Open tttp opened this issue 7 years ago • 2 comments

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 '';

tttp avatar Mar 11 '17 14:03 tttp

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!

h-c-c avatar Mar 11 '17 15:03 h-c-c

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!

h-c-c avatar Mar 13 '17 05:03 h-c-c