spree_sample 0.30.0.beta1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (54) hide show
  1. data/LICENSE +26 -0
  2. data/lib/generators/spree_sample/install_generator.rb +14 -0
  3. data/lib/generators/templates/db/sample/addresses.yml +27 -0
  4. data/lib/generators/templates/db/sample/adjustments.yml +24 -0
  5. data/lib/generators/templates/db/sample/assets/apache_baseball.png +0 -0
  6. data/lib/generators/templates/db/sample/assets/ror_bag.jpeg +0 -0
  7. data/lib/generators/templates/db/sample/assets/ror_baseball.jpeg +0 -0
  8. data/lib/generators/templates/db/sample/assets/ror_baseball_back.jpeg +0 -0
  9. data/lib/generators/templates/db/sample/assets/ror_baseball_jersey_back_blue.png +0 -0
  10. data/lib/generators/templates/db/sample/assets/ror_baseball_jersey_back_green.png +0 -0
  11. data/lib/generators/templates/db/sample/assets/ror_baseball_jersey_back_red.png +0 -0
  12. data/lib/generators/templates/db/sample/assets/ror_baseball_jersey_blue.png +0 -0
  13. data/lib/generators/templates/db/sample/assets/ror_baseball_jersey_green.png +0 -0
  14. data/lib/generators/templates/db/sample/assets/ror_baseball_jersey_red.png +0 -0
  15. data/lib/generators/templates/db/sample/assets/ror_jr_spaghetti.jpeg +0 -0
  16. data/lib/generators/templates/db/sample/assets/ror_mug.jpeg +0 -0
  17. data/lib/generators/templates/db/sample/assets/ror_mug_back.jpeg +0 -0
  18. data/lib/generators/templates/db/sample/assets/ror_ringer.jpeg +0 -0
  19. data/lib/generators/templates/db/sample/assets/ror_ringer_back.jpeg +0 -0
  20. data/lib/generators/templates/db/sample/assets/ror_stein.jpeg +0 -0
  21. data/lib/generators/templates/db/sample/assets/ror_stein_back.jpeg +0 -0
  22. data/lib/generators/templates/db/sample/assets/ror_tote.jpeg +0 -0
  23. data/lib/generators/templates/db/sample/assets/ror_tote_back.jpeg +0 -0
  24. data/lib/generators/templates/db/sample/assets/ruby_baseball.png +0 -0
  25. data/lib/generators/templates/db/sample/assets.yml +320 -0
  26. data/lib/generators/templates/db/sample/calculators.yml +16 -0
  27. data/lib/generators/templates/db/sample/checkouts.yml +14 -0
  28. data/lib/generators/templates/db/sample/inventory_units.rb +4 -0
  29. data/lib/generators/templates/db/sample/line_items.yml +40 -0
  30. data/lib/generators/templates/db/sample/option_types.yml +6 -0
  31. data/lib/generators/templates/db/sample/option_values.yml +35 -0
  32. data/lib/generators/templates/db/sample/orders.yml +17 -0
  33. data/lib/generators/templates/db/sample/payment_methods.yml +30 -0
  34. data/lib/generators/templates/db/sample/payments.rb +21 -0
  35. data/lib/generators/templates/db/sample/preferences.yml +20 -0
  36. data/lib/generators/templates/db/sample/product_groups.yml +9 -0
  37. data/lib/generators/templates/db/sample/product_option_types.yml +8 -0
  38. data/lib/generators/templates/db/sample/product_properties.yml +136 -0
  39. data/lib/generators/templates/db/sample/product_scopes.yml +35 -0
  40. data/lib/generators/templates/db/sample/products.rb +15 -0
  41. data/lib/generators/templates/db/sample/products.yml +53 -0
  42. data/lib/generators/templates/db/sample/properties.yml +39 -0
  43. data/lib/generators/templates/db/sample/prototypes.yml +9 -0
  44. data/lib/generators/templates/db/sample/shipments.yml +8 -0
  45. data/lib/generators/templates/db/sample/shipping_categories.yml +2 -0
  46. data/lib/generators/templates/db/sample/shipping_methods.yml +9 -0
  47. data/lib/generators/templates/db/sample/tax_categories.yml +6 -0
  48. data/lib/generators/templates/db/sample/taxonomies.yml +4 -0
  49. data/lib/generators/templates/db/sample/taxons.rb +3 -0
  50. data/lib/generators/templates/db/sample/taxons.yml +91 -0
  51. data/lib/generators/templates/db/sample/users.yml +6 -0
  52. data/lib/generators/templates/db/sample/variants.yml +133 -0
  53. data/lib/spree_sample.rb +6 -0
  54. metadata +133 -0
data/LICENSE ADDED
@@ -0,0 +1,26 @@
1
+ Copyright (c) 2007-2010, Rails Dog LLC and other contributors
2
+ All rights reserved.
3
+
4
+ Redistribution and use in source and binary forms, with or without modification,
5
+ are permitted provided that the following conditions are met:
6
+
7
+ * Redistributions of source code must retain the above copyright notice,
8
+ this list of conditions and the following disclaimer.
9
+ * Redistributions in binary form must reproduce the above copyright notice,
10
+ this list of conditions and the following disclaimer in the documentation
11
+ and/or other materials provided with the distribution.
12
+ * Neither the name Spree nor the names of its contributors may be used to
13
+ endorse or promote products derived from this software without specific
14
+ prior written permission.
15
+
16
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
17
+ "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
18
+ LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
19
+ A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
20
+ CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
21
+ EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
22
+ PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
23
+ PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
24
+ LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
25
+ NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
26
+ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
@@ -0,0 +1,14 @@
1
+ module SpreeSample
2
+ module Generators
3
+ class InstallGenerator < Rails::Generators::Base
4
+ source_root File.expand_path("../../templates", __FILE__)
5
+
6
+ desc "Copies sample fixtures and images into your Spree application."
7
+
8
+ def copy_stuff
9
+ directory 'db'
10
+ end
11
+
12
+ end
13
+ end
14
+ end
@@ -0,0 +1,27 @@
1
+ <%
2
+ require 'faker'
3
+ 1.upto(100) do |i|
4
+ %>
5
+ ship_address_<%= i %>:
6
+ firstname: <%= Faker::Name.first_name %>
7
+ lastname: <%= Faker::Name.last_name %>
8
+ address1: <%= Faker::Address.street_address %>
9
+ address2: <%= Faker::Address.secondary_address %>
10
+ city: <%= Faker::Address.city %>
11
+ state_id: 889445952
12
+ zipcode: 16804
13
+ country_id: 214
14
+ phone: <%= Faker::PhoneNumber.phone_number %>
15
+ <% end %>
16
+ <% 1.upto(100) do |i| %>
17
+ bill_address_<%= i %>:
18
+ firstname: <%= Faker::Name.first_name %>
19
+ lastname: <%= Faker::Name.last_name %>
20
+ address1: <%= Faker::Address.street_address %>
21
+ address2: <%= Faker::Address.secondary_address %>
22
+ city: <%= Faker::Address.city %>
23
+ state_id: 889445952
24
+ zipcode: 16804
25
+ country_id: 214
26
+ phone: <%= Faker::PhoneNumber.phone_number %>
27
+ <% end %>
@@ -0,0 +1,24 @@
1
+ <% 1.upto(100) do |i| %>
2
+ tax_<%= i %>:
3
+ order: order_<%= i %>
4
+ amount: 0
5
+ source: order_<%= i %>
6
+ source_type: Order
7
+ originator:
8
+ originator_type:
9
+ label: Tax
10
+ frozen: false
11
+ mandatory: true
12
+ <% end %>
13
+ <% 1.upto(100) do |i| %>
14
+ ship_<%= i %>:
15
+ order: order_<%= i %>
16
+ amount: 5
17
+ source: shipment_<%= i %>
18
+ source_type: Shipment
19
+ originator:
20
+ originator_type:
21
+ label: Shipping
22
+ frozen: true
23
+ mandatory: true
24
+ <% end %>
@@ -0,0 +1,320 @@
1
+ img_tote:
2
+ id: 1
3
+ viewable: ror_tote
4
+ viewable_type: Product
5
+ attachment_content_type: image/jpg
6
+ attachment_file_name: ror_tote.jpeg
7
+ attachment_width: 360
8
+ attachment_height: 360
9
+ type: Image
10
+ position: 1
11
+ img_tote_back:
12
+ id: 2
13
+ viewable: ror_tote
14
+ viewable_type: Product
15
+ attachment_content_type: image/jpg
16
+ attachment_file_name: ror_tote_back.jpeg
17
+ attachment_width: 360
18
+ attachment_height: 360
19
+ type: Image
20
+ position: 2
21
+ img_bag:
22
+ id: 3
23
+ viewable: ror_bag
24
+ viewable_type: Product
25
+ attachment_content_type: image/jpg
26
+ attachment_file_name: ror_bag.jpeg
27
+ attachment_width: 360
28
+ attachment_height: 360
29
+ type: Image
30
+ position: 1
31
+ img_baseball:
32
+ id: 4
33
+ viewable: ror_baseball_jersey
34
+ viewable_type: Product
35
+ attachment_content_type: image/jpg
36
+ attachment_file_name: ror_baseball.jpeg
37
+ attachment_width: 360
38
+ attachment_height: 360
39
+ type: Image
40
+ position: 1
41
+ img_baseball_back:
42
+ id: 5
43
+ viewable: ror_baseball_jersey
44
+ viewable_type: Product
45
+ attachment_content_type: image/jpg
46
+ attachment_file_name: ror_baseball_back.jpeg
47
+ attachment_width: 360
48
+ attachment_height: 360
49
+ type: Image
50
+ position: 2
51
+ img_jr_spaghetti:
52
+ id: 6
53
+ viewable: ror_jr_spaghetti
54
+ viewable_type: Product
55
+ attachment_content_type: image/jpg
56
+ attachment_file_name: ror_jr_spaghetti.jpeg
57
+ attachment_width: 360
58
+ attachment_height: 360
59
+ type: Image
60
+ position: 1
61
+ img_mug:
62
+ id: 7
63
+ viewable: ror_mug
64
+ viewable_type: Product
65
+ attachment_content_type: image/jpg
66
+ attachment_file_name: ror_mug.jpeg
67
+ attachment_width: 360
68
+ attachment_height: 360
69
+ type: Image
70
+ position: 1
71
+ img_mug_back:
72
+ id: 8
73
+ viewable: ror_mug
74
+ viewable_type: Product
75
+ attachment_content_type: image/jpg
76
+ attachment_file_name: ror_mug_back.jpeg
77
+ attachment_width: 360
78
+ attachment_height: 360
79
+ type: Image
80
+ position: 2
81
+ img_ringer:
82
+ id: 9
83
+ viewable: ror_ringer
84
+ viewable_type: Product
85
+ attachment_content_type: image/jpg
86
+ attachment_file_name: ror_ringer.jpeg
87
+ attachment_width: 360
88
+ attachment_height: 360
89
+ type: Image
90
+ position: 1
91
+ img_ringer_back:
92
+ id: 10
93
+ viewable: ror_ringer
94
+ viewable_type: Product
95
+ attachment_content_type: image/jpg
96
+ attachment_file_name: ror_ringer_back.jpeg
97
+ attachment_width: 360
98
+ attachment_height: 360
99
+ type: Image
100
+ position: 2
101
+ img_stein:
102
+ id: 11
103
+ viewable: ror_stein
104
+ viewable_type: Product
105
+ attachment_content_type: image/jpg
106
+ attachment_file_name: ror_stein.jpeg
107
+ attachment_width: 360
108
+ attachment_height: 360
109
+ type: Image
110
+ position: 1
111
+ img_stein_back:
112
+ id: 12
113
+ viewable: ror_stein
114
+ viewable_type: Product
115
+ attachment_content_type: image/jpg
116
+ attachment_file_name: ror_stein_back.jpeg
117
+ attachment_width: 360
118
+ attachment_height: 360
119
+ type: Image
120
+ position: 2
121
+ img_apache_baseball:
122
+ id: 1004
123
+ viewable: apache_baseball_jersey
124
+ viewable_type: Product
125
+ attachment_content_type: image/png
126
+ attachment_file_name: apache_baseball.png
127
+ attachment_width: 504
128
+ attachment_height: 484
129
+ type: Image
130
+ position: 1
131
+ img_ruby_baseball:
132
+ id: 1008
133
+ viewable: ruby_baseball_jersey
134
+ viewable_type: Product
135
+ attachment_content_type: image/png
136
+ attachment_file_name: ruby_baseball.png
137
+ attachment_width: 495
138
+ attachment_height: 477
139
+ type: Image
140
+ position: 1
141
+ img_baseball_small_green:
142
+ id: 1009
143
+ viewable: small-green-baseball
144
+ viewable_type: Variant
145
+ attachment_content_type: image/png
146
+ attachment_file_name: ror_baseball_jersey_green.png
147
+ attachment_width: 240
148
+ attachment_height: 240
149
+ type: Image
150
+ position: 1
151
+ img_baseball_small_green_back:
152
+ id: 1010
153
+ viewable: small-green-baseball
154
+ viewable_type: Variant
155
+ attachment_content_type: image/png
156
+ attachment_file_name: ror_baseball_jersey_back_green.png
157
+ attachment_width: 240
158
+ attachment_height: 240
159
+ type: Image
160
+ position: 2
161
+ img_baseball_med_green:
162
+ id: 1011
163
+ viewable: med-green-baseball
164
+ viewable_type: Variant
165
+ attachment_content_type: image/png
166
+ attachment_file_name: ror_baseball_jersey_green.png
167
+ attachment_width: 240
168
+ attachment_height: 240
169
+ type: Image
170
+ position: 1
171
+ img_baseball_med_green_back:
172
+ id: 1012
173
+ viewable: med-green-baseball
174
+ viewable_type: Variant
175
+ attachment_content_type: image/png
176
+ attachment_file_name: ror_baseball_jersey_back_green.png
177
+ attachment_width: 240
178
+ attachment_height: 240
179
+ type: Image
180
+ position: 2
181
+ img_baseball_large_green:
182
+ id: 1013
183
+ viewable: large-green-baseball
184
+ viewable_type: Variant
185
+ attachment_content_type: image/png
186
+ attachment_file_name: ror_baseball_jersey_green.png
187
+ attachment_width: 240
188
+ attachment_height: 240
189
+ type: Image
190
+ position: 1
191
+ img_baseball_large_green_back:
192
+ id: 1014
193
+ viewable: large-green-baseball
194
+ viewable_type: Variant
195
+ attachment_content_type: image/png
196
+ attachment_file_name: ror_baseball_jersey_back_green.png
197
+ attachment_width: 240
198
+ attachment_height: 240
199
+ type: Image
200
+ position: 2
201
+ img_baseball_small_blue:
202
+ id: 1015
203
+ viewable: small-blue-baseball
204
+ viewable_type: Variant
205
+ attachment_content_type: image/png
206
+ attachment_file_name: ror_baseball_jersey_blue.png
207
+ attachment_width: 240
208
+ attachment_height: 240
209
+ type: Image
210
+ position: 1
211
+ img_baseball_small_blue_back:
212
+ id: 1016
213
+ viewable: small-blue-baseball
214
+ viewable_type: Variant
215
+ attachment_content_type: image/png
216
+ attachment_file_name: ror_baseball_jersey_back_blue.png
217
+ attachment_width: 240
218
+ attachment_height: 240
219
+ type: Image
220
+ position: 2
221
+ img_baseball_med_blue:
222
+ id: 1017
223
+ viewable: med-blue-baseball
224
+ viewable_type: Variant
225
+ attachment_content_type: image/png
226
+ attachment_file_name: ror_baseball_jersey_blue.png
227
+ attachment_width: 240
228
+ attachment_height: 240
229
+ type: Image
230
+ position: 1
231
+ img_baseball_med_blue_back:
232
+ id: 1018
233
+ viewable: med-blue-baseball
234
+ viewable_type: Variant
235
+ attachment_content_type: image/png
236
+ attachment_file_name: ror_baseball_jersey_back_blue.png
237
+ attachment_width: 240
238
+ attachment_height: 240
239
+ type: Image
240
+ position: 2
241
+ img_baseball_large_blue:
242
+ id: 1019
243
+ viewable: large-blue-baseball
244
+ viewable_type: Variant
245
+ attachment_content_type: image/png
246
+ attachment_file_name: ror_baseball_jersey_blue.png
247
+ attachment_width: 240
248
+ attachment_height: 240
249
+ type: Image
250
+ position: 1
251
+ img_baseball_large_blue_back:
252
+ id: 1020
253
+ viewable: large-blue-baseball
254
+ viewable_type: Variant
255
+ attachment_content_type: image/png
256
+ attachment_file_name: ror_baseball_jersey_back_blue.png
257
+ attachment_width: 240
258
+ attachment_height: 240
259
+ type: Image
260
+ position: 2
261
+ img_baseball_large_red:
262
+ id: 1021
263
+ viewable: large-red-baseball
264
+ viewable_type: Variant
265
+ attachment_content_type: image/png
266
+ attachment_file_name: ror_baseball_jersey_red.png
267
+ attachment_width: 240
268
+ attachment_height: 240
269
+ type: Image
270
+ position: 1
271
+ img_baseball_large_red_back:
272
+ id: 1022
273
+ viewable: large-red-baseball
274
+ viewable_type: Variant
275
+ attachment_content_type: image/png
276
+ attachment_file_name: ror_baseball_jersey_back_red.png
277
+ attachment_width: 240
278
+ attachment_height: 240
279
+ type: Image
280
+ position: 2
281
+ img_baseball_med_red:
282
+ id: 1023
283
+ viewable: med-red-baseball
284
+ viewable_type: Variant
285
+ attachment_content_type: image/png
286
+ attachment_file_name: ror_baseball_jersey_red.png
287
+ attachment_width: 240
288
+ attachment_height: 240
289
+ type: Image
290
+ position: 1
291
+ img_baseball_med_red_back:
292
+ id: 1024
293
+ viewable: med-red-baseball
294
+ viewable_type: Variant
295
+ attachment_content_type: image/png
296
+ attachment_file_name: ror_baseball_jersey_back_red.png
297
+ attachment_width: 240
298
+ attachment_height: 240
299
+ type: Image
300
+ position: 2
301
+ img_baseball_small_red:
302
+ id: 1025
303
+ viewable: small-red-baseball
304
+ viewable_type: Variant
305
+ attachment_content_type: image/png
306
+ attachment_file_name: ror_baseball_jersey_red.png
307
+ attachment_width: 240
308
+ attachment_height: 240
309
+ type: Image
310
+ position: 1
311
+ img_baseball_small_red_back:
312
+ id: 1026
313
+ viewable: small-red-baseball
314
+ viewable_type: Variant
315
+ attachment_content_type: image/png
316
+ attachment_file_name: ror_baseball_jersey_back_red.png
317
+ attachment_width: 240
318
+ attachment_height: 240
319
+ type: Image
320
+ position: 2
@@ -0,0 +1,16 @@
1
+ ups_ground:
2
+ calculable: ups_ground
3
+ calculable_type: ShippingMethod
4
+ type: Calculator::FlatRate
5
+ ups_two_day:
6
+ calculable: ups_two_day
7
+ calculable_type: ShippingMethod
8
+ type: Calculator::FlatRate
9
+ ups_one_day:
10
+ calculable: ups_one_day
11
+ calculable_type: ShippingMethod
12
+ type: Calculator::FlatRate
13
+ flat_rate_coupon_calculator:
14
+ calculable: spree_coupon
15
+ calculable_type: Promotion
16
+ type: Calculator::FlatRate
@@ -0,0 +1,14 @@
1
+ <%
2
+ require 'faker'
3
+ 1.upto(100) do |i|
4
+ email = Faker::Internet.email
5
+ %>
6
+ checkout_<%= i %>:
7
+ bill_address: bill_address_<%= i %>
8
+ ship_address: ship_address_<%= i %>
9
+ email: <%= email %>
10
+ order: order_<%= i %>
11
+ ip_address: 127.0.0.1
12
+ state: "complete"
13
+ shipping_method: ups_ground
14
+ <% end %>
@@ -0,0 +1,4 @@
1
+ # create the inventory units associated with the line item (we need to do this after the fixture b/c quantity is random)
2
+ LineItem.all.each do |li|
3
+ li.quantity.times { li.order.inventory_units.create(:variant => li.variant, :state => "sold", :shipment => li.order.shipment) }
4
+ end
@@ -0,0 +1,40 @@
1
+ <% for i in 1..100 do%>
2
+ li_<%= i %>:
3
+ order: order_<%= i %>
4
+ variant: ror_tote_v
5
+ quantity: <%= rand(4) + 1 %>
6
+ price: 15.99
7
+ <% end %>
8
+
9
+ <% for i in 1..10 do%>
10
+ li_<%= i + 1000 %>:
11
+ order: order_<%= i %>
12
+ variant: ror_bag_v
13
+ quantity: <%= rand(2) + 1 %>
14
+ price: 22.99
15
+ <% end %>
16
+
17
+ <% for i in 10..20 do%>
18
+ li_<%= i + 2000 %>:
19
+ order: order_<%= i %>
20
+ variant: large-blue-baseball
21
+ quantity: <%= rand(3) + 1 %>
22
+ price: 19.99
23
+ <% end %>
24
+
25
+ <% for i in 10..30 do%>
26
+ li_<%= i + 3000 %>:
27
+ order: order_<%= i %>
28
+ variant: ror_stein_v
29
+ quantity: <%= rand(3) + 1 %>
30
+ price: 16.99
31
+ <% end %>
32
+
33
+ <% for i in 30..50 do%>
34
+ li_<%= i + 4000 %>:
35
+ order: order_<%= i %>
36
+ variant: ror_mug_v
37
+ quantity: <%= rand(10) + 1 %>
38
+ price: 13.99
39
+ <% end %>
40
+
@@ -0,0 +1,6 @@
1
+ size:
2
+ name: tshirt-size
3
+ presentation: Size
4
+ color:
5
+ name: tshirt-color
6
+ presentation: Color
@@ -0,0 +1,35 @@
1
+ s:
2
+ name: Small
3
+ presentation: S
4
+ position: 1
5
+ option_type: size
6
+ m:
7
+ name: Medium
8
+ presentation: M
9
+ position: 2
10
+ option_type: size
11
+ l:
12
+ name: Large
13
+ presentation: L
14
+ position: 3
15
+ option_type: size
16
+ xl:
17
+ name: Extra Large
18
+ presentation: XL
19
+ position: 4
20
+ option_type: size
21
+ red:
22
+ name: Red
23
+ presentation: Red
24
+ position: 1
25
+ option_type: color
26
+ green:
27
+ name: Green
28
+ presentation: Green
29
+ position: 2
30
+ option_type: color
31
+ blue:
32
+ name: Blue
33
+ presentation: Blue
34
+ position: 3
35
+ option_type: color
@@ -0,0 +1,17 @@
1
+ <%
2
+ order_date = Time.now
3
+ 1.upto(100) do |i|
4
+ order_date -= rand(12).hours
5
+ item_total = "#{1 + rand(400)}.#{rand(100)}".to_f
6
+ charges_total = "#{1 + rand(30)}.#{rand(100)}".to_f
7
+ %>
8
+ order_<%= i %>:
9
+ number: <%= "R#{Array.new(9){rand(9)}.join}" %>
10
+ user: user_<%= i %>
11
+ state: complete
12
+ item_total: <%= item_total %>
13
+ created_at: <%=order_date.to_s(:db)%>
14
+ completed_at: <%=order_date.to_s(:db)%>
15
+ total: <%= item_total + charges_total %>
16
+ adjustment_total: <%= charges_total %>
17
+ <% end %>
@@ -0,0 +1,30 @@
1
+ bogus_dev:
2
+ name: Credit Card
3
+ description: Bogus payment gateway for development.
4
+ environment: development
5
+ active: true
6
+ type: Gateway::Bogus
7
+ check_method:
8
+ name: Check
9
+ description: Pay by check.
10
+ active: true
11
+ type: PaymentMethod::Check
12
+ bogus_test:
13
+ name: Credit Card
14
+ description: Bogus payment gateway for test.
15
+ environment: test
16
+ active: true
17
+ type: Gateway::Bogus
18
+ bogus_prod:
19
+ name: Credit Card
20
+ description: Bogus payment gateway for production.
21
+ environment: production
22
+ active: true
23
+ type: Gateway::Bogus
24
+ bogus_prod:
25
+ name: Credit Card
26
+ description: Bogus payment gateway for staging.
27
+ environment: staging
28
+ active: true
29
+ type: Gateway::Bogus
30
+
@@ -0,0 +1,21 @@
1
+ # create payments based on the totals since they can't be known in YAML (quantities are random)
2
+ method = PaymentMethod.find(:first, :conditions => {:name => "Credit Card", :active => true})
3
+
4
+ # Hack the current method so we're able to return a gateway without a RAILS_ENV
5
+ Gateway.class_eval do
6
+ def self.current
7
+ Gateway::Bogus.new
8
+ end
9
+ end
10
+
11
+ creditcard = Creditcard.create(:cc_type => "visa", :month => 12, :year => 2014, :last_digits => "1111",
12
+ :first_name => "Sean", :last_name => "Schofield",
13
+ :gateway_customer_profile_id => "BGS-1234")
14
+
15
+ Order.all.each_with_index do |order,index|
16
+ printf "\rProcessing order #{index}"
17
+ STDOUT.flush
18
+ order.update!
19
+ payment = order.payments.create(:amount => order.total, :source => creditcard.clone, :payment_method => method)
20
+ end
21
+ puts
@@ -0,0 +1,20 @@
1
+ flat_rate_ground:
2
+ name: amount
3
+ owner: ups_ground
4
+ owner_type: Calculator
5
+ value: 5
6
+ flat_rate_two_day:
7
+ name: amount
8
+ owner: ups_two_day
9
+ owner_type: Calculator
10
+ value: 10
11
+ flat_rate_one_day:
12
+ name: amount
13
+ owner: ups_one_day
14
+ owner_type: Calculator
15
+ value: 15
16
+ flat_rate_five_dollars:
17
+ name: amount
18
+ owner: flat_rate_coupon_calculator
19
+ owner_type: Calculator
20
+ value: 5