iugusdk 1.0.0.alpha.21 → 1.0.0.alpha.22

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (31) hide show
  1. data/app/assets/stylesheets/iugu-sdk.css.sass +9 -1
  2. data/app/assets/stylesheets/settings.sass +13 -1
  3. data/app/controllers/iugu/account_controller.rb +58 -8
  4. data/app/controllers/iugu/invitations_controller.rb +5 -7
  5. data/app/controllers/iugu/plan_controller.rb +4 -3
  6. data/app/controllers/iugu/pricing_controller.rb +1 -1
  7. data/app/controllers/iugu/registrations_controller.rb +8 -1
  8. data/app/controllers/iugu/sessions_controller.rb +10 -2
  9. data/app/mailers/iugu_mailer.rb +4 -4
  10. data/app/models/account.rb +37 -0
  11. data/app/models/user.rb +24 -9
  12. data/app/models/user_invitation.rb +2 -0
  13. data/app/views/iugu/account/payment_history.html.haml +10 -2
  14. data/app/views/iugu/account_domains/index.html.haml +49 -31
  15. data/app/views/iugu/account_domains/instructions.html.haml +24 -5
  16. data/app/views/iugu/account_roles/edit.html.haml +22 -10
  17. data/app/views/iugu/account_users/index.html.haml +33 -20
  18. data/app/views/iugu/invitations/edit.html.haml +6 -1
  19. data/app/views/iugu/invitations/new.html.haml +21 -15
  20. data/app/views/iugu/plan/index.html.haml +14 -7
  21. data/app/views/iugu/registrations/new.html.haml +2 -0
  22. data/app/views/iugu/sessions/new.html.haml +2 -0
  23. data/app/views/iugu/settings/account.html.haml +61 -29
  24. data/app/views/iugu/settings/accounts.html.haml +21 -25
  25. data/config/locales/iugu.en.yml +20 -0
  26. data/config/locales/iugu.pt-BR.yml +21 -1
  27. data/config/routes.rb +3 -0
  28. data/db/migrate/20130723173704_add_used_to_user_invitation.rb +5 -0
  29. data/lib/iugusdk/version.rb +1 -1
  30. data/lib/iugusdk.rb +1 -1
  31. metadata +99 -87
@@ -1,25 +1,38 @@
1
1
  - content_for :title do "Account Users" end
2
2
 
3
- - @account_users.each do |account_user|
4
- %div
5
- - if account_user.user.name.blank?
6
- = account_user.user.email
7
- - else
8
- = account_user.user.name
9
- - if current_user.is?(:owner, @account) || current_user.is?(:admin, @account)
10
- |
11
- = link_to I18n.t("iugu.permissions"), account_roles_edit_path(@account, :user_id => account_user.user)
12
- - unless account_user.destroying?
13
- - unless account_user.is?(:owner) || account_user.user_id == current_user.id
14
- |
15
- = link_to I18n.t("iugu.remove"), account_users_destroy_path(@account, :user_id => account_user.user), :method => 'delete'
16
- - else
17
- |
18
- - if IuguSDK::delay_account_user_exclusion == 0
19
- = I18n.t("iugu.removing")
20
- - else
21
- = link_to I18n.t("iugu.undo"), account_users_cancel_destruction_path(@account, :user_id => account_user.user), :method => 'delete'
3
+ %h3
4
+ Usuários
5
+
6
+ %table.table
7
+ %thead
8
+ %tr
9
+ %th
10
+ Usuário
11
+ %th
12
+ %tbody
13
+ - @account_users.each do |account_user|
14
+ %tr
15
+ %td
16
+ - if account_user.user.name.blank?
17
+ = account_user.user.email
18
+ - else
19
+ = account_user.user.name
20
+ %td
21
+ - if current_user.is?(:owner, @account) || current_user.is?(:admin, @account)
22
+ = link_to I18n.t("iugu.permissions"), account_roles_edit_path(@account, :user_id => account_user.user), :class => "button small no-bottom-margin"
23
+ - unless account_user.destroying?
24
+ - unless account_user.is?(:owner) || account_user.user_id == current_user.id
25
+ |
26
+ = link_to I18n.t("iugu.remove"), account_users_destroy_path(@account, :user_id => account_user.user), :method => 'delete', :class => "button small no-bottom-margin"
27
+ - else
28
+ |
29
+ - if IuguSDK::delay_account_user_exclusion == 0
30
+ = I18n.t("iugu.removing")
31
+ - else
32
+ = link_to I18n.t("iugu.undo"), account_users_cancel_destruction_path(@account, :user_id => account_user.user), :method => 'delete', :class => "button small no-bottom-margin"
22
33
 
23
34
  - if current_user.is?(:owner, @account) || current_user.is?(:admin, @account)
24
35
  %div
25
- = link_to I18n.t("iugu.invite"), new_invite_path(@account)
36
+ = link_to I18n.t("iugu.invite"), new_invite_path(@account), :class => "button full-width"
37
+
38
+ = link_to I18n.t("iugu.back"), account_view_path(id: params[:account_id]), class: "button no-bottom-margin"
@@ -5,4 +5,9 @@
5
5
  = I18n.t("iugu.account")
6
6
  = @user_invitation.account.id.to_s
7
7
  %div
8
- = link_to I18n.t("iugu.accept"), update_invite_path(:invitation_token => @user_invitation.id.to_s + @user_invitation.token), :method => :post
8
+ - if current_user
9
+ = link_to I18n.t("iugu.accept"), update_invite_path(:invitation_token => @user_invitation.id.to_s + @user_invitation.token), :method => :post
10
+ - else
11
+ Você não está logado!
12
+ = link_to "Já tenho conta", new_user_session_path(invitation_token: @user_invitation.id.to_s + @user_invitation.token)
13
+ = link_to "Criar conta", new_user_registration_path(invitation_token: @user_invitation.id.to_s + @user_invitation.token)
@@ -1,27 +1,33 @@
1
+ %h3
2
+ Convidar um usuário
3
+
1
4
  = simple_form_for @user_invitation, :url => create_invite_path(@account.id), :method => :post do |f|
2
5
  - if @user_invitation.errors.any?
3
- #error_explanation{ :style => "margin-bottom: 15px" }
6
+ .notice.notice-red{ :style => "margin-bottom: 15px" }
4
7
  %ul
5
8
  - @user_invitation.errors.full_messages.each do |msg|
6
9
  %li
7
10
  = msg
8
11
 
9
12
  %div
10
- = f.label :email
11
- = f.email_field :email
12
- - if current_user.is?(:owner, @account)
13
- - APP_ROLES['roles'].each do |role|
14
- %div
15
- = check_box_tag "user_invitation[roles][]", role, false, :id => "#{role}_checkbox"
16
- = label_tag "#{role}_checkbox", I18n.t("iugu.#{role}")
17
-
18
- - elsif current_user.is?(:admin, @account)
19
- - APP_ROLES['roles'].each do |role|
20
- - unless role == APP_ROLES['owner_role'] || role == APP_ROLES['admin_role']
21
- %div
13
+ = f.email_field :email, :placeholder => "e-mail", :class => "full-width"
14
+ %div{ :style => "padding-top:20px;padding-bottom:10px" }
15
+ %h4
16
+ Permissões
17
+ - if current_user.is?(:owner, @account)
18
+ - APP_ROLES['roles'].each do |role|
19
+ %div{ :style => "margin-bottom: 5px" }
22
20
  = check_box_tag "user_invitation[roles][]", role, false, :id => "#{role}_checkbox"
23
21
  = label_tag "#{role}_checkbox", I18n.t("iugu.#{role}")
24
22
 
25
- %div
26
- = f.submit I18n.t("iugu.invite")
23
+ - elsif current_user.is?(:admin, @account)
24
+ - APP_ROLES['roles'].each do |role|
25
+ - unless role == APP_ROLES['owner_role'] || role == APP_ROLES['admin_role']
26
+ %div{ :style => "margin-bottom: 5px" }
27
+ = check_box_tag "user_invitation[roles][]", role, false, :id => "#{role}_checkbox"
28
+ = label_tag "#{role}_checkbox", I18n.t("iugu.#{role}")
29
+
30
+ %div{ :style => "margin-top: 10px" }
31
+ = f.submit I18n.t("iugu.invite"), :class => "button full-width"
27
32
 
33
+ = link_to I18n.t("iugu.back"), account_users_index_path(account_id: params[:account_id]), class: "button no-bottom-margin"
@@ -1,25 +1,32 @@
1
- = I18n.t "iugu.available_plans"
2
- %br
3
- %br
1
+ %h3
2
+ = I18n.t "iugu.available_plans"
3
+
4
4
  %table
5
5
  %tr
6
6
  %th
7
7
  = I18n.t "iugu.plan"
8
8
  %th
9
9
  = "#{I18n.t("iugu.price")} (#{@currency})"
10
+ %th
11
+ = I18n.t "iugu.duration"
10
12
  %th
11
13
  - @plans.reverse.each do |plan|
12
- %tr
14
+ %tr{ :class => "#{ (plan.identifier == @subscription.plan_identifier) ? 'plan active_plan' : 'plan' }" }
13
15
  %td
14
16
  = plan.name
15
17
  %td
16
18
  - price = plan.price_by_currency @currency
17
- = price.value_cents
19
+ = Money.new(price.value_cents, @currency).format
18
20
  %td
21
+ = "#{plan.interval} #{I18n.t("iugu.interval_type." + (plan.interval == 1 ? plan.interval_type.singularize : plan.interval_type))}"
22
+ %td{ :style => "text-align:center" }
19
23
  - if plan.identifier == @subscription.plan_identifier
20
- = I18n.t "iugu.your_plan"
24
+ %strong
25
+ = I18n.t "iugu.your_plan"
21
26
  - else
22
27
  - text = "iugu.change_plan"
23
28
  - text = "iugu.upgrade" if price.value_cents > @subscription.price_cents
24
29
  - text = "iugu.downgrade" if price.value_cents < @subscription.price_cents
25
- = link_to(I18n.t(text), plan_change_url(id: @account.id.to_param, plan: plan.identifier), method: :post)
30
+ = link_to(I18n.t(text), plan_change_url(id: @account.id.to_param, plan: plan.identifier), method: :post, :class => "button no-bottom-margin")
31
+
32
+ = link_to I18n.t("iugu.back"), account_view_path(id: params[:id]), class: "button no-bottom-margin"
@@ -33,6 +33,8 @@
33
33
  = f.input :account_alias, :label => 'Alias'
34
34
  = render :partial => "iugu/shared/signup_fields", :locals => {:f => f}
35
35
  = f.hidden_field :locale, :value => @matched_locale_from_browser
36
+ - if params[:invitation_token].blank?
37
+ = f.hidden_field :user_invitation, :value => params[:invitation_token].blank?
36
38
  - if IuguSDK::enable_subscription_features
37
39
  = f.hidden_field :plan_identifier, value: @plan_identifier
38
40
  = f.hidden_field :currency, value: @currency
@@ -24,6 +24,8 @@
24
24
 
25
25
  = f.input :password, :required => false, :placeholder => I18n.t("activerecord.attributes.password"), :label => false
26
26
  // = f.input :remember_me, :as => :boolean, :label => I18n.t("activerecord.attributes.remember_me") if devise_mapping.rememberable?
27
+ - if !params[:invitation_token].blank?
28
+ = f.input :user_invitation, as: :hidden, input_html: { value: params[:invitation_token] }
27
29
  .actions
28
30
  = f.button :submit, I18n.t("iugu.sign_in"), :class => "full-width default"
29
31
 
@@ -1,10 +1,28 @@
1
1
  - content_for :title do I18n.t("iugu.account") + " #{@account.id}" end
2
2
 
3
- %h2.no-bottom-margin
3
+ %h2
4
4
  = I18n.t("iugu.account_settings")
5
5
 
6
- %h4
7
- = "##{@account.id}"
6
+ %table
7
+ %tr
8
+ %td
9
+ = "##{@account.id}"
10
+
11
+ - if @has_subscription
12
+ - if @subscription.suspended
13
+ %div{ :style => "border: 2px solid #F00; padding: 20px;text-align:center;background:#FFCCCC" }
14
+ %h1.no-bottom-margin
15
+ Esta conta está suspensa
16
+ %p.no-bottom-margin
17
+ Você pode reativar esta conta clicando em ativar ou quitando seus débitos.
18
+ - elsif @subscription.in_trial
19
+ %div{ :style => "border: 2px solid #185277; padding: 20px;text-align:center;background:#A6D0E8" }
20
+ %h1.no-bottom-margin
21
+ = "Período de testes."
22
+ %p.no-bottom-margin
23
+ = "#{@subscription.trial_expires_at.to_date.mjd - Date.today.mjd} dia(s)"
24
+
25
+ %hr
8
26
 
9
27
  - if current_user.is?(:owner, @account)
10
28
  - if flash[:group] == :account_update
@@ -13,35 +31,39 @@
13
31
  = simple_form_for @account, :url => account_update_path(@account), :method => :put do |f|
14
32
  = f.text_field :name, :placeholder => I18n.t("activerecord.attributes.name")
15
33
 
16
- = f.submit I18n.t("iugu.save"), :class => "button default"
34
+ = f.submit I18n.t("iugu.save"), :class => "button default no-bottom-margin"
35
+
36
+ - if IuguSDK::enable_multiple_users_per_account
37
+ = link_to I18n.t("iugu.users_and_roles"), account_users_index_path(@account), class: "button full-width"
38
+
39
+ %hr
40
+
41
+ - if @has_subscription
42
+ %table.table
43
+ %thead
44
+ %tr
45
+ %th
46
+ = I18n.t "iugu.plan"
47
+ %th
48
+ %tbody
49
+ %tr
50
+ %td{ :style => "width: 60%" }
51
+ %h3{ :style => "margin:0px;padding-top:10px;padding-left:10px" }
52
+ = @plan_name
53
+ %td{ :style => "width: 40%" }
54
+ .group.horizontal_stacking
55
+ = link_to I18n.t("iugu.change"), plan_index_url(@account), class: "button"
56
+ = link_to I18n.t("iugu.payment_history"), account_payment_history_path(@account), class: "button full-width"
17
57
 
18
- - if IuguSDK::enable_subscription_features
19
- = "#{I18n.t "iugu.plan"}: #{@plan_name} "
20
- = link_to I18n.t("iugu.change"), plan_index_url
58
+ %hr
21
59
 
22
60
  - unless IuguSDK::enable_custom_domain == false && IuguSDK::enable_account_alias == false
23
- %br
24
- %br
25
- = I18n.t("iugu.custom_domains")
26
- - if current_user.is?(:owner, @account) || current_user.is?(:admin, @account)
27
- = link_to I18n.t("iugu.manage"), account_domains_index_path(@account)
28
- %br
29
- - if @primary_domain
30
- = I18n.t("iugu.primary") + ":"
31
- = @primary_domain.url
32
61
 
33
- - if IuguSDK::enable_multiple_users_per_account
34
- %br
35
- %br
36
- = link_to I18n.t("iugu.users_and_roles"), account_users_index_path(@account)
62
+ - if current_user.is?(:owner, @account) || current_user.is?(:admin, @account)
63
+ = link_to I18n.t("iugu.custom_domains"), account_domains_index_path(@account), :class => "button full-width"
37
64
 
38
- - if IuguSDK::enable_subscription_features
39
- %br
40
- %br
41
- %div
42
- = link_to I18n.t("iugu.payment_history"), account_payment_history_path(@account)
65
+ %hr
43
66
 
44
- %br
45
67
  - if IuguSDK::enable_account_api
46
68
  - if current_user.is?(:owner, @account)
47
69
  %h2
@@ -66,8 +88,10 @@
66
88
  = token.description
67
89
  %td
68
90
  = l token.created_at, :format => :short
91
+ %td
92
+ = link_to I18n.t("iugu.remove"), account_remove_token_path(@account, token), :class => "button no-bottom-margin", :confirm => I18n.t("iugu.are_you_sure?"), :method => :delete
69
93
  %tr
70
- %td{ :colspan => 3 }
94
+ %td{ :colspan => 4 }
71
95
  = token.token
72
96
  = form_tag(account_generate_new_token_path(@account), :method => :post) do
73
97
  %h3
@@ -79,11 +103,19 @@
79
103
  = submit_tag I18n.t("iugu.create"), :class => "button default"
80
104
 
81
105
  - if current_user.is?(:owner, @account)
106
+ - if @has_subscription
107
+ - if @subscription.suspended
108
+ = link_to I18n.t("iugu.activate"), account_activate_path(@account), :method => :post, class: "button full-width"
109
+ - else
110
+ = link_to I18n.t("iugu.suspend"), account_suspend_path(@account), :method => :post, class: "button full-width"
82
111
  - unless @account.destroying?
83
112
  - if IuguSDK::enable_account_cancel
84
- = link_to I18n.t("iugu.cancel_account"), account_destroy_path(@account), :method => :delete
113
+ = link_to I18n.t("iugu.cancel_account"), account_destroy_path(@account), :method => :delete, class: "button full-width no-bottom-margin"
85
114
  - else
86
115
  - if IuguSDK::delay_account_exclusion > 0
87
- = link_to I18n.t("iugu.undo"), account_cancel_destruction_path(@account), :method => :delete
116
+ = link_to I18n.t("iugu.undo"), account_cancel_destruction_path(@account), :method => :delete, class: "button full-width"
88
117
  - else
89
118
  = I18n.t("iugu.account_destruction_in") + @account.destruction_job.run_at.to_s
119
+
120
+ - if current_user.accounts.count > 1
121
+ = link_to I18n.t("iugu.back"), account_settings_path, class: "button"
@@ -1,35 +1,31 @@
1
1
  - content_for :title do I18n.t("iugu.account_settings") end
2
2
 
3
- %h3
4
- = I18n.t "iugu.account_settings"
3
+ - if @accounts.count > 0
5
4
 
6
- - if current_user.accounts.count > 0
7
-
8
- %h3
9
- - if IuguSDK::enable_multiple_accounts
10
- = I18n.t("iugu.accounts")
11
- - else
12
- - if current_user.accounts.count > 1
13
- = I18n.t("iugu.accounts")
14
- - else
15
- = I18n.t("iugu.account")
16
-
17
- - current_user.accounts.each do |account|
18
- %div
19
- = account.name
20
- - if current_user_account.account_id == account.id
21
- |
22
- = I18n.t("iugu.active")
23
- - else
24
- |
25
- = link_to I18n.t("iugu.select"), account_select_path(account)
26
- |
27
- = link_to I18n.t("iugu.settings"), account_view_path(account)
5
+ %table
6
+ %thead
7
+ %th
8
+ Conta
9
+ %th
10
+ &nbsp;
11
+ %tbody
12
+ - @accounts.each do |account|
13
+ %tr
14
+ %td
15
+ = account.name
16
+ %td
17
+ .group.horizontal_stacking
18
+ - if current_user_account.account_id == account.id
19
+ = link_to I18n.t("iugu.active"), "javascript:function(){}", :class => "button no-bottom-margin disabled", :style => "width: 50%"
20
+ - else
21
+ = link_to I18n.t("iugu.select"), account_select_path(account), :class => "button no-bottom-margin", :style => "width: 50%"
22
+ = link_to I18n.t("iugu.settings"), account_view_path(account), :class => "button no-bottom-margin", :style => "width: 50%"
28
23
 
29
24
  - else
30
25
  %h2
31
26
  = I18n.t("iugu.i_dont_have_any_accounts")
32
27
 
28
+
33
29
  - if IuguSDK::enable_multiple_accounts == true
34
30
  %div
35
- = link_to I18n.t("iugu.create_account"), account_create_path, :method => :post
31
+ = link_to I18n.t("iugu.create_account"), account_create_path, :method => :post, :class => "button full-width no-bottom-margin default"
@@ -1,4 +1,11 @@
1
1
  en:
2
+ invoice_status:
3
+ pending: "Pending"
4
+ canceled: "Canceled"
5
+ paid: "Paid"
6
+ emails:
7
+ user_invitation: "You have been invited to %{account_name}"
8
+ user_welcome: "Welcome to %{application_title}"
2
9
  errors:
3
10
  messages:
4
11
  only_owners_can_destroy_accounts: "Only owners can destroy Accounts"
@@ -7,6 +14,11 @@ en:
7
14
  email_already_in_use: "This email is already in use"
8
15
  not_supported_api_type: "not supported api type"
9
16
  iugu:
17
+ interval_type:
18
+ month: "Month"
19
+ months: "Months"
20
+ week: "Week"
21
+ weeks: "Weeks"
10
22
  welcome: "Welcome"
11
23
  edit: "Edit"
12
24
  update: "Update"
@@ -23,6 +35,8 @@ en:
23
35
  no_account_action: "Sign up"
24
36
  add: "Add"
25
37
  active: "Active"
38
+ activate: "Activate"
39
+ suspend: "Suspend"
26
40
  unnamed: "Unnamed"
27
41
  back_to: "Back to"
28
42
  back: "Back"
@@ -95,6 +109,7 @@ en:
95
109
  plan_name: "Plan name"
96
110
  plan: "Plan"
97
111
  plans: "Plans"
112
+ duration: "Duration"
98
113
  price: "Price"
99
114
  available_plans: "Available Plans"
100
115
  your_plan: "Your Plan"
@@ -115,11 +130,16 @@ en:
115
130
  guest: "guest"
116
131
  become_user: "Become an User"
117
132
  notices:
133
+ account_activated: "Account successfully activated"
134
+ error_activating_account: "Error activating account"
135
+ account_suspended: "Account successfully suspended"
136
+ error_suspending_account: "Error suspending account"
118
137
  congrats_for_becoming_user: "Congratulations for becoming an user"
119
138
  guest_login: "Guest successfully login"
120
139
  subdomain_updated: "Subdomain successfully updated"
121
140
  you_are_already_member_of_this_account: "You already member of this account"
122
141
  new_token_generated: "New token generated"
142
+ token_removed: "Token removed"
123
143
  account_updated: "Account was successfully updated"
124
144
  account_not_found: "Account not found"
125
145
  user_invited: "User invited"
@@ -1,4 +1,11 @@
1
1
  pt-BR:
2
+ invoice_status:
3
+ pending: "Pendente"
4
+ canceled: "Cancelada"
5
+ paid: "Paga"
6
+ emails:
7
+ user_invitation: "Convite para %{account_name}"
8
+ user_welcome: "Bem-vindo a %{application_title}"
2
9
  errors:
3
10
  messages:
4
11
  only_owners_can_destroy_accounts: "Apenas donos podem remover contas"
@@ -7,6 +14,11 @@ pt-BR:
7
14
  email_already_in_use: "Esse email já foi utilizado"
8
15
  not_supported_api_type: "tipo de api não suportado"
9
16
  iugu:
17
+ interval_type:
18
+ month: "Mês"
19
+ months: "Meses"
20
+ week: "Semana"
21
+ weeks: "Semanas"
10
22
  welcome: "Bem vindo"
11
23
  edit: "Editar"
12
24
  update: "Atualizar"
@@ -23,6 +35,8 @@ pt-BR:
23
35
  no_account_action: "Registre-se"
24
36
  add: "Adicionar"
25
37
  active: "Ativa"
38
+ activate: "Ativar"
39
+ suspend: "Desativar"
26
40
  unnamed: "Sem nome"
27
41
  back_to: "Voltar para"
28
42
  back: "Voltar"
@@ -98,13 +112,14 @@ pt-BR:
98
112
  plan_name: "Nome do Plano"
99
113
  plan: "Plano"
100
114
  plans: "Planos"
115
+ duration: "Duração"
101
116
  price: "Preço"
102
117
  available_plans: "Planos Disponíveis"
103
118
  your_plan: "Seu Plano"
104
119
  change_plan: "Alterar Plano"
105
120
  downgrade: "Rebaixar"
106
121
  upgrade: "Aprimorar"
107
- custom_domains: "Dominios customizados"
122
+ custom_domains: "Dominios personalizados"
108
123
  api_tokens: "Tokens da API"
109
124
  api_type: "Tipo de API"
110
125
  api_access: "Acesso via API"
@@ -118,11 +133,16 @@ pt-BR:
118
133
  guest: "convidado"
119
134
  become_user: "Tornar-se um usuário"
120
135
  notices:
136
+ account_activated: "Conta ativada com sucesso"
137
+ error_activating_account: "Erro ativando conta"
138
+ account_suspended: "Conta desativada com sucesso"
139
+ error_suspending_account: "Erro desativando conta"
121
140
  congrats_for_becoming_user: "Parabens por se tornar um usuário!"
122
141
  guest_login: "Convidado logado com sucesso"
123
142
  subdomain_updated: "Subdominio atualizado com sucesso"
124
143
  you_are_already_member_of_this_account: "Você já é membro dessa conta"
125
144
  new_token_generated: "Novo token gerado"
145
+ token_removed: "Token removido"
126
146
  account_updated: "Conta atualizada com sucesso."
127
147
  account_not_found: "Conta não encontrada"
128
148
  user_invited: "Usuário convidado"
data/config/routes.rb CHANGED
@@ -13,6 +13,9 @@ Rails.application.routes.draw do
13
13
  delete "settings/account/(:id)" => "iugu/account#destroy", :as => "account_destroy"
14
14
  delete "settings/account/(:id)/cancel" => "iugu/account#cancel_destruction", :as => "account_cancel_destruction"
15
15
  post "settings/account/(:account_id)/generate_new_token" => "iugu/account#generate_new_token", :as => "account_generate_new_token"
16
+ post "settings/account/(:account_id)/activate" => "iugu/account#activate", :as => "account_activate"
17
+ post "settings/account/(:account_id)/suspend" => "iugu/account#suspend", :as => "account_suspend"
18
+ delete "settings/account/(:account_id)/remove_token/:token" => "iugu/account#remove_token", :as => "account_remove_token"
16
19
  put "settings/account/(:id)" => "iugu/account#update", :as => "account_update"
17
20
  post "settings/account" => "iugu/account#create", :as => "account_create"
18
21
 
@@ -0,0 +1,5 @@
1
+ class AddUsedToUserInvitation < ActiveRecord::Migration
2
+ def change
3
+ add_column :user_invitations, :used, :boolean, default: false
4
+ end
5
+ end
@@ -1,3 +1,3 @@
1
1
  module IuguSDK
2
- VERSION = "1.0.0.alpha.21"
2
+ VERSION = "1.0.0.alpha.22"
3
3
  end
data/lib/iugusdk.rb CHANGED
@@ -18,6 +18,7 @@ require 'koala'
18
18
  require 'default_value_for'
19
19
  require 'activeuuid'
20
20
  require 'iugu-api'
21
+ require 'money'
21
22
  require 'iugusdk/uuid_mass_assignment_fix'
22
23
  require 'iugusdk/uuid_operators_extensions.rb'
23
24
 
@@ -129,7 +130,6 @@ module IuguSDK
129
130
  self.default_layout = "settings"
130
131
  self.alternative_layout = "iugu-sdk"
131
132
 
132
-
133
133
  def initialize
134
134
  end
135
135