rack-payment 0.0.5 → 0.0.6

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.
@@ -30,6 +30,9 @@ module Rack #:nodoc:
30
30
  def street() address1 end
31
31
  def street=(value) self.address1=(value) end
32
32
 
33
+ def address() address1 end
34
+ def address=(value) self.address1=(value) end
35
+
33
36
  # Returns a hash that can be passed to a Gateway#authorize call
34
37
  def active_merchant_hash
35
38
  {
@@ -26,7 +26,13 @@ module Rack #:nodoc:
26
26
  if express?
27
27
  express_amound_paid
28
28
  else
29
- (raw_capture_response.params['paid_amount'].to_f / 100)
29
+
30
+ if raw_capture_response.params['paid_amount'] # Sometimes we get this (like 995)
31
+ (raw_capture_response.params['paid_amount'].to_f / 100)
32
+ elsif raw_capture_response.params['gross_amount'] # PayPal likes to return this (like 9.95)
33
+ raw_capture_response.params['gross_amount'].to_d
34
+ end
35
+
30
36
  end
31
37
  end
32
38
  end
@@ -60,15 +60,19 @@
60
60
  <legend>Billing Address</legend>
61
61
 
62
62
  <div class='group'>
63
- <% %w( name address1 city ).each do |field| %>
64
- <label for='credit_card_<%= field %>'><%= field.gsub('_', ' ').capitalize %></label>
65
- <input type='text' id='billing_address_<%= field %>' name='billing_address[<%= field %>]' value='<%= billing_address[field] %>' />
66
- <% end %>
63
+ <label for='billing_address_name'>Full Name</label>
64
+ <input type='text' id='billing_address_name' name='billing_address[name]' value='<%= billing_address.name %>' />
65
+
66
+ <label for='billing_address_address1'>Address</label>
67
+ <input type='text' id='billing_address_address1' name='billing_address[address1]' value='<%= billing_address.address1 %>' />
68
+
69
+ <label for='billing_address_city'>City</label>
70
+ <input type='text' id='billing_address_city' name='billing_address[city]' value='<%= billing_address.city %>' />
67
71
  </div>
68
72
 
69
73
  <div class='group'>
70
74
  <% %w( state country zip ).each do |field| %>
71
- <label for='credit_card_<%= field %>'><%= field.gsub('_', ' ').capitalize %></label>
75
+ <label for='billing_address_<%= field %>'><%= field.gsub('_', ' ').capitalize %></label>
72
76
  <input type='text' id='billing_address_<%= field %>' name='billing_address[<%= field %>]' value='<%= billing_address[field] %>' />
73
77
  <% end %>
74
78
  </div>
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rack-payment
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.5
4
+ version: 0.0.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - remi