super_good-solidus_taxjar 0.18.2 → 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.circleci/config.yml +48 -6
- data/CHANGELOG.md +103 -1
- data/Gemfile +26 -10
- data/PULL_REQUEST_TEMPLATE.md +0 -1
- data/README.md +299 -39
- data/Rakefile +3 -0
- data/app/controllers/spree/admin/taxjar_settings_controller.rb +86 -1
- data/app/controllers/spree/admin/taxjar_transactions_controller.rb +37 -0
- data/app/controllers/spree/admin/transaction_sync_batches_controller.rb +18 -0
- data/app/jobs/super_good/solidus_taxjar/backfill_transaction_sync_batch_job.rb +23 -0
- data/app/jobs/super_good/solidus_taxjar/replace_transaction_job.rb +26 -0
- data/app/jobs/super_good/solidus_taxjar/report_transaction_job.rb +22 -0
- data/app/models/super_good/solidus_taxjar/configuration.rb +27 -0
- data/app/models/super_good/solidus_taxjar/order_transaction.rb +16 -0
- data/app/models/super_good/solidus_taxjar/refund_transaction.rb +13 -0
- data/app/models/super_good/solidus_taxjar/transaction_sync_batch.rb +11 -0
- data/app/models/super_good/solidus_taxjar/transaction_sync_log.rb +8 -0
- data/app/overrides/spree/admin/orders_controller_override.rb +12 -0
- data/app/overrides/spree/admin/shared/_order_submenu/add_taxjar_sync_history_tab.html.erb.deface +6 -0
- data/app/overrides/spree/admin/shared/_order_summary/add_taxjar_reported_at.html.erb.deface +30 -0
- data/app/overrides/spree/admin/shared/_taxes_tabs/add_configuration_menu_items.html.erb.deface +5 -0
- data/app/overrides/super_good/solidus_taxjar/spree/order_override.rb +21 -0
- data/app/views/spree/admin/orders/taxjar_transactions.html.erb +4 -0
- data/app/views/spree/admin/shared/_transaction_sync_log_table.html.erb +35 -0
- data/app/views/spree/admin/taxjar_settings/_nexus_regions.html.erb +23 -0
- data/app/views/spree/admin/taxjar_settings/_tax_categories.html.erb +41 -0
- data/app/views/spree/admin/taxjar_settings/edit.html.erb +17 -0
- data/app/views/spree/admin/taxjar_settings/edit_no_api_key.html.erb +21 -0
- data/app/views/spree/admin/transaction_sync_batches/index.html.erb +50 -0
- data/app/views/spree/admin/transaction_sync_batches/show.html.erb +7 -0
- data/bin/console +2 -0
- data/bin/rails-engine +1 -1
- data/bin/sandbox +43 -36
- data/bin/setup +3 -3
- data/config/routes.rb +13 -1
- data/db/migrate/20210908205201_create_taxjar_order_transactions.rb +16 -0
- data/db/migrate/20211008175113_create_taxjar_refund_transaction.rb +15 -0
- data/db/migrate/20211008183858_add_transaction_date_to_order_transaction.rb +5 -0
- data/db/migrate/20211119143354_create_configuration.rb +8 -0
- data/db/migrate/20220405213958_create_transaction_sync_batches.rb +7 -0
- data/db/migrate/20220405215225_create_transaction_sync_logs.rb +14 -0
- data/db/migrate/20220908181655_add_dates_to_transaction_sync_batch.rb +6 -0
- data/db/migrate/20220912182210_allow_null_transaction_sync_batches_on_logs.rb +5 -0
- data/db/migrate/20230320211309_add_refund_transaction_to_sync_logs.rb +5 -0
- data/lib/generators/super_good/solidus_taxjar/install/install_generator.rb +68 -0
- data/lib/super_good/solidus_taxjar/api.rb +41 -9
- data/lib/super_good/solidus_taxjar/api_params.rb +92 -25
- data/lib/super_good/solidus_taxjar/backfill_transactions.rb +11 -0
- data/lib/super_good/solidus_taxjar/cached_api.rb +23 -0
- data/lib/super_good/solidus_taxjar/calculator_helper.rb +33 -4
- data/lib/super_good/solidus_taxjar/discount_calculator.rb +1 -1
- data/lib/super_good/solidus_taxjar/overrides/request_override.rb +15 -0
- data/lib/super_good/solidus_taxjar/reportable.rb +91 -0
- data/lib/super_good/solidus_taxjar/reporting.rb +44 -0
- data/lib/super_good/solidus_taxjar/spree/legacy_reporting_subscriber.rb +41 -0
- data/lib/super_good/solidus_taxjar/spree/reporting_subscriber.rb +40 -0
- data/lib/super_good/solidus_taxjar/tax_calculator.rb +7 -1
- data/lib/super_good/solidus_taxjar/testing_support/factories/address_factory.rb +11 -0
- data/lib/super_good/solidus_taxjar/testing_support/factories/configuration_factory.rb +11 -0
- data/lib/super_good/solidus_taxjar/testing_support/factories/order_transaction_factory.rb +22 -0
- data/lib/super_good/solidus_taxjar/testing_support/factories/refund_transaction_factory.rb +7 -0
- data/lib/super_good/solidus_taxjar/testing_support/factories/transaction_sync_batch_factory.rb +9 -0
- data/lib/super_good/solidus_taxjar/testing_support/factories/transaction_sync_log_factory.rb +18 -0
- data/lib/super_good/solidus_taxjar/transaction_id_generator.rb +45 -0
- data/lib/super_good/solidus_taxjar/version.rb +1 -1
- data/lib/super_good/solidus_taxjar.rb +29 -2
- data/spec/features/spree/admin/backfill_transactions_spec.rb +138 -0
- data/spec/features/spree/admin/refund_spec.rb +167 -0
- data/spec/features/spree/admin/reporting_to_taxjar_spec.rb +156 -0
- data/spec/features/spree/admin/taxjar_settings_spec.rb +58 -16
- data/spec/features/spree/checkout_spec.rb +58 -0
- 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
- 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
- data/spec/fixtures/cassettes/Admin_TaxJar_Settings/Taxjar_settings_tab/Taxjar_API_token_is_set/shows_the_settings_page.yml +2437 -0
- 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
- data/spec/fixtures/cassettes/Admin_TaxJar_Settings/Taxjar_settings_tab/Taxjar_API_token_isn_t_set/shows_a_descriptive_error_message.yml +57 -0
- data/spec/fixtures/cassettes/Admin_TaxJar_Settings/Taxjar_settings_tab/Taxjar_reporting_is_enabled/shows_that_reporting_is_enabled.yml +2382 -0
- data/spec/fixtures/cassettes/Admin_TaxJar_Settings/Taxjar_settings_tab/order_is_shipped/the_user_backfills_their_transactions.yml +2511 -0
- data/spec/fixtures/cassettes/Admin_TaxJar_Settings/Taxjar_settings_tab/the_user_navigates_to_the_TaxJar_Settings.yml +2382 -0
- data/spec/fixtures/cassettes/Admin_Transaction_Sync_Batches/user_has_a_shipped_order/starts_a_transaction_backfill.yml +370 -0
- data/spec/fixtures/cassettes/Reporting_orders_to_TaxJar/shipping_a_complete_and_paid_order.yml +310 -0
- 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
- data/spec/fixtures/cassettes/Reporting_orders_to_TaxJar/with_an_order_with_invalid_zipcode/retry_of_a_previously_failed_transaction_sync.yml +418 -0
- data/spec/fixtures/cassettes/Spree_Admin_TransactionSyncBatchesController/_create/creates_a_batch.yml +250 -0
- data/spec/fixtures/cassettes/Spree_Admin_TransactionSyncBatchesController/_create/creates_a_log_in_the_batch_with_an_order.yml +250 -0
- data/spec/fixtures/cassettes/Spree_Admin_TransactionSyncBatchesController/_create/user_supplies_a_start_date/creates_a_batch.yml +250 -0
- 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
- 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
- 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
- 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
- data/spec/fixtures/cassettes/SuperGood_SolidusTaxjar_Reporting/_refund_and_create_transaction/when_Taxjar_cannot_create_a_refund_transaction/raises_an_error.yml +393 -0
- data/spec/fixtures/cassettes/Taxjar_API_Request/logging_is_disabled/doesn_t_call_the_logger.yml +158 -0
- data/spec/fixtures/cassettes/Taxjar_API_Request/logging_is_enabled/calls_the_logger.yml +158 -0
- data/spec/fixtures/cassettes/features/spree/admin/checkout.yml +238 -0
- data/spec/fixtures/cassettes/features/spree/admin/refund.yml +1162 -0
- data/spec/jobs/super_good/solidus_taxjar/backfill_transaction_sync_batch_job_spec.rb +117 -0
- data/spec/jobs/super_good/solidus_taxjar/replace_transaction_job_spec.rb +95 -0
- data/spec/jobs/super_good/solidus_taxjar/report_transaction_job_spec.rb +76 -0
- data/spec/models/super_good/solidus_taxjar/configuration_spec.rb +79 -0
- data/spec/models/super_good/solidus_taxjar/order_transaction_spec.rb +36 -0
- data/spec/models/super_good/solidus_taxjar/transaction_sync_batch_spec.rb +48 -0
- data/spec/requests/spree/admin/order_request_spec.rb +121 -0
- data/spec/requests/spree/admin/taxjar_settings_request_spec.rb +198 -0
- data/spec/requests/spree/admin/taxjar_transactions_request_spec.rb +62 -0
- data/spec/requests/spree/admin/transaction_sync_batches_request_spec.rb +82 -0
- data/spec/spec_helper.rb +46 -3
- data/spec/subscribers/super_good/solidus_taxjar/spree/reporting_subscriber_spec.rb +278 -0
- data/spec/super_good/solidus_taxjar/addresses_spec.rb +0 -14
- data/spec/super_good/solidus_taxjar/api_params_spec.rb +261 -89
- data/spec/super_good/solidus_taxjar/api_spec.rb +152 -29
- data/spec/super_good/solidus_taxjar/backfill_transactions_spec.rb +24 -0
- data/spec/super_good/solidus_taxjar/cached_api_spec.rb +58 -0
- data/spec/super_good/solidus_taxjar/calculator_helper_spec.rb +131 -0
- data/spec/super_good/solidus_taxjar/discount_calculator_spec.rb +19 -2
- data/spec/super_good/solidus_taxjar/reportable_spec.rb +194 -0
- data/spec/super_good/solidus_taxjar/reporting_spec.rb +243 -0
- data/spec/super_good/solidus_taxjar/tax_calculator_spec.rb +19 -19
- data/spec/super_good/solidus_taxjar/tax_rate_calculator_spec.rb +8 -3
- data/spec/super_good/solidus_taxjar/transaction_id_generator_spec.rb +77 -0
- data/spec/super_good/solidus_taxjar_spec.rb +84 -0
- data/spec/support/checkoutable_store_shared_context.rb +19 -0
- data/spec/support/solidus_events_helper.rb +26 -0
- data/spec/taxjar/api/request_spec.rb +52 -0
- data/super_good-solidus_taxjar.gemspec +3 -2
- metadata +169 -17
- data/app/decorators/super_good/solidus_taxjar/spree/order_updater/fire_recalculated_event.rb +0 -18
- data/app/overrides/spree/admin/shared/_configuration_menu.rb +0 -11
- data/app/views/spree/admin/taxjar_settings/show.html.erb +0 -13
- data/spec/models/spree/order_updater_spec.rb +0 -12
@@ -0,0 +1,57 @@
|
|
1
|
+
---
|
2
|
+
http_interactions:
|
3
|
+
- request:
|
4
|
+
method: get
|
5
|
+
uri: https://api.taxjar.com/v2/categories
|
6
|
+
body:
|
7
|
+
encoding: UTF-8
|
8
|
+
string: ''
|
9
|
+
headers:
|
10
|
+
User-Agent:
|
11
|
+
- 'TaxJar/Ruby (Darwin MacBook-Pro.hitronhub.home 21.2.0 Darwin Kernel Version
|
12
|
+
21.2.0: Sun Nov 28 20:28:54 PST 2021; root:xnu-8019.61.5~1/RELEASE_X86_64
|
13
|
+
x86_64; ruby 2.6.6-p146; OpenSSL 1.1.1m 14 Dec 2021) taxjar-ruby/3.0.2'
|
14
|
+
Authorization:
|
15
|
+
- 'Bearer '
|
16
|
+
X-Api-Version:
|
17
|
+
- '2020-08-07'
|
18
|
+
Plugin:
|
19
|
+
- supergoodsolidustaxjar
|
20
|
+
Connection:
|
21
|
+
- close
|
22
|
+
Host:
|
23
|
+
- api.taxjar.com
|
24
|
+
response:
|
25
|
+
status:
|
26
|
+
code: 401
|
27
|
+
message: Unauthorized
|
28
|
+
headers:
|
29
|
+
Content-Type:
|
30
|
+
- application/json; charset=utf-8
|
31
|
+
Content-Length:
|
32
|
+
- '94'
|
33
|
+
Connection:
|
34
|
+
- close
|
35
|
+
Date:
|
36
|
+
- Mon, 28 Mar 2022 18:41:35 GMT
|
37
|
+
X-Amzn-Requestid:
|
38
|
+
- 73a88251-8cf4-4d08-a4aa-15c7d5c85067
|
39
|
+
X-Amz-Apigw-Id:
|
40
|
+
- PtUm7GWNIAMFv7A=
|
41
|
+
X-Amzn-Trace-Id:
|
42
|
+
- Root=1-6242015f-2d26debe430a0e193cd82e0a
|
43
|
+
X-Cache:
|
44
|
+
- Error from cloudfront
|
45
|
+
Via:
|
46
|
+
- 1.1 567b44ed19c8caed2570b7bcd8c70034.cloudfront.net (CloudFront)
|
47
|
+
X-Amz-Cf-Pop:
|
48
|
+
- SEA73-P1
|
49
|
+
X-Amz-Cf-Id:
|
50
|
+
- mBwTXB3V_iLuNi-g7NZXn88dHQh-EXWBA1vfItyL1x3KAAvzWGdmAw==
|
51
|
+
body:
|
52
|
+
encoding: UTF-8
|
53
|
+
string: '{"status":401,"error":"Unauthorized","detail":"Not authorized for route
|
54
|
+
''GET /v2/categories''"}'
|
55
|
+
http_version:
|
56
|
+
recorded_at: Mon, 28 Mar 2022 18:41:35 GMT
|
57
|
+
recorded_with: VCR 4.0.0
|
@@ -0,0 +1,57 @@
|
|
1
|
+
---
|
2
|
+
http_interactions:
|
3
|
+
- request:
|
4
|
+
method: get
|
5
|
+
uri: https://api.taxjar.com/v2/categories
|
6
|
+
body:
|
7
|
+
encoding: UTF-8
|
8
|
+
string: ''
|
9
|
+
headers:
|
10
|
+
User-Agent:
|
11
|
+
- 'TaxJar/Ruby (Darwin MacBook-Pro.hitronhub.home 21.2.0 Darwin Kernel Version
|
12
|
+
21.2.0: Sun Nov 28 20:28:54 PST 2021; root:xnu-8019.61.5~1/RELEASE_X86_64
|
13
|
+
x86_64; ruby 2.6.6-p146; OpenSSL 1.1.1m 14 Dec 2021) taxjar-ruby/3.0.2'
|
14
|
+
Authorization:
|
15
|
+
- 'Bearer '
|
16
|
+
X-Api-Version:
|
17
|
+
- '2020-08-07'
|
18
|
+
Plugin:
|
19
|
+
- supergoodsolidustaxjar
|
20
|
+
Connection:
|
21
|
+
- close
|
22
|
+
Host:
|
23
|
+
- api.taxjar.com
|
24
|
+
response:
|
25
|
+
status:
|
26
|
+
code: 401
|
27
|
+
message: Unauthorized
|
28
|
+
headers:
|
29
|
+
Content-Type:
|
30
|
+
- application/json; charset=utf-8
|
31
|
+
Content-Length:
|
32
|
+
- '94'
|
33
|
+
Connection:
|
34
|
+
- close
|
35
|
+
Date:
|
36
|
+
- Mon, 28 Mar 2022 18:41:37 GMT
|
37
|
+
X-Amzn-Requestid:
|
38
|
+
- 2bc511de-3426-4f95-8adb-42f6996ae718
|
39
|
+
X-Amz-Apigw-Id:
|
40
|
+
- PtUnMGRHIAMFuIQ=
|
41
|
+
X-Amzn-Trace-Id:
|
42
|
+
- Root=1-62420161-2c59c9b4632249a8517d9b2a
|
43
|
+
X-Cache:
|
44
|
+
- Error from cloudfront
|
45
|
+
Via:
|
46
|
+
- 1.1 b8c4a4ca04bb1976e020396d211bc8dc.cloudfront.net (CloudFront)
|
47
|
+
X-Amz-Cf-Pop:
|
48
|
+
- SEA73-P1
|
49
|
+
X-Amz-Cf-Id:
|
50
|
+
- wmVUITJGhJb96I80Pz_zIIGZDA7VPgZvyLGbnLk_nYjD8gzsDqpZvg==
|
51
|
+
body:
|
52
|
+
encoding: UTF-8
|
53
|
+
string: '{"status":401,"error":"Unauthorized","detail":"Not authorized for route
|
54
|
+
''GET /v2/categories''"}'
|
55
|
+
http_version:
|
56
|
+
recorded_at: Mon, 28 Mar 2022 18:41:36 GMT
|
57
|
+
recorded_with: VCR 4.0.0
|