rack-payment 0.0.5 → 0.0.6
Sign up to get free protection for your applications and to get access to all the features.
@@ -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
|
-
|
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
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
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='
|
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>
|