Skip to content

Commit

Permalink
Merge pull request tomash#5 from jamesotron/master
Browse files Browse the repository at this point in the history
Add page_style and tax_cart.
  • Loading branch information
tomash committed Aug 4, 2011
2 parents 22a32d4 + 4f8fd85 commit 90f0302
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
4 changes: 3 additions & 1 deletion app/models/order_decorator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,9 @@ def paypal_encrypted(payment_notifications_url, options = {})
:return => Spree::Paypal::Config[:success_url],
:notify_url => payment_notifications_url,
:charset => "utf-8",
:cert_id => Spree::Paypal::Config[:cert_id]
:cert_id => Spree::Paypal::Config[:cert_id],
:page_style => Spree::Paypal::Config[:page_style],
:tax_cart => self.tax_total
}

self.line_items.each_with_index do |item, index|
Expand Down
1 change: 1 addition & 0 deletions app/views/checkout/_paypal_checkout.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
<%= hidden_field_tag(:encrypted, @order.paypal_encrypted(payment_notifications_url(:secret => Spree::Paypal::Config[:ipn_secret]))) %>
<% else %>

<input id="page_style" name="page_style" type="hidden" value="<%= Spree::Paypal::Config[:page_style] %>"/>
<input id="business" name="business" type="hidden" value="<%= Spree::Paypal::Config[:account] %>" />
<input id="invoice" name="invoice" type="hidden" value="<%= @order.number %>" />

Expand Down
5 changes: 3 additions & 2 deletions lib/paypal_configuration.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,13 @@ class PaypalConfiguration < Configuration

# this stuff is really handy
preference :currency_code, :string, :default => "EUR"
preference :page_style, :string, :default => 'PayPal'

# encryption / security
preference :encrypted, :boolean, :default => false
preference :cert_id, :string, :default => "12345678"
preference :ipn_secret, :string, :default => "secret"

validates_presence_of :name
validates_uniqueness_of :name
end
end

0 comments on commit 90f0302

Please sign in to comment.