permit stripe token and amount
This commit is contained in:
parent
cb03671c19
commit
c091676cb5
|
@ -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' => [] }
|
||||
|
||||
|
|
|
@ -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')) {
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
Loading…
Reference in New Issue