Skip to content
This repository has been archived by the owner on May 26, 2024. It is now read-only.

Commit

Permalink
Merge pull request #8 from affinity/hamsinibhoomi/update_subscription…
Browse files Browse the repository at this point in the history
…s_to_allow_new_parameter

Adding allowed parameter for subscription
  • Loading branch information
hamsinibhoomi authored Nov 29, 2023
2 parents 5a0b41f + 8e7b4e1 commit 30b4094
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/stripe_mock/request_handlers/subscriptions.rb
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ def create_subscription(route, method_url, params, headers)
customer[:default_source] = new_card[:id]
end

allowed_params = %w(customer application_fee_percent coupon items metadata plan quantity source tax_percent trial_end trial_period_days current_period_start created prorate billing_cycle_anchor billing days_until_due idempotency_key enable_incomplete_payments cancel_at_period_end default_tax_rates payment_behavior pending_invoice_item_interval default_payment_method collection_method off_session trial_from_plan proration_behavior backdate_start_date transfer_data expand automatic_tax)
allowed_params = %w(customer application_fee_percent coupon items metadata plan quantity source tax_percent trial_end trial_period_days current_period_start created prorate billing_cycle_anchor billing days_until_due idempotency_key enable_incomplete_payments cancel_at_period_end default_tax_rates payment_behavior pending_invoice_item_interval default_payment_method collection_method off_session trial_from_plan proration_behavior backdate_start_date transfer_data expand automatic_tax pay_immediately)
unknown_params = params.keys - allowed_params.map(&:to_sym)
if unknown_params.length > 0
raise Stripe::InvalidRequestError.new("Received unknown parameter: #{unknown_params.join}", unknown_params.first.to_s, http_status: 400)
Expand Down

0 comments on commit 30b4094

Please sign in to comment.