permit stripe token and amount

This commit is contained in:
Rimian Perkins 2017-05-18 10:46:11 +10:00
parent cb03671c19
commit c091676cb5
3 changed files with 3 additions and 4 deletions

View File

@ -7,7 +7,7 @@ module DiscourseDonations
skip_before_filter :verify_authenticity_token, only: [:create]
def create
params.permit(:name, :username, :email, :password)
params.permit(:name, :username, :email, :password, :stripeToken, :amount)
output = { 'messages' => [], 'rewards' => [] }

View File

@ -66,8 +66,7 @@ export default Ember.Component.extend({
stripeToken: data.token.id,
amount: self.get('amount') * 100,
email: self.get('email'),
username: self.get('username'),
create_account: this.get('create_accounts')
username: self.get('username')
};
if(!self.get('paymentSuccess')) {

View File

@ -24,7 +24,7 @@ module DiscourseDonations
end
it 'whitelists the params' do
params = { email: 'email@example.com', password: 'secret', username: 'mr-pink', name: 'kirsten' }
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)
end