workarea-gift_cards 3.4.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.editorconfig +20 -0
- data/.eslintignore +2 -0
- data/.eslintrc +24 -0
- data/.github/ISSUE_TEMPLATE/bug_report.md +37 -0
- data/.github/ISSUE_TEMPLATE/documentation-request.md +17 -0
- data/.github/ISSUE_TEMPLATE/feature_request.md +20 -0
- data/.gitignore +15 -0
- data/.scss-lint.yml +188 -0
- data/.yardopts +1 -0
- data/CHANGELOG.md +485 -0
- data/CODE_OF_CONDUCT.md +3 -0
- data/CONTRIBUTING.md +3 -0
- data/Gemfile +7 -0
- data/LICENSE +52 -0
- data/README.md +119 -0
- data/Rakefile +53 -0
- data/app/assets/images/workarea/admin/payment_icons/gift_card.svg +1 -0
- data/app/assets/images/workarea/storefront/payment_icons/gift_card.svg +1 -0
- data/app/controllers/workarea/admin/data_file_exports_controller.decorator +28 -0
- data/app/controllers/workarea/admin/payment_gift_cards_controller.rb +78 -0
- data/app/controllers/workarea/api/admin/payment_gift_cards_controller.rb +49 -0
- data/app/controllers/workarea/api/storefront/checkouts_controller.decorator +10 -0
- data/app/controllers/workarea/api/storefront/gift_cards_controller.rb +26 -0
- data/app/controllers/workarea/storefront/checkouts_controller.decorator +24 -0
- data/app/controllers/workarea/storefront/gift_cards_controller.rb +24 -0
- data/app/mailers/workarea/storefront/gift_card_mailer.rb +28 -0
- data/app/models/workarea/catalog/customizations/gift_card.rb +9 -0
- data/app/models/workarea/catalog/product.decorator +11 -0
- data/app/models/workarea/order/item.decorator +7 -0
- data/app/models/workarea/payment/authorize/gift_card.rb +43 -0
- data/app/models/workarea/payment/capture/gift_card.rb +25 -0
- data/app/models/workarea/payment/gift_card/redemption.rb +23 -0
- data/app/models/workarea/payment/gift_card.rb +186 -0
- data/app/models/workarea/payment/purchase/gift_card.rb +7 -0
- data/app/models/workarea/payment/refund/gift_card.rb +35 -0
- data/app/models/workarea/payment/tender/gift_card.rb +30 -0
- data/app/models/workarea/payment.decorator +19 -0
- data/app/models/workarea/search/admin/order.decorator +9 -0
- data/app/models/workarea/search/admin/payment_gift_card.rb +46 -0
- data/app/queries/workarea/admin_redemptions_export.rb +84 -0
- data/app/queries/workarea/order_item_details.decorator +11 -0
- data/app/queries/workarea/search/admin_gift_cards.rb +20 -0
- data/app/seeds/workarea/gift_card_seeds.rb +44 -0
- data/app/services/workarea/checkout/steps/gift_card.rb +49 -0
- data/app/view_models/workarea/admin/payment_gift_card_view_model.rb +11 -0
- data/app/view_models/workarea/storefront/checkout/payment_view_model.decorator +32 -0
- data/app/view_models/workarea/storefront/checkout/summary_view_model.decorator +11 -0
- data/app/view_models/workarea/storefront/gift_card_order_pricing.rb +36 -0
- data/app/view_models/workarea/storefront/order_view_model.decorator +27 -0
- data/app/view_models/workarea/storefront/product_templates/gift_card_view_model.rb +4 -0
- data/app/views/workarea/admin/activities/_payment_gift_card_create.html.haml +12 -0
- data/app/views/workarea/admin/activities/_payment_gift_card_destroy.html.haml +10 -0
- data/app/views/workarea/admin/activities/_payment_gift_card_update.html.haml +14 -0
- data/app/views/workarea/admin/orders/tenders/_gift_card.html.haml +5 -0
- data/app/views/workarea/admin/payment_gift_cards/_aux_navigation.html.haml +4 -0
- data/app/views/workarea/admin/payment_gift_cards/_cards.html.haml +74 -0
- data/app/views/workarea/admin/payment_gift_cards/_menu.html.haml +1 -0
- data/app/views/workarea/admin/payment_gift_cards/_summary.html.haml +11 -0
- data/app/views/workarea/admin/payment_gift_cards/edit.html.haml +37 -0
- data/app/views/workarea/admin/payment_gift_cards/index.html.haml +95 -0
- data/app/views/workarea/admin/payment_gift_cards/new.html.haml +43 -0
- data/app/views/workarea/admin/payment_gift_cards/redemptions.html.haml +29 -0
- data/app/views/workarea/admin/payment_gift_cards/show.html.haml +19 -0
- data/app/views/workarea/api/storefront/checkouts/steps/_gift_card.json.jbuilder +6 -0
- data/app/views/workarea/api/storefront/gift_cards/balance.json.jbuilder +3 -0
- data/app/views/workarea/api/storefront/orders/tenders/_gift_card.json.jbuilder +3 -0
- data/app/views/workarea/storefront/checkouts/_gift_card_error.html.haml +6 -0
- data/app/views/workarea/storefront/checkouts/_gift_card_payment.html.haml +28 -0
- data/app/views/workarea/storefront/checkouts/_gift_card_summary.html.haml +6 -0
- data/app/views/workarea/storefront/gift_card_mailer/created.html.haml +15 -0
- data/app/views/workarea/storefront/gift_cards/index.html.haml +17 -0
- data/app/views/workarea/storefront/order_mailer/_gift_card_summary.html.haml +5 -0
- data/app/views/workarea/storefront/order_mailer/tenders/_gift_card.html.haml +5 -0
- data/app/views/workarea/storefront/orders/_gift_card_summary.html.haml +6 -0
- data/app/views/workarea/storefront/orders/tenders/_gift_card.html.haml +9 -0
- data/app/views/workarea/storefront/products/templates/_gift_card.html.haml +77 -0
- data/app/workers/workarea/create_ordered_gift_cards.rb +47 -0
- data/app/workers/workarea/log_gift_card_redemption.rb +32 -0
- data/app/workers/workarea/send_gift_card_notifications.rb +20 -0
- data/bin/rails +18 -0
- data/config/initializers/append_points.rb +37 -0
- data/config/initializers/configuration.rb +8 -0
- data/config/initializers/jump_to_navigation.rb +3 -0
- data/config/locales/en.yml +82 -0
- data/config/routes.rb +31 -0
- data/lib/workarea/gift_cards/engine.rb +19 -0
- data/lib/workarea/gift_cards/version.rb +5 -0
- data/lib/workarea/gift_cards.rb +11 -0
- data/lib/workarea/mailer_previews/storefront/gift_card_mailer_preview.rb +18 -0
- data/test/documentation/workarea/api/admin/gift_cards_documentation_test.rb +82 -0
- data/test/documentation/workarea/api/storefront/gift_cards_documentation_test.rb +107 -0
- data/test/dummy/Rakefile +6 -0
- data/test/dummy/app/assets/config/manifest.js +4 -0
- data/test/dummy/app/assets/images/.keep +0 -0
- data/test/dummy/app/assets/javascripts/application.js +13 -0
- data/test/dummy/app/assets/stylesheets/application.css +15 -0
- data/test/dummy/app/controllers/application_controller.rb +3 -0
- data/test/dummy/app/controllers/concerns/.keep +0 -0
- data/test/dummy/app/helpers/application_helper.rb +2 -0
- data/test/dummy/app/jobs/application_job.rb +2 -0
- data/test/dummy/app/mailers/application_mailer.rb +4 -0
- data/test/dummy/app/models/concerns/.keep +0 -0
- data/test/dummy/app/views/layouts/application.html.erb +14 -0
- data/test/dummy/app/views/layouts/mailer.html.erb +13 -0
- data/test/dummy/app/views/layouts/mailer.text.erb +1 -0
- data/test/dummy/bin/bundle +3 -0
- data/test/dummy/bin/rails +4 -0
- data/test/dummy/bin/rake +4 -0
- data/test/dummy/bin/setup +34 -0
- data/test/dummy/bin/update +29 -0
- data/test/dummy/config/application.rb +24 -0
- data/test/dummy/config/boot.rb +5 -0
- data/test/dummy/config/cable.yml +9 -0
- data/test/dummy/config/environment.rb +5 -0
- data/test/dummy/config/environments/development.rb +54 -0
- data/test/dummy/config/environments/production.rb +86 -0
- data/test/dummy/config/environments/test.rb +43 -0
- data/test/dummy/config/initializers/application_controller_renderer.rb +6 -0
- data/test/dummy/config/initializers/assets.rb +11 -0
- data/test/dummy/config/initializers/backtrace_silencers.rb +7 -0
- data/test/dummy/config/initializers/cookies_serializer.rb +5 -0
- data/test/dummy/config/initializers/filter_parameter_logging.rb +4 -0
- data/test/dummy/config/initializers/inflections.rb +16 -0
- data/test/dummy/config/initializers/mime_types.rb +4 -0
- data/test/dummy/config/initializers/new_framework_defaults.rb +21 -0
- data/test/dummy/config/initializers/session_store.rb +3 -0
- data/test/dummy/config/initializers/workarea.rb +5 -0
- data/test/dummy/config/initializers/wrap_parameters.rb +14 -0
- data/test/dummy/config/locales/en.yml +23 -0
- data/test/dummy/config/puma.rb +47 -0
- data/test/dummy/config/routes.rb +6 -0
- data/test/dummy/config/secrets.yml +22 -0
- data/test/dummy/config/spring.rb +6 -0
- data/test/dummy/config.ru +5 -0
- data/test/dummy/lib/assets/.keep +0 -0
- data/test/dummy/log/.keep +0 -0
- data/test/dummy/public/404.html +67 -0
- data/test/dummy/public/422.html +67 -0
- data/test/dummy/public/500.html +66 -0
- data/test/dummy/public/apple-touch-icon-precomposed.png +0 -0
- data/test/dummy/public/apple-touch-icon.png +0 -0
- data/test/dummy/public/favicon.ico +0 -0
- data/test/factories/gift_cards.rb +27 -0
- data/test/integration/workarea/admin/gift_card_integration_test.rb +53 -0
- data/test/integration/workarea/admin/gift_card_redemptions_export_integration_test.rb +104 -0
- data/test/integration/workarea/api/admin/gift_card_integration_test.rb +57 -0
- data/test/integration/workarea/api/storefront/balance_integration_test.rb +40 -0
- data/test/integration/workarea/api/storefront/checkout_integration_test.rb +161 -0
- data/test/integration/workarea/storefront/gift_card_integration_test.rb +222 -0
- data/test/models/workarea/catalog/gift_card_product_test.rb +15 -0
- data/test/models/workarea/gift_card_payment_test.rb +12 -0
- data/test/models/workarea/payment/gift_card_test.rb +127 -0
- data/test/models/workarea/payment/purchase/gift_card_test.rb +52 -0
- data/test/models/workarea/payment/refund/gift_card_test.rb +19 -0
- data/test/queries/workarea/admin_redemptions_export_test.rb +52 -0
- data/test/queries/workarea/gift_card_order_item_details_test.rb +11 -0
- data/test/services/workarea/checkout/steps/gift_card_test.rb +87 -0
- data/test/system/workarea/admin/gift_cards_system_test.rb +89 -0
- data/test/system/workarea/storefront/gift_cards_system_test.rb +400 -0
- data/test/test_helper.rb +10 -0
- data/test/view_models/workarea/storefront/checkout/gift_card_payment_view_model_test.rb +65 -0
- data/test/workers/workarea/create_ordered_gift_cards_test.rb +39 -0
- data/test/workers/workarea/log_gift_card_redemption_test.rb +19 -0
- data/workarea-gift_cards.gemspec +21 -0
- metadata +227 -0
data/CHANGELOG.md
ADDED
@@ -0,0 +1,485 @@
|
|
1
|
+
Workarea Gift Cards 3.4.6 (2019-08-21)
|
2
|
+
--------------------------------------------------------------------------------
|
3
|
+
|
4
|
+
* Open Source!
|
5
|
+
|
6
|
+
|
7
|
+
|
8
|
+
Workarea Gift Cards 3.4.5 (2019-03-05)
|
9
|
+
--------------------------------------------------------------------------------
|
10
|
+
|
11
|
+
* Create Gift Cards For Order When Creating Fulfillment
|
12
|
+
|
13
|
+
Workarea previously enqueued the `Workarea::CreateOrderedGiftCards`
|
14
|
+
worker when an order was placed, but this caused an error if the job was
|
15
|
+
executed prior to the fulfillment being persisted. This job will now
|
16
|
+
enqueue after creating a new `Workarea::Fulfillment` record, ensuring
|
17
|
+
that the data the worker needs is in place before it runs.
|
18
|
+
|
19
|
+
GIFTCARDS-122
|
20
|
+
Tom Scott
|
21
|
+
|
22
|
+
* Fix Gift Cards Overwriting "To:" Field Translation
|
23
|
+
|
24
|
+
Installing the gift cards plugin previously overrode the base
|
25
|
+
`workarea.admin.fields.to` translation with "Recipient: ".
|
26
|
+
This translation is now named to `workarea.admin.fields.recipient`,
|
27
|
+
in order to preserve the text of `workarea.admin.fields.to` for other
|
28
|
+
uses in the admin.
|
29
|
+
|
30
|
+
GIFTCARDS-126
|
31
|
+
Tom Scott
|
32
|
+
|
33
|
+
* Add product-details__heading class for direct styling hook
|
34
|
+
|
35
|
+
ECOMMERCE-6363
|
36
|
+
Curt Howard
|
37
|
+
|
38
|
+
|
39
|
+
|
40
|
+
Workarea Gift Cards 3.4.4 (2019-02-05)
|
41
|
+
--------------------------------------------------------------------------------
|
42
|
+
|
43
|
+
* Update for workarea v3.4 compatibility
|
44
|
+
|
45
|
+
GIFTCARDS-123
|
46
|
+
Matt Duffy
|
47
|
+
|
48
|
+
|
49
|
+
|
50
|
+
Workarea Gift Cards 3.4.3 (2019-01-22)
|
51
|
+
--------------------------------------------------------------------------------
|
52
|
+
|
53
|
+
* Add #scroll to AdminRedemptionExport class to support large exports
|
54
|
+
|
55
|
+
Matt Duffy
|
56
|
+
|
57
|
+
* Incorrect Gift Card Timeline Link URL
|
58
|
+
|
59
|
+
The URL to the gift card on the timeline when created is not correct,
|
60
|
+
seems to be a bad copy/paste from the products. This link is now
|
61
|
+
correctly pointing to the gift card's payment page, not a product page
|
62
|
+
that doesn't exist.
|
63
|
+
|
64
|
+
GIFTCARDS-104
|
65
|
+
Tom Scott
|
66
|
+
|
67
|
+
|
68
|
+
|
69
|
+
Workarea Gift Cards 3.4.2 (2019-01-08)
|
70
|
+
--------------------------------------------------------------------------------
|
71
|
+
|
72
|
+
* Update README
|
73
|
+
|
74
|
+
GIFTCARDS-121
|
75
|
+
Matt Duffy
|
76
|
+
|
77
|
+
|
78
|
+
|
79
|
+
Workarea Gift Cards 3.4.1 (2018-09-05)
|
80
|
+
--------------------------------------------------------------------------------
|
81
|
+
|
82
|
+
* Gift Card Balance Can Equal Tendered Amount
|
83
|
+
|
84
|
+
When a gift card is in use on an order, Workarea did not detect that it
|
85
|
+
would cover the order total if the balance of the gift card was equal
|
86
|
+
to the tendered amount. Change the `>` to a `>=` to ensure that gift
|
87
|
+
cards with the exact amount as the order total will still be accounted
|
88
|
+
for in checkout.
|
89
|
+
|
90
|
+
GIFTCARDS-119
|
91
|
+
Tom Scott
|
92
|
+
|
93
|
+
|
94
|
+
|
95
|
+
Workarea Gift Cards 3.4.0 (2018-05-24)
|
96
|
+
--------------------------------------------------------------------------------
|
97
|
+
|
98
|
+
* Support Bulk Action Items UI
|
99
|
+
|
100
|
+
ECOMMERCE-6012
|
101
|
+
Curt Howard
|
102
|
+
|
103
|
+
* Update exporting to work with v3.3.0 DataFile::Export
|
104
|
+
|
105
|
+
GIFTCARDS-117
|
106
|
+
Matt Duffy
|
107
|
+
|
108
|
+
* Leverage Workarea Changelog task
|
109
|
+
|
110
|
+
ECOMMERCE-5355
|
111
|
+
Curt Howard
|
112
|
+
|
113
|
+
* Update Mailers for Premailer
|
114
|
+
|
115
|
+
GIFTCARDS-116
|
116
|
+
Curt Howard
|
117
|
+
|
118
|
+
* Make Gift Card an optional field
|
119
|
+
|
120
|
+
GIFTCARDS-115
|
121
|
+
Curt Howard
|
122
|
+
|
123
|
+
|
124
|
+
|
125
|
+
Workarea Gift Cards 3.3.0 (2018-02-06)
|
126
|
+
--------------------------------------------------------------------------------
|
127
|
+
|
128
|
+
* Supportive updates for v3.2 Order Summary changes
|
129
|
+
|
130
|
+
GIFTCARDS-113
|
131
|
+
Curt Howard
|
132
|
+
|
133
|
+
* Include shipping in pricing request
|
134
|
+
|
135
|
+
When re-pricing the order to apply gift card deductions, pass the
|
136
|
+
`Shipping` for this corresponding `Order` so that setting the gift card
|
137
|
+
tender amount factors in the shipping total along with the items
|
138
|
+
subtotal.
|
139
|
+
|
140
|
+
GIFTCARDS-94
|
141
|
+
Tom Scott
|
142
|
+
|
143
|
+
* Convert index cards into table
|
144
|
+
|
145
|
+
GIFTCARDS-110
|
146
|
+
Curt Howard
|
147
|
+
|
148
|
+
|
149
|
+
Workarea Gift Cards 3.2.1 (2017-10-31)
|
150
|
+
--------------------------------------------------------------------------------
|
151
|
+
|
152
|
+
* Prevent errors when API isn't installed
|
153
|
+
|
154
|
+
Add condition to documentation test to check for API before requiring documentation test
|
155
|
+
|
156
|
+
GIFTCARDS-111
|
157
|
+
Jake Beresford
|
158
|
+
|
159
|
+
|
160
|
+
Workarea Gift Cards 3.2.0 (2017-10-17)
|
161
|
+
--------------------------------------------------------------------------------
|
162
|
+
|
163
|
+
* Add crud endpoints for payment gift cards in admin api
|
164
|
+
|
165
|
+
GIFTCARDS-109
|
166
|
+
Francisco Galarza
|
167
|
+
|
168
|
+
Workarea Gift Cards 3.1.0 (2017-09-15)
|
169
|
+
--------------------------------------------------------------------------------
|
170
|
+
|
171
|
+
* Rework gift card fulfillment tie in
|
172
|
+
|
173
|
+
GIFTCARDS-106
|
174
|
+
Matt Duffy
|
175
|
+
|
176
|
+
* Update order fulfillment upon creation of Payment::GiftCard
|
177
|
+
|
178
|
+
GIFTCARDS-106
|
179
|
+
Matt Duffy
|
180
|
+
|
181
|
+
* Add storefront API support (if it's installed)
|
182
|
+
|
183
|
+
Includes endpoints for checking gift card balance, paying with a gift
|
184
|
+
card, and tender display support.
|
185
|
+
|
186
|
+
GIFTCARDS-102
|
187
|
+
Ben Crouse
|
188
|
+
|
189
|
+
* Update activity for trash restore link helper
|
190
|
+
|
191
|
+
GIFTCARDS-101
|
192
|
+
Matt Duffy
|
193
|
+
|
194
|
+
* Add restore link to gift card admin activity
|
195
|
+
|
196
|
+
GIFTCARDS-101
|
197
|
+
Matt Duffy
|
198
|
+
|
199
|
+
* Add jump to navigation config to plugin
|
200
|
+
|
201
|
+
GIFTCARDS-100
|
202
|
+
Dave Barnow
|
203
|
+
|
204
|
+
|
205
|
+
Workarea Gift Cards 3.0.2 (2017-08-22)
|
206
|
+
--------------------------------------------------------------------------------
|
207
|
+
|
208
|
+
* Use token for gift card name on activity after card is deleted
|
209
|
+
|
210
|
+
GIFTCARDS-103
|
211
|
+
Matt Duffy
|
212
|
+
|
213
|
+
|
214
|
+
Workarea Gift Cards 3.0.1 (2017-07-25)
|
215
|
+
--------------------------------------------------------------------------------
|
216
|
+
|
217
|
+
* Add jump to navigation config to plugin
|
218
|
+
|
219
|
+
GIFTCARDS-100
|
220
|
+
Dave Barnow
|
221
|
+
|
222
|
+
|
223
|
+
Workarea Gift Cards 3.0.0 (2017-05-26)
|
224
|
+
--------------------------------------------------------------------------------
|
225
|
+
|
226
|
+
* Update for v3 compatibility
|
227
|
+
|
228
|
+
GIFTCARDS-95
|
229
|
+
Matt Duffy
|
230
|
+
|
231
|
+
|
232
|
+
WebLinc Gift Cards 2.1.1 (2017-03-01)
|
233
|
+
--------------------------------------------------------------------------------
|
234
|
+
|
235
|
+
* Update giftcard mailer translation to render link correctly when passed as html
|
236
|
+
|
237
|
+
GIFTCARDS-91
|
238
|
+
Beresford, Jake
|
239
|
+
|
240
|
+
* Add a maler preview for gift cards mailer.
|
241
|
+
|
242
|
+
GIFTCARDS-90
|
243
|
+
Beresford, Jake
|
244
|
+
|
245
|
+
|
246
|
+
WebLinc Gift Cards 2.1.0 (2016-10-12)
|
247
|
+
--------------------------------------------------------------------------------
|
248
|
+
|
249
|
+
* Add activity support for v2.3
|
250
|
+
|
251
|
+
GIFTCARDS-88
|
252
|
+
Ben Crouse
|
253
|
+
|
254
|
+
* Update product-prices markup to match generic
|
255
|
+
|
256
|
+
Clean up call to pricing partial
|
257
|
+
|
258
|
+
GIFTCARDS-84
|
259
|
+
Kristen Ward
|
260
|
+
|
261
|
+
|
262
|
+
WebLinc Gift Cards 2.0.4 (2016-07-06)
|
263
|
+
--------------------------------------------------------------------------------
|
264
|
+
|
265
|
+
* Update product-prices markup to match generic
|
266
|
+
|
267
|
+
Clean up call to pricing partial
|
268
|
+
|
269
|
+
GIFTCARDS-84
|
270
|
+
Kristen Ward
|
271
|
+
|
272
|
+
|
273
|
+
WebLinc Gift Cards 2.0.3 (2016-04-26)
|
274
|
+
--------------------------------------------------------------------------------
|
275
|
+
|
276
|
+
* Add reset results button to gift card redemptions page
|
277
|
+
|
278
|
+
After applying date filters, there is no quick way to reset them.
|
279
|
+
Add action button consistent with other admin pages.
|
280
|
+
|
281
|
+
GIFTCARDS-78
|
282
|
+
Kristen Ward
|
283
|
+
|
284
|
+
|
285
|
+
WebLinc Gift Cards 2.0.2 (2016-04-04)
|
286
|
+
--------------------------------------------------------------------------------
|
287
|
+
|
288
|
+
|
289
|
+
WebLinc Gift Cards 2.0.1 (2016-03-22)
|
290
|
+
--------------------------------------------------------------------------------
|
291
|
+
|
292
|
+
* Ensure credit card is not added to payment if not necessary
|
293
|
+
|
294
|
+
GIFTCARDS-73
|
295
|
+
Matt Duffy
|
296
|
+
|
297
|
+
|
298
|
+
|
299
|
+
WebLinc Gift Cards 2.0.0 (January 26, 2016)
|
300
|
+
--------------------------------------------------------------------------------
|
301
|
+
|
302
|
+
* Update add to cart form to use drawer, add analytics
|
303
|
+
|
304
|
+
GIFTCARDS-79
|
305
|
+
|
306
|
+
* Rename tender-related Gift Card methods
|
307
|
+
|
308
|
+
Resolve a conflict between methods around order pricing during
|
309
|
+
checkout and final amounts displayed on order summaries wihtin the
|
310
|
+
store front.
|
311
|
+
|
312
|
+
GIFTCARDS-77
|
313
|
+
|
314
|
+
|
315
|
+
WebLinc Gift Cards 1.0.0 (January 14, 2016)
|
316
|
+
--------------------------------------------------------------------------------
|
317
|
+
|
318
|
+
* Improve misleading verbiage in checkout messaging
|
319
|
+
|
320
|
+
The balance indicates current balance, not balance after the order
|
321
|
+
has been placed.
|
322
|
+
|
323
|
+
GIFTCARDS-76
|
324
|
+
|
325
|
+
* Update date range pickers to current
|
326
|
+
|
327
|
+
Replace in gift card and redemption index
|
328
|
+
|
329
|
+
Update start/end date search parameters to be consistent with base
|
330
|
+
|
331
|
+
Update tests
|
332
|
+
|
333
|
+
GIFTCARDS-75
|
334
|
+
|
335
|
+
* Add form submitting control to has balance dropdown
|
336
|
+
|
337
|
+
GIFTCARDS-75
|
338
|
+
|
339
|
+
* Update for compatibility with WebLinc 2.0
|
340
|
+
|
341
|
+
* Replace absolute URLs with relative paths
|
342
|
+
|
343
|
+
|
344
|
+
WebLinc Gift Cards 0.11.0 (October 6, 2015)
|
345
|
+
--------------------------------------------------------------------------------
|
346
|
+
|
347
|
+
* Add metadata to the edit view
|
348
|
+
|
349
|
+
GIFTCARDS-69
|
350
|
+
|
351
|
+
* Update plugin to be compatible with v0.12
|
352
|
+
|
353
|
+
Update new & edit views, property work
|
354
|
+
Add blank row to permissions partial
|
355
|
+
Update indexes, add context-menu to summary/edit
|
356
|
+
|
357
|
+
GIFTCARDS-69
|
358
|
+
|
359
|
+
* Fix typo in sort menu options
|
360
|
+
|
361
|
+
s/Redeeed/Redeemed in app/models/workarea/payment/gift_card/redemption.rb
|
362
|
+
|
363
|
+
GIFTCARDS-72
|
364
|
+
|
365
|
+
* Update plugin to be compatible with v0.12
|
366
|
+
|
367
|
+
Update new & edit views, property work
|
368
|
+
Add blank row to permissions partial
|
369
|
+
Update indexes, add context-menu to summary/edit
|
370
|
+
|
371
|
+
GIFTCARDS-69
|
372
|
+
|
373
|
+
* Update menu classes for compatibility with WebLinc v0.12 (ECOMMERCE-1344)
|
374
|
+
|
375
|
+
GIFTCARDS-64
|
376
|
+
|
377
|
+
* Update for compatibility with the WebLinc v0.12 Ruby API.
|
378
|
+
|
379
|
+
ECOMMERCE-1543
|
380
|
+
|
381
|
+
|
382
|
+
WebLinc Gift Cards 0.10.0 (August 21, 2015)
|
383
|
+
--------------------------------------------------------------------------------
|
384
|
+
|
385
|
+
* Rename SCSS blocks `panel` and `panel--buttons` to `index-filters` and
|
386
|
+
`form-actions`, respectively, for compatibility with WebLinc 0.11.
|
387
|
+
|
388
|
+
4b4b284a2aa93f4aa1ce60333f3cbabe8f8e4ed7
|
389
|
+
|
390
|
+
|
391
|
+
WebLinc Gift Cards 0.9.0 (July 11, 2015)
|
392
|
+
--------------------------------------------------------------------------------
|
393
|
+
|
394
|
+
* Add model summaries to index.
|
395
|
+
|
396
|
+
GIFTCARDS-57
|
397
|
+
|
398
|
+
21042f498aa5ef9bf9bf5937b89f6c95e0303185 (merge)
|
399
|
+
|
400
|
+
* Remove view `workarea/storefront/orders/tenders/_gift_card.json.jbuilder`,
|
401
|
+
which isn't used.
|
402
|
+
|
403
|
+
679cabac2411dd4d0039ffbb25b564df13af7382
|
404
|
+
|
405
|
+
* Update for compatibility with workarea 0.10.0.
|
406
|
+
|
407
|
+
38055d2486d57d28164da779a4d8763cac727e76
|
408
|
+
c1528cd6098bf565005dad94a7b62adeaecaa447
|
409
|
+
18822a95254a6d475be7aee7fbd59743a4847be4
|
410
|
+
618b4512d03a13b3a063e3faf70254b4c57baeeb
|
411
|
+
74f4ad180bc5f17883ff987a336235d99737daa6
|
412
|
+
c78cd1aa7a9e2edb4a6867cb7ab0e149f1d64e2e
|
413
|
+
d4e2ea1a5e334df9f1f83849ec8b263539456fd9
|
414
|
+
|
415
|
+
* Fix "back" links in Admin.
|
416
|
+
|
417
|
+
GIFTCARDS-61
|
418
|
+
|
419
|
+
fc80b8a6428e478e0f21d256a91fe9a89354dfdc
|
420
|
+
|
421
|
+
* Fix `selected_navigation_nodes` in Admin.
|
422
|
+
|
423
|
+
GIFTCARDS-60
|
424
|
+
|
425
|
+
405446c3a63700bd20a2efac4b934c35f9fd3e9e
|
426
|
+
|
427
|
+
* Remove quantity field from gift card template.
|
428
|
+
|
429
|
+
GIFTCARDS-44
|
430
|
+
|
431
|
+
c554279546f896e1973993c54d139efeda91944b
|
432
|
+
|
433
|
+
|
434
|
+
WebLinc Gift Cards 0.8.0 (June 1, 2015)
|
435
|
+
--------------------------------------------------------------------------------
|
436
|
+
|
437
|
+
* Rename fixtures to factories and clean up factories.
|
438
|
+
|
439
|
+
dae3b82cbdb54ba988bc1804ba332c614c21016d
|
440
|
+
|
441
|
+
* Refactor listeners.
|
442
|
+
|
443
|
+
ea96c63c536d3b922c0b05e1ab4e843a8bc9a6eb
|
444
|
+
|
445
|
+
* Update for compatibility with workarea 0.9.0.
|
446
|
+
|
447
|
+
faf0721baaee7431c7c1825576b68574acbf137b
|
448
|
+
|
449
|
+
GIFTCARDS-56
|
450
|
+
|
451
|
+
* Allow both strings and symbols as keys in params hash of gift card search.
|
452
|
+
|
453
|
+
GIFTCARDS-54
|
454
|
+
|
455
|
+
* Move gift cards API functionality from workarea-gift_cards to workarea-api.
|
456
|
+
|
457
|
+
GIFTCARDS-50
|
458
|
+
|
459
|
+
|
460
|
+
WebLinc Gift Cards 0.7.0 (April 10, 2015)
|
461
|
+
--------------------------------------------------------------------------------
|
462
|
+
|
463
|
+
* Allow "From" to be a value other than an email address.
|
464
|
+
|
465
|
+
The "From" field for gift cards was required to be an email address, but users were entering non-email values such as "Mom & Dad". This change removes the email validation from the model.
|
466
|
+
|
467
|
+
GIFTCARDS-51
|
468
|
+
|
469
|
+
* Update JavaScript modules for compatibility with WebLinc 0.8.0.
|
470
|
+
|
471
|
+
* Update testing environment for compatibility with WebLinc 0.8.0.
|
472
|
+
|
473
|
+
* Move product description out of add to cart form for consistency with WebLinc 0.8.0.
|
474
|
+
|
475
|
+
GIFTCARDS-36
|
476
|
+
|
477
|
+
* Use new decorator style for consistency with WebLinc 0.8.0.
|
478
|
+
|
479
|
+
* Remove gems server secrets for consistency with WebLinc 0.8.0.
|
480
|
+
|
481
|
+
* Remove `money_field` method for compatibility with WebLinc 0.8.0.
|
482
|
+
|
483
|
+
GIFTCARDS-43
|
484
|
+
|
485
|
+
* Update assets for compatibility with WebLinc 0.8.0.
|
data/CODE_OF_CONDUCT.md
ADDED
data/CONTRIBUTING.md
ADDED
data/Gemfile
ADDED
data/LICENSE
ADDED
@@ -0,0 +1,52 @@
|
|
1
|
+
WebLinc
|
2
|
+
Business Source License
|
3
|
+
|
4
|
+
Licensor: WebLinc Corporation, 22 S. 3rd Street, 2nd Floor, Philadelphia PA 19106
|
5
|
+
|
6
|
+
Licensed Work: Workarea Commerce Platform
|
7
|
+
The Licensed Work is (c) 2019 WebLinc Corporation
|
8
|
+
|
9
|
+
Additional Use Grant:
|
10
|
+
You may make production use of the Licensed Work without an additional license agreement with WebLinc so long as you do not use the Licensed Work for a Commerce Service.
|
11
|
+
|
12
|
+
A "Commerce Service" is a commercial offering that allows third parties (other than your employees and contractors) to access the functionality of the Licensed Work by creating or managing commerce functionality, the products, taxonomy, assets and/or content of which are controlled by such third parties.
|
13
|
+
|
14
|
+
For information about obtaining an additional license agreement with WebLinc, contact licensing@workarea.com.
|
15
|
+
|
16
|
+
Change Date: 2019-08-20
|
17
|
+
|
18
|
+
Change License: Version 2.0 or later of the GNU General Public License as published by the Free Software Foundation
|
19
|
+
|
20
|
+
Terms
|
21
|
+
|
22
|
+
The Licensor hereby grants you the right to copy, modify, create derivative works, redistribute, and make non-production use of the Licensed Work. The Licensor may make an Additional Use Grant, above, permitting limited production use.
|
23
|
+
|
24
|
+
Effective on the Change Date, or the fourth anniversary of the first publicly available distribution of a specific version of the Licensed Work under this License, whichever comes first, the Licensor hereby grants you rights under the terms of the Change License, and the rights granted in the paragraph above terminate.
|
25
|
+
|
26
|
+
If your use of the Licensed Work does not comply with the requirements currently in effect as described in this License, you must purchase a commercial license from the Licensor, its affiliated entities, or authorized resellers, or you must refrain from using the Licensed Work.
|
27
|
+
|
28
|
+
All copies of the original and modified Licensed Work, and derivative works of the Licensed Work, are subject to this License. This License applies separately for each version of the Licensed Work and the Change Date may vary for each version of the Licensed Work released by Licensor.
|
29
|
+
|
30
|
+
You must conspicuously display this License on each original or modified copy of the Licensed Work. If you receive the Licensed Work in original or modified form from a third party, the terms and conditions set forth in this License apply to your use of that work.
|
31
|
+
|
32
|
+
Any use of the Licensed Work in violation of this License will automatically terminate your rights under this License for the current and all other versions of the Licensed Work.
|
33
|
+
|
34
|
+
This License does not grant you any right in any trademark or logo of Licensor or its affiliates (provided that you may use a trademark or logo of Licensor as expressly required by this License). TO THE EXTENT PERMITTED BY APPLICABLE LAW, THE LICENSED WORK IS PROVIDED ON AN "AS IS" BASIS. LICENSOR HEREBY DISCLAIMS ALL WARRANTIES AND CONDITIONS, EXPRESS OR IMPLIED, INCLUDING (WITHOUT LIMITATION) WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, NON-INFRINGEMENT, AND TITLE. MariaDB hereby grants you permission to use this License’s text to license your works and to refer to it using the trademark "Business Source License" as long as you comply with the Covenants of Licensor below.
|
35
|
+
|
36
|
+
Covenants of Licensor
|
37
|
+
In consideration of the right to use this License’s text and the "Business Source License" name and trademark, Licensor covenants to MariaDB, and to all other recipients of the licensed work to be provided by Licensor:
|
38
|
+
|
39
|
+
To specify as the Change License the GPL Version 2.0 or any later version, or a license that is compatible with GPL Version 2.0 or a later version, where "compatible" means that software provided under the Change License can be included in a program with software provided under GPL Version 2.0 or a later version. Licensor may specify additional Change Licenses without limitation.
|
40
|
+
|
41
|
+
To either: (a) specify an additional grant of rights to use that does not impose any additional restriction on the right granted in this License, as the Additional Use Grant; or (b) insert the text "None."
|
42
|
+
|
43
|
+
To specify a Change Date.
|
44
|
+
|
45
|
+
Not to modify this License in any other way.
|
46
|
+
|
47
|
+
Notice
|
48
|
+
The Business Source License (this document, or the "License") is not an Open Source license. However, the Licensed Work will eventually be made available under an Open Source License, as stated in this License.
|
49
|
+
|
50
|
+
For more information on the use of the Business Source License generally, please visit the Adopting and Developing Business Source License FAQ.
|
51
|
+
|
52
|
+
License text copyright (c) 2017 MariaDB Corporation Ab, All Rights Reserved. "Business Source License" is a trademark of MariaDB Corporation Ab.
|
data/README.md
ADDED
@@ -0,0 +1,119 @@
|
|
1
|
+
Workarea Gift Cards
|
2
|
+
================================================================================
|
3
|
+
|
4
|
+
A Workarea Commerce plugin that enables customers to purchase physical and digital gift cards and redeem them for other merchandise within the catalog.
|
5
|
+
|
6
|
+
Overview
|
7
|
+
--------------------------------------------------------------------------------
|
8
|
+
|
9
|
+
* Create gift card products, both digital and physical
|
10
|
+
* Allow gift card customization with recipient name, email, and personal message
|
11
|
+
* Automatically deliver digital gift card information to recipient upon purchase
|
12
|
+
* Use any number of gift cards as payment in checkout (with configurable limit)
|
13
|
+
* Check the balance of a digital gift card
|
14
|
+
* Manage digital gift cards from the admin
|
15
|
+
* View gift card redemptions from the admin
|
16
|
+
* Admin API management of gift cards
|
17
|
+
* Storefront API support for using gift cards in checkout
|
18
|
+
* Gateway support for easily using a third-party gift card service (see below)
|
19
|
+
|
20
|
+
Getting Started
|
21
|
+
--------------------------------------------------------------------------------
|
22
|
+
|
23
|
+
Add the gem to your application's Gemfile:
|
24
|
+
|
25
|
+
```ruby
|
26
|
+
# ...
|
27
|
+
gem 'workarea-gift_cards'
|
28
|
+
# ...
|
29
|
+
```
|
30
|
+
|
31
|
+
Update your application's bundle.
|
32
|
+
|
33
|
+
```bash
|
34
|
+
cd path/to/application
|
35
|
+
bundle
|
36
|
+
```
|
37
|
+
|
38
|
+
Using a custom gift card gateway
|
39
|
+
--------------------------------------------------------------------------------
|
40
|
+
|
41
|
+
The `workarea-gift_cards` plugin comes fully functional with management of gift cards, tracking of redemptions and balances within the Workarea admin. However, using a third-party gift card service is not uncommon. Taking that into consideration, the plugin allows for the use of a custom gateway for looking up
|
42
|
+
balances, validating gift card info, and processing gift card payments. This allows a retailer to utilize the plugin for the gift card product behaviors, but continue using a third-party service for generating gift card codes and tracking the use of purchased gift cards.
|
43
|
+
|
44
|
+
## Setup a custom gateway
|
45
|
+
|
46
|
+
The plugin adds a configuration value of `Workarea.config.gateways.gift_card`. By default, this is set to `Workarea::GiftCards::Gateway`, which utilizes the existing `Workarea::Payment::GiftCard` collection. This configuration value can be changed to a custom class of your choice that responds to the same methods.
|
47
|
+
|
48
|
+
```ruby
|
49
|
+
class ThirdPartyGiftCardGateway
|
50
|
+
# setup any relevant configuration required for connecting to a
|
51
|
+
# third-party service
|
52
|
+
#
|
53
|
+
def initialize; end
|
54
|
+
|
55
|
+
# Optional. Define this method to tell the system you are using the
|
56
|
+
# Workarea::Payment::GiftCard collection. This will turn on a number of
|
57
|
+
# behaviors only relevant when using the collection. If the gateway does not
|
58
|
+
# respond to this method, it will assume false.
|
59
|
+
#
|
60
|
+
def uses_system_cards?
|
61
|
+
true
|
62
|
+
end
|
63
|
+
|
64
|
+
# These are the transactional methods expected from the gateway. They each
|
65
|
+
# take two arguments:
|
66
|
+
# amount - is the value (in cents) that transaction is looking to apply.
|
67
|
+
# tender - will be a Workarea::Payment::Tender::GiftCard which you can use
|
68
|
+
# to find the relevant card number or other info stored on the
|
69
|
+
# tender associated to this transaction.
|
70
|
+
#
|
71
|
+
# The system expects these method to return an object that responds to
|
72
|
+
# two methods:
|
73
|
+
# success? - a boolean that determines if the transaction was successful
|
74
|
+
# message - information around the transaction result
|
75
|
+
#
|
76
|
+
def authorize(amount, tender); end
|
77
|
+
def cancel(amount, tender); end
|
78
|
+
def capture(amount, tender); end
|
79
|
+
def purchase(amount, tender); end
|
80
|
+
def refund(amount, tender); end
|
81
|
+
|
82
|
+
# This passes in one or more tokens/numbers as strings and returns a Money
|
83
|
+
# object that represents the total balance of all valid card numbers.
|
84
|
+
#
|
85
|
+
def balance(token); end
|
86
|
+
|
87
|
+
# This method is used when a customer looks up their balance from the
|
88
|
+
# storefront. This will often require them to provide some unique info
|
89
|
+
# to protect against malicious attempts at discovering gift card numbers.
|
90
|
+
# The request parameters are passed directly into the method to allow
|
91
|
+
# flexibility in the information you request from the user to show them
|
92
|
+
# the balance. By default, the system expects this method to return an
|
93
|
+
# object that responds to #balance, #token, and #to. This is entirely
|
94
|
+
# dependent on the resulting view rendered, which can be customized.
|
95
|
+
#
|
96
|
+
def lookup(params); end
|
97
|
+
end
|
98
|
+
```
|
99
|
+
|
100
|
+
After building a custom class, set the config value to the custom class.
|
101
|
+
|
102
|
+
```ruby
|
103
|
+
Workarea.configure do |config|
|
104
|
+
config.gateways.gift_card = 'ThirdPartyGiftCardGateway'
|
105
|
+
end
|
106
|
+
```
|
107
|
+
|
108
|
+
Note that it is set to a string of the class constant, and not an instance of the class. The system constantizes and initializes a new instance whenever it uses the gateway to ensure autoloading works correctly and so a gateway that cares about the current state of the application is applied correctly. This is most relevant in multi-site environments where each site might want to use their own gift card gateway.
|
109
|
+
|
110
|
+
|
111
|
+
Workarea Commerce Documentation
|
112
|
+
--------------------------------------------------------------------------------
|
113
|
+
|
114
|
+
See [https://developer.workarea.com](https://developer.workarea.com) for Workarea Commerce documentation.
|
115
|
+
|
116
|
+
License
|
117
|
+
--------------------------------------------------------------------------------
|
118
|
+
|
119
|
+
Workarea Gift Cards is released under the [Business Software License](LICENSE)
|