My favorites | Sign in
Project Home Downloads Wiki Issues Source
READ-ONLY: This project has been archived. For more information see this post.
Search
for
  Advanced search   Search tips   Subscriptions

Issue 13 attachment: diff1.diff (5.1 KB)

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
Index: app/models/preference.rb
===================================================================
--- app/models/preference.rb (revision 155)
+++ app/models/preference.rb (working copy)
@@ -33,6 +33,14 @@
ActionMailer::Base.smtp_settings = mail_server_settings
end

+ def self.setup_am_based_on_preferences
+ if Preference.find_by_name('store_test_transactions').is_true?
+ ActiveMerchant::Billing::Base.integration_mode = :test
+ else
+ ActiveMerchant::Billing::Base.integration_mode = :production
+ end
+ end
+
# Saves preferences passed in from our form.
#
def self.save_settings(settings)
@@ -55,6 +63,6 @@

class NilClass
def is_true?
- return nil
+ raise "perhaps a preference not found--you may need to create and run a migration to load the new ones"
end
end
\ No newline at end of file
Index: app/controllers/store_controller.rb
===================================================================
--- app/controllers/store_controller.rb (revision 155)
+++ app/controllers/store_controller.rb (working copy)
@@ -11,13 +11,7 @@
:select_shipping_method, :view_shipping_method, :set_shipping_method,
:confirm_order, :finish_order
]
-
- if Preference.find_by_name('store_test_transactions').is_true?
- ActiveMerchant::Billing::Base.integration_mode = :test
- else
- ActiveMerchant::Billing::Base.integration_mode = :production
- end
-
+
# You can change this in an override depending on how many steps you want.
#
# For instance, perhaps you want to skip shipping calculation.
@@ -27,6 +21,8 @@
# @@action_after_checkout = 'finish_order'
@@action_after_checkout = 'select_shipping_method'

+ Preference.setup_am_based_on_preferences
+
# Our simple store index
def index
@title = "Store"
Index: app/controllers/admin/preferences_controller.rb
===================================================================
--- app/controllers/admin/preferences_controller.rb (revision 155)
+++ app/controllers/admin/preferences_controller.rb (working copy)
@@ -38,7 +38,7 @@
flash[:notice] = "There was an error initializing your mail server settings."
flash[:notice] << "Please re-check your settings and save again."
end
-
+ Preference.setup_am_based_on_preferences
redirect_to :action => 'index' and return
end

Index: app/views/admin/preferences/index.rhtml
===================================================================
--- app/views/admin/preferences/index.rhtml (revision 155)
+++ app/views/admin/preferences/index.rhtml (working copy)
@@ -16,7 +16,7 @@
<%= make_label('Handling Fee', true) %>
<%= text_field_tag('prefs[store_handling_fee]', @prefs['store_handling_fee'].value, :class => 'textInput')%>
<br/>
- <span class="info">This charge will be added to all orders.</span>
+ <span class="info">This charge will be added to all orders, and will be combined together with shipping on checkouts.</span>
</p>
<p>
<%= make_label('Your Country', true) %>
@@ -55,7 +55,7 @@
<span class="info">
If set, customers who have ordered previously will be prompted for their e-mail and password or previous order number upon checkout.
<br/>
- After login, their adress information will be auto-filled in the checkout form.
+ After login, their address information will be auto-filled in the checkout form.
</span>
</p>
</div>
@@ -70,7 +70,7 @@
<%= check_box_tag('prefs[store_test_transactions]', 1, (@prefs['store_test_transactions'].is_true?)) %>
Store is in test mode
</label>
- <span class="info">When in test mode, no real orders will be processed.</span>
+ <span class="info">When in test mode, no real orders will be processed. They will be processed in 'test mode' by the selected CC Processor.</span>
<input name="prefs[store_test_transactions]" type="hidden" value="0" />
</p>
<p>
@@ -81,18 +81,20 @@
<%= make_label('Login', true) %>
<%= text_field_tag('prefs[cc_login]', @prefs['cc_login'].value, :class => 'textInput')%>
<br>
- <span class="info">When using PayPal, this is your PayPal email address</span>
+ <span class="info">When using PayPal, this is your PayPal email address. With authorize.net, your API Login ID.</span>
</p>
<p>
<%= make_label('Password') %>
<%= password_field_tag('prefs[cc_pass]', @prefs['cc_pass'].value, :class => 'textInput')%>
+ <br/>
+ <span class="info">With paypal your password, with authorize.net, your transaction key.</span>
</p>
<p>
<label>
<%= check_box_tag('prefs[cc_clear_after_order]', 1, (@prefs['cc_clear_after_order'].is_true?)) %>
Clear all but last 4 digits of CC# after processing order?
<br/>
- <span class="info">If set, after a successful order all but the last 4 digits of CC# will be cleared.</span>
+ <span class="info">If set, after a successful order all but the last 4 digits of CC# will be cleared. Doesn't make a difference if you use paypal IPN, as no credit card numbers are entered on site.</span>
</label>
<input name="prefs[cc_clear_after_order]" type="hidden" value="0" />
</p>
Powered by Google Project Hosting