From e3e21a1e0b15d4d575c88c3fb2c2b9e64f06734c Mon Sep 17 00:00:00 2001 From: Luuk Veenis Date: Thu, 10 Nov 2016 08:51:42 -0800 Subject: [PATCH] Remove separate paypal button and address views --- .../_address_field.html.erb | 9 ---- .../_paypal_button.html.erb | 38 -------------- .../_paypal_credit_button.html.erb | 40 --------------- .../payment/_paypal_braintree.html.erb | 42 ++++++++++++++-- .../payment/_paypal_credit_braintree.html.erb | 49 +++++++++++++++---- 5 files changed, 78 insertions(+), 100 deletions(-) delete mode 100644 lib/views/frontend/solidus_paypal_braintree/_address_field.html.erb delete mode 100644 lib/views/frontend/solidus_paypal_braintree/_paypal_button.html.erb delete mode 100644 lib/views/frontend/solidus_paypal_braintree/_paypal_credit_button.html.erb diff --git a/lib/views/frontend/solidus_paypal_braintree/_address_field.html.erb b/lib/views/frontend/solidus_paypal_braintree/_address_field.html.erb deleted file mode 100644 index 3e06eeaa..00000000 --- a/lib/views/frontend/solidus_paypal_braintree/_address_field.html.erb +++ /dev/null @@ -1,9 +0,0 @@ -<% address = {line1: shipping_address.address1, - line2: shipping_address.address2, - city: shipping_address.city, - state: shipping_address.state.name, - postalCode: shipping_address.zipcode, - countryCode: shipping_address.country.iso, - phone: shipping_address.phone, - recipientName: "#{shipping_address.firstname} #{shipping_address.lastname}"}.to_json %> -<%= hidden_field_tag 'shipping_address', address %> diff --git a/lib/views/frontend/solidus_paypal_braintree/_paypal_button.html.erb b/lib/views/frontend/solidus_paypal_braintree/_paypal_button.html.erb deleted file mode 100644 index eb97dc0c..00000000 --- a/lib/views/frontend/solidus_paypal_braintree/_paypal_button.html.erb +++ /dev/null @@ -1,38 +0,0 @@ -<% address = current_order.ship_address %> - - - - - - - - - diff --git a/lib/views/frontend/solidus_paypal_braintree/_paypal_credit_button.html.erb b/lib/views/frontend/solidus_paypal_braintree/_paypal_credit_button.html.erb deleted file mode 100644 index ae6b3d96..00000000 --- a/lib/views/frontend/solidus_paypal_braintree/_paypal_credit_button.html.erb +++ /dev/null @@ -1,40 +0,0 @@ -<% address = current_order.ship_address %> - - - - - - - - - diff --git a/lib/views/frontend/spree/checkout/payment/_paypal_braintree.html.erb b/lib/views/frontend/spree/checkout/payment/_paypal_braintree.html.erb index 5a1d151f..eb97dc0c 100644 --- a/lib/views/frontend/spree/checkout/payment/_paypal_braintree.html.erb +++ b/lib/views/frontend/spree/checkout/payment/_paypal_braintree.html.erb @@ -1,4 +1,38 @@ -<% if current_order.valid? %> - <%= render partial: 'solidus_paypal_braintree/address_field', locals: { shipping_address: current_order.shipping_address } %> -<% end %> -<%= render partial: 'solidus_paypal_braintree/paypal_button' %> +<% address = current_order.ship_address %> + + + + + + + + + diff --git a/lib/views/frontend/spree/checkout/payment/_paypal_credit_braintree.html.erb b/lib/views/frontend/spree/checkout/payment/_paypal_credit_braintree.html.erb index bf4da10b..ae6b3d96 100644 --- a/lib/views/frontend/spree/checkout/payment/_paypal_credit_braintree.html.erb +++ b/lib/views/frontend/spree/checkout/payment/_paypal_credit_braintree.html.erb @@ -1,9 +1,40 @@ -<% payment_method = current_store.payment_methods.where(active: true).find_by_type('SolidusPaypalBraintree::Gateway') %> -<% if payment_method %> - <%= render partial: 'solidus_paypal_braintree/address_field', locals: { shipping_address: current_order.shipping_address } %> - - <%= render partial: 'solidus_paypal_braintree/paypal_credit_button' %> -<% end %> +<% address = current_order.ship_address %> + + + + + + + + +