We've moved discussions to Discord

Stripe Webhooks Failing

Jason Ackerman
I'm getting a failure from Stripe when it tries to connect to my app (on Heroku) via webhooks. I resent the webhook and see the following in the Heroku logs. Any idea what is causing this? I've bolded two sections of the log below that seem to be the issue, but I'm not sure what's actually happening. Any guidance would be much appreciated!

It looks like in the Stripe initializer in notify_user it is calling subscription.stripe_id, but stripe_id is a field on Plan, not Subscription (as far as I can tell), is this the problem? I did not modify this initializer at all, so it's exactly as it shipped with Jumpstart.

Thanks!

2021-02-27T15:26:06.841588+00:00 app[web.1]: I, [2021-02-27T15:26:06.841464 #4]  INFO -- : [770a7e9d-50ca-4f86-82f5-42c81ef65f03] Started POST "/webhooks/stripe" for 54.187.216.72 at 2021-02-27 15:26:06 +00002021-02-27T15:26:06.848881+00:00 app[web.1]: I, [2021-02-27T15:26:06.848784 #4]  INFO -- : [770a7e9d-50ca-4f86-82f5-42c81ef65f03] Processing by StripeEvent::WebhookController#event as XML2021-02-27T15:26:06.850006+00:00 app[web.1]: I, [2021-02-27T15:26:06.849906 #4]  INFO -- : [770a7e9d-50ca-4f86-82f5-42c81ef65f03]   Parameters: {"id"=>"evt_1IOpWdFeP1NdBQ7G3KhUNgjc", "object"=>"event", "api_version"=>"2020-03-02", "created"=>1614281367, "data"=>{"object"=>{"object"=>"invoice", "account_country"=>"US", "account_name"=>"[FILTERED]", "account_tax_ids"=>nil, "amount_due"=>0, "amount_paid"=>0, "amount_remaining"=>0, "application_fee_amount"=>nil, "attempt_count"=>0, "attempted"=>false, "billing_reason"=>"upcoming", "charge"=>nil, "collection_method"=>"charge_automatically", "created"=>1614886165, "currency"=>"usd", "custom_fields"=>nil, "customer"=>"cus_IVlUtg5OaBnZMV", "customer_address"=>nil, "customer_email"=>"[FILTERED]", "customer_name"=>"[FILTERED]", "customer_phone"=>nil, "customer_shipping"=>nil, "customer_tax_exempt"=>"none", "customer_tax_ids"=>[], "default_payment_method"=>nil, "default_source"=>nil, "default_tax_rates"=>[], "description"=>nil, "discount"=>nil, "discounts"=>[], "due_date"=>nil, "ending_balance"=>0, "footer"=>nil, "last_finalization_error"=>nil, "lines"=>{"object"=>"list", "data"=>[{"id"=>"il_tmp_5008b5c7591fe1", "object"=>"line_item", "amount"=>0, "currency"=>"usd", "description"=>"1 × Free (at $0.00 / month)", "discount_amounts"=>[], "discountable"=>true, "discounts"=>[], "livemode"=>true, "metadata"=>{}, "period"=>{"end"=>1617564565, "start"=>1614886165}, "plan"=>{"id"=>"price_1HL8xPFeP1NdBQ7GEYQtpQAJ", "object"=>"plan", "active"=>true, "aggregate_usage"=>nil, "amount"=>0, "amount_decimal"=>"0", "billing_scheme"=>"per_unit", "created"=>1598626415, "currency"=>"usd", "interval"=>"month", "interval_count"=>1, "livemode"=>true, "metadata"=>{}, "nickname"=>"[FILTERED]", "product"=>"prod_HuyvTa17weuKAO", "tiers"=>nil, "tiers_mode"=>nil, "transform_usage"=>nil, "trial_period_days"=>nil, "usage_type"=>"licensed"}, "price"=>{"id"=>"price_1HL8xPFeP1NdBQ7GEYQtpQAJ", "object"=>"price", "active"=>true, "billing_scheme"=>"per_unit", "created"=>1598626415, "currency"=>"usd", "livemode"=>true, "lookup_key"=>nil, "metadata"=>{}, "nickname"=>"[FILTERED]", "product"=>"prod_HuyvTa17weuKAO", "recurring"=>{"aggregate_usage"=>nil, "interval"=>"month", "interval_count"=>1, "trial_period_days"=>nil, "usage_type"=>"licensed"}, "tiers_mode"=>nil, "transform_quantity"=>nil, "type"=>"recurring", "unit_amount"=>0, "unit_amount_decimal"=>"0"}, "proration"=>false, "quantity"=>1, "subscription"=>"sub_IVlVJWT8VeO174", "subscription_item"=>"si_IVlVymmiYbtBos", "tax_amounts"=>[], "tax_rates"=>[], "type"=>"subscription"}], "has_more"=>false, "total_count"=>1, "url"=>"/v1/invoices/upcoming/lines?customer=cus_IVlUtg5OaBnZMV&subscription=sub_IVlVJWT8VeO174"}, "livemode"=>true, "metadata"=>{}, "next_payment_attempt"=>1614889765, "number"=>nil, "on_behalf_of"=>nil, "paid"=>false, "payment_intent"=>nil, "payment_settings"=>{"payment_method_options"=>nil, "payment_method_types"=>nil}, "period_end"=>1614886165, "period_start"=>1612466965, "post_payment_credit_notes_amount"=>0, "pre_payment_credit_notes_amount"=>0, "receipt_number"=>nil, "starting_balance"=>0, "statement_descriptor"=>nil, "status"=>"draft", "status_transitions"=>{"finalized_at"=>nil, "marked_uncollectible_at"=>nil, "paid_at"=>nil, "voided_at"=>nil}, "subscription"=>"sub_IVlVJWT8VeO174", "subtotal"=>0, "tax"=>nil, "tax_percent"=>nil, "total"=>0, "total_discount_amounts"=>[], "total_tax_amounts"=>[], "transfer_data"=>nil, "webhooks_delivered_at"=>nil}}, "livemode"=>true, "pending_webhooks"=>1, "request"=>{"id"=>nil, "idempotency_key"=>nil}, "type"=>"invoice.upcoming", "webhook"=>{"id"=>"evt_1IOpWdFeP1NdBQ7G3KhUNgjc", "object"=>"event", "api_version"=>"2020-03-02", "created"=>1614281367, "data"=>{"object"=>{"object"=>"invoice", "account_country"=>"US", "account_name"=>"[FILTERED]", "account_tax_ids"=>nil, "amount_due"=>0, "amount_paid"=>0, "amount_remaining"=>0, "application_fee_amount"=>nil, "attempt_count"=>0, "attempted"=>false, "billing_reason"=>"upcoming", "charge"=>nil, "collection_method"=>"charge_automatically", "created"=>1614886165, "currency"=>"usd", "custom_fields"=>nil, "customer"=>"cus_IVlUtg5OaBnZMV", "customer_address"=>nil, "customer_email"=>"[FILTERED]", "customer_name"=>"[FILTERED]", "customer_phone"=>nil, "customer_shipping"=>nil, "customer_tax_exempt"=>"none", "customer_tax_ids"=>[], "default_payment_method"=>nil, "default_source"=>nil, "default_tax_rates"=>[], "description"=>nil, "discount"=>nil, "discounts"=>[], "due_date"=>nil, "ending_balance"=>0, "footer"=>nil, "last_finalization_error"=>nil, "lines"=>{"object"=>"list", "data"=>[{"id"=>"il_tmp_5008b5c7591fe1", "object"=>"line_item", "amount"=>0, "currency"=>"usd", "description"=>"1 × Free (at $0.00 / month)", "discount_amounts"=>[], "discountable"=>true, "discounts"=>[], "livemode"=>true, "metadata"=>{}, "period"=>{"end"=>1617564565, "start"=>1614886165}, "plan"=>{"id"=>"price_1HL8xPFeP1NdBQ7GEYQtpQAJ", "object"=>"plan", "active"=>true, "aggregate_usage"=>nil, "amount"=>0, "amount_decimal"=>"0", "billing_scheme"=>"per_unit", "created"=>1598626415, "currency"=>"usd", "interval"=>"month", "interval_count"=>1, "livemode"=>true, "metadata"=>{}, "nickname"=>"[FILTERED]", "product"=>"prod_HuyvTa17weuKAO", "tiers"=>nil, "tiers_mode"=>nil, "transform_usage"=>nil, "trial_period_days"=>nil, "usage_type"=>"licensed"}, "price"=>{"id"=>"price_1HL8xPFeP1NdBQ7GEYQtpQAJ", "object"=>"price", "active"=>true, "billing_scheme"=>"per_unit", "created"=>1598626415, "currency"=>"usd", "livemode"=>true, "lookup_key"=>nil, "metadata"=>{}, "nickname"=>"[FILTERED]", "product"=>"prod_HuyvTa17weuKAO", "recurring"=>{"aggregate_usage"=>nil, "interval"=>"month", "interval_count"=>1, "trial_period_days"=>nil, "usage_type"=>"licensed"}, "tiers_mode"=>nil, "transform_quantity"=>nil, "type"=>"recurring", "unit_amount"=>0, "unit_amount_decimal"=>"0"}, "proration"=>false, "quantity"=>1, "subscription"=>"sub_IVlVJWT8VeO174", "subscription_item"=>"si_IVlVymmiYbtBos", "tax_amounts"=>[], "tax_rates"=>[], "type"=>"subscription"}], "has_more"=>false, "total_count"=>1, "url"=>"/v1/invoices/upcoming/lines?customer=cus_IVlUtg5OaBnZMV&subscription=sub_IVlVJWT8VeO174"}, "livemode"=>true, "metadata"=>{}, "next_payment_attempt"=>1614889765, "number"=>nil, "on_behalf_of"=>nil, "paid"=>false, "payment_intent"=>nil, "payment_settings"=>{"payment_method_options"=>nil, "payment_method_types"=>nil}, "period_end"=>1614886165, "period_start"=>1612466965, "post_payment_credit_notes_amount"=>0, "pre_payment_credit_notes_amount"=>0, "receipt_number"=>nil, "starting_balance"=>0, "statement_descriptor"=>nil, "status"=>"draft", "status_transitions"=>{"finalized_at"=>nil, "marked_uncollectible_at"=>nil, "paid_at"=>nil, "voided_at"=>nil}, "subscription"=>"sub_IVlVJWT8VeO174", "subtotal"=>0, "tax"=>nil, "tax_percent"=>nil, "total"=>0, "total_discount_amounts"=>[], "total_tax_amounts"=>[], "transfer_data"=>nil, "webhooks_delivered_at"=>nil}}, "livemode"=>true, "pending_webhooks"=>1, "request"=>{"id"=>nil, "idempotency_key"=>nil}, "type"=>"invoice.upcoming"}}2021-02-27T15:26:06.872859+00:00 app[web.1]: D, [2021-02-27T15:26:06.872739 #4] DEBUG -- : [770a7e9d-50ca-4f86-82f5-42c81ef65f03]   [1m[36mPay::Subscription Load (1.0ms)[0m  [1m[34mSELECT "pay_subscriptions".* FROM "pay_subscriptions" WHERE "pay_subscriptions"."processor" = $1 AND "pay_subscriptions"."processor_id" = $2 LIMIT $3[0m  [["processor", "stripe"], ["processor_id", "sub_IVlVJWT8VeO174"], ["LIMIT", 1]]2021-02-27T15:26:06.887047+00:00 app[web.1]: D, [2021-02-27T15:26:06.886919 #4] DEBUG -- : [770a7e9d-50ca-4f86-82f5-42c81ef65f03]   [1m[36mAccount Load (2.0ms)[0m  [1m[34mSELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2[0m  [["id", 18], ["LIMIT", 1]]2021-02-27T15:26:06.925644+00:00 app[web.1]: I, [2021-02-27T15:26:06.925523 #4]  INFO -- : [770a7e9d-50ca-4f86-82f5-42c81ef65f03] Completed 500 Internal Server Error in 74ms (ActiveRecord: 2.9ms | Allocations: 7464)2021-02-27T15:26:06.929849+00:00 app[web.1]: F, [2021-02-27T15:26:06.929764 #4] 
FATAL -- : [770a7e9d-50ca-4f86-82f5-42c81ef65f03]   2021-02-27T15:26:06.929851+00:00 app[web.1]: [770a7e9d-50ca-4f86-82f5-42c81ef65f03] NoMethodError (undefined method `stripe_id' for #<Pay::Subscription:0x0000555d8541f1d0>2021-02-27T15:26:06.929853+00:00 app[web.1]: Did you mean?  stripe?):2021-02-27T15:26:06.929854+00:00 app[web.1]: [770a7e9d-50ca-4f86-82f5-42c81ef65f03]   2021-02-27T15:26:06.929854+00:00 app[web.1]: [770a7e9d-50ca-4f86-82f5-42c81ef65f03] config/initializers/stripe.rb:21:in `notify_user'2021-02-27T15:26:06.941167+00:00 app[web.1]: I, [2021-02-27T15:26:06.941050 #4]  INFO -- : [770a7e9d-50ca-4f86-82f5-42c81ef65f03] Processing by ErrorsController#internal_server_error as XML2021-02-27T15:26:06.943335+00:00 
app[web.1]: I, [2021-02-27T15:26:06.943204 #4]  INFO -- : [770a7e9d-50ca-4f86-82f5-42c81ef65f03]   Parameters: {"id"=>"evt_1IOpWdFeP1NdBQ7G3KhUNgjc", "object"=>"event", "api_version"=>"2020-03-02", "created"=>1614281367, "data"=>{"object"=>{"object"=>"invoice", "account_country"=>"US", "account_name"=>"[FILTERED]", "account_tax_ids"=>nil, "amount_due"=>0, "amount_paid"=>0, "amount_remaining"=>0, "application_fee_amount"=>nil, "attempt_count"=>0, "attempted"=>false, "billing_reason"=>"upcoming", "charge"=>nil, "collection_method"=>"charge_automatically", "created"=>1614886165, "currency"=>"usd", "custom_fields"=>nil, "customer"=>"cus_IVlUtg5OaBnZMV", "customer_address"=>nil, "customer_email"=>"[FILTERED]", "customer_name"=>"[FILTERED]", "customer_phone"=>nil, "customer_shipping"=>nil, "customer_tax_exempt"=>"none", "customer_tax_ids"=>[], "default_payment_method"=>nil, "default_source"=>nil, "default_tax_rates"=>[], "description"=>nil, "discount"=>nil, "discounts"=>[], "due_date"=>nil, "ending_balance"=>0, "footer"=>nil, "last_finalization_error"=>nil, "lines"=>{"object"=>"list", "data"=>[{"id"=>"il_tmp_5008b5c7591fe1", "object"=>"line_item", "amount"=>0, "currency"=>"usd", "description"=>"1 × Free (at $0.00 / month)", "discount_amounts"=>[], "discountable"=>true, "discounts"=>[], "livemode"=>true, "metadata"=>{}, "period"=>{"end"=>1617564565, "start"=>1614886165}, "plan"=>{"id"=>"price_1HL8xPFeP1NdBQ7GEYQtpQAJ", "object"=>"plan", "active"=>true, "aggregate_usage"=>nil, "amount"=>0, "amount_decimal"=>"0", "billing_scheme"=>"per_unit", "created"=>1598626415, "currency"=>"usd", "interval"=>"month", "interval_count"=>1, "livemode"=>true, "metadata"=>{}, "nickname"=>"[FILTERED]", "product"=>"prod_HuyvTa17weuKAO", "tiers"=>nil, "tiers_mode"=>nil, "transform_usage"=>nil, "trial_period_days"=>nil, "usage_type"=>"licensed"}, "price"=>{"id"=>"price_1HL8xPFeP1NdBQ7GEYQtpQAJ", "object"=>"price", "active"=>true, "billing_scheme"=>"per_unit", "created"=>1598626415, "currency"=>"usd", "livemode"=>true, "lookup_key"=>nil, "metadata"=>{}, "nickname"=>"[FILTERED]", "product"=>"prod_HuyvTa17weuKAO", "recurring"=>{"aggregate_usage"=>nil, "interval"=>"month", "interval_count"=>1, "trial_period_days"=>nil, "usage_type"=>"licensed"}, "tiers_mode"=>nil, "transform_quantity"=>nil, "type"=>"recurring", "unit_amount"=>0, "unit_amount_decimal"=>"0"}, "proration"=>false, "quantity"=>1, "subscription"=>"sub_IVlVJWT8VeO174", "subscription_item"=>"si_IVlVymmiYbtBos", "tax_amounts"=>[], "tax_rates"=>[], "type"=>"subscription"}], "has_more"=>false, "total_count"=>1, "url"=>"/v1/invoices/upcoming/lines?customer=cus_IVlUtg5OaBnZMV&subscription=sub_IVlVJWT8VeO174"}, "livemode"=>true, "metadata"=>{}, "next_payment_attempt"=>1614889765, "number"=>nil, "on_behalf_of"=>nil, "paid"=>false, "payment_intent"=>nil, "payment_settings"=>{"payment_method_options"=>nil, "payment_method_types"=>nil}, "period_end"=>1614886165, "period_start"=>1612466965, "post_payment_credit_notes_amount"=>0, "pre_payment_credit_notes_amount"=>0, "receipt_number"=>nil, "starting_balance"=>0, "statement_descriptor"=>nil, "status"=>"draft", "status_transitions"=>{"finalized_at"=>nil, "marked_uncollectible_at"=>nil, "paid_at"=>nil, "voided_at"=>nil}, "subscription"=>"sub_IVlVJWT8VeO174", "subtotal"=>0, "tax"=>nil, "tax_percent"=>nil, "total"=>0, "total_discount_amounts"=>[], "total_tax_amounts"=>[], "transfer_data"=>nil, "webhooks_delivered_at"=>nil}}, "livemode"=>true, "pending_webhooks"=>1, "request"=>{"id"=>nil, "idempotency_key"=>nil}, "type"=>"invoice.upcoming", "webhook"=>{"id"=>"evt_1IOpWdFeP1NdBQ7G3KhUNgjc", "object"=>"event", "api_version"=>"2020-03-02", "created"=>1614281367, "data"=>{"object"=>{"object"=>"invoice", "account_country"=>"US", "account_name"=>"[FILTERED]", "account_tax_ids"=>nil, "amount_due"=>0, "amount_paid"=>0, "amount_remaining"=>0, "application_fee_amount"=>nil, "attempt_count"=>0, "attempted"=>false, "billing_reason"=>"upcoming", "charge"=>nil, "collection_method"=>"charge_automatically", "created"=>1614886165, "currency"=>"usd", "custom_fields"=>nil, "customer"=>"cus_IVlUtg5OaBnZMV", "customer_address"=>nil, "customer_email"=>"[FILTERED]", "customer_name"=>"[FILTERED]", "customer_phone"=>nil, "customer_shipping"=>nil, "customer_tax_exempt"=>"none", "customer_tax_ids"=>[], "default_payment_method"=>nil, "default_source"=>nil, "default_tax_rates"=>[], "description"=>nil, "discount"=>nil, "discounts"=>[], "due_date"=>nil, "ending_balance"=>0, "footer"=>nil, "last_finalization_error"=>nil, "lines"=>{"object"=>"list", "data"=>[{"id"=>"il_tmp_5008b5c7591fe1", "object"=>"line_item", "amount"=>0, "currency"=>"usd", "description"=>"1 × Free (at $0.00 / month)", "discount_amounts"=>[], "discountable"=>true, "discounts"=>[], "livemode"=>true, "metadata"=>{}, "period"=>{"end"=>1617564565, "start"=>1614886165}, "plan"=>{"id"=>"price_1HL8xPFeP1NdBQ7GEYQtpQAJ", "object"=>"plan", "active"=>true, "aggregate_usage"=>nil, "amount"=>0, "amount_decimal"=>"0", "billing_scheme"=>"per_unit", "created"=>1598626415, "currency"=>"usd", "interval"=>"month", "interval_count"=>1, "livemode"=>true, "metadata"=>{}, "nickname"=>"[FILTERED]", "product"=>"prod_HuyvTa17weuKAO", "tiers"=>nil, "tiers_mode"=>nil, "transform_usage"=>nil, "trial_period_days"=>nil, "usage_type"=>"licensed"}, "price"=>{"id"=>"price_1HL8xPFeP1NdBQ7GEYQtpQAJ", "object"=>"price", "active"=>true, "billing_scheme"=>"per_unit", "created"=>1598626415, "currency"=>"usd", "livemode"=>true, "lookup_key"=>nil, "metadata"=>{}, "nickname"=>"[FILTERED]", "product"=>"prod_HuyvTa17weuKAO", "recurring"=>{"aggregate_usage"=>nil, "interval"=>"month", "interval_count"=>1, "trial_period_days"=>nil, "usage_type"=>"licensed"}, "tiers_mode"=>nil, "transform_quantity"=>nil, "type"=>"recurring", "unit_amount"=>0, "unit_amount_decimal"=>"0"}, "proration"=>false, "quantity"=>1, "subscription"=>"sub_IVlVJWT8VeO174", "subscription_item"=>"si_IVlVymmiYbtBos", "tax_amounts"=>[], "tax_rates"=>[], "type"=>"subscription"}], "has_more"=>false, "total_count"=>1, "url"=>"/v1/invoices/upcoming/lines?customer=cus_IVlUtg5OaBnZMV&subscription=sub_IVlVJWT8VeO174"}, "livemode"=>true, "metadata"=>{}, "next_payment_attempt"=>1614889765, "number"=>nil, "on_behalf_of"=>nil, "paid"=>false, "payment_intent"=>nil, "payment_settings"=>{"payment_method_options"=>nil, "payment_method_types"=>nil}, "period_end"=>1614886165, "period_start"=>1612466965, "post_payment_credit_notes_amount"=>0, "pre_payment_credit_notes_amount"=>0, "receipt_number"=>nil, "starting_balance"=>0, "statement_descriptor"=>nil, "status"=>"draft", "status_transitions"=>{"finalized_at"=>nil, "marked_uncollectible_at"=>nil, "paid_at"=>nil, "voided_at"=>nil}, "subscription"=>"sub_IVlVJWT8VeO174", "subtotal"=>0, "tax"=>nil, "tax_percent"=>nil, "total"=>0, "total_discount_amounts"=>[], "total_tax_amounts"=>[], "transfer_data"=>nil, "webhooks_delivered_at"=>nil}}, "livemode"=>true, "pending_webhooks"=>1, "request"=>{"id"=>nil, "idempotency_key"=>nil}, "type"=>"invoice.upcoming"}, "error"=>{"id"=>"evt_1IOpWdFeP1NdBQ7G3KhUNgjc", "object"=>"event", "api_version"=>"2020-03-02", "created"=>1614281367, "data"=>{"object"=>{"object"=>"invoice", "account_country"=>"US", "account_name"=>"[FILTERED]", "account_tax_ids"=>nil, "amount_due"=>0, "amount_paid"=>0, "amount_remaining"=>0, "application_fee_amount"=>nil, "attempt_count"=>0, "attempted"=>false, "billing_reason"=>"upcoming", "charge"=>nil, "collection_method"=>"charge_automatically", "created"=>1614886165, "currency"=>"usd", "custom_fields"=>nil, "customer"=>"cus_IVlUtg5OaBnZMV", "customer_address"=>nil, "customer_email"=>"[FILTERED]", "customer_name"=>"[FILTERED]", "customer_phone"=>nil, "customer_shipping"=>nil, "customer_tax_exempt"=>"none", "customer_tax_ids"=>[], "default_payment_method"=>nil, "default_source"=>nil, "default_tax_rates"=>[], "description"=>nil, "discount"=>nil, "discounts"=>[], "due_date"=>nil, "ending_balance"=>0, "footer"=>nil, "last_finalization_error"=>nil, "lines"=>{"object"=>"list", "data"=>[{"id"=>"il_tmp_5008b5c7591fe1", "object"=>"line_item", "amount"=>0, "currency"=>"usd", "description"=>"1 × Free (at $0.00 / month)", "discount_amounts"=>[], "discountable"=>true, "discounts"=>[], "livemode"=>true, "metadata"=>{}, "period"=>{"end"=>1617564565, "start"=>1614886165}, "plan"=>{"id"=>"price_1HL8xPFeP1NdBQ7GEYQtpQAJ", "object"=>"plan", "active"=>true, "aggregate_usage"=>nil, "amount"=>0, "amount_decimal"=>"0", "billing_scheme"=>"per_unit", "created"=>1598626415, "currency"=>"usd", "interval"=>"month", "interval_count"=>1, "livemode"=>true, "metadata"=>{}, "nickname"=>"[FILTERED]", "product"=>"prod_HuyvTa17weuKAO", "tiers"=>nil, "tiers_mode"=>nil, "transform_usage"=>nil, "trial_period_days"=>nil, "usage_type"=>"licensed"}, "price"=>{"id"=>"price_1HL8xPFeP1NdBQ7GEYQtpQAJ", "object"=>"price", "active"=>true, "billing_scheme"=>"per_unit", "created"=>1598626415, "currency"=>"usd", "livemode"=>true, "lookup_key"=>nil, "metadata"=>{}, "nickname"=>"[FILTERED]", "product"=>"prod_HuyvTa17weuKAO", "recurring"=>{"aggregate_usage"=>nil, "interval"=>"month", "interval_count"=>1, "trial_period_days"=>nil, "usage_type"=>"licensed"}, "tiers_mode"=>nil, "transform_quantity"=>nil, "type"=>"recurring", "unit_amount"=>0, "unit_amount_decimal"=>"0"}, "proration"=>false, "quantity"=>1, "subscription"=>"sub_IVlVJWT8VeO174", "subscription_item"=>"si_IVlVymmiYbtBos", "tax_amounts"=>[], "tax_rates"=>[], "type"=>"subscription"}], "has_more"=>false, "total_count"=>1, "url"=>"/v1/invoices/upcoming/lines?customer=cus_IVlUtg5OaBnZMV&subscription=sub_IVlVJWT8VeO174"}, "livemode"=>true, "metadata"=>{}, "next_payment_attempt"=>1614889765, "number"=>nil, "on_behalf_of"=>nil, "paid"=>false, "payment_intent"=>nil, "payment_settings"=>{"payment_method_options"=>nil, "payment_method_types"=>nil}, "period_end"=>1614886165, "period_start"=>1612466965, "post_payment_credit_notes_amount"=>0, "pre_payment_credit_notes_amount"=>0, "receipt_number"=>nil, "starting_balance"=>0, "st2021-02-27T15:26:06.943335+00:00 app[web.1]: atement_descriptor"=>nil, "status"=>"draft", "status_transitions"=>{"finalized_at"=>nil, "marked_uncollectible_at"=>nil, "paid_at"=>nil, "voided_at"=>nil}, "subscription"=>"sub_IVlVJWT8VeO174", "subtotal"=>0, "tax"=>nil, "tax_percent"=>nil, "total"=>0, "total_discount_amounts"=>[], "total_tax_amounts"=>[], "transfer_data"=>nil, "webhooks_delivered_at"=>nil}}, "livemode"=>true, "pending_webhooks"=>1, "request"=>{"id"=>nil, "idempotency_key"=>nil}, "type"=>"invoice.upcoming", "webhook"=>{"id"=>"evt_1IOpWdFeP1NdBQ7G3KhUNgjc", "object"=>"event", "api_version"=>"2020-03-02", "created"=>1614281367, "data"=>{"object"=>{"object"=>"invoice", "account_country"=>"US", "account_name"=>"[FILTERED]", "account_tax_ids"=>nil, "amount_due"=>0, "amount_paid"=>0, "amount_remaining"=>0, "application_fee_amount"=>nil, "attempt_count"=>0, "attempted"=>false, "billing_reason"=>"upcoming", "charge"=>nil, "collection_method"=>"charge_automatically", "created"=>1614886165, "currency"=>"usd", "custom_fields"=>nil, "customer"=>"cus_IVlUtg5OaBnZMV", "customer_address"=>nil, "customer_email"=>"[FILTERED]", "customer_name"=>"[FILTERED]", "customer_phone"=>nil, "customer_shipping"=>nil, "customer_tax_exempt"=>"none", "customer_tax_ids"=>[], "default_payment_method"=>nil, "default_source"=>nil, "default_tax_rates"=>[], "description"=>nil, "discount"=>nil, "discounts"=>[], "due_date"=>nil, "ending_balance"=>0, "footer"=>nil, "last_finalization_error"=>nil, "lines"=>{"object"=>"list", "data"=>[{"id"=>"il_tmp_5008b5c7591fe1", "object"=>"line_item", "amount"=>0, "currency"=>"usd", "description"=>"1 × Free (at $0.00 / month)", "discount_amounts"=>[], "discountable"=>true, "discounts"=>[], "livemode"=>true, "metadata"=>{}, "period"=>{"end"=>1617564565, "start"=>1614886165}, "plan"=>{"id"=>"price_1HL8xPFeP1NdBQ7GEYQtpQAJ", "object"=>"plan", "active"=>true, "aggregate_usage"=>nil, "amount"=>0, "amount_decimal"=>"0", "billing_scheme"=>"per_unit", "created"=>1598626415, "currency"=>"usd", "interval"=>"month", "interval_count"=>1, "livemode"=>true, "metadata"=>{}, "nickname"=>"[FILTERED]", "product"=>"prod_HuyvTa17weuKAO", "tiers"=>nil, "tiers_mode"=>nil, "transform_usage"=>nil, "trial_period_days"=>nil, "usage_type"=>"licensed"}, "price"=>{"id"=>"price_1HL8xPFeP1NdBQ7GEYQtpQAJ", "object"=>"price", "active"=>true, "billing_scheme"=>"per_unit", "created"=>1598626415, "currency"=>"usd", "livemode"=>true, "lookup_key"=>nil, "metadata"=>{}, "nickname"=>"[FILTERED]", "product"=>"prod_HuyvTa17weuKAO", "recurring"=>{"aggregate_usage"=>nil, "interval"=>"month", "interval_count"=>1, "trial_period_days"=>nil, "usage_type"=>"licensed"}, "tiers_mode"=>nil, "transform_quantity"=>nil, "type"=>"recurring", "unit_amount"=>0, "unit_amount_decimal"=>"0"}, "proration"=>false, "quantity"=>1, "subscription"=>"sub_IVlVJWT8VeO174", "subscription_item"=>"si_IVlVymmiYbtBos", "tax_amounts"=>[], "tax_rates"=>[], "type"=>"subscription"}], "has_more"=>false, "total_count"=>1, "url"=>"/v1/invoices/upcoming/lines?customer=cus_IVlUtg5OaBnZMV&subscription=sub_IVlVJWT8VeO174"}, "livemode"=>true, "metadata"=>{}, "next_payment_attempt"=>1614889765, "number"=>nil, "on_behalf_of"=>nil, "paid"=>false, "payment_intent"=>nil, "payment_settings"=>{"payment_method_options"=>nil, "payment_method_types"=>nil}, "period_end"=>1614886165, "period_start"=>1612466965, "post_payment_credit_notes_amount"=>0, "pre_payment_credit_notes_amount"=>0, "receipt_number"=>nil, "starting_balance"=>0, "statement_descriptor"=>nil, "status"=>"draft", "status_transitions"=>{"finalized_at"=>nil, "marked_uncollectible_at"=>nil, "paid_at"=>nil, "voided_at"=>nil}, "subscription"=>"sub_IVlVJWT8VeO174", "subtotal"=>0, "tax"=>nil, "tax_percent"=>nil, "total"=>0, "total_discount_amounts"=>[], "total_tax_amounts"=>[], "transfer_data"=>nil, "webhooks_delivered_at"=>nil}}, "livemode"=>true, "pending_webhooks"=>1, "request"=>{"id"=>nil, "idempotency_key"=>nil}, "type"=>"invoice.upcoming"}}}

2021-02-27T15:26:06.953702+00:00 app[web.1]: W, [2021-02-27T15:26:06.953589 #4] WARN -- : [770a7e9d-50ca-4f86-82f5-42c81ef65f03] Can't verify CSRF token authenticity.2021-02-27T15:26:06.957016+00:00 app[web.1]: I, [2021-02-27T15:26:06.956940 #4] INFO -- : [770a7e9d-50ca-4f86-82f5-42c81ef65f03] Completed 422 Unprocessable Entity in 9ms (ActiveRecord: 0.0ms | Allocations: 968)2021-02-27T15:26:06.957119+00:00 app[web.1]: Error during failsafe response: ActionController::InvalidAuthenticityToken2021-02-27T15:26:06.957120+00:00 app[web.1]: /app/vendor/bundle/ruby/2.7.0/gems/actionpack-6.0.3.4/lib/action_controller/metal/request_forgery_protection.rb:215:in `handle_unverified_request'2021-02-27T15:26:06.957121+00:00 app[web.1]: /app/vendor/bundle/ruby/2.7.0/gems/actionpack-6.0.3.4/lib/action_controller/metal/request_forgery_protection.rb:247:in `handle_unverified_request'2021-02-27T15:26:06.957121+00:00 app[web.1]: /app/vendor/bundle/ruby/2.7.0/gems/devise-4.7.3/lib/devise/controllers/helpers.rb:255:in `handle_unverified_request'2021-02-27T15:26:06.957122+00:00 app[web.1]: /app/vendor/bundle/ruby/2.7.0/gems/actionpack-6.0.3.4/lib/action_controller/metal/request_forgery_protection.rb:242:in `verify_authenticity_token'2021-02-27T15:26:06.957122+00:00 app[web.1]: /app/vendor/bundle/ruby/2.7.0/gems/activesupport-6.0.3.4/lib/active_support/callbacks.rb:428:in `block in make_lambda'2021-02-27T15:26:06.957123+00:00 app[web.1]: /app/vendor/bundle/ruby/2.7.0/gems/activesupport-6.0.3.4/lib/active_support/callbacks.rb:200:in `block (2 levels) in halting'2021-02-27T15:26:06.957124+00:00 app[web.1]: /app/vendor/bundle/ruby/2.7.0/gems/actionpack-6.0.3.4/lib/abstract_controller/callbacks.rb:34:in `block (2 levels) in <module:Callbacks>'2021-02-27T15:26:06.957124+00:00 app[web.1]: /app/vendor/bundle/ruby/2.7.0/gems/activesupport-6.0.3.4/lib/active_support/callbacks.rb:201:in `block in halting'2021-02-27T15:26:06.957124+00:00 app[web.1]: /app/vendor/bundle/ruby/2.7.0/gems/activesupport-6.0.3.4/lib/active_support/callbacks.rb:513:in `block in invoke_before'2021-02-27T15:26:06.957126+00:00 app[web.1]: /app/vendor/bundle/ruby/2.7.0/gems/activesupport-6.0.3.4/lib/active_support/callbacks.rb:513:in `each'2021-02-27T15:26:06.957126+00:00 app[web.1]: /app/vendor/bundle/ruby/2.7.0/gems/activesupport-6.0.3.4/lib/active_support/callbacks.rb:513:in `invoke_before'2021-02-27T15:26:06.957126+00:00 app[web.1]: /app/vendor/bundle/ruby/2.7.0/gems/activesupport-6.0.3.4/lib/active_support/callbacks.rb:134:in `run_callbacks'2021-02-27T15:26:06.957127+00:00 app[web.1]: /app/vendor/bundle/ruby/2.7.0/gems/actionpack-6.0.3.4/lib/abstract_controller/callbacks.rb:41:in `process_action'2021-02-27T15:26:06.957127+00:00 app[web.1]: /app/vendor/bundle/ruby/2.7.0/gems/actionpack-6.0.3.4/lib/action_controller/metal/rescue.rb:22:in `process_action'2021-02-27T15:26:06.957128+00:00 app[web.1]: /app/vendor/bundle/ruby/2.7.0/gems/actionpack-6.0.3.4/lib/action_controller/metal/instrumentation.rb:33:in `block in process_action'2021-02-27T15:26:06.957128+00:00 app[web.1]: /app/vendor/bundle/ruby/2.7.0/gems/activesupport-6.0.3.4/lib/active_support/notifications.rb:180:in `block in instrument'2021-02-27T15:26:06.957129+00:00 app[web.1]: /app/vendor/bundle/ruby/2.7.0/gems/activesupport-6.0.3.4/lib/active_support/notifications/instrumenter.rb:24:in `instrument'2021-02-27T15:26:06.957129+00:00 app[web.1]: /app/vendor/bundle/ruby/2.7.0/gems/activesupport-6.0.3.4/lib/active_support/notifications.rb:180:in `instrument'2021-02-27T15:26:06.957129+00:00 app[web.1]: /app/vendor/bundle/ruby/2.7.0/gems/actionpack-6.0.3.4/lib/action_controller/metal/instrumentation.rb:32:in `process_action'2021-02-27T15:26:06.957130+00:00 app[web.1]: /app/vendor/bundle/ruby/2.7.0/gems/actionpack-6.0.3.4/lib/action_controller/metal/params_wrapper.rb:245:in `process_action'2021-02-27T15:26:06.957130+00:00 app[web.1]: /app/vendor/bundle/ruby/2.7.0/gems/activerecord-6.0.3.4/lib/active_record/railties/controller_runtime.rb:27:in `process_action'2021-02-27T15:26:06.957131+00:00 app[web.1]: /app/vendor/bundle/ruby/2.7.0/gems/actionpack-6.0.3.4/lib/abstract_controller/base.rb:136:in `process'2021-02-27T15:26:06.957131+00:00 app[web.1]: /app/vendor/bundle/ruby/2.7.0/gems/actionview-6.0.3.4/lib/action_view/rendering.rb:39:in `process'2021-02-27T15:26:06.957131+00:00 app[web.1]: /app/vendor/bundle/ruby/2.7.0/gems/actionpack-6.0.3.4/lib/action_controller/metal.rb:190:in `dispatch'2021-02-27T15:26:06.957132+00:00 app[web.1]: /app/vendor/bundle/ruby/2.7.0/gems/actionpack-6.0.3.4/lib/action_controller/metal.rb:254:in `dispatch'2021-02-27T15:26:06.957132+00:00 app[web.1]: /app/vendor/bundle/ruby/2.7.0/gems/actionpack-6.0.3.4/lib/action_dispatch/routing/route_set.rb:50:in `dispatch'2021-02-27T15:26:06.957133+00:00 app[web.1]: /app/vendor/bundle/ruby/2.7.0/gems/actionpack-6.0.3.4/lib/action_dispatch/routing/route_set.rb:33:in `serve'2021-02-27T15:26:06.957133+00:00 app[web.1]: /app/vendor/bundle/ruby/2.7.0/gems/actionpack-6.0.3.4/lib/action_dispatch/journey/router.rb:49:in `block in serve'2021-02-27T15:26:06.957133+00:00 app[web.1]: /app/vendor/bundle/ruby/2.7.0/gems/actionpack-6.0.3.4/lib/action_dispatch/journey/router.rb:32:in `each'2021-02-27T15:26:06.957134+00:00 app[web.1]: /app/vendor/bundle/ruby/2.7.0/gems/actionpack-6.0.3.4/lib/action_dispatch/journey/router.rb:32:in `serve'2021-02-27T15:26:06.957134+00:00 app[web.1]: /app/vendor/bundle/ruby/2.7.0/gems/actionpack-6.0.3.4/lib/action_dispatch/routing/route_set.rb:834:in `call'2021-02-27T15:26:06.957135+00:00 app[web.1]: /app/vendor/bundle/ruby/2.7.0/gems/actionpack-6.0.3.4/lib/action_dispatch/middleware/show_exceptions.rb:50:in `render_exception'2021-02-27T15:26:06.957135+00:00 app[web.1]: /app/vendor/bundle/ruby/2.7.0/gems/actionpack-6.0.3.4/lib/action_dispatch/middleware/show_exceptions.rb:36:in `rescue in call'2021-02-27T15:26:06.957141+00:00 app[web.1]: /app/vendor/bundle/ruby/2.7.0/gems/actionpack-6.0.3.4/lib/action_dispatch/middleware/show_exceptions.rb:31:in `call'2021-02-27T15:26:06.957141+00:00 app[web.1]: /app/vendor/bundle/ruby/2.7.0/gems/turbolinks_render-0.9.20/lib/turbolinks_render/middleware.rb:81:in `call'2021-02-27T15:26:06.957142+00:00 app[web.1]: /app/vendor/bundle/ruby/2.7.0/gems/railties-6.0.3.4/lib/rails/rack/logger.rb:37:in `call_app'2021-02-27T15:26:06.957143+00:00 app[web.1]: /app/vendor/bundle/ruby/2.7.0/gems/railties-6.0.3.4/lib/rails/rack/logger.rb:26:in `block in call'2021-02-27T15:26:06.957143+00:00 app[web.1]: /app/vendor/bundle/ruby/2.7.0/gems/activesupport-6.0.3.4/lib/active_support/tagged_logging.rb:80:in `block in tagged'2021-02-27T15:26:06.957143+00:00 app[web.1]: /app/vendor/bundle/ruby/2.7.0/gems/activesupport-6.0.3.4/lib/active_support/tagged_logging.rb:28:in `tagged'2021-02-27T15:26:06.957144+00:00 app[web.1]: /app/vendor/bundle/ruby/2.7.0/gems/activesupport-6.0.3.4/lib/active_support/tagged_logging.rb:80:in `tagged'2021-02-27T15:26:06.957144+00:00 app[web.1]: /app/vendor/bundle/ruby/2.7.0/gems/railties-6.0.3.4/lib/rails/rack/logger.rb:26:in `call'2021-02-27T15:26:06.957145+00:00 app[web.1]: /app/vendor/bundle/ruby/2.7.0/gems/actionpack-6.0.3.4/lib/action_dispatch/middleware/remote_ip.rb:81:in `call'2021-02-27T15:26:06.957145+00:00 app[web.1]: /app/vendor/bundle/ruby/2.7.0/gems/request_store-1.5.0/lib/request_store/middleware.rb:19:in `call'2021-02-27T15:26:06.957146+00:00 app[web.1]: /app/vendor/bundle/ruby/2.7.0/gems/actionpack-6.0.3.4/lib/action_dispatch/middleware/request_id.rb:27:in `call'2021-02-27T15:26:06.957146+00:00 app[web.1]: /app/vendor/bundle/ruby/2.7.0/gems/rack-2.2.3/lib/rack/method_override.rb:24:in `call'2021-02-27T15:26:06.957146+00:00 app[web.1]: /app/vendor/bundle/ruby/2.7.0/gems/rack-2.2.3/lib/rack/runtime.rb:22:in `call'2021-02-27T15:26:06.957147+00:00 app[web.1]: /app/vendor/bundle/ruby/2.7.0/gems/activesupport-6.0.3.4/lib/active_support/cache/strategy/local_cache_middleware.rb:29:in `call'2021-02-27T15:26:06.957147+00:00 app[web.1]: /app/vendor/bundle/ruby/2.7.0/gems/actionpack-6.0.3.4/lib/action_dispatch/middleware/executor.rb:14:in `call'2021-02-27T15:26:06.957148+00:00 app[web.1]: /app/vendor/bundle/ruby/2.7.0/gems/actionpack-6.0.3.4/lib/action_dispatch/middleware/static.rb:126:in `call'2021-02-27T15:26:06.957148+00:00 app[web.1]: /app/vendor/bundle/ruby/2.7.0/gems/rack-2.2.3/lib/rack/sendfile.rb:110:in `call'2021-02-27T15:26:06.957148+00:00 app[web.1]: /app/vendor/bundle/ruby/2.7.0/gems/actionpack-6.0.3.4/lib/action_dispatch/middleware/host_authorization.rb:76:in `call'2021-02-27T15:26:06.957149+00:00 app[web.1]: /app/vendor/bundle/ruby/2.7.0/gems/railties-6.0.3.4/lib/rails/engine.rb:527:in `call'2021-02-27T15:26:06.957149+00:00 app[web.1]: /app/vendor/bundle/ruby/2.7.0/gems/puma-4.3.6/lib/puma/configuration.rb:228:in `call'2021-02-27T15:26:06.957150+00:00 app[web.1]: /app/vendor/bundle/ruby/2.7.0/gems/puma-4.3.6/lib/puma/server.rb:713:in `handle_request'2021-02-27T15:26:06.957150+00:00 app[web.1]: /app/vendor/bundle/ruby/2.7.0/gems/puma-4.3.6/lib/puma/server.rb:472:in `process_client'2021-02-27T15:26:06.957150+00:00 app[web.1]: /app/vendor/bundle/ruby/2.7.0/gems/puma-4.3.6/lib/puma/server.rb:328:in `block in run'2021-02-27T15:26:06.957151+00:00 app[web.1]: /app/vendor/bundle/ruby/2.7.0/gems/puma-4.3.6/lib/puma/thread_pool.rb:134:in `block in spawn_thread'2021-02-27T15:26:06.959101+00:00 heroku[router]: at=info method=POST path="/webhooks/stripe" host=www.entitycloud.io request_id=770a7e9d-50ca-4f86-82f5-42c81ef65f03 fwd="54.187.216.72" dyno=web.1 connect=0ms service=119ms status=500 bytes=377 protocol=https
Jason Ackerman
So the answer here was that I needed to change subscription.stripe_id to subscription.processor_id in stripe.rb. Chris had already fixed this in the Jumpstart repo, but if anyone else has this issue and hasn't been pulling down all of the updates, hopefully this helps you!
John Joubert
Jason Ackerman  huge thanks for posting this! This helped me a ton!
Notifications
You’re not receiving notifications from this thread.