diff --git a/TODO b/TODO index efe1c57dd9..99bcd50298 100644 --- a/TODO +++ b/TODO @@ -18,6 +18,8 @@ - If subscription is created and terminated on the same day, cancel is used - Duplicate price metadata - Auto-archived price metadata +- Prices which are not created directly from pricebooks (i.e. from order lines, or duplicated because of the one-price-per-subscription) are archived (active = false) after they are used +- Prices which are duplicated because of the one-price-per-subscription) have a special metadata key (salesforce_duplicate = true) Next: diff --git a/config/application.rb b/config/application.rb index f41f579232..b487be5a89 100644 --- a/config/application.rb +++ b/config/application.rb @@ -65,6 +65,14 @@ class Application < Rails::Application # NOTE lograge doesn't include params by default, we need to manually include them here custom_params = {"params" => event.payload[:params].except('controller', 'action')} + # stripe webhooks are very noisy and gobble up a ton of log space + if event.payload[:params]['controller'] == 'stripe_webhook' && event.payload[:params]['action'] == 'stripe_webhook' + custom_params = {"params" => { + "stripe_event_id" => event.payload[:params]['id'], + "stripe_resource_id" => event.payload[:params].dig('data', 'object', 'id'), + }} + end + # include headers which identify which account and other details the request is coming from= SALESFORCE_HEADERS.each {|h| custom_params[h] = event.payload[:request].headers[h] }