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/new.html.haml | 17 ----------------- 1 file changed, 17 deletions(-) delete mode 100644 engines/billing/app/views/payments/new.html.haml (limited to 'engines/billing/app/views/payments/new.html.haml') 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 2e1d21f53f0f96fba544b592fde84af2f4879a24 Mon Sep 17 00:00:00 2001 From: claucece Date: Mon, 21 Sep 2015 23:27:05 -0500 Subject: subscriptions, haml and translations --- engines/billing/app/views/payments/new.html.haml | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 engines/billing/app/views/payments/new.html.haml (limited to 'engines/billing/app/views/payments/new.html.haml') 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/new.html.haml') 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