super_good-solidus_taxjar 0.18.1 → 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (127) hide show
  1. checksums.yaml +4 -4
  2. data/.circleci/config.yml +58 -0
  3. data/CHANGELOG.md +118 -5
  4. data/Gemfile +28 -10
  5. data/README.md +300 -45
  6. data/Rakefile +3 -0
  7. data/app/controllers/spree/admin/taxjar_settings_controller.rb +93 -0
  8. data/app/controllers/spree/admin/taxjar_transactions_controller.rb +37 -0
  9. data/app/controllers/spree/admin/transaction_sync_batches_controller.rb +18 -0
  10. data/app/jobs/super_good/solidus_taxjar/backfill_transaction_sync_batch_job.rb +23 -0
  11. data/app/jobs/super_good/solidus_taxjar/replace_transaction_job.rb +26 -0
  12. data/app/jobs/super_good/solidus_taxjar/report_transaction_job.rb +22 -0
  13. data/app/models/super_good/solidus_taxjar/configuration.rb +27 -0
  14. data/app/models/super_good/solidus_taxjar/order_transaction.rb +16 -0
  15. data/app/models/super_good/solidus_taxjar/refund_transaction.rb +13 -0
  16. data/app/models/super_good/solidus_taxjar/transaction_sync_batch.rb +11 -0
  17. data/app/models/super_good/solidus_taxjar/transaction_sync_log.rb +8 -0
  18. data/app/overrides/spree/admin/orders_controller_override.rb +12 -0
  19. data/app/overrides/spree/admin/shared/_order_submenu/add_taxjar_sync_history_tab.html.erb.deface +6 -0
  20. data/app/overrides/spree/admin/shared/_order_summary/add_taxjar_reported_at.html.erb.deface +30 -0
  21. data/app/overrides/spree/admin/shared/_taxes_tabs/add_configuration_menu_items.html.erb.deface +5 -0
  22. data/app/overrides/super_good/solidus_taxjar/spree/order_override.rb +21 -0
  23. data/app/views/spree/admin/orders/taxjar_transactions.html.erb +4 -0
  24. data/app/views/spree/admin/shared/_transaction_sync_log_table.html.erb +35 -0
  25. data/app/views/spree/admin/taxjar_settings/_nexus_regions.html.erb +23 -0
  26. data/app/views/spree/admin/taxjar_settings/_tax_categories.html.erb +41 -0
  27. data/app/views/spree/admin/taxjar_settings/edit.html.erb +17 -0
  28. data/app/views/spree/admin/taxjar_settings/edit_no_api_key.html.erb +21 -0
  29. data/app/views/spree/admin/transaction_sync_batches/index.html.erb +50 -0
  30. data/app/views/spree/admin/transaction_sync_batches/show.html.erb +7 -0
  31. data/bin/console +2 -0
  32. data/bin/rails-engine +1 -1
  33. data/bin/sandbox +43 -36
  34. data/bin/setup +3 -3
  35. data/config/routes.rb +19 -0
  36. data/db/migrate/20210908205201_create_taxjar_order_transactions.rb +16 -0
  37. data/db/migrate/20211008175113_create_taxjar_refund_transaction.rb +15 -0
  38. data/db/migrate/20211008183858_add_transaction_date_to_order_transaction.rb +5 -0
  39. data/db/migrate/20211119143354_create_configuration.rb +8 -0
  40. data/db/migrate/20220405213958_create_transaction_sync_batches.rb +7 -0
  41. data/db/migrate/20220405215225_create_transaction_sync_logs.rb +14 -0
  42. data/db/migrate/20220908181655_add_dates_to_transaction_sync_batch.rb +6 -0
  43. data/db/migrate/20220912182210_allow_null_transaction_sync_batches_on_logs.rb +5 -0
  44. data/db/migrate/20230320211309_add_refund_transaction_to_sync_logs.rb +5 -0
  45. data/lib/generators/super_good/solidus_taxjar/install/install_generator.rb +68 -0
  46. data/lib/super_good/engine.rb +2 -0
  47. data/lib/super_good/solidus_taxjar/addresses.rb +3 -3
  48. data/lib/super_good/solidus_taxjar/api.rb +45 -9
  49. data/lib/super_good/solidus_taxjar/api_params.rb +93 -26
  50. data/lib/super_good/solidus_taxjar/backfill_transactions.rb +11 -0
  51. data/lib/super_good/solidus_taxjar/cached_api.rb +23 -0
  52. data/lib/super_good/solidus_taxjar/calculator_helper.rb +34 -5
  53. data/lib/super_good/solidus_taxjar/discount_calculator.rb +1 -1
  54. data/lib/super_good/solidus_taxjar/overrides/request_override.rb +15 -0
  55. data/lib/super_good/solidus_taxjar/reportable.rb +91 -0
  56. data/lib/super_good/solidus_taxjar/reporting.rb +44 -0
  57. data/lib/super_good/solidus_taxjar/spree/legacy_reporting_subscriber.rb +41 -0
  58. data/lib/super_good/solidus_taxjar/spree/reporting_subscriber.rb +40 -0
  59. data/lib/super_good/solidus_taxjar/tax_calculator.rb +10 -4
  60. data/lib/super_good/solidus_taxjar/testing_support/factories/address_factory.rb +11 -0
  61. data/lib/super_good/solidus_taxjar/testing_support/factories/configuration_factory.rb +11 -0
  62. data/lib/super_good/solidus_taxjar/testing_support/factories/order_transaction_factory.rb +22 -0
  63. data/lib/super_good/solidus_taxjar/testing_support/factories/refund_transaction_factory.rb +7 -0
  64. data/lib/super_good/solidus_taxjar/testing_support/factories/transaction_sync_batch_factory.rb +9 -0
  65. data/lib/super_good/solidus_taxjar/testing_support/factories/transaction_sync_log_factory.rb +18 -0
  66. data/lib/super_good/solidus_taxjar/transaction_id_generator.rb +45 -0
  67. data/lib/super_good/solidus_taxjar/version.rb +1 -1
  68. data/lib/super_good/solidus_taxjar.rb +30 -3
  69. data/spec/features/spree/admin/backfill_transactions_spec.rb +138 -0
  70. data/spec/features/spree/admin/refund_spec.rb +167 -0
  71. data/spec/features/spree/admin/reporting_to_taxjar_spec.rb +156 -0
  72. data/spec/features/spree/admin/taxjar_settings_spec.rb +90 -0
  73. data/spec/features/spree/checkout_spec.rb +58 -0
  74. data/spec/fixtures/cassettes/Admin_TaxJar_Settings/GET_sync_nexus_regions/Taxjar_API_token_is_not_set/doesn_t_make_a_request_for_the_nexus_regions.yml +57 -0
  75. data/spec/fixtures/cassettes/Admin_TaxJar_Settings/GET_sync_tax_categories/Taxjar_API_token_is_not_set/doesn_t_make_a_request_for_the_tax_categories.yml +57 -0
  76. data/spec/fixtures/cassettes/Admin_TaxJar_Settings/Taxjar_settings_tab/Taxjar_API_token_is_set/shows_the_settings_page.yml +2437 -0
  77. data/spec/fixtures/cassettes/Admin_TaxJar_Settings/Taxjar_settings_tab/Taxjar_API_token_isn_t_set/doesn_t_show_any_other_TaxJar_features.yml +57 -0
  78. data/spec/fixtures/cassettes/Admin_TaxJar_Settings/Taxjar_settings_tab/Taxjar_API_token_isn_t_set/shows_a_descriptive_error_message.yml +57 -0
  79. data/spec/fixtures/cassettes/Admin_TaxJar_Settings/Taxjar_settings_tab/Taxjar_reporting_is_enabled/shows_that_reporting_is_enabled.yml +2382 -0
  80. data/spec/fixtures/cassettes/Admin_TaxJar_Settings/Taxjar_settings_tab/order_is_shipped/the_user_backfills_their_transactions.yml +2511 -0
  81. data/spec/fixtures/cassettes/Admin_TaxJar_Settings/Taxjar_settings_tab/the_user_navigates_to_the_TaxJar_Settings.yml +2382 -0
  82. data/spec/fixtures/cassettes/Admin_Transaction_Sync_Batches/user_has_a_shipped_order/starts_a_transaction_backfill.yml +370 -0
  83. data/spec/fixtures/cassettes/Reporting_orders_to_TaxJar/shipping_a_complete_and_paid_order.yml +310 -0
  84. data/spec/fixtures/cassettes/Reporting_orders_to_TaxJar/updating_an_order_which_was_not_reported_due_to_failure/it_reports_the_order_instead_of_trying_to_replace_it.yml +794 -0
  85. data/spec/fixtures/cassettes/Reporting_orders_to_TaxJar/with_an_order_with_invalid_zipcode/retry_of_a_previously_failed_transaction_sync.yml +418 -0
  86. data/spec/fixtures/cassettes/Spree_Admin_TransactionSyncBatchesController/_create/creates_a_batch.yml +250 -0
  87. data/spec/fixtures/cassettes/Spree_Admin_TransactionSyncBatchesController/_create/creates_a_log_in_the_batch_with_an_order.yml +250 -0
  88. data/spec/fixtures/cassettes/Spree_Admin_TransactionSyncBatchesController/_create/user_supplies_a_start_date/creates_a_batch.yml +250 -0
  89. data/spec/fixtures/cassettes/Spree_Admin_TransactionSyncBatchesController/_create/user_supplies_a_start_date/user_supplies_start_and_end_date/creates_a_batch.yml +250 -0
  90. data/spec/fixtures/cassettes/SuperGood_SolidusTaxjar_CalculatorHelper/_taxable_address_/when_taxable_address_check_returns_true/with_US_address/when_the_address_is_not_within_a_nexus_region/1_3_2_2_2_1.yml +58 -0
  91. data/spec/fixtures/cassettes/SuperGood_SolidusTaxjar_CalculatorHelper/_taxable_address_/when_taxable_address_check_returns_true/with_US_address/when_the_address_is_within_a_nexus_region/1_3_2_2_1_1.yml +58 -0
  92. data/spec/fixtures/cassettes/SuperGood_SolidusTaxjar_Reporting/_refund_and_create_transaction/when_Taxjar_cannot_create_a_refund_transaction/doesn_t_create_a_new_transaction.yml +393 -0
  93. data/spec/fixtures/cassettes/SuperGood_SolidusTaxjar_Reporting/_refund_and_create_transaction/when_Taxjar_cannot_create_a_refund_transaction/raises_an_error.yml +393 -0
  94. data/spec/fixtures/cassettes/Taxjar_API_Request/logging_is_disabled/doesn_t_call_the_logger.yml +158 -0
  95. data/spec/fixtures/cassettes/Taxjar_API_Request/logging_is_enabled/calls_the_logger.yml +158 -0
  96. data/spec/fixtures/cassettes/features/spree/admin/checkout.yml +238 -0
  97. data/spec/fixtures/cassettes/features/spree/admin/refund.yml +1162 -0
  98. data/spec/jobs/super_good/solidus_taxjar/backfill_transaction_sync_batch_job_spec.rb +117 -0
  99. data/spec/jobs/super_good/solidus_taxjar/replace_transaction_job_spec.rb +95 -0
  100. data/spec/jobs/super_good/solidus_taxjar/report_transaction_job_spec.rb +76 -0
  101. data/spec/models/super_good/solidus_taxjar/configuration_spec.rb +79 -0
  102. data/spec/models/super_good/solidus_taxjar/order_transaction_spec.rb +36 -0
  103. data/spec/models/super_good/solidus_taxjar/transaction_sync_batch_spec.rb +48 -0
  104. data/spec/requests/spree/admin/order_request_spec.rb +121 -0
  105. data/spec/requests/spree/admin/taxjar_settings_request_spec.rb +198 -0
  106. data/spec/requests/spree/admin/taxjar_transactions_request_spec.rb +62 -0
  107. data/spec/requests/spree/admin/transaction_sync_batches_request_spec.rb +82 -0
  108. data/spec/spec_helper.rb +47 -4
  109. data/spec/subscribers/super_good/solidus_taxjar/spree/reporting_subscriber_spec.rb +278 -0
  110. data/spec/super_good/solidus_taxjar/addresses_spec.rb +0 -14
  111. data/spec/super_good/solidus_taxjar/api_params_spec.rb +284 -80
  112. data/spec/super_good/solidus_taxjar/api_spec.rb +168 -28
  113. data/spec/super_good/solidus_taxjar/backfill_transactions_spec.rb +24 -0
  114. data/spec/super_good/solidus_taxjar/cached_api_spec.rb +58 -0
  115. data/spec/super_good/solidus_taxjar/calculator_helper_spec.rb +131 -0
  116. data/spec/super_good/solidus_taxjar/discount_calculator_spec.rb +19 -2
  117. data/spec/super_good/solidus_taxjar/reportable_spec.rb +194 -0
  118. data/spec/super_good/solidus_taxjar/reporting_spec.rb +243 -0
  119. data/spec/super_good/solidus_taxjar/tax_calculator_spec.rb +19 -19
  120. data/spec/super_good/solidus_taxjar/tax_rate_calculator_spec.rb +8 -3
  121. data/spec/super_good/solidus_taxjar/transaction_id_generator_spec.rb +77 -0
  122. data/spec/super_good/solidus_taxjar_spec.rb +99 -0
  123. data/spec/support/checkoutable_store_shared_context.rb +19 -0
  124. data/spec/support/solidus_events_helper.rb +26 -0
  125. data/spec/taxjar/api/request_spec.rb +52 -0
  126. data/super_good-solidus_taxjar.gemspec +4 -3
  127. metadata +176 -14
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 977d3ededff1e9bd56c37b6dda9228545160525fed6f7667e194e0ab45486ce8
4
- data.tar.gz: 10466dec877f8de3eadb843929ec93173bc30fd7ab58be34c5ff08d5de4214b2
3
+ metadata.gz: 1ea462e3495029115fadb24132bdd24c82eb099c69e54864f51958b2df7986ee
4
+ data.tar.gz: c90b8d81ddd5d173b6bd62b276e7a7f472f2f90018ab3568e2ae82dcd4e21f88
5
5
  SHA512:
6
- metadata.gz: 46ffc2f0a1c52205acdf91a12ec2a3b1806bca174450a1a763e03ba1c54add5a7c82ac538b04bca72c31fa7d295fc2cd9a040e719cd58ddaf7233a1af7655b35
7
- data.tar.gz: 3186b598fb5d11dd0cab75e145d8e088e6563562767acab012e4127544428fa6e4ac927adb2cc1c9ccbd7dfc831e7bdde1e402462596230736045bb970d54c6e
6
+ metadata.gz: dada93cad3b627f3b76fe73825a62831c38f583dd695e4de42d869e3bbcb23143097509167f6eb6298fdc46b8a85f1fca7dc4bfdb1e22ab19337a6ab7e76c0a9
7
+ data.tar.gz: a9e0be635741a3c9e4dc2b02cd9588f493db59c3bee25a2331513f40ecdc6b1662618bd7440f5b7227410d03b14701325c775f138645b75da147380933fdb80b
@@ -0,0 +1,58 @@
1
+ version: 2.1
2
+ orbs:
3
+ # Browser tools are required for feature specs.
4
+ browser-tools: circleci/browser-tools@1.4
5
+
6
+ # Always run tests agains the versions of Solidus defined in the
7
+ # most recent version of the Orb.
8
+ solidusio_extensions: solidusio/extensions@volatile
9
+
10
+ jobs:
11
+ run-specs-solidus-current:
12
+ executor:
13
+ name: solidusio_extensions/postgres
14
+ ruby_version: "3.0"
15
+ steps:
16
+ - checkout
17
+ - browser-tools/install-browser-tools
18
+ - solidusio_extensions/run-tests-solidus-older
19
+ - solidusio_extensions/run-tests-solidus-current
20
+ - solidusio_extensions/store-test-results
21
+ run-specs-solidus-older:
22
+ executor:
23
+ name: solidusio_extensions/postgres
24
+ ruby_version: "3.0"
25
+ steps:
26
+ - checkout
27
+ - browser-tools/install-browser-tools
28
+ - solidusio_extensions/run-tests-solidus-older
29
+ - solidusio_extensions/store-test-results
30
+ run-specs-solidus-main:
31
+ executor:
32
+ name: solidusio_extensions/postgres
33
+ ruby_version: "3.1"
34
+ steps:
35
+ - browser-tools/install-browser-tools
36
+ - checkout
37
+ - solidusio_extensions/run-tests-solidus-main
38
+ - solidusio_extensions/store-test-results
39
+ workflows:
40
+ "Run specs on current Solidus versions":
41
+ jobs:
42
+ - run-specs-solidus-current
43
+ "Run specs on older Solidus versions":
44
+ jobs:
45
+ - run-specs-solidus-older
46
+ "Run specs on Solidus main":
47
+ jobs:
48
+ - run-specs-solidus-main
49
+ "Weekly run specs against master":
50
+ triggers:
51
+ - schedule:
52
+ cron: "0 0 * * 4" # every Thursday
53
+ filters:
54
+ branches:
55
+ only:
56
+ - master
57
+ jobs:
58
+ - run-specs-solidus-main
data/CHANGELOG.md CHANGED
@@ -1,15 +1,128 @@
1
1
  # Changelog
2
-
3
- ## master
4
-
5
- ## v0.18.1
2
+ All notable changes to this project will be documented in this file.
3
+
4
+ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
5
+ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
6
+
7
+ ## Unreleased
8
+
9
+ - Nothing yet.
10
+
11
+ ## v1.0.0
12
+
13
+ ### Added
14
+
15
+ - [#190](https://github.com/SuperGoodSoft/solidus_taxjar/pull/190) Add transaction sync batch show page
16
+ - [#188](https://github.com/SuperGoodSoft/solidus_taxjar/pull/188) Show transaction sync batches in user interface
17
+ - [#185](https://github.com/SuperGoodSoft/solidus_taxjar/pull/185) Backfill transactions in batches
18
+ - [#139](https://github.com/SuperGoodSoft/solidus_taxjar/pull/139) Refund and create a new order transaction when an order is recalculated
19
+ - [#175](https://github.com/SuperGoodSoft/solidus_taxjar/pull/175) Add request logging to TaxJar API requests
20
+ - [#138](https://github.com/SuperGoodSoft/solidus_taxjar/pull/138) Add admin UI for configuring reporting
21
+ - [#158](https://github.com/SuperGoodSoft/solidus_taxjar/pull/158) Update sandbox bin stub for `solidus@3`
22
+ - [#88](https://github.com/SuperGoodSoft/solidus_taxjar/pull/88) Fire `shipment_shipped` event when any shipment on an order ships.
23
+ - [#81](https://github.com/SuperGoodSoft/solidus_taxjar/pull/81) Add install generator
24
+ - [#98](https://github.com/SuperGoodSoft/solidus_taxjar/pull/98) Add generator for TaxJar transaction IDs
25
+ - [#103](https://github.com/SuperGoodSoft/solidus_taxjar/pull/103) Add `reporting_enabled` configuration option
26
+ - [#97](https://github.com/SuperGoodSoft/solidus_taxjar/pull/97) Add public API method to request the latest transaction associated with a solidus order.
27
+ - [#100](https://github.com/SuperGoodSoft/solidus_taxjar/pull/100) Add public API method to post a taxjar refund transaction for a solidus order.
28
+ - [#102](https://github.com/SuperGoodSoft/solidus_taxjar/pull/102) Add description to transaction line item params
29
+ - [#108](https://github.com/SuperGoodSoft/solidus_taxjar/pull/108) Add new model associated with a `Spree::Order` to represent taxjar order creation transactions
30
+ - [#114](https://github.com/SuperGoodSoft/solidus_taxjar/pull/114) Add new model associated with a `SuperGood::SolidusTaxjar::OrderTransaction` to represent taxjar refund creation transactions
31
+ - [#116](https://github.com/SuperGoodSoft/solidus_taxjar/pull/116) Update the `OrderTransaction` model to record the transaction date.
32
+ - [#109](https://github.com/SuperGoodSoft/solidus_taxjar/pull/109) Save `OrderTransaction` after API call to TaxJar
33
+ - [#111](https://github.com/SuperGoodSoft/solidus_taxjar/pull/111) Create a new taxjar transaction when a shipment is shipped.
34
+ - [#141](https://github.com/SuperGoodSoft/solidus_taxjar/pull/141) Handle unimplemented reporting features
35
+ - [#129](https://github.com/SuperGoodSoft/solidus_taxjar/pull/129) Report transaction asynchronously when a shipment is shipped.
36
+ - [#127](https://github.com/SuperGoodSoft/solidus_taxjar/pull/127) Add acceptance test for calculating taxes with the extension.
37
+ - [#160](https://github.com/SuperGoodSoft/solidus_taxjar/pull/160) Add tax categories API endpoint wrapper
38
+ - [#171](https://github.com/SuperGoodSoft/solidus_taxjar/pull/171) Display existing Nexus regions
39
+ - [#170](https://github.com/SuperGoodSoft/solidus_taxjar/pull/170) Hide all reporting features behind API key
40
+ - [#174](https://github.com/SuperGoodSoft/solidus_taxjar/pull/174) Provide a link to Taxjar state settings
41
+ - [#177](https://github.com/SuperGoodSoft/solidus_taxjar/pull/177) Make nexus caching configurable
42
+ - [#169](https://github.com/SuperGoodSoft/solidus_taxjar/pull/169) Add basic backfill transaction functionality
43
+ - [#176](https://github.com/SuperGoodSoft/solidus_taxjar/pull/176) Create refund transaction database models when reporting refunds.
44
+ - [#192](https://github.com/SuperGoodSoft/solidus_taxjar/pull/192) Handle failures that occur in the middle of refunding a transaction.
45
+ - [#194](https://github.com/SuperGoodSoft/solidus_taxjar/pull/194) Move the transaction backfill button to it's own unique page
46
+ - [#198](https://github.com/SuperGoodSoft/solidus_taxjar/pull/198) Don't create zero dollar transactions when an order is fully refunded.
47
+ - [#195](https://github.com/SuperGoodSoft/solidus_taxjar/pull/195) Run transaction backfills asynchronously
48
+ - [#200](https://github.com/SuperGoodSoft/solidus_taxjar/pull/200) Expand `solidus` gem into dependencies to support Solidus 3.2+
49
+ - [#183](https://github.com/SuperGoodSoft/solidus_taxjar/pull/183) Add ability to fetch tax codes from TaxJar and assign to tax categories in admin
50
+ - [#200](https://github.com/SuperGoodSoft/solidus_taxjar/pull/200) Render error message when backfilling transactions fails
51
+ - [#203](https://github.com/SuperGoodSoft/solidus_taxjar/pull/203) Remove outdated backfill button
52
+ - [#202](https://github.com/SuperGoodSoft/solidus_taxjar/pull/202) Add TaxJar transaction sync status to order show page
53
+ - [#204](https://github.com/SuperGoodSoft/solidus_taxjar/pull/204) Add page to render an orders TaxJar transactions
54
+ - [#201](https://github.com/SuperGoodSoft/solidus_taxjar/pull/201) Allow transaction backfills to be filtered by date range
55
+ - [#244](https://github.com/SuperGoodSoft/solidus_taxjar/pull/244) Let admins manually retry syncing failed TaxJar transactions
56
+ - [#255](https://github.com/SuperGoodSoft/solidus_taxjar/pull/255) Add a delay before reporting transactions
57
+ - [#253](https://github.com/SuperGoodSoft/solidus_taxjar/pull/253) Fix various bugs with reporting refund transactions
58
+
59
+ ### Changed
60
+
61
+ - [#95](https://github.com/SuperGoodSoft/solidus_taxjar/pull/95) Only require "state" for Canadian and US addresses
62
+ - [#181](https://github.com/SuperGoodSoft/solidus_taxjar/pull/181) Take all non-tax adjustment types into account when calculating a line item's discount
63
+ - [#182](https://github.com/SuperGoodSoft/solidus_taxjar/pull/182) Automatically create default Tax Rate
64
+ - [#205](https://github.com/SuperGoodSoft/solidus_taxjar/pull/205) Use nexus regions for taxable address checks
65
+ - [#218](https://github.com/SuperGoodSoft/solidus_taxjar/pull/218) Removed `order_recalculated` event backport
66
+ - [#216](https://github.com/SuperGoodSoft/solidus_taxjar/pull/216) Add `deface` as a dependency.
67
+ - [#217](https://github.com/SuperGoodSoft/solidus_taxjar/pull/217) Handle updates to orders that have not been reported
68
+ - [#227](https://github.com/SuperGoodSoft/solidus_taxjar/pull/227) Fix reporting for orders with refunds
69
+ - [#226](https://github.com/SuperGoodSoft/solidus_taxjar/pull/226) Refactor reporting subscriber logic
70
+ - [#238](https://github.com/SuperGoodSoft/solidus_taxjar/pull/238) Drop support for loading of reporting subscriber for Solidus < 2.11
71
+ - [#237](https://github.com/SuperGoodSoft/solidus_taxjar/pull/237) Sort order transactions by `created_at`
72
+ - [#236](https://github.com/SuperGoodSoft/solidus_taxjar/pull/236) Don't send cancelled or returned line items
73
+ - [#225](https://github.com/SuperGoodSoft/solidus_taxjar/pull/225) Create sync logs for replace transaction jobs
74
+ - [#231](https://github.com/SuperGoodSoft/solidus_taxjar/pull/231) Load Solidus factories using new conventions
75
+ - [#246](https://github.com/SuperGoodSoft/solidus_taxjar/pull/246) Fix bugs with sync retries when reporting or replacing a transaction fails
76
+
77
+ ### Removed
78
+
79
+ - [#137](https://github.com/SuperGoodSoft/solidus_taxjar/pull/137) Only run tests against Solidus 2.11. This also represents the drop of official support for Solidus 2.9 and 2.10.
80
+ - [#193](https://github.com/SuperGoodSoft/solidus_taxjar/pull/193) Bump version requirement for `solidus_support` to ">= 0.9.0", and as a result drop support for Rails 5.2.
81
+
82
+ ### Fixed
83
+
84
+ - [#107](https://github.com/SuperGoodSoft/solidus_taxjar/pull/107) Fix rails-engine binstub to point to correct engine entry point
85
+ - [#117](https://github.com/SuperGoodSoft/solidus_taxjar/pull/117) Fix migration install
86
+ - [#119](https://github.com/SuperGoodSoft/solidus_taxjar/pull/119) Move the install generator into the correct path so that it will be installed in the dummy app.
87
+ - [#250](https://github.com/SuperGoodSoft/solidus_taxjar/pull/250) Improve error handling for `ReportTransactionJob`
88
+ - [#254](https://github.com/SuperGoodSoft/solidus_taxjar/pull/254) Get tests and binstubs working against Solidus `main`
89
+
90
+ ### Development Changes
91
+
92
+ These changes only affect the development of this extension.
93
+
94
+ - [#120](https://github.com/SuperGoodSoft/solidus_taxjar/pull/120) Change default `SOLIDUS_BRANCH` and `RAILS_VERSION`
95
+ - [#137](https://github.com/SuperGoodSoft/solidus_taxjar/pull/137) Run tests against the most up to date versions of Solidus
96
+ - [#249](https://github.com/SuperGoodSoft/solidus_taxjar/pull/249) Don't depend on `webdrivers` gem
97
+
98
+ ### Upgrading from 0.18.x to 1.0.0
99
+
100
+ If you had previously configured a `Spree::TaxRate` with the name "Sales Tax",
101
+ it can be deleted after upgrading, as a new `Spree::TaxRate` with the name
102
+ "Solidus TaxJar Rate" will automatically be created. Alternatively, you can
103
+ rename your existing `Spree::TaxRate` from "Sales Tax" to "Solidus TaxJar
104
+ Rate". [#182](https://github.com/SuperGoodSoft/solidus_taxjar/pull/182)
105
+
106
+ ## v0.18.2
107
+
108
+ - [#71](https://github.com/SuperGoodSoft/solidus_taxjar/pull/69) Unlock ExecJS version. This reverts the temporary fix introduced in #69
109
+ - [#79](https://github.com/SuperGoodSoft/solidus_taxjar/pull/79) Relax Ruby required version to support Ruby 3.0+
110
+ - [#51](https://github.com/SuperGoodSoft/solidus_taxjar/pull/51) Add nexus regions method to API
111
+ - [#58](https://github.com/SuperGoodSoft/solidus_taxjar/pull/58) Take shipping promotions into account in default calculator
112
+ - [#59](https://github.com/SuperGoodSoft/solidus_taxjar/pull/59) Add pry debugging tools
113
+ - [#69](https://github.com/SuperGoodSoft/solidus_taxjar/pull/69) Lock ExecJS version
114
+ - [#37](https://github.com/SuperGoodSoft/solidus_taxjar/pull/37) Added a basic Taxjar settings admin interface which displays placeholder text.
115
+ - [#64](https://github.com/SuperGoodSoft/solidus_taxjar/pull/64) Provide Spree::Address.address2 to TaxJar address validation if it is present.
116
+ - [#80](https://github.com/SuperGoodSoft/solidus_taxjar/pull/80) Support order_recalculated event in < 2.11
117
+
118
+ ## v0.18.1
6
119
 
7
120
  [#52](https://github.com/supergoodsoft/solidus_taxjar/pull/52) fixes a critical bug in the API class that was released in `v0.18.0`. Please upgrade.
8
121
 
9
122
  - [#47](https://github.com/SuperGoodSoft/solidus_taxjar/pull/47) Fixed bug in `validate_address_params` for addresses without a state
10
123
  - [#52](https://github.com/supergoodsoft/solidus_taxjar/pull/52) Fixed critical bug in API class
11
124
 
12
- ## ~~v0.18.0~~
125
+ ## ~~v0.18.0~~
13
126
  `v0.18.0` was removed due to a regression in the API class that was fixed in [#52](https://github.com/SuperGoodSoft/solidus_taxjar/pull/52) and `v0.18.1`
14
127
 
15
128
  - [#21](https://github.com/SuperGoodSoft/solidus_taxjar/pull/21) Migrated project to `solidus_dev_support`
data/Gemfile CHANGED
@@ -1,16 +1,25 @@
1
- source "https://rubygems.org"
2
-
3
- git_source(:github) {|repo_name| "https://github.com/#{repo_name}" }
1
+ # frozen_string_literal: true
4
2
 
5
- branch = ENV.fetch('SOLIDUS_BRANCH', 'master')
6
-
7
- gem "solidus", github: "solidusio/solidus", branch: branch
3
+ source "https://rubygems.org"
4
+ git_source(:github) { |repo_name| "https://github.com/#{repo_name}" }
5
+
6
+ branch = ENV.fetch("SOLIDUS_BRANCH", "v3.1")
7
+ git "https://github.com/solidusio/solidus.git", branch: branch do
8
+ gem "solidus_core"
9
+ gem "solidus_backend"
10
+ gem "solidus_api"
11
+ gem "solidus_sample"
12
+ end
8
13
 
9
- # Needed to help Bundler figure out how to resolve dependencies,
10
- # otherwise it takes forever to resolve them.
11
- # See https://github.com/bundler/bundler/issues/6677
12
- gem "rails", ENV.fetch("RAILS_VERSION") { ">0.a" }
14
+ if (branch == 'main') || (branch >= 'v4.0')
15
+ gem "solidus_frontend", github: "solidusio/solidus_frontend", branch: 'main'
16
+ elsif (branch >= 'v3.2') && (branch < 'v4.0')
17
+ gem "solidus_frontend", github: "solidusio/solidus_frontend", branch: branch
18
+ else
19
+ gem "solidus_frontend", github: "solidusio/solidus", branch: branch
20
+ end
13
21
 
22
+ gem "rails"
14
23
  # Provides basic authentication functionality for testing parts of your engine
15
24
  gem "solidus_auth_devise"
16
25
 
@@ -25,6 +34,15 @@ end
25
34
 
26
35
  group :development, :test do
27
36
  gem "pry"
37
+ gem "pry-stack_explorer"
38
+ gem "pry-byebug"
39
+
40
+ # FIXME:
41
+ # Once a new version of `solidus_dev_support` is released to RubyGems, we can
42
+ # use that.
43
+ gem "solidus_dev_support",
44
+ github: "solidusio/solidus_dev_support",
45
+ branch: "main"
28
46
  end
29
47
 
30
48
  gemspec
data/README.md CHANGED
@@ -1,91 +1,346 @@
1
- # `SuperGood::SolidusTaxjar` [![Build Status](https://travis-ci.com/SuperGoodSoft/solidus_taxjar.svg?token=rc5QTgHvLLF7cpqkmyfd&branch=master)](https://travis-ci.com/SuperGoodSoft/solidus_taxjar)
1
+ # `SuperGood::SolidusTaxjar`
2
2
 
3
- `SuperGood::SolidusTaxjar` is a [Solidus](https://github.com/solidusio/solidus) extension that allows Solidus stores to use [TaxJar](https://www.taxjar.com/) for tax calculations.
3
+ [![CircleCI build status](https://circleci.com/gh/SuperGoodSoft/solidus_taxjar/tree/master.svg?style=shield)](https://circleci.com/gh/SuperGoodSoft/solidus_taxjar/tree/master)
4
4
 
5
- This is not a fork of [spree_taxjar](https://github.com/vinsol-spree-contrib/spree_taxjar), like [solidus_taxjar](https://github.com/boomerdigital/solidus_taxjar). Instead of using a custom calculator, `SuperGood::SolidusTaxjar` uses the new configurable tax system [by @adammathys](https://github.com/solidusio/solidus/pull/1892) introduced in Solidus v2.4. This maps better to how the TaxJar API itself works.
5
+ `SuperGood::SolidusTaxjar` is a [Solidus](https://github.com/solidusio/solidus)
6
+ extension that allows Solidus stores to use [TaxJar](https://www.taxjar.com/)
7
+ for tax calculations.
6
8
 
7
- ## Installation
9
+ This is not a fork of [`spree_taxjar`][spree_taxjar] like Boomer Digital's
10
+ [`solidus_taxjar`][boomer_taxjar] extension. Instead of using a custom
11
+ calculator, `SuperGood::SolidusTaxjar` uses the new configurable tax system [by
12
+ @adammathys](https://github.com/solidusio/solidus/pull/1892) introduced in
13
+ Solidus v2.4. This maps better to how the TaxJar API itself works.
8
14
 
9
- 1. Add this line to your application's Gemfile:
15
+ [boomer_taxjar]: https://github.com/boomerdigital/solidus_taxjar
16
+ [spree_taxjar]: https://github.com/vinsol-spree-contrib/spree_taxjar
17
+
18
+ ## Documentation
19
+
20
+ **If you're a developer**, any information you need about this Solidus extension
21
+ should be referenced in this file or in the source code of the extension.
22
+
23
+ **If you're not a developer**, see [the wiki][wiki] for additional documentation
24
+ about using the Solidus TaxJar extension after it has been installed.
10
25
 
11
- ```ruby
12
- gem 'super_good-solidus_taxjar'
13
- ```
26
+ [wiki]: https://github.com/supergoodsoft/solidus_taxjar/wiki
14
27
 
15
- And then execute:
28
+ ## Installation
29
+
30
+ 1. Add this line to your application's Gemfile:
16
31
 
17
- $ bundle
32
+ ```ruby
33
+ gem 'super_good-solidus_taxjar'
34
+ ```
18
35
 
19
- 2. Install and run the necessary migrations:
36
+ And then execute:
20
37
 
21
- ```shell
22
- bundle exec rails g super_good:solidus_taxjar:install
23
- bundle exec rake db:migrate
24
- ```
38
+ ```sh
39
+ bundle
40
+ ```
25
41
 
26
- 3. Next, configure Solidus to use this gem:
42
+ 2. Next, configure Solidus to use this gem by running the install generator:
27
43
 
28
- ```ruby
29
- # Put this in config/initializers/solidus.rb
44
+ ```sh
45
+ bundle exec rails generate super_good:solidus_taxjar:install
46
+ ```
30
47
 
31
- Spree.config do |config|
32
- config.tax_calculator_class = SuperGood::SolidusTaxjar::TaxCalculator
33
- end
34
- ```
48
+ 3. Also, configure your own [exception handler](#exception-handling).
35
49
 
36
- 4. Also, configure your error handling:
50
+ 4. Finally, make sure that the `TAXJAR_API_KEY` environment variable is set to
51
+ your TaxJar API key.
37
52
 
38
- ```ruby
39
- # Put this in config/initializers/taxjar.rb
53
+ ### Warning: Installing on Production
40
54
 
41
- SuperGood::SolidusTaxjar.exception_handler = ->(e) {
42
- # Report exceptions in here. For example, if you were using the Sentry's
43
- # raven-ruby gem to report errors, you might do this:
44
- Raven.capture_exception(e)
45
- }
46
- ```
55
+ Before you install this extension in your production environment, **we strongly
56
+ recommend that you install and configure a supported ActiveJob backend**.
47
57
 
48
- 5. Finally, make sure that the `TAXJAR_API_KEY` environment variable is set to a your TaxJar API key and make sure that you have a `Spree::TaxRate` with the name "Sales Tax". This will be used as the source for the tax adjustments that Solidus creates.
58
+ By default, ActiveJob performs jobs in memory. The order reporting backfill
59
+ functionality of this extension may enqueue *a lot* of jobs if you have hundreds
60
+ or thousands of historical orders to report.
49
61
 
50
- ## Project Status
62
+ Using this extension without a backend like Sidekiq, Resque, or Delayed Job,
63
+ **may cause your application to crash with out-of-memory errors**. For more
64
+ information, read the Rails Guides's [Active Jobs Basics][active-job-basics]
65
+ article. You may find the [Job Execution][active-job-execution] section
66
+ particularly helpful.
51
67
 
52
- This extension is under active development and not yet at a v1.0 release, but it's currently being used in production by multiple Solidus stores.
68
+ [active-job-basics]: https://edgeguides.rubyonrails.org/active_job_basics.html
69
+ [active-job-execution]: https://edgeguides.rubyonrails.org/active_job_basics.html#job-execution
53
70
 
54
- Requirements for TaxJar integrations vary as some stores also need reporting, which isn't provided out of the box by this extension. This is because individual stores will be using different background job frameworks or runners (Sidekiq, delayed_job, ActiveJob, etc.) and a reliable integration will rely on one of these. Because this part of the integration is small, we've chosen to provide the transaction reporting functionality, but have skipped directly integrating it.
71
+ ## Developer Support
55
72
 
56
- If you're having trouble integrating this extension with your store and would like some assistance, please reach out to Jared via e-mail at [jared@super.gd](mailto:jared@super.gd) or on the official Solidus as `@jared`.
73
+ If you're having trouble integrating this extension with your store and would
74
+ like some assistance, please reach out to Jared via e-mail at [jared@super.gd](mailto:jared@super.gd)
75
+ or on the official Solidus Slack as `@Jared Norman`.
57
76
 
58
77
  ## Features
59
78
 
60
- The extension provides currently two high level `calculator` classes that wrap the low-level Ruby taxjar gem API calls:
79
+ This extension provides two high level `calculator` classes that wrap the
80
+ low-level Ruby `taxjar` gem API calls:
61
81
 
62
82
  * tax calculator
63
83
  * tax rate calculator
64
84
 
85
+ :warning: The transaction reporting features this extension provides depend on
86
+ the Solidus event system, and in particular the `order_recalculated` event.
87
+ That does not exist on Solidus < 2.11, so if you're version of Solidus is older
88
+ than that and you want to use the reporting feature you will need to backport
89
+ that event to your applicaiton.
90
+
91
+ This extension also supports:
92
+
93
+ * syncing orders to TaxJar's reporting dashboard
94
+ * syncing nexus regions as configured in the connected TaxJar account (including
95
+ automatic _and_ manual sync)
96
+ * connecting your Solidus store's tax categories to TaxJar's tax categories (U.S. tax codes)
97
+
98
+ **Note that reporting is turned off by default.**
99
+
65
100
  ### TaxCalculator
66
101
 
67
- `SuperGood::SolidusTaxjar::TaxCalculator` allows calculating the full tax breakdown for a given `Spree::Order`. The breakdown includes separate line items taxes and shipment taxes.
102
+ `SuperGood::SolidusTaxjar::TaxCalculator` allows calculating the full tax
103
+ breakdown for a given `Spree::Order`. The breakdown includes separate line items
104
+ taxes and shipment taxes.
105
+
106
+ This tax calculator will create a `Spree::TaxRate` that is required for tax
107
+ adjustments. All other `Spree::TaxRate`s will be ignored in calculations. See
108
+ [this wiki
109
+ page](https://github.com/SuperGoodSoft/solidus_taxjar/wiki/How-Solidus-TaxJar-calculates-tax)
110
+ for more details.
68
111
 
69
112
  ### TaxRateCalculator
70
113
 
71
- `SuperGood::SolidusTaxjar::TaxRateCalculator` allows calculating the tax rate for a given `Spree::Address`. It relies on the same low-level Ruby TaxJar API endpoint of the tax calculator in order to provide the most coherent and reliable results. TaxJar support recommends using this endpoint for live calculations.
114
+ `SuperGood::SolidusTaxjar::TaxRateCalculator` allows calculating the tax rate
115
+ for a given `Spree::Address`. It relies on the same low-level Ruby TaxJar API
116
+ endpoint of the tax calculator in order to provide the most coherent and
117
+ reliable results. TaxJar support recommends using this endpoint for live
118
+ calculations.
119
+
120
+ ### Order-level Adjustments are Unsupported
121
+
122
+ Although Solidus supports order-level adjustments, **TaxJar does not support
123
+ order-level adjustments**. Currently, this extension does not make any
124
+ assumptions about how order-level adjustments should be reported to TaxJar.
125
+ After enabling the extension, any attempts to create an order-level adjustment
126
+ will result in an error being raised by default.
127
+
128
+ **If you need to support order-level adjustments, you'll need to configure the
129
+ `discount_calculator` setting to handle them.** See
130
+ [Configuration](#configuration) for more more information about configuring the
131
+ extension.
132
+
133
+ ## Configuration
134
+
135
+ Developers can configure the extension in a Rails initializer file. All of the
136
+ configuration settings, and their default values, are defined in
137
+ [`lib/super_good/solidus_taxjar.rb`](lib/super_good/solidus_taxjar.rb). The
138
+ settings are described in the [Settings](#settings) section below.
139
+
140
+ As an example, your application's initializer might look like this:
141
+
142
+ ```ruby
143
+ # config/initializers/taxjar.rb
144
+
145
+ SuperGood::SolidusTaxjar.tap do |config|
146
+ config.cache_duration = 2.hours
147
+ config.line_item_tax_label_maker = ->(taxjar_line_item, spree_line_item) {
148
+ "My Tax Label"
149
+ }
150
+ config.test_mode = true
151
+ end
152
+ ```
153
+
154
+ ### Settings
155
+
156
+ Developers can configure the following settings in an initializer:
157
+
158
+ - `cache_duration`: The length of time that cacheable responses from
159
+ the TaxJar API are cached. Cacheable responses include the list of active
160
+ nexus regions, as well as tax and tax rate calculations.
161
+
162
+ Default value: `3.hours`
163
+
164
+ - `cache_key`: function that returns a distinct cache key for
165
+ a cacheable response from the TaxJar API. A safe default function is provided.
166
+
167
+ Default value: (See the source code.)
168
+
169
+ - `custom_order_params`: A function that returns any parameterized custom
170
+ order information you need to send to TaxJar in every API request that
171
+ includes a customer's order. By default no custom order parameters are
172
+ sent.
173
+
174
+ Note that all the essential `Spree::Order`, `Spree::LineItem`, and
175
+ `Spree::Address` attributes are already sent by default.
176
+
177
+ Default value: `{}`
178
+
179
+ - `discount_calculator`: A discount calculator class. A safe default
180
+ calculator is provided: it handles promotions that rely on line item and
181
+ shipment adjustments. Since TaxJar requires dicounts to be specified per line
182
+ item, you need to provide a custom version of this calculator in order to
183
+ support any of your promotions that create order-level adjustments.
184
+
185
+ Default value: `::SuperGood::SolidusTaxjar::DiscountCalculator`
186
+
187
+ - `exception_handler`: A function that returns your own exception
188
+ handler. See [Exception handling](#exception-handling).
189
+
190
+ Default value: (See the source code.)
191
+
192
+ - `job_queue`: A string or symbol that matches the name of a job queue in your
193
+ application's job queuer. (The extension uses ActiveJob to delegate new jobs.)
194
+
195
+ Default value: `:default`
196
+
197
+ - `line_item_tax_label_maker`: A string to label line item taxes in TaxJar.
198
+
199
+ Default value: "Sales Tax"
200
+
201
+ - `logging_enabled`: Boolean. Whether logging is enabled.
202
+
203
+ Default value: `true`
204
+
205
+ - `shipping_calculator`: A function that calculates the total cost of the
206
+ shipments for an order. A default default is provided
207
+ inline, but your store may require additional logic
208
+ for accurate calculations.
209
+
210
+ Default value: (See the source code.)
211
+
212
+ - `shipping_tax_label_maker`: A string to label shipment taxes in TaxJar.
213
+
214
+ Default value: "Sales Tax"
215
+
216
+ - `taxable_address_check`: A function that returns a boolean after checking
217
+ whether an address should be considered taxable. By default this function
218
+ returns `true`.
219
+
220
+ Default value: `true`
221
+
222
+ - `taxable_order_check`: A function that returns a boolean after checking
223
+ whether an order should be considered taxable. By default this function
224
+ always returns `true`.
225
+
226
+ Default value: `true`
227
+
228
+ - `test_mode`: Boolean. Whether the extension is in test mode.
229
+ If true, no tax or tax rate calculations will be requested via the TaxJar API.
230
+
231
+ Default value: `false`
232
+
233
+ ### Taxable Orders
234
+
235
+ Note that the configuration setting `taxable_order_check` can be customized if
236
+ there is specific criteria that make some orders taxable and other orders not
237
+ taxable. By default this extension considers all orders taxable.
238
+
239
+ ### Exception Handling
240
+
241
+ You can configure your own exception handler in an initializer. using the
242
+ `exception_handler` configuration point:
243
+
244
+ ```ruby
245
+ # Put this in config/initializers/taxjar.rb
246
+
247
+ SuperGood::SolidusTaxjar.exception_handler = ->(e) {
248
+ # Report exceptions in here. For example, if you were using the Sentry's
249
+ # raven-ruby gem to report errors, you might do this:
250
+ Raven.capture_exception(e)
251
+ }
252
+ ```
253
+
254
+ For more information about configuring the extension, see
255
+ [Configuration](#configuration).
256
+
257
+ ### Logging
258
+
259
+ By default, all requests to TaxJar are logged to the Rails logger. URIs, HTTP
260
+ method, and response codes will be logged at the `info` level, any further
261
+ details (such as response body) are logged at the `debug` level.
262
+
263
+ If you are interested in logs for full request responses, be sure to set your
264
+ logger to the `debug` level:
265
+
266
+ ```ruby
267
+ Rails.logger.level = 0 # debug
268
+ ```
269
+
270
+ Or, if you want an alternate logger implementation, you can provide your own:
271
+
272
+ ```ruby
273
+ SuperGood::SolidusTaxjar.tap do |config|
274
+ logger = Logger.new(STDOUT)
275
+ logger.log_level = :warn
276
+ config.logger = logger
277
+ end
278
+ ```
279
+
280
+ More details on the Rails Logger are available [here](https://guides.rubyonrails.org/debugging_rails_applications.html#the-logger).
281
+
282
+ Logging can also be disabled all together:
283
+
284
+ ```ruby
285
+ SuperGood::SolidusTaxjar.tap do |config|
286
+ config.logging_enabled = false
287
+ end
288
+ ```
72
289
 
73
290
  ## Development
74
291
 
75
- Before installing dependencies, make sure your environment variables are setup. Our CI uses something like this: `SOLIDUS_BRANCH=v2.10 DB=postgresql RAILS_VERSION="~> 5.2.0`. These environment variables need to be set when installing dependencies and running specs, so set them before the command like this: `SOLIDUS_BRANCH=v2.10 DB=postgresql RAILS_VERSION="~> 5.2.0 bin/setup`
292
+ Run `bin/setup` to install dependencies. Then, run `bundle exec rake` to run the
293
+ tests. You can also run `bin/console` for an interactive prompt that will allow
294
+ you to experiment.
295
+
296
+ To install this gem onto your local machine, run `bundle exec rake install`.
297
+
298
+ ### Changing the Rails/Solidus Versions
299
+
300
+ The Rails and the Solidus version can be changed by setting the `RAILS_VERSION`
301
+ and `SOLIDUS_BRANCH` environment variables, respectively. See the
302
+ [Gemfile](./Gemfile) for examples.
303
+
304
+ ### Changing the Database Vendor
305
+
306
+ The database vendor can also be changed from the default (`sqlite3`) by setting
307
+ the `DB` environment variable.
308
+
309
+ ### Testing the Extension
310
+
311
+ When testing your application's integration with this extension you may use its factories.
312
+ You can load Solidus core factories along with this extension's factories using this statement:
313
+
314
+ ```ruby
315
+ SolidusDevSupport::TestingSupport::Factories.load_for(SuperGoodSolidusTaxjar::Engine)
316
+ ```
76
317
 
77
- Run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
318
+ ## Releasing a New Version
78
319
 
79
- To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
320
+ 1. Update the `master` header in changelog to the version that you're releasing.
321
+ 2. Commit your changes and open a PR for the release
322
+ 3. Once the PR has been merged into master, run `gem bump -v [<major>|<minor>|<patch>] -p -t -r` to create a tag and release the gem to ✨ RubyGems ✨
323
+ 4. Push your local master branch with `--tags` to the repository to add the tag to github.
324
+ 5. Create a new release on github with the tag
325
+ * [ ] Ensure the changelog since the previous release is included
326
+ * [ ] Ensure you have noted version migration instructions if applicable
327
+ * [ ] Ensure breaking/significant changes are clearly highlighted
328
+ * [ ] Ensure changes that are **not production ready** are clearly highlighted
80
329
 
81
330
  ## Contributing
82
331
 
83
- Bug reports and pull requests are welcome on GitHub at https://github.com/SuperGoodSoft/solidus_taxjar. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.
332
+ Bug reports and pull requests are welcome on GitHub at [https://github.com/SuperGoodSoft/solidus_taxjar](https://github.com/SuperGoodSoft/solidus_taxjar).
333
+ This project is intended to be a safe, welcoming space for collaboration, and
334
+ contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org)
335
+ code of conduct.
84
336
 
85
337
  ## License
86
338
 
87
- The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
339
+ The gem is available as open source under the terms of the
340
+ [MIT License](https://opensource.org/licenses/MIT).
88
341
 
89
342
  ## Code of Conduct
90
343
 
91
- Everyone interacting in the `SuperGood::SolidusTaxjar` project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/SuperGoodSoft/solidus_taxjar/blob/master/CODE_OF_CONDUCT.md).
344
+ Everyone interacting in the `SuperGood::SolidusTaxjar` project’s codebases,
345
+ issue trackers, chat rooms and mailing lists is expected to follow the
346
+ [code of conduct](https://github.com/SuperGoodSoft/solidus_taxjar/blob/master/CODE_OF_CONDUCT.md).