workarea-global_e 1.2.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (232) hide show
  1. checksums.yaml +7 -0
  2. data/.eslintrc.json +37 -0
  3. data/.github/ISSUE_TEMPLATE/bug_report.md +37 -0
  4. data/.github/ISSUE_TEMPLATE/documentation-request.md +17 -0
  5. data/.github/ISSUE_TEMPLATE/feature_request.md +20 -0
  6. data/.github/workflows/ci.yml +77 -0
  7. data/.gitignore +20 -0
  8. data/.rubocop.yml +2 -0
  9. data/.ruby-version +1 -0
  10. data/CHANGELOG.md +261 -0
  11. data/Gemfile +16 -0
  12. data/README.md +39 -0
  13. data/Rakefile +59 -0
  14. data/app/assets/javascripts/workarea/storefront/global_e/modules/checkout_info_validator.js +122 -0
  15. data/app/assets/javascripts/workarea/storefront/global_e/modules/suppress_price_ranges.js +19 -0
  16. data/app/controllers/workarea/admin/country_exceptions_controller.rb +67 -0
  17. data/app/controllers/workarea/admin/fixed_prices_controller.rb +89 -0
  18. data/app/controllers/workarea/admin/orders_controller.decorator +6 -0
  19. data/app/controllers/workarea/storefront/application_controller.decorator +30 -0
  20. data/app/controllers/workarea/storefront/checkouts_controller.decorator +22 -0
  21. data/app/controllers/workarea/storefront/ge_checkouts_controller.rb +10 -0
  22. data/app/controllers/workarea/storefront/global_e_controller.rb +42 -0
  23. data/app/controllers/workarea/storefront/globale/api_controller.rb +108 -0
  24. data/app/controllers/workarea/storefront/globale/refund_controller.rb +65 -0
  25. data/app/controllers/workarea/storefront/users/logins_controller.decorator +13 -0
  26. data/app/helpers/workarea/admin/global_e_helpers.rb +28 -0
  27. data/app/models/workarea/address.decorator +11 -0
  28. data/app/models/workarea/catalog/product.decorator +14 -0
  29. data/app/models/workarea/fulfillment/status/partially_refunded.rb +13 -0
  30. data/app/models/workarea/fulfillment/status/refunded.rb +15 -0
  31. data/app/models/workarea/fulfillment.decorator +55 -0
  32. data/app/models/workarea/global_e/country_exception.rb +37 -0
  33. data/app/models/workarea/global_e/fixed_price.rb +93 -0
  34. data/app/models/workarea/global_e/order_api_events.rb +29 -0
  35. data/app/models/workarea/order/item.decorator +46 -0
  36. data/app/models/workarea/order/status/pending_global_e_fraud_check.rb +12 -0
  37. data/app/models/workarea/order.decorator +64 -0
  38. data/app/models/workarea/payment/status/global_e_appoved.rb +9 -0
  39. data/app/models/workarea/payment/status/pending_global_e_fraud_check.rb +9 -0
  40. data/app/models/workarea/payment/tender/global_e_payment.rb +16 -0
  41. data/app/models/workarea/payment.decorator +10 -0
  42. data/app/models/workarea/price_adjustment.decorator +13 -0
  43. data/app/models/workarea/price_adjustment_set.decorator +25 -0
  44. data/app/models/workarea/pricing/calculators/item_calculator.decorator +48 -0
  45. data/app/models/workarea/pricing/collection.decorator +90 -0
  46. data/app/models/workarea/pricing/discount/appliation_group.decorator +16 -0
  47. data/app/models/workarea/pricing/discount/international_item_proxy.rb +27 -0
  48. data/app/models/workarea/pricing/discount/international_order.rb +29 -0
  49. data/app/models/workarea/pricing/discount.decorator +65 -0
  50. data/app/models/workarea/pricing/price_distributor.decorator +37 -0
  51. data/app/models/workarea/pricing/request.decorator +17 -0
  52. data/app/models/workarea/pricing/sku.decorator +17 -0
  53. data/app/models/workarea/search/admin/order.decorator +11 -0
  54. data/app/models/workarea/shipping/sku.decorator +23 -0
  55. data/app/models/workarea/shipping.decorator +11 -0
  56. data/app/models/workarea/user.decorator +10 -0
  57. data/app/seeds/workarea/global_e_seeds.rb +66 -0
  58. data/app/services/workarea/create_fulfillment.decorator +12 -0
  59. data/app/services/workarea/global_e/address_details.rb +218 -0
  60. data/app/services/workarea/global_e/api/notify_order_refunded.rb +45 -0
  61. data/app/services/workarea/global_e/api/perform_order_payment.rb +46 -0
  62. data/app/services/workarea/global_e/api/remove_restricted_products.rb +28 -0
  63. data/app/services/workarea/global_e/api/send_order_to_merchant/item_pricer.rb +147 -0
  64. data/app/services/workarea/global_e/api/send_order_to_merchant/save_user.rb +59 -0
  65. data/app/services/workarea/global_e/api/send_order_to_merchant.rb +359 -0
  66. data/app/services/workarea/global_e/api/update_order_shipping_info.rb +38 -0
  67. data/app/services/workarea/global_e/api/update_order_status/canceled.rb +42 -0
  68. data/app/services/workarea/global_e/api/update_order_status.rb +28 -0
  69. data/app/services/workarea/global_e/attribute.rb +44 -0
  70. data/app/services/workarea/global_e/brand.rb +19 -0
  71. data/app/services/workarea/global_e/cart_user_details.rb +34 -0
  72. data/app/services/workarea/global_e/category.rb +19 -0
  73. data/app/services/workarea/global_e/checkout_cart_info.rb +358 -0
  74. data/app/services/workarea/global_e/custom_product_attribute.rb +19 -0
  75. data/app/services/workarea/global_e/discount.rb +215 -0
  76. data/app/services/workarea/global_e/merchant/brand.rb +21 -0
  77. data/app/services/workarea/global_e/merchant/category.rb +21 -0
  78. data/app/services/workarea/global_e/merchant/customer.rb +36 -0
  79. data/app/services/workarea/global_e/merchant/customer_details.rb +201 -0
  80. data/app/services/workarea/global_e/merchant/discount.rb +127 -0
  81. data/app/services/workarea/global_e/merchant/international_details.rb +296 -0
  82. data/app/services/workarea/global_e/merchant/order.rb +425 -0
  83. data/app/services/workarea/global_e/merchant/order_refund.rb +103 -0
  84. data/app/services/workarea/global_e/merchant/original_order.rb +28 -0
  85. data/app/services/workarea/global_e/merchant/parcel_tracking.rb +31 -0
  86. data/app/services/workarea/global_e/merchant/payment_details.rb +161 -0
  87. data/app/services/workarea/global_e/merchant/product.rb +222 -0
  88. data/app/services/workarea/global_e/merchant/refund_product.rb +69 -0
  89. data/app/services/workarea/global_e/merchant/response_info.rb +115 -0
  90. data/app/services/workarea/global_e/merchant_cart_product_attribute.rb +21 -0
  91. data/app/services/workarea/global_e/order_status.rb +20 -0
  92. data/app/services/workarea/global_e/order_status_details.rb +79 -0
  93. data/app/services/workarea/global_e/order_status_reason.rb +20 -0
  94. data/app/services/workarea/global_e/parcel.rb +53 -0
  95. data/app/services/workarea/global_e/product.rb +612 -0
  96. data/app/services/workarea/global_e/product_meta_data.rb +13 -0
  97. data/app/services/workarea/global_e/tracking_details.rb +23 -0
  98. data/app/services/workarea/global_e/update_order_dispatch_exception.rb +46 -0
  99. data/app/services/workarea/global_e/update_order_dispatch_request.rb +108 -0
  100. data/app/services/workarea/global_e/user_id_number_type.rb +21 -0
  101. data/app/services/workarea/global_e/users_details.rb +151 -0
  102. data/app/services/workarea/global_e/vat_category.rb +20 -0
  103. data/app/services/workarea/global_e/vat_rate_type.rb +27 -0
  104. data/app/services/workarea/save_order_analytics.decorator +18 -0
  105. data/app/view_models/workarea/admin/order_view_model.decorator +13 -0
  106. data/app/view_models/workarea/storefront/cart_view_model.decorator +7 -0
  107. data/app/view_models/workarea/storefront/order_item_view_model.decorator +16 -0
  108. data/app/view_models/workarea/storefront/order_view_model.decorator +45 -0
  109. data/app/view_models/workarea/storefront/product_view_model.decorator +35 -0
  110. data/app/views/workarea/admin/catalog_products/_country_exceptions_card.html.haml +31 -0
  111. data/app/views/workarea/admin/catalog_products/_global_e_attributes.html.haml +3 -0
  112. data/app/views/workarea/admin/catalog_products/_global_e_fields.html.haml +4 -0
  113. data/app/views/workarea/admin/country_exceptions/edit.html.haml +48 -0
  114. data/app/views/workarea/admin/country_exceptions/index.html.haml +47 -0
  115. data/app/views/workarea/admin/country_exceptions/new.html.haml +44 -0
  116. data/app/views/workarea/admin/fixed_prices/edit.html.haml +73 -0
  117. data/app/views/workarea/admin/fixed_prices/index.html.haml +55 -0
  118. data/app/views/workarea/admin/fixed_prices/new.html.haml +70 -0
  119. data/app/views/workarea/admin/orders/_global_e.html.haml +27 -0
  120. data/app/views/workarea/admin/orders/attributes.html.haml +131 -0
  121. data/app/views/workarea/admin/orders/global_e.html.haml +110 -0
  122. data/app/views/workarea/admin/orders/show.html.haml +27 -0
  123. data/app/views/workarea/admin/orders/tenders/_global_e_payment.html.haml +3 -0
  124. data/app/views/workarea/admin/pricing_skus/_cards.html.haml +98 -0
  125. data/app/views/workarea/storefront/cart_items/create.html.haml +71 -0
  126. data/app/views/workarea/storefront/carts/_pricing.html.haml +14 -0
  127. data/app/views/workarea/storefront/carts/show.html.haml +187 -0
  128. data/app/views/workarea/storefront/ge_checkouts/show.html.haml +1 -0
  129. data/app/views/workarea/storefront/global_e/_country_picker.html.haml +1 -0
  130. data/app/views/workarea/storefront/global_e/_head.html.haml +10 -0
  131. data/app/views/workarea/storefront/orders/_summary.html.haml +275 -0
  132. data/app/views/workarea/storefront/orders/tenders/_global_e_payment.html.haml +3 -0
  133. data/app/views/workarea/storefront/products/_pricing.html.haml +49 -0
  134. data/app/views/workarea/storefront/products/_restricted_item_text.html.haml +1 -0
  135. data/app/views/workarea/storefront/users/orders/_summary.html.haml +22 -0
  136. data/app/workers/workarea/global_e/update_order_dispatch.rb +28 -0
  137. data/app/workers/workarea/save_user_order_details.decorator +9 -0
  138. data/bin/rails +25 -0
  139. data/config/initializers/appends.rb +46 -0
  140. data/config/initializers/seeds.rb +1 -0
  141. data/config/initializers/workarea.rb +64 -0
  142. data/config/locales/en.yml +105 -0
  143. data/config/routes.rb +31 -0
  144. data/lib/workarea/global_e/engine.rb +10 -0
  145. data/lib/workarea/global_e/error.rb +8 -0
  146. data/lib/workarea/global_e/version.rb +5 -0
  147. data/lib/workarea/global_e.rb +58 -0
  148. data/script/admin_ci +5 -0
  149. data/script/ci +8 -0
  150. data/script/core_ci +5 -0
  151. data/script/plugins_ci +5 -0
  152. data/script/storefront_ci +5 -0
  153. data/test/dummy/.ruby-version +1 -0
  154. data/test/dummy/Rakefile +6 -0
  155. data/test/dummy/app/assets/config/manifest.js +3 -0
  156. data/test/dummy/app/assets/images/.keep +0 -0
  157. data/test/dummy/app/assets/javascripts/application.js +14 -0
  158. data/test/dummy/app/assets/stylesheets/application.css +15 -0
  159. data/test/dummy/app/controllers/application_controller.rb +2 -0
  160. data/test/dummy/app/controllers/concerns/.keep +0 -0
  161. data/test/dummy/app/helpers/application_helper.rb +2 -0
  162. data/test/dummy/app/jobs/application_job.rb +2 -0
  163. data/test/dummy/app/mailers/application_mailer.rb +4 -0
  164. data/test/dummy/app/models/concerns/.keep +0 -0
  165. data/test/dummy/app/views/layouts/application.html.erb +15 -0
  166. data/test/dummy/app/views/layouts/mailer.html.erb +13 -0
  167. data/test/dummy/app/views/layouts/mailer.text.erb +1 -0
  168. data/test/dummy/bin/bundle +3 -0
  169. data/test/dummy/bin/rails +4 -0
  170. data/test/dummy/bin/rake +4 -0
  171. data/test/dummy/bin/setup +28 -0
  172. data/test/dummy/bin/update +28 -0
  173. data/test/dummy/bin/yarn +11 -0
  174. data/test/dummy/config/application.rb +23 -0
  175. data/test/dummy/config/boot.rb +5 -0
  176. data/test/dummy/config/environment.rb +5 -0
  177. data/test/dummy/config/environments/development.rb +52 -0
  178. data/test/dummy/config/environments/production.rb +83 -0
  179. data/test/dummy/config/environments/test.rb +45 -0
  180. data/test/dummy/config/initializers/application_controller_renderer.rb +8 -0
  181. data/test/dummy/config/initializers/assets.rb +14 -0
  182. data/test/dummy/config/initializers/backtrace_silencers.rb +7 -0
  183. data/test/dummy/config/initializers/content_security_policy.rb +25 -0
  184. data/test/dummy/config/initializers/cookies_serializer.rb +5 -0
  185. data/test/dummy/config/initializers/filter_parameter_logging.rb +4 -0
  186. data/test/dummy/config/initializers/inflections.rb +16 -0
  187. data/test/dummy/config/initializers/mime_types.rb +4 -0
  188. data/test/dummy/config/initializers/workarea.rb +5 -0
  189. data/test/dummy/config/initializers/wrap_parameters.rb +9 -0
  190. data/test/dummy/config/locales/en.yml +33 -0
  191. data/test/dummy/config/puma.rb +34 -0
  192. data/test/dummy/config/routes.rb +5 -0
  193. data/test/dummy/config/secrets.yml +18 -0
  194. data/test/dummy/config/spring.rb +6 -0
  195. data/test/dummy/config.ru +5 -0
  196. data/test/dummy/db/seeds.rb +2 -0
  197. data/test/dummy/lib/assets/.keep +0 -0
  198. data/test/dummy/log/.keep +0 -0
  199. data/test/factories/workarea/global_e_factories.rb +836 -0
  200. data/test/integration/workarea/admin/catalog_product_country_exceptions_integration_test.rb +81 -0
  201. data/test/integration/workarea/admin/global_e_jump_to_integration_test.rb +20 -0
  202. data/test/integration/workarea/admin/pricing_sku_fixed_prices_integration_test.rb +83 -0
  203. data/test/integration/workarea/storefront/global_e_api/receive_order_integration_test.rb +278 -0
  204. data/test/integration/workarea/storefront/global_e_api/receive_order_refund_integration_test.rb +25 -0
  205. data/test/integration/workarea/storefront/global_e_api/receive_payment_integration_test.rb +34 -0
  206. data/test/integration/workarea/storefront/global_e_api/receive_shipping_info_integration_test.rb +29 -0
  207. data/test/integration/workarea/storefront/global_e_api/remove_restricted_products_integration_test.rb +27 -0
  208. data/test/integration/workarea/storefront/global_e_api/update_order_status_integration_test.rb +29 -0
  209. data/test/integration/workarea/storefront/global_e_checkout_cart_info/fixed_pricing_test.rb +438 -0
  210. data/test/integration/workarea/storefront/global_e_checkout_cart_info/gift_card_test.rb +63 -0
  211. data/test/integration/workarea/storefront/global_e_checkout_cart_info_integration_test.rb +660 -0
  212. data/test/integration/workarea/storefront/global_e_checkouts_integration_test.rb +71 -0
  213. data/test/integration/workarea/storefront/users/global_e_logins_integration_test.rb +20 -0
  214. data/test/models/workarea/catalog/product_global_e_test.rb +13 -0
  215. data/test/models/workarea/fixed_pricing_test.rb +117 -0
  216. data/test/models/workarea/global_e/country_exception_test.rb +36 -0
  217. data/test/models/workarea/payment_test.decorator +31 -0
  218. data/test/models/workarea/pricing/calculators/item_calculator_fixed_prices_test.rb +83 -0
  219. data/test/models/workarea/pricing/collection_fixed_prices_test.rb +83 -0
  220. data/test/models/workarea/pricing/price_distributor_test.decorator +21 -0
  221. data/test/models/workarea/pricing/sku_fixed_price_test.rb +133 -0
  222. data/test/support/workarea/global_e_support.rb +18 -0
  223. data/test/system/workarea/admin/global_e_system_test.rb +21 -0
  224. data/test/system/workarea/storefront/global_e_cart_system_test.rb +48 -0
  225. data/test/system/workarea/storefront/global_e_order_history_system_test.rb +43 -0
  226. data/test/teaspoon_env.rb +6 -0
  227. data/test/test_helper.rb +9 -0
  228. data/test/view_models/workarea/admin/global_e_order_view_model_test.rb +22 -0
  229. data/test/workers/workarea/global_e/update_order_dispatch_test.rb +64 -0
  230. data/test/workers/workarea/global_e_save_user_order_details_test.rb +41 -0
  231. data/workarea-global_e.gemspec +16 -0
  232. metadata +293 -0
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: 2bcc2917f5a64ec8d14456093734b5c4b1a6e1fcf85b0976a66e57a91dc58abc
4
+ data.tar.gz: c05824af47f63ca359feaaa9e4a731106ba9f6da1b33c29ecacda078311bfa9b
5
+ SHA512:
6
+ metadata.gz: eb0499af8c77ed655353602d2617a168c61d92290db8f4fb08902a51d4a320613d9aa9f095e1d74b4079c52318ed98ff177569f96722c8ee69d91fe74cd8ec4d
7
+ data.tar.gz: e6fa70f2c129fb2a421b6088cfd63b384b00dc0c57ae3e3f043d8bb86daffbc6916c00b65ef1f28fb43ea0d563bcb96793f8b955037808f2c0837c9d08b188fb
data/.eslintrc.json ADDED
@@ -0,0 +1,37 @@
1
+ {
2
+ "extends": "eslint:recommended",
3
+ "rules": {
4
+ "semi": ["error", "always"],
5
+ "eqeqeq": ["error", "always"]
6
+ },
7
+ "globals": {
8
+ "window": true,
9
+ "document": true,
10
+ "WORKAREA": true,
11
+ "$": true,
12
+ "jQuery": true,
13
+ "_": true,
14
+ "feature": true,
15
+ "JST": true,
16
+ "Turbolinks": true,
17
+ "I18n": true,
18
+ "Chart": true,
19
+ "Dropzone": true,
20
+ "strftime": true,
21
+ "Waypoint": true,
22
+ "wysihtml": true,
23
+ "LocalTime": true,
24
+ "describe": true,
25
+ "after": true,
26
+ "afterEach": true,
27
+ "before": true,
28
+ "beforeEach": true,
29
+ "it": true,
30
+ "expect": true,
31
+ "sinon": true,
32
+ "fixture": true,
33
+ "chai": true,
34
+ "flow": true,
35
+ "Promise": true
36
+ }
37
+ }
@@ -0,0 +1,37 @@
1
+ ---
2
+ name: Bug report
3
+ about: Create a report to help us improve Workarea
4
+ title: ''
5
+ labels: bug
6
+ assignees: ''
7
+
8
+ ---
9
+
10
+ ⚠️**Before you create**⚠️
11
+ Please verify the issue you're experiencing is not part of your Workarea project customizations. The best way to do this is with a [vanilla Workarea installation](https://developer.workarea.com/articles/create-a-new-host-application.html). This will help us spend time on fixes/improvements for the whole community. Thank you!
12
+
13
+ **Describe the bug**
14
+ A clear and concise description of what the bug is.
15
+
16
+ **To Reproduce**
17
+ Steps to reproduce the behavior:
18
+ 1. Go to '...'
19
+ 2. Click on '....'
20
+ 3. Scroll down to '....'
21
+ 4. See error
22
+
23
+ **Expected behavior**
24
+ A clear and concise description of what you expected to happen.
25
+
26
+ **Workarea Setup (please complete the following information):**
27
+ - Workarea Version: [e.g. v3.4.6]
28
+ - Plugins [e.g. workarea-blog, workarea-sitemaps]
29
+
30
+ **Attachments**
31
+ If applicable, add any attachments to help explain your problem, things like:
32
+ - screenshots
33
+ - Gemfile.lock
34
+ - test cases
35
+
36
+ **Additional context**
37
+ Add any other context about the problem here.
@@ -0,0 +1,17 @@
1
+ ---
2
+ name: Documentation request
3
+ about: Suggest documentation
4
+ title: ''
5
+ labels: documentation
6
+ assignees: ''
7
+
8
+ ---
9
+
10
+ **Is your documentation related to a problem? Please describe.**
11
+ A clear and concise description of what the problem is. Ex. I'm confused by [...]
12
+
13
+ **Describe the article you'd like**
14
+ A clear and concise description of what would be in the documentation article.
15
+
16
+ **Additional context**
17
+ Add any other context or screenshots about the feature request here.
@@ -0,0 +1,20 @@
1
+ ---
2
+ name: Feature request
3
+ about: Suggest an idea for Workarea
4
+ title: ''
5
+ labels: enhancement
6
+ assignees: ''
7
+
8
+ ---
9
+
10
+ **Is your feature request related to a problem? Please describe.**
11
+ A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
12
+
13
+ **Describe the solution you'd like**
14
+ A clear and concise description of what you want to happen.
15
+
16
+ **Describe alternatives you've considered**
17
+ A clear and concise description of any alternative solutions or features you've considered.
18
+
19
+ **Additional context**
20
+ Add any other context or screenshots about the feature request here.
@@ -0,0 +1,77 @@
1
+ name: CI
2
+ on: [push]
3
+
4
+ jobs:
5
+ rubocop:
6
+ runs-on: ubuntu-latest
7
+ steps:
8
+ - uses: actions/checkout@v1
9
+ - uses: workarea-commerce/ci/rubocop@ruby-2.4
10
+ env:
11
+ BUNDLE_GEMS__WEBLINC__COM: ${{ secrets.BUNDLE_GEMS__WEBLINC__COM }}
12
+ bundler_audit:
13
+ runs-on: ubuntu-latest
14
+ steps:
15
+ - uses: actions/checkout@v1
16
+ - uses: workarea-commerce/ci/bundler-audit@ruby-2.4
17
+ env:
18
+ BUNDLE_GEMS__WEBLINC__COM: ${{ secrets.BUNDLE_GEMS__WEBLINC__COM }}
19
+ eslint:
20
+ runs-on: ubuntu-latest
21
+ steps:
22
+ - uses: actions/checkout@v1
23
+ - uses: workarea-commerce/ci/eslint@v1
24
+ with:
25
+ args: '**/*.js'
26
+
27
+ admin_tests:
28
+ runs-on: ubuntu-latest
29
+ steps:
30
+ - uses: actions/checkout@v1
31
+ - uses: actions/setup-ruby@v1
32
+ with:
33
+ ruby-version: 2.4.x
34
+ - uses: workarea-commerce/ci/test@v1
35
+ with:
36
+ command: bin/rails app:workarea:test:admin
37
+ env:
38
+ BUNDLE_GEMS__WEBLINC__COM: ${{ secrets.BUNDLE_GEMS__WEBLINC__COM }}
39
+
40
+ core_tests:
41
+ runs-on: ubuntu-latest
42
+ steps:
43
+ - uses: actions/checkout@v1
44
+ - uses: actions/setup-ruby@v1
45
+ with:
46
+ ruby-version: 2.4.x
47
+ - uses: workarea-commerce/ci/test@v1
48
+ with:
49
+ command: bin/rails app:workarea:test:core
50
+ env:
51
+ BUNDLE_GEMS__WEBLINC__COM: ${{ secrets.BUNDLE_GEMS__WEBLINC__COM }}
52
+
53
+ storefront_tests:
54
+ runs-on: ubuntu-latest
55
+ steps:
56
+ - uses: actions/checkout@v1
57
+ - uses: actions/setup-ruby@v1
58
+ with:
59
+ ruby-version: 2.4.x
60
+ - uses: workarea-commerce/ci/test@v1
61
+ with:
62
+ command: bin/rails app:workarea:test:storefront
63
+ env:
64
+ BUNDLE_GEMS__WEBLINC__COM: ${{ secrets.BUNDLE_GEMS__WEBLINC__COM }}
65
+
66
+ plugins_tests:
67
+ runs-on: ubuntu-latest
68
+ steps:
69
+ - uses: actions/checkout@v1
70
+ - uses: actions/setup-ruby@v1
71
+ with:
72
+ ruby-version: 2.4.x
73
+ - uses: workarea-commerce/ci/test@v1
74
+ with:
75
+ command: bin/rails app:workarea:test:plugins
76
+ env:
77
+ BUNDLE_GEMS__WEBLINC__COM: ${{ secrets.BUNDLE_GEMS__WEBLINC__COM }}
data/.gitignore ADDED
@@ -0,0 +1,20 @@
1
+ .bundle/
2
+ .yardoc
3
+ .DS_Store
4
+ .byebug_history
5
+ .sass-cache/
6
+ log/*.log
7
+ pkg/
8
+ coverage
9
+ test/dummy/log/*.log
10
+ test/dummy/node_modules/
11
+ test/dummy/yarn-error.log
12
+ test/dummy/tmp/
13
+ test/dummy/public/
14
+ test/dummy/db/*.sqlite3
15
+ test/dummy/db/*.sqlite3-journal
16
+ node_modules
17
+ Gemfile.lock
18
+ package.json
19
+ yarn.lock
20
+ .rubocop-http*
data/.rubocop.yml ADDED
@@ -0,0 +1,2 @@
1
+ inherit_gem:
2
+ workarea-ci: rubocop.yml
data/.ruby-version ADDED
@@ -0,0 +1 @@
1
+ 2.4.6
data/CHANGELOG.md ADDED
@@ -0,0 +1,261 @@
1
+ Workarea Global E 1.2.1 (2020-01-21)
2
+ --------------------------------------------------------------------------------
3
+
4
+ * Add Discount Adjustments To Admin Order Views
5
+
6
+ The `#discount_adjustments` on an order are now being output to the
7
+ admin user in **/admin/orders/:id**.
8
+
9
+ GLOBALE-4
10
+ Tom Scott
11
+
12
+ * Add Discount Adjustments To Admin Order Views
13
+
14
+ The `#discount_adjustments` on an order are now being output to the
15
+ admin user in **/admin/orders/:id**.
16
+
17
+ GLOBALE-4
18
+ Tom Scott
19
+
20
+
21
+
22
+ Workarea Global E 1.2.0 (2019-12-11)
23
+ --------------------------------------------------------------------------------
24
+
25
+ * Add Remove Restricted Products API
26
+
27
+ This allows Global-E to `POST` any products in an order that should be
28
+ removed, since they are restricted in the given user's area.
29
+
30
+ GLOBALE-1
31
+ Tom Scott
32
+
33
+ * Store nonadjusted base currency pricing
34
+
35
+ Store the original `ItemCalculator` `price` and `amount` in the data of
36
+ the first price adjustment for GlobalE orders
37
+
38
+ GLOBALE-40
39
+ Eric Pigeon
40
+
41
+
42
+
43
+ Workarea Global E 1.1.0 (2019-10-01)
44
+ --------------------------------------------------------------------------------
45
+
46
+ * GlobalE Saved Language Preferences
47
+
48
+ Store GlobalE culture code on user and set cookie for GlobalE to use
49
+ when starting GlobalE checkout
50
+
51
+ GLOBALE-39
52
+ Eric Pigeon
53
+
54
+ * Pass AddressBookId to GlobalE
55
+
56
+ Pass AddressBookId to GlobalE for saved addresses in checkout and update
57
+ the address after the order has been placed.
58
+
59
+ GLOBALE-36
60
+ Eric Pigeon
61
+
62
+ * Allow GlobalE to override fixed pricing for order
63
+
64
+ Even though a customer is ordering in a fixed price currency, sometimes
65
+ the order needs to be priced using conversion rules instead of the fixed
66
+ prices.
67
+
68
+ GLOBALE-38
69
+ Eric Pigeon
70
+
71
+
72
+
73
+ Workarea Global E 1.0.0 (2019-08-22)
74
+ --------------------------------------------------------------------------------
75
+
76
+ * Fix incorrect item price adjustment amounts
77
+
78
+ GLOBALE-37
79
+ Eric Pigeon
80
+
81
+ * Save payment with journaled and write majority
82
+
83
+ GLOBALE-31
84
+ Eric Pigeon
85
+
86
+ * Add GlobalE Order Id to Admin Search Text
87
+
88
+ Update GlobalE orders to be search `jump_to`
89
+
90
+ GLOBALE-32
91
+ Eric Pigeon
92
+
93
+
94
+
95
+ Workarea Global E 1.0.0.beta.9 (2019-06-19)
96
+ --------------------------------------------------------------------------------
97
+
98
+ * Move GlobalE domains to config
99
+
100
+ Eric Pigeon
101
+
102
+ * Remove domestic countries config
103
+
104
+ Remove config for controlling what countries aren't operated by GlobalE
105
+ and use new cookie
106
+
107
+ GLOBALE-30
108
+ Eric Pigeon
109
+
110
+
111
+
112
+ Workarea Global E 1.0.0.beta.8 (2019-06-07)
113
+ --------------------------------------------------------------------------------
114
+
115
+ * Update Product.Attributes
116
+
117
+ Change Attribute#name to the detail values and Attribute#code to the the
118
+ key.
119
+ Fix typo in GlobalE API URLs
120
+ Eric Pigeon
121
+
122
+
123
+
124
+ Workarea Global E 1.0.0.beta.7 (2019-06-04)
125
+ --------------------------------------------------------------------------------
126
+
127
+ * Handle discounts that only exist in GlobalE
128
+
129
+ Shipping and Duties discounts only exist in GlobalE and don't have a
130
+ corresponding discount in Workarea, handle when the original discount
131
+ doens't exist and ignore them in analytics
132
+ Eric Pigeon
133
+
134
+ * Only show country execptions on Products#show
135
+
136
+ only add country exceptions data tags to the main product on
137
+ Products#show
138
+ Eric Pigeon
139
+
140
+ * Fix discounts overdiscounting fixed pricing orders
141
+
142
+ In `Discount::ApplicationGroup#value` each discount is applied to the
143
+ order then removed from the order to determine the total value of that
144
+ group. This fixes a bug were the discounts weren't removing
145
+ international adjustments when calculating `ApplicationGroup#value`
146
+
147
+ GLOBALE-29
148
+ Eric Pigeon
149
+
150
+ * Change Order::Item#discounted_price_except_duties_and_taxes to discounted_price_for_customs
151
+
152
+ Eric Pigeon
153
+
154
+ * Add Catalog::Product#global_e_forbidden to the admin
155
+
156
+ Eric Pigeon
157
+
158
+
159
+
160
+ Workarea Global E 1.0.0.beta.6 (2019-05-17)
161
+ --------------------------------------------------------------------------------
162
+
163
+ * Fix broken tests
164
+
165
+ Eric Pigeon
166
+
167
+
168
+
169
+ Workarea Global E 1.0.0.beta.5 (2019-05-16)
170
+ --------------------------------------------------------------------------------
171
+
172
+ * QA feedback
173
+
174
+ Fix DiveredQuantity -> DilveryQuantity
175
+ Add `name` in Product.Attributes
176
+ Add missing data tags on `cart_items/create`
177
+ Add data tag to GE Checkout view
178
+ Add config for controlling GE environment
179
+ Send only required fields in Parcel.Product
180
+ Eric Pigeon
181
+
182
+
183
+
184
+ Workarea Global E 1.0.0.beta.4 (2019-05-13)
185
+ --------------------------------------------------------------------------------
186
+
187
+ * Feedback from GlobalE QA
188
+
189
+ Price order before redirect to ensure fixed pricing is cleared out if
190
+ needed
191
+ Set gift cards as forbidden
192
+ Only send GlobalE orders to GlobalE in OrderUpdateDispatch
193
+ Add data tags to `cart_items/create.html.haml`
194
+ Add fixed pricing tags to unit prices in `carts/show.html.haml`
195
+
196
+ GLOBALE-27
197
+ Eric Pigeon
198
+
199
+
200
+
201
+ Workarea Global E 1.0.0.beta.3 (2019-05-01)
202
+ --------------------------------------------------------------------------------
203
+
204
+ * Implement OrderUpdateDispatch
205
+
206
+ GLOBALE-21
207
+ Eric Pigeon
208
+
209
+ * Country Exceptions Support
210
+
211
+ Country exceptions allow certain product's to have a minimum VAT rate,
212
+ or be restricted from checkout.
213
+
214
+ GLOBALE-26
215
+ Eric Pigeon
216
+
217
+ * Add Fixed Price Support
218
+
219
+ Fixed prices allow the merchant to target specific countries, or
220
+ currencies (like the Eurozone) to localize their prices instead of
221
+ dynamic conversion.
222
+
223
+ GLOBALE-25
224
+ Eric Pigeon
225
+
226
+
227
+
228
+ Workarea Global E 1.0.0.beta.2 (2019-04-04)
229
+ --------------------------------------------------------------------------------
230
+
231
+ * Add new fields from GlobalE
232
+
233
+ `Order#contains_clearance_fees_price`
234
+ `Order::Item#discounted_price_except_duties_and_taxes`
235
+ `Order::Item#generic_hs_code`
236
+ Eric Pigeon
237
+
238
+
239
+
240
+ Workarea Global E 1.0.0.beta.1 (2019-04-03)
241
+ --------------------------------------------------------------------------------
242
+
243
+ * Beta 1.0.0 release
244
+
245
+ Update discount display and CheckoutCartInfo response to match, and fix
246
+ issues with discount analytics
247
+ Eric Pigeon
248
+
249
+
250
+
251
+ Workarea Global E 1.0.0.alpha.1 (2019-03-28)
252
+ --------------------------------------------------------------------------------
253
+
254
+ * Alpha 1.0.0 release
255
+
256
+ GlobalE's smart cross border solution enables international customers to
257
+ shop in a localized experience.
258
+ Eric Pigeon
259
+
260
+
261
+
data/Gemfile ADDED
@@ -0,0 +1,16 @@
1
+ source 'https://rubygems.org'
2
+ git_source(:github) { |repo| "https://github.com/#{repo}.git" }
3
+
4
+ source 'https://gems.weblinc.com' do
5
+ gem 'workarea'
6
+ gem 'workarea-ci'
7
+ gem 'workarea-gift_cards', '~> 3'
8
+ end
9
+
10
+ gem 'sprockets', '~> 3'
11
+
12
+ gemspec
13
+
14
+ group :test do
15
+ gem 'simplecov', require: false
16
+ end
data/README.md ADDED
@@ -0,0 +1,39 @@
1
+ # Workarea GlobalE
2
+
3
+ GlobalE in an international checkout provider.
4
+
5
+ ## Configuration
6
+ ```yaml
7
+ Workarea.configure do |config|
8
+ config.global_e.javascript_source = YOUR GLOBALE JAVASCRIPT URL
9
+ config.global_e.css_source = YOUR GLOBALE CSS URL
10
+ config.global_e.merchant_guid = YOUR GLOBALE MERCHANT ID
11
+ end
12
+ ```
13
+
14
+ ## Views
15
+ GlobalE requires data tags on multiple views on Storefront. The plugin
16
+ overrides the following views:
17
+ * `storefront/cart_items/create.html.haml`
18
+ * `storefront/cart/_pricing.html.haml`
19
+ * `storefront/cart/show.html.haml`
20
+ * `storefront/products/pricing.html.haml`
21
+ * `storefront/uses/orders/_summary.html.haml`
22
+
23
+
24
+ ## Fraud
25
+ GlobalE handles the liability of fraud for their orders; after an order is placed via GlobalE
26
+ it will be Pending GlobalE Faud until GlobalE clears the payment. `Order#place` callbacks aren't fired
27
+ until after the order is cleared for fraud. GlobalE will cancel the order if it it's fraudulent.
28
+
29
+ Refer to the views in the plugin for required data tags.
30
+
31
+ ## Workarea Platform Documentation
32
+
33
+ See [http://developer.weblinc.com](http://developer.weblinc.com) for Workarea platform documentation.
34
+
35
+ ## Copyright & Licensing
36
+
37
+ Copyright WebLinc 2019. All rights reserved.
38
+
39
+ For licensing, contact sales@workarea.com.
data/Rakefile ADDED
@@ -0,0 +1,59 @@
1
+ begin
2
+ require 'bundler/setup'
3
+ rescue LoadError
4
+ puts 'You must `gem install bundler` and `bundle install` to run rake tasks'
5
+ end
6
+
7
+ require 'rdoc/task'
8
+ RDoc::Task.new(:rdoc) do |rdoc|
9
+ rdoc.rdoc_dir = 'rdoc'
10
+ rdoc.title = 'Global E'
11
+ rdoc.options << '--line-numbers'
12
+ rdoc.rdoc_files.include('README.md')
13
+ rdoc.rdoc_files.include('lib/**/*.rb')
14
+ end
15
+
16
+ APP_RAKEFILE = File.expand_path("../test/dummy/Rakefile", __FILE__)
17
+ load 'rails/tasks/engine.rake'
18
+ load 'rails/tasks/statistics.rake'
19
+ load 'workarea/changelog.rake'
20
+
21
+ require 'rake/testtask'
22
+ Rake::TestTask.new(:test) do |t|
23
+ t.libs << 'lib'
24
+ t.libs << 'test'
25
+ t.pattern = 'test/**/*_test.rb'
26
+ t.verbose = false
27
+ end
28
+ task default: :test
29
+
30
+ $LOAD_PATH.unshift File.expand_path('../lib', __FILE__)
31
+ require 'workarea/global_e/version'
32
+
33
+ desc "Release version #{Workarea::GlobalE::VERSION} of the gem"
34
+ task :release do
35
+ host = "https://#{ENV['BUNDLE_GEMS__WEBLINC__COM']}@gems.weblinc.com"
36
+
37
+ Rake::Task['workarea:changelog'].execute
38
+ system 'git add CHANGELOG.md'
39
+ system 'git commit -m "Update CHANGELOG"'
40
+
41
+ system "git tag -a v#{Workarea::GlobalE::VERSION} -m 'Tagging #{Workarea::GlobalE::VERSION}'"
42
+ system 'git push origin HEAD --follow-tags'
43
+
44
+ system "gem build workarea-global_e.gemspec"
45
+ system "gem push workarea-global_e-#{Workarea::GlobalE::VERSION}.gem"
46
+ system "gem push workarea-global_e-#{Workarea::GlobalE::VERSION}.gem --host #{host}"
47
+ system "rm workarea-global_e-#{Workarea::GlobalE::VERSION}.gem"
48
+ end
49
+
50
+ desc 'Run the JavaScript tests'
51
+ ENV['TEASPOON_RAILS_ENV'] = File.expand_path('../test/dummy/config/environment', __FILE__)
52
+ task teaspoon: 'app:teaspoon'
53
+
54
+ desc 'Start a server at http://localhost:3000/teaspoon for JavaScript tests'
55
+ task :teaspoon_server do
56
+ Dir.chdir("test/dummy")
57
+ teaspoon_env = File.expand_path('../test/teaspoon_env.rb', __FILE__)
58
+ system "RAILS_ENV=test TEASPOON_ENV=#{teaspoon_env} rails s"
59
+ end