diff --git a/app/controllers/discourse_donations/charges_controller.rb b/app/controllers/discourse_donations/charges_controller.rb index 9efc1a9..714c325 100644 --- a/app/controllers/discourse_donations/charges_controller.rb +++ b/app/controllers/discourse_donations/charges_controller.rb @@ -7,7 +7,7 @@ module DiscourseDonations skip_before_filter :verify_authenticity_token, only: [:create] def create - params.permit(:name, :username, :email, :password, :stripeToken, :amount) + params.permit(:name, :username, :email, :password, :stripeToken, :amount, :create_account) output = { 'messages' => [], 'rewards' => [] } diff --git a/plugin.rb b/plugin.rb index a0a3a44..e32812c 100644 --- a/plugin.rb +++ b/plugin.rb @@ -1,6 +1,6 @@ # name: discourse-donations # about: Integrating Discourse with Stripe for donations -# version: 1.10.0 +# version: 1.10.1 # url: https://github.com/choiceaustralia/discourse-donations # authors: Rimian Perkins diff --git a/spec/controllers/discourse_donations/charges_controller_spec.rb b/spec/controllers/discourse_donations/charges_controller_spec.rb index 1b981cf..c69b1d6 100644 --- a/spec/controllers/discourse_donations/charges_controller_spec.rb +++ b/spec/controllers/discourse_donations/charges_controller_spec.rb @@ -24,8 +24,8 @@ module DiscourseDonations end it 'whitelists the params' do - params = { email: 'email@example.com', password: 'secret', username: 'mr-pink', name: 'kirsten', amount: 100, stripeToken: 'rrurrrurrrrr' } - should permit(:name, :username, :email, :password).for(:create, params: params) + params = { create_account: 'true', email: 'email@example.com', password: 'secret', username: 'mr-pink', name: 'kirsten', amount: 100, stripeToken: 'rrurrrurrrrr' } + should permit(:name, :username, :email, :password, :create_account).for(:create, params: params) end it 'responds ok for anonymous users' do