From d11768e58b98312c95a8ac5e9c18e3069b4d76dc Mon Sep 17 00:00:00 2001 From: claucece Date: Tue, 15 Sep 2015 00:26:52 -0500 Subject: implemented the form and the generate --- engines/billing/app/views/payments/_form.html.erb | 16 +++++++++++++++ engines/billing/app/views/payments/new.html.erb | 25 +++++++++++++++++++++++ engines/billing/app/views/payments/new.html.haml | 17 --------------- 3 files changed, 41 insertions(+), 17 deletions(-) create mode 100644 engines/billing/app/views/payments/_form.html.erb create mode 100644 engines/billing/app/views/payments/new.html.erb delete mode 100644 engines/billing/app/views/payments/new.html.haml (limited to 'engines/billing/app/views/payments') diff --git a/engines/billing/app/views/payments/_form.html.erb b/engines/billing/app/views/payments/_form.html.erb new file mode 100644 index 0000000..9713981 --- /dev/null +++ b/engines/billing/app/views/payments/_form.html.erb @@ -0,0 +1,16 @@ +-# slim template += form_tag organization_payment_path(organization) do + + #dropin + + = submit_tag 'Confirm', class: 'btn push--ends' + +- content_for :javascript do + = javascript_include_tag "https://js.braintreegateway.com/v2/braintree.js" + javascript: + var client_token = "#{@organization.payment['client_token']}"; + braintree.setup( + client_token, + 'dropin', { + container: 'dropin' + }); diff --git a/engines/billing/app/views/payments/new.html.erb b/engines/billing/app/views/payments/new.html.erb new file mode 100644 index 0000000..7eab364 --- /dev/null +++ b/engines/billing/app/views/payments/new.html.erb @@ -0,0 +1,25 @@ +
+
+

New Donation

+

Please enter your donation details (this is a donation, and will not be applied towards your account):

+
+ +<%= braintree_form_for :transaction, :html => {:autocomplete => "off"} do |f|%> + <%= f.label :amount, t(:amount)%> + <%= f.text_field :amount%> +
+ + + <%= f.submit "Submit Donation", :class => 'btn btn-primary'%> +<%end%> + diff --git a/engines/billing/app/views/payments/new.html.haml b/engines/billing/app/views/payments/new.html.haml deleted file mode 100644 index e9a8273..0000000 --- a/engines/billing/app/views/payments/new.html.haml +++ /dev/null @@ -1,17 +0,0 @@ -%h1 - = t(:Donation) -- if logged_in? - = t(:donation_not_payment) -- if @result and @result.errors.size > 0 - %div{:style => "color: red;"} - = h @result.errors.size - error(s) -- if @result and @result.transaction and @result.transaction.status != 'success' - %div{:style => "color: red;"} - = t(:processor_declined) -= braintree_form_for :transaction, :html => {:autocomplete => "off"} do |f| - = f.label :amount, t(:amount) - = f.text_field :amount - = render :partial => 'non_customer_fields', :locals => {:f => f} - = hidden_field_tag :tr_data, @tr_data - = f.submit "Submit Donation", :class => 'btn btn-primary' -- cgit v1.2.3 From 027086fc7be10607d27a56fa18f905b696f917d4 Mon Sep 17 00:00:00 2001 From: claucece Date: Tue, 15 Sep 2015 17:49:35 -0500 Subject: add donate button, bitcoin, payment_method --- engines/billing/app/views/payments/new.html.erb | 30 ++++++++++++------------- 1 file changed, 15 insertions(+), 15 deletions(-) (limited to 'engines/billing/app/views/payments') diff --git a/engines/billing/app/views/payments/new.html.erb b/engines/billing/app/views/payments/new.html.erb index 7eab364..86a1d64 100644 --- a/engines/billing/app/views/payments/new.html.erb +++ b/engines/billing/app/views/payments/new.html.erb @@ -1,25 +1,25 @@ -
-
-

New Donation

-

Please enter your donation details (this is a donation, and will not be applied towards your account):

-
+

New Donation

+

Please enter your donation details (this is a donation and will not be applied towards your account):

+
+<%= form_tag confirm_payment_path, id: "checkout-form" do %> +
+
+ + +<% end %> -<%= braintree_form_for :transaction, :html => {:autocomplete => "off"} do |f|%> - <%= f.label :amount, t(:amount)%> - <%= f.text_field :amount%> -
- <%= f.submit "Submit Donation", :class => 'btn btn-primary'%> -<%end%> -- cgit v1.2.3 From 234cb9af5f11953f93910e79143fcb842e924248 Mon Sep 17 00:00:00 2001 From: claucece Date: Wed, 16 Sep 2015 00:13:01 -0500 Subject: added payment_info, _customer_form, sucess instances --- engines/billing/app/views/payments/_customer_form.html.erb | 13 +++++++++++++ engines/billing/app/views/payments/new.html.erb | 2 ++ 2 files changed, 15 insertions(+) create mode 100644 engines/billing/app/views/payments/_customer_form.html.erb (limited to 'engines/billing/app/views/payments') diff --git a/engines/billing/app/views/payments/_customer_form.html.erb b/engines/billing/app/views/payments/_customer_form.html.erb new file mode 100644 index 0000000..2e8a3b1 --- /dev/null +++ b/engines/billing/app/views/payments/_customer_form.html.erb @@ -0,0 +1,13 @@ +

Please enter your personal info:

+
+ <%= text_field_tag :first_name, "",placeholder: "First Name", class: "radius" %> +
+
+ <%= text_field_tag :last_name, "",placeholder: "Last Name", class: "radius" %> +
+
+ <%= text_field_tag :company, "",placeholder: "Company", class: "radius" %> +
+
+ <%= text_field_tag :phone, "",placeholder: "Phone", class: "radius" %> +
diff --git a/engines/billing/app/views/payments/new.html.erb b/engines/billing/app/views/payments/new.html.erb index 86a1d64..3cdda01 100644 --- a/engines/billing/app/views/payments/new.html.erb +++ b/engines/billing/app/views/payments/new.html.erb @@ -2,6 +2,8 @@

Please enter your donation details (this is a donation and will not be applied towards your account):


<%= form_tag confirm_payment_path, id: "checkout-form" do %> + # add migration to user first. Not sure about the anonymous part. + # <%= render 'customer_form' unless current_user.has_payment_info? && current_user.where.not.is_anonymous? %>
-- cgit v1.2.3 From 4b7fdbee260f703c8d09bec60c55003b2c5528bd Mon Sep 17 00:00:00 2001 From: claucece Date: Wed, 16 Sep 2015 00:20:45 -0500 Subject: correctly set up comments --- engines/billing/app/views/payments/new.html.erb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'engines/billing/app/views/payments') diff --git a/engines/billing/app/views/payments/new.html.erb b/engines/billing/app/views/payments/new.html.erb index 3cdda01..002377c 100644 --- a/engines/billing/app/views/payments/new.html.erb +++ b/engines/billing/app/views/payments/new.html.erb @@ -2,8 +2,8 @@

Please enter your donation details (this is a donation and will not be applied towards your account):


<%= form_tag confirm_payment_path, id: "checkout-form" do %> - # add migration to user first. Not sure about the anonymous part. - # <%= render 'customer_form' unless current_user.has_payment_info? && current_user.where.not.is_anonymous? %> + <%# add migration to user first. Not sure about the anonymous part. %> + <%# render 'customer_form' unless current_user.has_payment_info? && current_user.where.not.is_anonymous? %>
-- cgit v1.2.3 From e4a012e09a6b16438bd1286b2057aed916a106f7 Mon Sep 17 00:00:00 2001 From: claucece Date: Wed, 16 Sep 2015 00:26:26 -0500 Subject: just played a little --- engines/billing/app/views/payments/new.html.erb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'engines/billing/app/views/payments') diff --git a/engines/billing/app/views/payments/new.html.erb b/engines/billing/app/views/payments/new.html.erb index 002377c..5eb3e35 100644 --- a/engines/billing/app/views/payments/new.html.erb +++ b/engines/billing/app/views/payments/new.html.erb @@ -20,7 +20,7 @@ var clientToken = "<%= @client_token %>"; braintree.setup(clientToken, "dropin", { container: "payment-form", form: "checkout-form", - coinbase: { container: "payment-form" } + coinbase: { container: "coinbase-container-id" } } ); -- cgit v1.2.3 From f55fd33542c68fc8fc4519d622a41ef9517ebee3 Mon Sep 17 00:00:00 2001 From: claucece Date: Fri, 18 Sep 2015 17:33:05 -0500 Subject: added customers, recurring payment and payment_info --- engines/billing/app/views/payments/new.html.erb | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'engines/billing/app/views/payments') diff --git a/engines/billing/app/views/payments/new.html.erb b/engines/billing/app/views/payments/new.html.erb index 5eb3e35..03fc5b9 100644 --- a/engines/billing/app/views/payments/new.html.erb +++ b/engines/billing/app/views/payments/new.html.erb @@ -1,9 +1,13 @@

New Donation

-

Please enter your donation details (this is a donation and will not be applied towards your account):


<%= form_tag confirm_payment_path, id: "checkout-form" do %> <%# add migration to user first. Not sure about the anonymous part. %> <%# render 'customer_form' unless current_user.has_payment_info? && current_user.where.not.is_anonymous? %> + <% if current_user and !current_user.has_payment_info? %> + <%= render 'customer_form' unless @anonymous_user%> + <% end %> +
+

Please enter your donation details (this is a donation and will not be applied towards your account):

-- cgit v1.2.3 From 2e1d21f53f0f96fba544b592fde84af2f4879a24 Mon Sep 17 00:00:00 2001 From: claucece Date: Mon, 21 Sep 2015 23:27:05 -0500 Subject: subscriptions, haml and translations --- .../app/views/payments/_customer_form.html.erb | 13 --------- .../app/views/payments/_customer_form.html.haml | 10 +++++++ engines/billing/app/views/payments/_form.html.erb | 16 ----------- .../billing/app/views/payments/default.html.erb | 27 +++++++++++++++++++ engines/billing/app/views/payments/new.html.erb | 31 ---------------------- engines/billing/app/views/payments/new.html.haml | 21 +++++++++++++++ 6 files changed, 58 insertions(+), 60 deletions(-) delete mode 100644 engines/billing/app/views/payments/_customer_form.html.erb create mode 100644 engines/billing/app/views/payments/_customer_form.html.haml delete mode 100644 engines/billing/app/views/payments/_form.html.erb create mode 100644 engines/billing/app/views/payments/default.html.erb delete mode 100644 engines/billing/app/views/payments/new.html.erb create mode 100644 engines/billing/app/views/payments/new.html.haml (limited to 'engines/billing/app/views/payments') diff --git a/engines/billing/app/views/payments/_customer_form.html.erb b/engines/billing/app/views/payments/_customer_form.html.erb deleted file mode 100644 index 2e8a3b1..0000000 --- a/engines/billing/app/views/payments/_customer_form.html.erb +++ /dev/null @@ -1,13 +0,0 @@ -

Please enter your personal info:

-
- <%= text_field_tag :first_name, "",placeholder: "First Name", class: "radius" %> -
-
- <%= text_field_tag :last_name, "",placeholder: "Last Name", class: "radius" %> -
-
- <%= text_field_tag :company, "",placeholder: "Company", class: "radius" %> -
-
- <%= text_field_tag :phone, "",placeholder: "Phone", class: "radius" %> -
diff --git a/engines/billing/app/views/payments/_customer_form.html.haml b/engines/billing/app/views/payments/_customer_form.html.haml new file mode 100644 index 0000000..82828cd --- /dev/null +++ b/engines/billing/app/views/payments/_customer_form.html.haml @@ -0,0 +1,10 @@ +%p + = t(:personal_info) +%div + = text_field_tag :first_name, "",placeholder: "First Name", class: "radius" +%div + = text_field_tag :last_name, "",placeholder: "Last Name", class: "radius" +%div + = text_field_tag :company, "",placeholder: "Company", class: "radius" +%div + = text_field_tag :phone, "",placeholder: "Phone", class: "radius" diff --git a/engines/billing/app/views/payments/_form.html.erb b/engines/billing/app/views/payments/_form.html.erb deleted file mode 100644 index 9713981..0000000 --- a/engines/billing/app/views/payments/_form.html.erb +++ /dev/null @@ -1,16 +0,0 @@ --# slim template -= form_tag organization_payment_path(organization) do - - #dropin - - = submit_tag 'Confirm', class: 'btn push--ends' - -- content_for :javascript do - = javascript_include_tag "https://js.braintreegateway.com/v2/braintree.js" - javascript: - var client_token = "#{@organization.payment['client_token']}"; - braintree.setup( - client_token, - 'dropin', { - container: 'dropin' - }); diff --git a/engines/billing/app/views/payments/default.html.erb b/engines/billing/app/views/payments/default.html.erb new file mode 100644 index 0000000..bbecf46 --- /dev/null +++ b/engines/billing/app/views/payments/default.html.erb @@ -0,0 +1,27 @@ +

New Donation

+
+<%= form_tag confirm_payment_path, id: "checkout-form" do %> + <% if current_user and !current_user.has_payment_info? %> + <%= render 'customer_form' unless @anonymous_user%> + <% end %> +
+

Please enter your donation details (this is a donation and will not be applied towards your account):

+
+
+ + +<% end %> + + + diff --git a/engines/billing/app/views/payments/new.html.erb b/engines/billing/app/views/payments/new.html.erb deleted file mode 100644 index 03fc5b9..0000000 --- a/engines/billing/app/views/payments/new.html.erb +++ /dev/null @@ -1,31 +0,0 @@ -

New Donation

-
-<%= form_tag confirm_payment_path, id: "checkout-form" do %> - <%# add migration to user first. Not sure about the anonymous part. %> - <%# render 'customer_form' unless current_user.has_payment_info? && current_user.where.not.is_anonymous? %> - <% if current_user and !current_user.has_payment_info? %> - <%= render 'customer_form' unless @anonymous_user%> - <% end %> -
-

Please enter your donation details (this is a donation and will not be applied towards your account):

-
-
- - -<% end %> - - - - diff --git a/engines/billing/app/views/payments/new.html.haml b/engines/billing/app/views/payments/new.html.haml new file mode 100644 index 0000000..8d5bd5a --- /dev/null +++ b/engines/billing/app/views/payments/new.html.haml @@ -0,0 +1,21 @@ +%h2.mbs + = t(:new_donation) +%br/ += form_tag confirm_payment_path, id: "checkout-form" do + - if current_user and !current_user.has_payment_info? + = render 'customer_form' unless current_user.is_anonymous? + %br/ + %p + = t(:donation_info) + %div{:id => "payment-form" } + %div{:id => "coinbase-container-id" } + %input{:name => "amount", :placeholder => "Enter amount", :type => "text"} + %input.btn.btn-primary{:type => "submit", :value => "Donate"} +%script{:src => "https://js.braintreegateway.com/v2/braintree.js"} +:javascript + var clientToken = "#{@client_token}"; + braintree.setup(clientToken, "dropin", { + container: "payment-form", + form: "checkout-form", + coinbase: { container: "coinbase-container-id" } + }); -- cgit v1.2.3 From b26d10fe7d87b570bd888fa2a2543f3675278f8b Mon Sep 17 00:00:00 2001 From: claucece Date: Fri, 25 Sep 2015 00:04:19 -0500 Subject: add subscriptions --- engines/billing/app/views/payments/new.html.haml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'engines/billing/app/views/payments') diff --git a/engines/billing/app/views/payments/new.html.haml b/engines/billing/app/views/payments/new.html.haml index 8d5bd5a..67018b2 100644 --- a/engines/billing/app/views/payments/new.html.haml +++ b/engines/billing/app/views/payments/new.html.haml @@ -4,13 +4,12 @@ = form_tag confirm_payment_path, id: "checkout-form" do - if current_user and !current_user.has_payment_info? = render 'customer_form' unless current_user.is_anonymous? - %br/ %p = t(:donation_info) %div{:id => "payment-form" } %div{:id => "coinbase-container-id" } - %input{:name => "amount", :placeholder => "Enter amount", :type => "text"} - %input.btn.btn-primary{:type => "submit", :value => "Donate"} + %input{:name => "amount", :placeholder => "#{t(:donation_amount)}", :type => "text"} + %input.btn.btn-primary{:type => "submit", :value => "#{t(:donate)}"} %script{:src => "https://js.braintreegateway.com/v2/braintree.js"} :javascript var clientToken = "#{@client_token}"; -- cgit v1.2.3 From 6c4f02fd2d530c28899561fac40ca76075975dc8 Mon Sep 17 00:00:00 2001 From: claucece Date: Sun, 27 Sep 2015 23:04:55 -0500 Subject: update to haml, created translations, deleted files --- .../app/views/payments/_customer_form.html.haml | 8 +++---- .../views/payments/_non_customer_fields.html.haml | 16 ------------- .../views/payments/_transaction_details.html.haml | 15 ------------ .../billing/app/views/payments/confirm.html.haml | 26 --------------------- .../billing/app/views/payments/default.html.erb | 27 ---------------------- engines/billing/app/views/payments/index.html.haml | 3 ++- 6 files changed, 6 insertions(+), 89 deletions(-) delete mode 100644 engines/billing/app/views/payments/_non_customer_fields.html.haml delete mode 100644 engines/billing/app/views/payments/_transaction_details.html.haml delete mode 100644 engines/billing/app/views/payments/confirm.html.haml delete mode 100644 engines/billing/app/views/payments/default.html.erb (limited to 'engines/billing/app/views/payments') diff --git a/engines/billing/app/views/payments/_customer_form.html.haml b/engines/billing/app/views/payments/_customer_form.html.haml index 82828cd..df61d3d 100644 --- a/engines/billing/app/views/payments/_customer_form.html.haml +++ b/engines/billing/app/views/payments/_customer_form.html.haml @@ -1,10 +1,10 @@ %p = t(:personal_info) %div - = text_field_tag :first_name, "",placeholder: "First Name", class: "radius" + = text_field_tag :first_name, "",placeholder: "#{t(:first_name)}", class: "radius" %div - = text_field_tag :last_name, "",placeholder: "Last Name", class: "radius" + = text_field_tag :last_name, "",placeholder: "#{t(:last_name)}", class: "radius" %div - = text_field_tag :company, "",placeholder: "Company", class: "radius" + = text_field_tag :company, "",placeholder: "#{t(:company)}", class: "radius" %div - = text_field_tag :phone, "",placeholder: "Phone", class: "radius" + = text_field_tag :phone, "",placeholder: "#{t(:phone)}", class: "radius" diff --git a/engines/billing/app/views/payments/_non_customer_fields.html.haml b/engines/billing/app/views/payments/_non_customer_fields.html.haml deleted file mode 100644 index 77cfe95..0000000 --- a/engines/billing/app/views/payments/_non_customer_fields.html.haml +++ /dev/null @@ -1,16 +0,0 @@ -= field_set_tag "Personal Information" do - = f.fields_for :customer do |c| - %div= c.label :first_name, "First Name" - %div= c.text_field :first_name - %div= c.label :last_name, "Last Name" - %div= c.text_field :last_name - %div= c.label :email, "Email" - %div= c.text_field :email -= field_set_tag "Credit Card" do - = f.fields_for :credit_card do |c| - %div= c.label :number, "Number" - %div= c.text_field :number - %div= c.label :expiration_date, "Expiration Date (MM/YY)" - %div= c.text_field :expiration_date - %div= c.label :cvv, "CVV" - %div= c.text_field :cvv \ No newline at end of file diff --git a/engines/billing/app/views/payments/_transaction_details.html.haml b/engines/billing/app/views/payments/_transaction_details.html.haml deleted file mode 100644 index 85e4f6a..0000000 --- a/engines/billing/app/views/payments/_transaction_details.html.haml +++ /dev/null @@ -1,15 +0,0 @@ -%p - = transaction.id - Type: - = transaction.type - Amount: - = number_to_currency(transaction.amount) - Status: - = transaction.status - Date - = transaction.created_at.strftime("%Y-%m-%d") - - if sub_start = transaction.subscription_details.billing_period_start_date - From subscription which started - = sub_start - - else # should not have any of these - Not paid as part of subscription \ No newline at end of file diff --git a/engines/billing/app/views/payments/confirm.html.haml b/engines/billing/app/views/payments/confirm.html.haml deleted file mode 100644 index 45af3c9..0000000 --- a/engines/billing/app/views/payments/confirm.html.haml +++ /dev/null @@ -1,26 +0,0 @@ -%h1 Payment Result -%div Thank you for your donation. -%h2 Transaction Details -%table - %tr - %td Amount - %td - $#{@result.transaction.amount} - %tr - %td Transaction ID: - %td= @result.transaction.id - %tr - %td First Name: - %td= h @result.transaction.customer_details.first_name - %tr - %td Last Name: - %td= h @result.transaction.customer_details.last_name - %tr - %td Email: - %td= h @result.transaction.customer_details.email - %tr - %td Credit Card: - %td= h @result.transaction.credit_card_details.masked_number - %tr - %td Card Type: - %td= h @result.transaction.credit_card_details.card_type \ No newline at end of file diff --git a/engines/billing/app/views/payments/default.html.erb b/engines/billing/app/views/payments/default.html.erb deleted file mode 100644 index bbecf46..0000000 --- a/engines/billing/app/views/payments/default.html.erb +++ /dev/null @@ -1,27 +0,0 @@ -

New Donation

-
-<%= form_tag confirm_payment_path, id: "checkout-form" do %> - <% if current_user and !current_user.has_payment_info? %> - <%= render 'customer_form' unless @anonymous_user%> - <% end %> -
-

Please enter your donation details (this is a donation and will not be applied towards your account):

-
-
- - -<% end %> - - - diff --git a/engines/billing/app/views/payments/index.html.haml b/engines/billing/app/views/payments/index.html.haml index 7a89917..01aa660 100644 --- a/engines/billing/app/views/payments/index.html.haml +++ b/engines/billing/app/views/payments/index.html.haml @@ -1,5 +1,6 @@ +/ check if necessary %h2=t :transaction_history - if (@transactions.count == 0) = t(:no_transaction_history) - @transactions.each do |t| - = render :partial => "transaction_details", :locals => {:transaction => t} \ No newline at end of file + = render :partial => "transaction_details", :locals => {:transaction => t} -- cgit v1.2.3 From 775835dc1b9a8f79cdd53d450fd6cd35f131b4a6 Mon Sep 17 00:00:00 2001 From: claucece Date: Mon, 5 Oct 2015 21:57:05 -0500 Subject: add test to payments and subscriptions --- engines/billing/app/views/payments/_customer_form.html.haml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'engines/billing/app/views/payments') diff --git a/engines/billing/app/views/payments/_customer_form.html.haml b/engines/billing/app/views/payments/_customer_form.html.haml index df61d3d..70b9b97 100644 --- a/engines/billing/app/views/payments/_customer_form.html.haml +++ b/engines/billing/app/views/payments/_customer_form.html.haml @@ -1,10 +1,10 @@ %p - = t(:personal_info) + = t(:personal_info) %div = text_field_tag :first_name, "",placeholder: "#{t(:first_name)}", class: "radius" %div - = text_field_tag :last_name, "",placeholder: "#{t(:last_name)}", class: "radius" + = text_field_tag :last_name, "",placeholder: "#{t(:last_name)}", class: "radius" %div - = text_field_tag :company, "",placeholder: "#{t(:company)}", class: "radius" + = text_field_tag :company, "",placeholder: "#{t(:company)}", class: "radius" %div - = text_field_tag :phone, "",placeholder: "#{t(:phone)}", class: "radius" + = text_field_tag :phone, "",placeholder: "#{t(:phone)}", class: "radius" -- cgit v1.2.3